open_framegrabber ( : : Name, FGWidth, FGHeight, Width, Height, StartRow, StartColumn, SquarePixels, Field, Bits, SpaceOrThresh, Gain, Generic, Device, Port : )

Open and configure a framegrabber.

The operator open_framegrabber opens and configures the chosen framegrabber. During this process in particular the link with the framegrabber is tested, the framegrabber is (normally) locked for other processes and if necessary memory is reserved as data buffer. The image is actually grabbed via the operator grab_image. If the framegrabber is not needed anymore, it should be closed via the operator close_framegrabber, releasing it for other processes. This automatically happens when another framegrabber is opened. This means that only one framegrabber can be open at a time. For all parameters (except for name) -1 can be transferred for integer, -1.0, for real and/or 'unchanged' for string values. In this case the settings last chosen for this framegrabber (i.e. the HORUS defaults on first call) remain unchanged. The meaning of the particular parameters is as follows:

FGWidth,FGHeight             Desired resolution of framegrabber.
Width,Height                 Size of the image area to be returned 
                             by grab_image.
StartRow,StartColumn         Upper left corner of the desired image area.
SquarePixels                 Statement whether square pixels
                             ('yes') are desired or not ('no').
Field                        Number of desired half image
                             (0 / 1) and/or value 2 for a full image.
Bits                         Desired resolution of color and/or 
                             grayvalues (typically 1, 8 or 24 bits).
SpaceOrThresh                Desired color space (mostly 'rgb') for
                             colored images or threshold for
                             the binarisation of binary images
                             (1 bit). In the case of binary images
                             the pixels (as a region) are returned
                             with a brightness greater or the
                             same as the threshold set by grab_image.
Gain                         Amplification factor for the video
                             amplifier.
Generic                      Generic parameter (string
                             type) with framegrabber specific
                             meaning. This can be queried via
                             info_framegrabber.
Device                       Device name of the framegrabber card.
Port                         Port of the framegrabber the video signal
                             is linked to.

The operator info_framegrabber queries all possible parameters of a concrete framegrabber which was opened before. It is therefore advisable to first open the framegrabber via the HORUS defaults (-1, -1.0 and 'unchanged'). Then the operator info_framegrabber returns all possible parameter combinations by which the framegrabber (now in the modus suitable for the conceptual formulation) can be opened again.


Attention

Due to the multitude of supported framegrabbers a large number of parameters is necessary for the operator open_framegrabber. However, not all parameters are needed for a specific framegrabber.


Parameters

Name (input_control)
string -> string
Framegrabber to be opened.
Default value: 'UserFG'
List of values: 'J300', 'MATROXMeteor', 'ProgRes', 'SlicVideo', 'SunVideo', 'VideoPix', 'VigraPix', 'ProgRes', 'UserFG'

FGWidth (input_control)
extent.x -> integer
Desired horizontal resolution of framegrabber (-1: leave value unchanged).
Default value: -1
Suggested values: 998, 768, 720, 499, 384, 250, 192, -1

FGHeight (input_control)
extent.y -> integer
Desired vertical resolution of framegrabber (-1: leave value unchanged).
Default value: -1
Suggested values: 870, 580, 576, 575, 291, 288, 144, -1

Width (input_control)
rectangle.extent.x -> integer
Width of desired image area (-1: leave value unchanged).
Default value: -1
Suggested values: 998, 768, 720, 499, 384, 250, 192, -1

Height (input_control)
rectangle.extent.y -> integer
Height of desired image area (-1: leave value unchanged).
Default value: -1
Suggested values: 870, 580, 576, 575, 291, 288, 144, -1

StartRow (input_control)
rectangle.origin.y -> integer
Line number of upper left corner of desired image area (-1: leave value unchanged).
Default value: -1
Suggested values: 0, -1

StartColumn (input_control)
rectangle.origin.x -> integer
Column number of upper left corner of desired image area (-1: leave value unchanged).
Default value: -1
Suggested values: 0, -1

SquarePixels (input_control)
string -> string
Square pixels or not ('unchanged': leave value unchanged).
Default value: 'unchanged'
List of values: 'yes', 'no', 'unchanged'

Field (input_control)
integer -> integer
Desired half image (0/1) or 2 for full image (-1: leave value unchanged).
Default value: -1
List of values: 0, 1, 2, -1

Bits (input_control)
integer -> integer
Number of bits per pixel (-1: leave value unchanged).
Default value: -1
List of values: 1, 8, 16, 24, -1

SpaceOrThresh (input_control)
string -> string
The desired color space of colored images (mostly 'rgb') or the threshold for binarisation of binary images ('unchanged': leave value unchanged).
Default value: 'unchanged'
List of values: 'rgb', 'yuv', 'unchanged'

Gain (input_control)
real -> real
Amplification factor for video amplifier (-1.0: leave value unchanged).
Default value: -1.0
Suggested values: 0.25, 0.5, 0.75, 1.0, -1.0

Generic (input_control)
string -> string
Generic parameter (framegrabber specific) ('unchanged': leave value unchanged).
Default value: 'unchanged'

Device (input_control)
string -> string
Device the framegrabber is linked to ('unchanged': leave value unchanged).
Default value: 'unchanged'

Port (input_control)
integer -> integer
Port of the framegrabber the video signal is linked to (-1: leave value unchanged).
Default value: -1
List of values: 1, 2, 3, -1


Example
query_framegrabber(:::FGs) >

< Selection of a suitable Framegrabbers FG from FGs >

open_framegrabber(::FG,-1,-1,-1,-1,-1,-1,'unchanged',-1,-1,'unchanged',
-1.0,'unchanged','unchanged',-1:) >
info_framegrabber(:::Width,Height,Bits,ColorSpaces,PixelRatios,Full,Explain) >

< Selection  of a suitable Modus [W,H,B,C,YesOrNo,Field] with
  YesOrNo = 'yes', if entry in PixelRatios = 1.0
  Field   = 0 or 1 (Full = 'false') or 2 (Full = 'true')
  Generic sedate in accordance with Explain 
  and a suitable Image area [Wi,He,L,C] >

open_framegrabber(::FG,W,H,Wi,He,L,C,YesOrNo,Field,B,C,Gain,Generic,
'unchanged',-1:) >
grab_image(:Img::) >
close_framegrabber(:::).

Result

If the parameter values are correct and the desired framegrabber is available at call time, open_framegrabber returns the value TRUE. Otherwise an exception is raised.


Possible Predecessors

query_framegrabber


Possible Successors

grab_image, info_framegrabber


See also

query_framegrabber, info_framegrabber, close_framegrabber, grab_image



Copyright © 1996-1997 MVTec Software GmbH