DC1394Input

Input object for acquiring images using a IIDC 1394-based digital camera (standard digital firewire camera).  Damien Douxchamps’ dc1394-library is used to access the camera.  Currently libdc1394 version 2 is not supported.

The software should work with IEEE1394a as well as IEEE1394b cameras as long as they are IIDC/DCAM compatible.

Inherits

See also

Summary
DC1394InputInput object for acquiring images using a IIDC 1394-based digital camera (standard digital firewire camera).
Constants
Picture formats
Modes for format 0This modes are only valid in connection with format FORMAT_VGA_NONCOMPRESSED.
Modes for format 1This modes are only valid in connection with format FORMAT_SVGA_NONCOMPRESSED_1.
Modes for format 2This modes are only valid in connection with format FORMAT_SVGA_NONCOMPRESSED_2.
Modes for format 6This modes are only valid in connection with format FORMAT_STILL_IMAGE.
Modes for format 7This modes are only valid in connection with format FORMAT_SCALABLE_IMAGE_SIZE.
Colourspaces for format 7Specifying a colourspace is only possible in connection with format FORMAT_SCALABLE_IMAGE_SIZE.
Frame rates
Speed of firewire bus
Camera featuresConstants for accessing the different features of the camera.
Properties
widthWidth of images.
heightHeight of images.
Functions
DC1394Input.newConstructor.
inspectReturn string with information about this object.
closeClose the device.
readRead an image.
status?Indicates whether the device is still open.
feature_nameGet the name of a feature
feature_readRead the value of a feature.
feature_writeChange the value of a feature.
feature_exist?Check whether a certain feature is supported by the camera.
feature_readable?Query whether the camera feature can be read.
feature_optional?Query whether a camera feature can be switched on and off.
feature_on?Check whether an optional camera feature is switched on or off.
feature_onSwitch an optional camera feature on or off.
feature_has_auto?Check whether the camera can adjust the feature automatically.
feature_has_manual?Check whether the feature can be controlled by software.
feature_auto?Check whether a camera feature is currently controlled by the camera.
feature_autoSet a feature to automatic or manual mode.
feature_minGet lower boundary of feature value.
feature_maxGet upper boundary of feature value.

Constants

Picture formats

FORMAT_VGA_NONCOMPRESSEDFormat 0
FORMAT_SVGA_NONCOMPRESSED_1Format 1
FORMAT_SVGA_NONCOMPRESSED_2Format 2
FORMAT_STILL_IMAGEFormat 6
FORMAT_SCALABLE_IMAGE_SIZEFormat 7

Modes for format 0

This modes are only valid in connection with format FORMAT_VGA_NONCOMPRESSED.

MODE_160x120_YUV444160x 120 YUV444
MODE_320x240_YUV422320x 240 YUV422
MODE_640x480_YUV411640x 480 YUV411
MODE_640x480_YUV422640x 480 YUV422
MODE_640x480_RGB640x 480 RGB
MODE_640x480_MONO640x 480 MONO
MODE_640x480_MONO16640x 480 MONO16

Modes for format 1

This modes are only valid in connection with format FORMAT_SVGA_NONCOMPRESSED_1.

MODE_800x600_YUV422800x 600 YUV422
MODE_800x600_RGB800x 600 RGB
MODE_800x600_MONO800x 600 MONO
MODE_1024x768_YUV4221024x 768 YUV422
MODE_1024x768_RGB1024x 768 RGB
MODE_1024x768_MONO1024x 768 MONO
MODE_800x600_MONO16800x 600 MONO16
MODE_1024x768_MONO161024x 768 MONO16

Modes for format 2

This modes are only valid in connection with format FORMAT_SVGA_NONCOMPRESSED_2.

MODE_1280x960_YUV4221280x 960 YUV422
MODE_1280x960_RGB1280x 960 RGB
MODE_1280x960_MONO1280x 960 MONO
MODE_1600x1200_YUV4221600x1200 YUV422
MODE_1600x1200_RGB1600x1200 RGB
MODE_1600x1200_MONO1600x1200 MONO
MODE_1280x960_MONO161280x 960 MONO16
MODE_1600x1200_MONO161600x1200 MONO16

Modes for format 6

This modes are only valid in connection with format FORMAT_STILL_IMAGE.

MODE_EXIFEXIF mode

Modes for format 7

This modes are only valid in connection with format FORMAT_SCALABLE_IMAGE_SIZE.

MODE_FORMAT7_0mode 0
MODE_FORMAT7_1mode 1
MODE_FORMAT7_2mode 2
MODE_FORMAT7_3mode 3
MODE_FORMAT7_4mode 4
MODE_FORMAT7_5mode 5
MODE_FORMAT7_6mode 6
MODE_FORMAT7_7mode 7

Colourspaces for format 7

Specifying a colourspace is only possible in connection with format FORMAT_SCALABLE_IMAGE_SIZE.

COLOR_FORMAT7_MONO8MONO8
COLOR_FORMAT7_YUV411YUV411
COLOR_FORMAT7_YUV422YUV422
COLOR_FORMAT7_YUV444YUV444
COLOR_FORMAT7_RGB8RGB8
COLOR_FORMAT7_MONO16MONO16
COLOR_FORMAT7_RGB16RGB16
COLOR_FORMAT7_MONO16SMONO16S
COLOR_FORMAT7_RGB16SRGB16S
COLOR_FORMAT7_RAW8RAW8
COLOR_FORMAT7_RAW16RAW16

Frame rates

FRAMERATE_1_8751.875 frames/s
FRAMERATE_3_753.75 frames/s
FRAMERATE_7_57.5 frames/s
FRAMERATE_1515 frames/s
FRAMERATE_3030 frames/s
FRAMERATE_6060 frames/s
FRAMERATE_120120 frames/s
FRAMERATE_240240 frames/s

Speed of firewire bus

SPEED_100100 Mbit/s
SPEED_200200 Mbit/s
SPEED_400400 Mbit/s
SPEED_800800 Mbit/s
SPEED_16001600 Mbit/s
SPEED_32003200 Mbit/s

Camera features

Constants for accessing the different features of the camera.

FEATURE_MINfirst feature (brightness)
FEATURE_BRIGHTNESSbrightness
FEATURE_EXPOSUREexposure
FEATURE_SHARPNESSsharpness
FEATURE_WHITE_BALANCEwhite balance
FEATURE_HUEhue
FEATURE_SATURATIONsaturation
FEATURE_GAMMAgamma
FEATURE_SHUTTERshutter
FEATURE_GAINgain
FEATURE_IRISiris
FEATURE_FOCUSfocus
FEATURE_TEMPERATUREtemperature
FEATURE_TRIGGERtrigger
FEATURE_TRIGGER_DELAYtrigger delay
FEATURE_WHITE_SHADINGwhite shading
FEATURE_FRAME_RATEframe rate
FEATURE_ZOOMzoom
FEATURE_PANpan
FEATURE_TILTtilt
FEATURE_OPTICAL_FILTERoptical filter
FEATURE_CAPTURE_SIZEcapture size
FEATURE_CAPTURE_QUALITYcapture quality
FEATURE_MAXlast feature (capture quality)

Properties

width

Width of images.

height

Height of images.

Functions

DC1394Input.new

def DC1394Input.new(device =  "",
node =  0,
channel =  0,
preferred_format =  -1,
preferred_mode =  -1,
preferred_format7_colour =  -1,
preferred_frame_rate =  -1,
speed =  SPEED_400)

Constructor.

Parameters

deviceFilename of input device.
nodeSelect node on firewire bus.
channelSelect channel of device.
preferred_formatSelect picture format.  The possible formats are listed above.
preferred_modeEach format offers a number of modes.  Possible modes are listed above.
preferred_format7_colourIf the format is FORMAT_SCALABLE_IMAGE_SIZE, you can choose a preferred colourspace here.  Colourspaces supported by HornetsEye are: COLOR_FORMAT7_RGB8, COLOR_FORMAT7_YUV422, and COLOR_FORMAT7_MONO8.
preferred_frame_rateIf the format is any other format than FORMAT_SCALABLE_IMAGE_SIZE, you can select the frame rate here.  The possible values are listed above.
speedSpecify the speed here.  I think that speeds above 400 MBit/second are not supported by HornetsEye at the moment.

inspect

def inspect

Return string with information about this object.

Returns

This string: “DC1394Input”

close

def close

Close the device.

read

def read

Read an image.

Returns

An object of type Frame_ or Sequence_

status?

def status?

Indicates whether the device is still open.

feature_name

def feature_name(feature)

Get the name of a feature

Parameters

featureindex of feature

Returns

String with the name of the feature.

feature_read

def feature_read(feature)

Read the value of a feature.

Note that not all features are readable.

Parameters

featureindex of feature

Returns

Current value of feature

feature_write

def feature_write(feature,
value)

Change the value of a feature.

Note that some features may not exist on the camera.

Parameters

featureindex of feature
valuenominal value of feature

feature_exist?

def feature_exist?(feature)

Check whether a certain feature is supported by the camera.

Parameters

featureindex of feature

Returns

A boolean

feature_readable?

def feature_readable?(feature)

Query whether the camera feature can be read.

For example the white balance usually cannot be read.

Parameters

featureindex of feature

Returns

A boolean

feature_optional?

def feature_optional?(feature)

Query whether a camera feature can be switched on and off.

Note that some features may not exist on the camera.

Parameters

featureindex of feature

Returns

A boolean

feature_on?

def feature_on?(feature)

Check whether an optional camera feature is switched on or off.

Note that some features may not exist on the camera.

Parameters

featureindex of feature

Returns

A boolean

feature_on

def feature_on(feature,
value)

Switch an optional camera feature on or off.

Note that some features may not exist on the camera.

Parameters

featureindex of feature
valueboolean

feature_has_auto?

def feature_has_auto?(feature)

Check whether the camera can adjust the feature automatically.

Note that some features may not exist on the camera.

Parameters

featureindex of feature

Returns

A boolean

feature_has_manual?

def feature_has_manual?(feature)

Check whether the feature can be controlled by software.

Note that some features may not exist on the camera.

Parameters

featureindex of feature

Returns

A boolean

feature_auto?

def feature_auto?(feature)

Check whether a camera feature is currently controlled by the camera.

Note that some features may not exist on the camera.

Parameters

featureindex of feature

Returns

A boolean

feature_auto

def feature_auto(feature,
value)

Set a feature to automatic or manual mode.

Note that sometimes this is not supported.

Parameters

featureindex of feature
valueboolean

feature_min

def feature_min(feature)

Get lower boundary of feature value.

Note that sometimes this is not supported.

Parameters

featureindex of feature

Returns

Minimum value of feature

feature_max

def feature_max(feature)

Get upper boundary of feature value.

Note that sometimes this is not supported.

Parameters

featureindex of feature

Returns

Maximum value of feature

Format 0
Format 1
Format 2
Format 6
Format 7
def DC1394Input.new(device =  "",
node =  0,
channel =  0,
preferred_format =  -1,
preferred_mode =  -1,
preferred_format7_colour =  -1,
preferred_frame_rate =  -1,
speed =  SPEED_400)
Constructor.
def inspect
Return string with information about this object.
def close
Close the device.
def read
Read an image.
def status?
Indicates whether the device is still open.
def feature_name(feature)
Get the name of a feature
def feature_read(feature)
Read the value of a feature.
def feature_write(feature,
value)
Change the value of a feature.
def feature_exist?(feature)
Check whether a certain feature is supported by the camera.
def feature_readable?(feature)
Query whether the camera feature can be read.
def feature_optional?(feature)
Query whether a camera feature can be switched on and off.
def feature_on?(feature)
Check whether an optional camera feature is switched on or off.
def feature_has_auto?(feature)
Check whether the camera can adjust the feature automatically.
def feature_has_manual?(feature)
Check whether the feature can be controlled by software.
def feature_auto?(feature)
Check whether a camera feature is currently controlled by the camera.
def feature_min(feature)
Get lower boundary of feature value.
def feature_max(feature)
Get upper boundary of feature value.
Base class for different types of input sources for images.
HornetsEye can acquire images with a DC1394-compatible camera.
RGB8
YUV422
MONO8
This class provides fast (multi-dimensional) Ruby arrays where all elements are of the same type.
Close