HALCON Reference Manual 10.0.2
Table of Contents / Image / Acquisition ClassesClassesClasses | | | Operators

open_framegrabberopen_framegrabberopen_framegrabberOpenFramegrabberOpenFramegrabber (Operator)

Name

open_framegrabberopen_framegrabberopen_framegrabberOpenFramegrabberOpenFramegrabber — Open and configure an image acquisition device.

Signature

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

Herror open_framegrabber(const char* Name, const Hlong HorizontalResolution, const Hlong VerticalResolution, const Hlong ImageWidth, const Hlong ImageHeight, const Hlong StartRow, const Hlong StartColumn, const char* Field, const Hlong BitsPerChannel, const char* ColorSpace, double Generic, const char* ExternalTrigger, const char* CameraType, const char* Device, const Hlong Port, const Hlong LineIn, Hlong* AcqHandle)

Herror T_open_framegrabber(const Htuple Name, const Htuple HorizontalResolution, const Htuple VerticalResolution, const Htuple ImageWidth, const Htuple ImageHeight, const Htuple StartRow, const Htuple StartColumn, const Htuple Field, const Htuple BitsPerChannel, const Htuple ColorSpace, const Htuple Generic, const Htuple ExternalTrigger, const Htuple CameraType, const Htuple Device, const Htuple Port, const Htuple LineIn, Htuple* AcqHandle)

Herror open_framegrabber(const HTuple& Name, const HTuple& HorizontalResolution, const HTuple& VerticalResolution, const HTuple& ImageWidth, const HTuple& ImageHeight, const HTuple& StartRow, const HTuple& StartColumn, const HTuple& Field, const HTuple& BitsPerChannel, const HTuple& ColorSpace, const HTuple& Generic, const HTuple& ExternalTrigger, const HTuple& CameraType, const HTuple& Device, const HTuple& Port, const HTuple& LineIn, Hlong* AcqHandle)

void HFramegrabber::OpenFramegrabber(const HTuple& Name, const HTuple& HorizontalResolution, const HTuple& VerticalResolution, const HTuple& ImageWidth, const HTuple& ImageHeight, const HTuple& StartRow, const HTuple& StartColumn, const HTuple& Field, const HTuple& BitsPerChannel, const HTuple& ColorSpace, const HTuple& Generic, const HTuple& ExternalTrigger, const HTuple& CameraType, const HTuple& Device, const HTuple& Port, const HTuple& LineIn)

void HOperatorSetX.OpenFramegrabber(
[in] VARIANT Name, [in] VARIANT HorizontalResolution, [in] VARIANT VerticalResolution, [in] VARIANT ImageWidth, [in] VARIANT ImageHeight, [in] VARIANT StartRow, [in] VARIANT StartColumn, [in] VARIANT Field, [in] VARIANT BitsPerChannel, [in] VARIANT ColorSpace, [in] VARIANT Generic, [in] VARIANT ExternalTrigger, [in] VARIANT CameraType, [in] VARIANT Device, [in] VARIANT Port, [in] VARIANT LineIn, [out] VARIANT* AcqHandle)

void HFramegrabberX.OpenFramegrabber(
[in] BSTR Name, [in] Hlong HorizontalResolution, [in] Hlong VerticalResolution, [in] Hlong ImageWidth, [in] Hlong ImageHeight, [in] Hlong StartRow, [in] Hlong StartColumn, [in] BSTR Field, [in] VARIANT BitsPerChannel, [in] VARIANT ColorSpace, [in] VARIANT Generic, [in] BSTR ExternalTrigger, [in] VARIANT CameraType, [in] VARIANT Device, [in] VARIANT Port, [in] VARIANT LineIn)

static void HOperatorSet.OpenFramegrabber(HTuple name, HTuple horizontalResolution, HTuple verticalResolution, HTuple imageWidth, HTuple imageHeight, HTuple startRow, HTuple startColumn, HTuple field, HTuple bitsPerChannel, HTuple colorSpace, HTuple generic, HTuple externalTrigger, HTuple cameraType, HTuple device, HTuple port, HTuple lineIn, out HTuple acqHandle)

public HFramegrabber(string name, int horizontalResolution, int verticalResolution, int imageWidth, int imageHeight, int startRow, int startColumn, string field, HTuple bitsPerChannel, HTuple colorSpace, HTuple generic, string externalTrigger, HTuple cameraType, HTuple device, HTuple port, HTuple lineIn)

public HFramegrabber(string name, int horizontalResolution, int verticalResolution, int imageWidth, int imageHeight, int startRow, int startColumn, string field, int bitsPerChannel, string colorSpace, double generic, string externalTrigger, string cameraType, string device, int port, int lineIn)

void HFramegrabber.OpenFramegrabber(string name, int horizontalResolution, int verticalResolution, int imageWidth, int imageHeight, int startRow, int startColumn, string field, HTuple bitsPerChannel, HTuple colorSpace, HTuple generic, string externalTrigger, HTuple cameraType, HTuple device, HTuple port, HTuple lineIn)

void HFramegrabber.OpenFramegrabber(string name, int horizontalResolution, int verticalResolution, int imageWidth, int imageHeight, int startRow, int startColumn, string field, int bitsPerChannel, string colorSpace, double generic, string externalTrigger, string cameraType, string device, int port, int lineIn)

Description

The operator open_framegrabberopen_framegrabberopen_framegrabberOpenFramegrabberOpenFramegrabber 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_imagegrab_imagegrab_imageGrabImageGrabImage, grab_datagrab_datagrab_dataGrabDataGrabData, grab_image_asyncgrab_image_asyncgrab_image_asyncGrabImageAsyncGrabImageAsync, or grab_data_asyncgrab_data_asyncgrab_data_asyncGrabDataAsyncGrabDataAsync. If the image acquisition device is not needed anymore, it should be closed via the operator close_framegrabberclose_framegrabberclose_framegrabberCloseFramegrabberCloseFramegrabber, 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_framegrabberinfo_framegrabberinfo_framegrabberInfoFramegrabberInfoFramegrabber. A comprehensive documentation of all image acquistion device-specific parameters con be found in the corresponding description file in the directory 'doc/html/manuals'"doc/html/manuals""doc/html/manuals""doc/html/manuals""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_imagegrab_imagegrab_imageGrabImageGrabImage 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_framegrabberinfo_framegrabberinfo_framegrabberInfoFramegrabberInfoFramegrabber.

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_framegrabberopen_framegrabberopen_framegrabberOpenFramegrabberOpenFramegrabber returns a handle (AcqHandleAcqHandleAcqHandleAcqHandleacqHandle) to the opened image acquisition device.

Attention

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

Parallelization

Parameters

NameNameNameNamename (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

HALCON image acquisition interface name, i.e., name of the corresponding DLL (Windows) or shared library (Linux/UNIX).

Default value: 'File' "File" "File" "File" "File"

Suggested values: '1394IIDC'"1394IIDC""1394IIDC""1394IIDC""1394IIDC", '1394IIDC-2'"1394IIDC-2""1394IIDC-2""1394IIDC-2""1394IIDC-2", 'ABS'"ABS""ABS""ABS""ABS", 'ADLINK'"ADLINK""ADLINK""ADLINK""ADLINK", 'Andor'"Andor""Andor""Andor""Andor", 'BitFlow'"BitFlow""BitFlow""BitFlow""BitFlow", 'Crevis'"Crevis""Crevis""Crevis""Crevis", 'DahengCAM'"DahengCAM""DahengCAM""DahengCAM""DahengCAM", 'DirectFile'"DirectFile""DirectFile""DirectFile""DirectFile", 'DirectShow'"DirectShow""DirectShow""DirectShow""DirectShow", 'eneo'"eneo""eneo""eneo""eneo", 'File'"File""File""File""File", 'GenICamTL'"GenICamTL""GenICamTL""GenICamTL""GenICamTL", 'GigEVision'"GigEVision""GigEVision""GigEVision""GigEVision", 'Ginga++'"Ginga++""Ginga++""Ginga++""Ginga++", 'GingaDG'"GingaDG""GingaDG""GingaDG""GingaDG", 'INSPECTA'"INSPECTA""INSPECTA""INSPECTA""INSPECTA", 'INSPECTA5'"INSPECTA5""INSPECTA5""INSPECTA5""INSPECTA5", 'LinX'"LinX""LinX""LinX""LinX", 'LPS36'"LPS36""LPS36""LPS36""LPS36", 'LuCam'"LuCam""LuCam""LuCam""LuCam", 'MatrixVisionAcquire'"MatrixVisionAcquire""MatrixVisionAcquire""MatrixVisionAcquire""MatrixVisionAcquire", 'MILLite'"MILLite""MILLite""MILLite""MILLite", 'MultiCam'"MultiCam""MultiCam""MultiCam""MultiCam", 'Opteon'"Opteon""Opteon""Opteon""Opteon", 'p3i2'"p3i2""p3i2""p3i2""p3i2", 'PcEyeCL'"PcEyeCL""PcEyeCL""PcEyeCL""PcEyeCL", 'PixeLINK'"PixeLINK""PixeLINK""PixeLINK""PixeLINK", 'pylon'"pylon""pylon""pylon""pylon", 'SaperaLT'"SaperaLT""SaperaLT""SaperaLT""SaperaLT", 'Sentech'"Sentech""Sentech""Sentech""Sentech", 'SICK-3DCamera'"SICK-3DCamera""SICK-3DCamera""SICK-3DCamera""SICK-3DCamera", 'SiliconSoftware'"SiliconSoftware""SiliconSoftware""SiliconSoftware""SiliconSoftware", 'SonyXCI-2'"SonyXCI-2""SonyXCI-2""SonyXCI-2""SonyXCI-2", 'SVCam-GigE'"SVCam-GigE""SVCam-GigE""SVCam-GigE""SVCam-GigE", 'TWAIN'"TWAIN""TWAIN""TWAIN""TWAIN", 'uEye'"uEye""uEye""uEye""uEye", 'VRmAreaScan3D'"VRmAreaScan3D""VRmAreaScan3D""VRmAreaScan3D""VRmAreaScan3D", 'VRmUsbCam'"VRmUsbCam""VRmUsbCam""VRmUsbCam""VRmUsbCam"

HorizontalResolutionHorizontalResolutionHorizontalResolutionHorizontalResolutionhorizontalResolution (input_control)  extent.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

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

VerticalResolutionVerticalResolutionVerticalResolutionVerticalResolutionverticalResolution (input_control)  extent.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

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

ImageWidthImageWidthImageWidthImageWidthimageWidth (input_control)  rectangle.extent.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Width of desired image part (absolute value or 0 for HorizontalResolutionHorizontalResolutionHorizontalResolutionHorizontalResolutionhorizontalResolution - 2*StartColumnStartColumnStartColumnStartColumnstartColumn).

Default value: 0

Suggested values: 0, -1

ImageHeightImageHeightImageHeightImageHeightimageHeight (input_control)  rectangle.extent.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Height of desired image part (absolute value or 0 for VerticalResolutionVerticalResolutionVerticalResolutionVerticalResolutionverticalResolution - 2*StartRowStartRowStartRowStartRowstartRow).

Default value: 0

Suggested values: 0, -1

StartRowStartRowStartRowStartRowstartRow (input_control)  rectangle.origin.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Line number of upper left corner of desired image part (or border height if ImageHeightImageHeightImageHeightImageHeightimageHeight = 0).

Default value: 0

Suggested values: 0, -1

StartColumnStartColumnStartColumnStartColumnstartColumn (input_control)  rectangle.origin.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Column number of upper left corner of desired image part (or border width if ImageWidthImageWidthImageWidthImageWidthimageWidth = 0).

Default value: 0

Suggested values: 0, -1

FieldFieldFieldFieldfield (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Desired half image or full image.

Default value: 'default' "default" "default" "default" "default"

Suggested values: 'first'"first""first""first""first", 'second'"second""second""second""second", 'next'"next""next""next""next", 'interlaced'"interlaced""interlaced""interlaced""interlaced", 'progressive'"progressive""progressive""progressive""progressive", 'default'"default""default""default""default"

BitsPerChannelBitsPerChannelBitsPerChannelBitsPerChannelbitsPerChannel (input_control)  integer(-array) HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

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

ColorSpaceColorSpaceColorSpaceColorSpacecolorSpace (input_control)  string(-array) HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

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' "default" "default" "default" "default"

Suggested values: 'gray'"gray""gray""gray""gray", 'raw'"raw""raw""raw""raw", 'rgb'"rgb""rgb""rgb""rgb", 'yuv'"yuv""yuv""yuv""yuv", 'default'"default""default""default""default"

GenericGenericGenericGenericgeneric (input_control)  string(-array) HTupleHTupleVARIANTHtuple (real / string / integer) (double / string / int / long) (double / char* / Hlong) (double / BSTR / Hlong) (double / char* / Hlong)

Generic parameter with device-specific meaning.

Default value: -1

ExternalTriggerExternalTriggerExternalTriggerExternalTriggerexternalTrigger (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

External triggering.

Default value: 'default' "default" "default" "default" "default"

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false", 'default'"default""default""default""default"

CameraTypeCameraTypeCameraTypeCameraTypecameraType (input_control)  string(-array) HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Type of used camera ('default': device-specific default value).

Default value: 'default' "default" "default" "default" "default"

Suggested values: 'ntsc'"ntsc""ntsc""ntsc""ntsc", 'pal'"pal""pal""pal""pal", 'auto'"auto""auto""auto""auto", 'default'"default""default""default""default"

DeviceDeviceDeviceDevicedevice (input_control)  string(-array) HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Device the image acquisition device is connected to ('default': device-specific default value).

Default value: 'default' "default" "default" "default" "default"

Suggested values: '-1'"-1""-1""-1""-1", '0'"0""0""0""0", '1'"1""1""1""1", '2'"2""2""2""2", '3'"3""3""3""3", 'default'"default""default""default""default"

PortPortPortPortport (input_control)  integer(-array) HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Port the image acquisition device is connected to (-1: device-specific default value).

Default value: -1

Suggested values: 0, 1, 2, 3, -1

LineInLineInLineInLineInlineIn (input_control)  integer(-array) HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Camera input line of multiplexer (-1: device-specific default value).

Default value: -1

Suggested values: 1, 2, 3, 4, -1

AcqHandleAcqHandleAcqHandleAcqHandleacqHandle (output_control)  framegrabber HFramegrabber, HTupleHFramegrabber, HTupleHFramegrabberX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Handle of the opened image acquisition device.

Example (HDevelop)

* 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)

Example (C)

/* 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) ;

Example (HDevelop)

* 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)

Example (HDevelop)

* 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)

Example (HDevelop)

* 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_framegrabberopen_framegrabberopen_framegrabberOpenFramegrabberOpenFramegrabber returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Possible Predecessors

info_framegrabberinfo_framegrabberinfo_framegrabberInfoFramegrabberInfoFramegrabber

Possible Successors

grab_imagegrab_imagegrab_imageGrabImageGrabImage, grab_datagrab_datagrab_dataGrabDataGrabData, grab_image_startgrab_image_startgrab_image_startGrabImageStartGrabImageStart, grab_image_asyncgrab_image_asyncgrab_image_asyncGrabImageAsyncGrabImageAsync, grab_data_asyncgrab_data_asyncgrab_data_asyncGrabDataAsyncGrabDataAsync, set_framegrabber_paramset_framegrabber_paramset_framegrabber_paramSetFramegrabberParamSetFramegrabberParam, set_framegrabber_callbackset_framegrabber_callbackset_framegrabber_callbackSetFramegrabberCallbackSetFramegrabberCallback

See also

info_framegrabberinfo_framegrabberinfo_framegrabberInfoFramegrabberInfoFramegrabber, close_framegrabberclose_framegrabberclose_framegrabberCloseFramegrabberCloseFramegrabber, grab_imagegrab_imagegrab_imageGrabImageGrabImage

Module

Foundation


Table of Contents / Image / Acquisition ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH