HALCON Reference Manual / Image / Acquisition Operators

open_framegrabber (Operator)

Name

open_framegrabber — Open and configure a image acquisition device.

Synopsis

open_framegrabber( : : Name, HorizontalResolution, VerticalResolution, ImageWidth, ImageHeight, StartRow, StartColumn, Field, BitsPerChannel, ColorSpace, Generic, ExternalTrigger, CameraType, Device, Port, LineIn : AcqHandle)

Description

The operator open_framegrabber opens and configures the chosen image acquisition device. During this process, the connection to the image acquisition device is tested, the image acquisition device is locked for other processes, and, if necessary, memory is reserved for the data buffers. The actual image grabbing is done via the operators grab_image, grab_data, grab_image_async, or grab_data_async. If the image acquisition device is not needed anymore, it should be closed via the operator close_framegrabber, releasing it for other processes. Some image acquisition devices allow to open several instances of the same image acquisition device class.

For all parameters image acquisition device-specific default values can be chosen explicitly (see the parameter description below). Additional information for a specific image acquisition device is available via info_framegrabber. A comprehensive documentation of all image acquistion device-specific parameters con be found in the corresponding description file in the directory doc/html/manuals.

The meaning of the particular parameters is as follows:

HorizontalResolution,VerticalResolution
                             Desired resolution of the image acquisition 
                             device.
ImageWidth,ImageHeight       Size of the image part to be returned 
                             by grab_image etc.
StartRow,StartColumn         Upper left corner of the desired image area.
Field                        Desired half image ('first', 'second', or 
                             'next') or selection of a full image.
BitsPerChannel               Number of bits, which are transferred from the 
                             image acquisition device per pixel and image 
                             channel (typically 5, 8, 10, 12, or 16).
ColorSpace                   Output color format of the grabbed images
                             (typically 'gray' or 'raw' for single-channel
                             or 'rgb' or 'yuv' for three-channel images).
Generic                      Generic parameter with device-specific
                             meaning which can be queried
                             by info_framegrabber.
ExternalTrigger              Activation of external triggering (if
                             available).
CameraType                   More detailed specification of the desired 
                             image acquistion device (typically the type
                             of the analog video format or the name of the
                             desired camera configuration file).
Device                       Device name of the image acquistion device.
Port                         Port the image acquistion device is connected 
                             to.
LineIn                       Camera input line of multiplexer (if available).

The operator open_framegrabber returns a handle (AcqHandle) to the opened image acquisition device.

Attention

Due to the multitude of supported image acquisition devices, open_framegrabber contains a large number of parameters. However, not all parameters are needed for a specific image acquisition device.

Parameters

Name (input_control) string (string)
HALCON image acquisition interface name, i.e., name of the corresponding DLL (Windows) or shared library (Linux/UNIX).
Default value: 'File'
Suggested values: '1394IIDC', 'ABS', 'BaumerFCAM', 'BitFlow', 'Crevis', 'DahengCAM', 'DFG-LC', 'DirectFile', 'DirectShow', 'eneo', 'eXcite', 'FALCON', 'File', 'FlashBusMX', 'GigEVision', 'Ginga++', 'GingaDG', 'INSPECTA', 'INSPECTA5', 'Leutron', 'LinX', 'LuCam', 'MatrixVisionAcquire', 'MILLite', 'mEnableIII', 'mEnableIV', 'mEnableVisualApplets', 'MultiCam', 'Opteon', 'p3i2', 'p3i4', 'PixeLINK', 'PX', 'PXC', 'PXD', 'PXR', 'pylon', 'RangerC', 'RangerE', 'SaperaLT', 'SonyXCI', 'SonyXCI-2', 'TAG', 'TWAIN', 'uEye', 'VRmUsbCam'

HorizontalResolution (input_control) extent.x (integer)
Desired horizontal resolution of image acquisition interface (absolute value or 1 for full resolution, 2 for half resolution, or 4 for quarter resolution).
Default value: 1
Suggested values: 1, 2, 4, 1600, 1280, 768, 640, 384, 320, 192, 160, -1

VerticalResolution (input_control) extent.y (integer)
Desired vertical resolution of image acquisition interface (absolute value or 1 for full resolution, 2 for half resolution, or 4 for quarter resolution).
Default value: 1
Suggested values: 1, 2, 4, 1200, 1024, 576, 480, 288, 240, 144, 120, -1

ImageWidth (input_control) rectangle.extent.x (integer)
Width of desired image part (absolute value or 0 for HorizontalResolution - 2*StartColumn).
Default value: 0
Suggested values: 0, -1

ImageHeight (input_control) rectangle.extent.y (integer)
Height of desired image part (absolute value or 0 for VerticalResolution - 2*StartRow).
Default value: 0
Suggested values: 0, -1

StartRow (input_control) rectangle.origin.y (integer)
Line number of upper left corner of desired image part (or border height if ImageHeight = 0).
Default value: 0
Suggested values: 0, -1

StartColumn (input_control) rectangle.origin.x (integer)
Column number of upper left corner of desired image part (or border width if ImageWidth = 0).
Default value: 0
Suggested values: 0, -1

Field (input_control) string (string)
Desired half image or full image.
Default value: 'default'
Suggested values: 'first', 'second', 'next', 'interlaced', 'progressive', 'default'

BitsPerChannel (input_control) integer(-array) (integer)
Number of transferred bits per pixel and image channel (-1: device-specific default value).
Default value: -1
Suggested values: 5, 8, 10, 12, 14, 16, -1

ColorSpace (input_control) string(-array) (string)
Output color format of the grabbed images, typically 'gray' or 'raw' for single-channel or 'rgb' or 'yuv' for three-channel images ('default': device-specific default value).
Default value: 'default'
Suggested values: 'gray', 'raw', 'rgb', 'yuv', 'default'

Generic (input_control) string(-array) (real / string / integer)
Generic parameter with device-specific meaning.
Default value: -1

ExternalTrigger (input_control) string (string)
External triggering.
Default value: 'default'
List of values: 'true', 'false', 'default'

CameraType (input_control) string(-array) (string)
Type of used camera ('default': device-specific default value).
Default value: 'default'
Suggested values: 'ntsc', 'pal', 'auto', 'default'

Device (input_control) string(-array) (string)
Device the image acquisition device is connected to ('default': device-specific default value).
Default value: 'default'
Suggested values: '-1', '0', '1', '2', '3', 'default'

Port (input_control) integer(-array) (integer)
Port the image acquisition device is connected to (-1: device-specific default value).
Default value: -1
Suggested values: 0, 1, 2, 3, -1

LineIn (input_control) integer(-array) (integer)
Camera input line of multiplexer (-1: device-specific default value).
Default value: -1
Suggested values: 1, 2, 3, 4, -1

AcqHandle (output_control) framegrabber (integer)
Handle of the opened image acquisition device.

Example

* Select a suitable image acquisition interface name AcqName
info_framegrabber(AcqName,'port',Information,Values)
* Choose the port P and the input line L your camera is connected to
open_framegrabber(AcqName,1,1,0,0,0,0,'default',-1,'default',-1.0, \
                  'default','default','default',P,L,AcqHandle)
grab_image(Image,AcqHandle)
close_framegrabber(AcqHandle)

Result

If the parameter values are correct and the desired image acquisition device could be opened, open_framegrabber returns the value 2 (H_MSG_TRUE). Otherwise an exception handling is raised.

Parallelization Information

open_framegrabber is processed completely exclusively without parallelization.

Possible Predecessors

info_framegrabber

Possible Successors

grab_image, grab_data, grab_image_start, grab_image_async, grab_data_async, set_framegrabber_param, set_framegrabber_callback

See also

info_framegrabber, close_framegrabber, grab_image

Module

Foundation


HALCON Reference Manual / Image / Acquisition Operators
Version 9.0.1 Copyright © 1996-2009 MVTec Software GmbH