interfaces mvtec

Interface Documentation

Image Acquisition Interface for MATRIX VISION Boards and Cameras

Interface: MatrixVisionAcquire
Revision: 13.0.1
Date: 2016-10-28
HALCON Version: 13.0

General

This page provides the documentation of the HALCON MatrixVisionAcquire interface that supports frame grabber boards and cameras from MATRIX VISION GmbH. This interface offers full control over the mvBlueFOX USB 2.0 and USB 3.0 camera series, the mvBlueCOUGAR and mvBlueLYNX-M7 GigE camera series, the mvHYPERION, mvDELTA, mvGAMMA, mvSIGMA, and mvTITAN frame grabber boards and mvVirtualDevice virtual devices. For also accessing pcIMAGE frame grabber boards from MATRIX VISION please refer to the existing HALCON MatrixVision interface (legacy). Registered customers can download the latest revision of this interface from the MVTec WWW server.

System Requirements

  • Intel compatible PC with Windows 7 (32-bit or 64-bit) or newer that is also supported by the vendor-specific SDK, also WoW64 (using 32-bit HALCON on 64-bit Windows), or Linux with kernel 2.6.x.
  • Successfully installed MATRIX VISION driver from the MATRIX VISION Driver CD (Windows: version 1.11.49 or higher, Linux: version 1.9.12 or higher).
  • Windows: HALCON image acquisition interface hAcqMatrixVisionAcquire.dll or hAcqMatrixVisionAcquirexl.dll, respectively. If you have properly installed the interface, both DLLs should reside in bin\%HALCONARCH%within the HALCON base directory %HALCONROOT% you have chosen during the installation of HALCON.
    Linux: HALCON image acquisition interface hAcqMatrixVisionAcquire.so or hAcqMatrixVisionAcquirexl.so, respectively. Both files should reside in the directory /lib/$HALCONARCH within the HALCON base directory $HALCONROOT.

Features

  • Multiple devices.
  • Generic access to all device-specific parameters.
  • Synchronous and asynchronous grabbing.
  • Cropping of image parts.
  • Subsampling.
  • External trigger.

Multiple devices

The HALCON MatrixVisionAcquire interface supports working with multiple devices. To allow the interface to distinguish between multiple devices of the same type, each device should be assigned with an unique ID, that is stored inside the devices non-volatile memory. To assign an ID to a device please use mvDeviceConfigure tool, that is part of the MATRIX VISION installation. A list of all currently installed devices can be obtained by calling info_framegrabber(..., 'info_boards', ...)
Currently, an ID must be assigned to USB devices only.

More Information about Parameters

Assume a call to get_framegrabber_param(..., 'readable_instance_properties', ...) returns a tuple containing three strings: [ 'Camera/ExposeTime_us', 'Camera/TriggerMode', 'Camera/Gain_dB' ]. This tells the user that
  • these properties can be set differently for each handle to that device.
  • these properties will be valid in all future releases for this particular device without ever calling reading the property list again, i.e., during design time the user needs to query the property list once, but in the final solution of his application he can just work with the string once read.
  • '_us' indicates that this property can be set in microseconds, '_dB' indicates that this property can be set in decibel. Other possible postfixes are '_pc' for percent, '_ms' for milliseconds, '_s' for seconds, '_kB' for kilobytes, and '_MB' for megabytes.

Now to read e.g. the current gain of the instance AcqHandle the user can call get_framegrabber_param(..., 'Camera/Gain_dB', ...)

There are some properties that store more than a single value. One example for such a property is 'ImageProcessing/LUTOperations/LUTs/LUT-0/DirectValues'. If this parameters is read by using get_framegrabber_param (..., 'ImageProcessing/LUTOperations/LUTs/LUT-0/DirectValues', ...) the interface will return a tuple containing all values. For writing to such a property a tuple must be used as well.

Furthermore, the user can query additional information about the properties. Some might define limits like min, max or step width. These values can be queried as a list by postfixing the properties name with '_range' or by prefixing it with 'limits.'.
Thus, to query the limits of the gain property the user can call get_framegrabber_param(..., 'limits.Camera/Gain_dB', ...). This might e.g. result in a list like this: [ 0.0, 30.0, 0.045, 3.5 ]. The first value indicates the minimum value, the second value is the maximum value, the third value is the step width and the last value is the current value for this property. Values written to the property, that don't match the stepwidth, will be rounded to the closest matching step automatically. Note, that you can also obtain this list by get_framegrabber_param(..., 'Camera/Gain_dB_range', ...).

Other properties like e.g. the trigger mode property can only be set to certain values. To find out which values are valid for a certain property the user can either prefix the property's name with 'dictionary.' or postfix it with '_values'. Thus, to find out which values are allowed for the trigger mode property the user can either call get_framegrabber_param(..., 'dictionary.Camera/TriggerMode', ...) or get_framegrabber_param(..., 'Camera/TriggerMode_values', ...). Afterwards the returned tuple will contain a list of strings defining the allowed trigger modes for this device. This list might look like this: [ 'Continuous', 'OnDemand', 'OnRisingEdge', 'OnFallingEdge' ]. Again: These modes will stay consistent. New ones may occur, but the modes once queried will be valid for all future releases.

Now e.g. to switch the trigger mode to 'OnDemand' the user could call set_framegrabber_param(..., 'Camera/TriggerMode', 'OnDemand').

Certain properties can be set by the user, but won't affect the behaviour of the acquisition. For example, the user might have switched on the AGC (Automatic Gain Control). Then writing the property 'Camera/ExposeTime_us' will not affect the expose time used for the image acquisition. However, the value written to the property will have affect as soon as the AGC is switched off again. Some properties therefore will be shadowed by values applied to other properties.

To find out if a property currently is shadowed the user can prefix the name of the property in question with the word 'isVisible.'. Then a call to get_framegrabber_param(..., 'isVisible.Camera/TriggerMode', ...) will return either 0 to indicate that the property currently is NOT shadowed or 1 to indicate that the property is currently not active.

Parameters for info_framegrabber

Parameter Value List Type Kind Description
'bits_per_channel' [] Ignored.
'camera_type' ['mvBlueFOX*', 'mvBlueCOUGAR*', 'mvBlueLYNX-M7*', 'mvDELTA*', 'mvSIGMA*', 'mvGAMMA*', 'mvTITAN*', 'mvHYPERION*', 'Virtual*'] string pre-defined Returns the value list for camera type.
'color_space' ['gray', 'rgb', 'yuv'] string pre-defined Values for color space.
'defaults' [1, 1, 0, 0, 0, 0, 'interlaced', 8, 'gray', -1.0, 'false', '*', '0', 0, 0] mixed pre-defined Default values for open_framegrabber.
'device' ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] string dynamic Returns a pre-defined list of possible device IDs.
'external_trigger' [] Unused.
'field' [] Unused.
'general' [] string pre-defined Information about the HALCON MatrixVisionAcquire interface.
'generic' [] Unsupported query.
'horizontal_resolution' 1 integer pre-defined Value list for horizontal resolution.
'image_height' [] Unsupported query.
'image_width' [] Unsupported query.
'info_boards' ['device type: <type>, device ID: <device_id>, GUID: <guid>, current state: <state>'] string dynamic A list of the available devices.
'parameters' ['<parameters>'] string pre-defined Pre-defined parameters of the HALCON interface.
'parameters_readonly' ['<parameters>'] string pre-defined Pre-defined read-only parameters of the HALCON interface.
'parameters_writeonly' ['<parameters>'] string pre-defined Pre-defined write-only parameters of the HALCON interface.
'port' [] Unused.
'revision' '<revision>' string pre-defined Revision number of the MatrixVisionAcquire interface.
'start_column' [] Unsupported query.
'start_row' [] Unsupported query.
'vertical_resolution' 1 integer pre-defined Value list for vertical resolution.

Parameters for open_framegrabber

Parameter Values Default Type Description
Name 'MatrixVisionAcquire' string Name of the HALCON interface.
HorizontalResolution --- Ignored.
VerticalResolution --- Ignored.
ImageWidth 0, <width> 0 integer The width of the desired image part ('0' stands for the complete image).
ImageHeight 0, <height> 0 integer The height of the desired image part ('0' stands for the complete image).
StartRow 0, <row> 0 integer Row coordinate of the upper left pixel within the desired image part.
StartColumn 0, <column> 0 integer Column coordinate of the upper left pixel within the desired image part.
Field --- Ignored.
BitsPerChannel --- Ignored.
ColorSpace 'gray', 'rgb', 'yuv' 'gray' string Desired color space and thus the number of image channels of the resulting HALCON image.
Generic --- Ignored.
ExternalTrigger --- string Ignored. The external trigger can be activated by set_framegrabber_param with the parameter 'Camera/TriggerMode'.
CameraType
  • '*'
  • 'mvBlueFOX*'
  • 'mvBlueCOUGAR*'
  • 'mvBlueLYNX-M7*'
  • 'mvDELTA*'
  • 'mvSIGMA*'
  • 'mvGAMMA*'
  • 'mvTITAN*'
  • 'mvHYPERION*'
  • 'Virtual*'
'*' string This parameter is used to specify the type of device the user wants to access. To access a certain product, the string parameter passed here can be used with several levels of precision. Internally the driver tries to locate a device that matches the search string up to the wildcard ('*') in connection with the value passed via the 'Device' parameter. EXAMPLE: 'mvBlueFOX-M124*' with 'Device' set to 2 will try to open any mvBlueFOX-M124 device (color or gray) that has the device ID 2, while 'mvHY*' and 'Device' set to 0 will try to open the first mvHYPERION device found on the bus.
'*' will therefore try to open the first device supported by this device interface driver.
Device '<device_id>' '0' string The device ID which has been assigned to that device using mvDeviceConfigure. Assigning different IDs to each device allows to work with multiple devices of the same type.
Port <port> 0 integer Specifies the port the device is connected to. For mvBlueFOX cameras this value is always 0.
LineIn --- Ignored.

Parameters for set_framegrabber_param

Note that most parameters of this interface are generic, i.e., all available parameters can be queried directly from the acquisition device by use of the parameters 'available_param_names', 'readable_device_properties', 'readable_instance_properties', 'writeable_device_properties', and 'writeable_instance_properties'.
Parameter Values Default Type Description
'do_abort_grab' --- Cancel current grab.
'do_invalidate_property_cache' --- Invalidates the internal property cache. This might be useful when modifying a property at runtime, that in terms results in the creation or deletion of other features. For performance reasons changes like this must be explicitly applied by the application. Thus, in order to get access to dynamically created features after certain changes the internal property cache should be invalidated. When calling get_framegrabber_param with a parameter that returns a list of parameters, the list will be invalidated automatically.
'do_update_digital_inputs' --- Updates the digital input related properties with the values currently applied to the physical inputs. Without calling this parameter, reading the digital input related properties might NOT reflect the current state of the physical inputs.
'grab_timeout' <milliseconds> 5000 integer Desired timeout (milliseconds) for aborting a pending grab. If -1 is specified, the timeout is set to INFINITE.
'image_height' <height> integer Specify the desired image height. '0' means to use maximum image height. Note that you can also adapt this setting with the parameter 'Camera/Aoi/H'.
'image_width' <width> integer Specify the desired image width. '0' means to use maximum image width. Note that you can also adapt this setting with the parameter 'Camera/Aoi/W'.
'port' <port> integer Switch to the camera connected to the specified port number. Default: 0.
'request_queue_depth' 1, 2, ... 1 integer Internal queue size that is used in combination with grab_image_async: To achieve optimal performance, a certain number of image requests will be sent down to the driver the first time an asynchronous grab is requested. Once send down to the driver the acquisition parameters for this image request (e.g., the gain) can't be modified anymore.
'start_column' <start_column> integer The column coordinate of the upper left corner of the resulting HALCON image part. Note that you can also adapt this setting with the parameter 'Camera/Aoi/X'.
'start_row' <start_row> integer The row coordinate of the upper left corner of the resulting HALCON image part. Note that you can also adapt this setting with the parameter 'Camera/Aoi/Y'.
'volatile' 'disable', 'enable' 'disable' string Grayscale only. In the volatile mode the two image acquisition interface buffers are used directly to store HALCON images. This is the fastest mode avoiding to copy raw images in memory. However, be aware that older images are overwritten again and again as a side-effect. Thus, you can only process one image while you grab another image. Older images are invalid!

Parameters for get_framegrabber_param

There may exist additional read-only parameters with the following postfixes:
  • '_description': These parameters provide the tool-tip of the corresponding parameter as a string.
  • '_range': These parameters provide the minimum, maximum, step width, and default values for the corresponding integer or float parameter as a tuple with 4 elements, e.g., get_framegrabber_param(.., 'Shutter_range', ..) will return the output tuple [min, max, step, default].
  • '_values': These parameters provide the valid value list for the corresponding parameter as a tuple, e.g., get_framegrabber_param(.., 'volatile_values', ..) will return the output tuple ['enable', 'disable'].

All these postfixed parameter names are not returned when calling info_framegrabber(.., 'parameters', ..) and are used to enable the easy parameterization via a generic graphical user interface, particularly the HDevelop Image Acquisition Assistant.

Parameter Values Default Type Kind Description
'available_param_access' ['<accessibility>'] string dynamic A list containing the accessibility of all parameters. The following types are possible:
  • 'ro' (read only)
  • 'rw' (read and write)
  • 'wo' (write only)
The order of the entries is equal to the order of the parameter names returned by 'available_param_names'.
'available_param_descriptions' ['<descriptions>'] string dynamic A list containing additional information about all parameters. The order of the entries is equal to the order of the parameter names returned by 'available_param_names'.
'available_param_names' ['<parameters>'] string dynamic The list contains the names of all available parameters.
'available_param_types' ['<types>'] string dynamic A list containing the types of all parameters. The following types are possible:
  • 'I' (integer value)
  • 'F' (float value)
  • 'S' (string value)
  • 'SE' (string enumeration)
The order of the entries is equal to the order of the parameter names returned by 'available_param_names'.
'bits_per_channel' <default> 8 integer pre-defined The value is not used, so a default value is returned.
'camera_type' '<camera_type>' '*' string pre-defined Returns the current value for camera type.
'color_space' 'gray', 'rgb', 'yuv' 'gray' string pre-defined Desired color space and thus the number of image channels of the resulting HALCON image.
'device' '<device_id>' '0' string dynamic Returns the current device ID.
'external_trigger' <default> 'false' string pre-defined The value is not used, so a default value is returned.
'field' '<default>' 'interlaced' string pre-defined The value is not used, so a default value is returned.
'generic' <default> -1 integer pre-defined The value is not used, so a default value is returned.
'grab_timeout' <milliseconds> 5000 integer pre-defined Current grab timeout in milliseconds.
'horizontal_resolution' <resolution> 1 integer pre-defined Current value of horizontal resolution.
'image_available' 0, 1 integer dynamic Status of the last asynchronous grab command. The value 1 means that the image is already acquired and thus can be fetched by grab_image_async without delay. Note that this parameter is especially useful in combination with external triggering.
'image_height' <height> 0 integer pre-defined Height of the desired image part ('0' stands for the complete image).
'image_width' <width> 0 integer pre-defined Width of the desired image part ('0' stands for the complete image).
'line_in' <default> 0 integer pre-defined The value is not used, so a default value is returned.
'name' 'MatrixVisionAcquire' string pre-defined Name of the HALCON interface.
'port' <port> 0 integer pre-defined Current port number.
'readable_device_properties' ['<properties>'] string dynamic A list containing the names of additional device-specific properties. user can query using the operator get_framegrabber_param. The values of these parameters will be valid for each handle/instance referring to that device, i.e., this data is shared between multiple instances referring to the same device.
'readable_instance_properties' ['<properties>'] string dynamic A list containing the names of additional instance-specific properties the user can query using the operator get_framegrabber_param. The values of these parameters will be valid for the current handle/instance referring to that device only, i.e., this data is NOT shared between multiple instances referring to the same device. Note: Not every parameter returned by 'readable_instance_parameters' is also writeable!
'request_queue_depth' 1, 2, ... 1 integer pre-defined Internal queue size that is used in combination with grab_image_async.
'revision' '<revision>' string pre-defined Revision number of the MatrixVisionAcquire interface.
'start_column' <column> 0 integer pre-defined Returns the current start column of the HALCON image.
'start_row' <row> 0 integer pre-defined Returns the current start row of the HALCON image.
'vertical_resolution' <resolution> 1 integer pre-defined Current value of vertical resolution.
'volatile' 'disable', 'enable' 'disable' string pre-defined Grayscale only. In the volatile mode the two image acquisition interface buffers are used directly to store HALCON images. This is the fastest mode avoiding to copy raw images in memory. However, be aware that older images are overwritten again and again as a side-effect. Thus, you can only process one image while you grab another image. Older images are invalid!
'writeable_device_properties' ['<properties>'] string dynamic A list containing the names of additional device-specific properties the user can write to using the operator set_framegrabber_param. The values of these parameters will be valid for each handle/instance referring to that device, i.e., this data is shared between multiple instances referring to the same device. Note: The user can't use the prefixes 'limits.' and 'dictionary.' when calling set_framegrabber_param.
'writeable_instance_properties' ['<properties>'] string dynamic A list containing the names of additional instance-specific properties the user can write to using the operator set_framegrabber_param. The values of these parameters will be valid for the current handle/instance referring to that device only, i.e., this data is NOT shared between multiple instances referring to the same device. Note: The user can't use the prefixes 'limits.' and 'dictionary.' when calling set_framegrabber_param.

Operator set_framegrabber_lut

Not supported by this interface.

Operator get_framegrabber_lut

Not supported by this interface.

Operator set_framegrabber_callback

Not supported by this interface.

Operator get_framegrabber_callback

Not supported by this interface.

Operator grab_image_start

Starts a new asynchronous grab. See also grab_image_start.

Operator grab_image

grab_image starts a new synchronous grab. See also grab_image. Note that the interface converts the image from the device to the desired image format specified by the parameters 'image_width', 'image_height', 'start_row', 'start_column', 'bits_per_channel', and 'color_space'.

Operator grab_image_async

grab_image_async returns an image and starts the next asynchronous grab. See also grab_image_async. Note that the interface converts the image from the device to the desired image format specified by the parameters 'image_width', 'image_height', 'start_row', 'start_column', 'bits_per_channel', and 'color_space'.

Operator grab_data

Not supported by this interface.

Operator grab_data_async

Not supported by this interface.

Operator close_framegrabber

This operator closes the device. See also close_framegrabber.

HDevelop Examples

For this interface there are the following examples available:
  • matrixvisionacquire_crop.hdev - Shows grabbing images with image cropping.
  • matrixvisionacquire.hdev - Benchmark
  • matrixvisionacquire_multiple.hdev - Example for the usage of multiple instances with one camera.
  • matrixvisionacquire_parameters.hdev - Lists all parameters of a device.
  • matrixvisionacquire_properties.hdev - Working with dynamic properties of a MATRIX VISION device.
  • matrixvisionacquire_simple.hdev - A simple example to show the usage of the interface.

Release Notes

  • Revision 13.0.1 (Oct 28, 2016):
    • HALCON 13 version of the interface.
  • Revision 6.0 (Oct 31, 2014):
    • HALCON 12 version of the interface
  • Revision 5.2 (Aug 27, 2014):
    • Fixed bug in open_framegrabber. In case that a device does not define a maximum value for the OffsetX or OffsetY feature a numeric limit will be used instead.
    • Fixed bug in get_framegrabber_param when reading the list of valid enumerated values from a property. The maximum size of this list was limited to a single element.
    • Fixed bug in info_framegrabber. When calling the operator with 'device' and 'info_boards' in a specific order sometimes an empty tuple was reported.
    • Added support for mvVirtualDevice virtual devices.
    • Fixed bug in set_framegrabber_param when trying to set a parameter without specifying a value.
  • Revision 5.1 (Apr 22, 2014):
    • Fixed bug in open_framegrabber in case that no device is found. The resources were not correctly freed leading to a crash when calling open_framegrabber again.
    • Fixed bug in open_framegrabber when setting the image part in case that one of the parameters (ImageWidth, ImageHeight, StartRow or StartColumn) is not writeable.
    • Improved info_framegrabber(.., 'info_boards', ...) when listing devices that have changed to 'Absent' status. Now these devices are not listed anymore. For the listed devices, the current state information will be now returned.
    • Added support for mvIMPACT Acquire pixel format ibpfMono12Packed_V1.
    • Added support for 64 bit integer properties.
    • Improved low-level error messages.
  • Revision 5.0 (May 15, 2012):
  • Revision 4.7(Jul 27, 2011)
    • Added parameter 'do_invalidate_property_cache'.
    • Added support for unlimited 'grab_timeout' (-1).
    • mvIMPACT Acquire vector properties (properties that store more than a single value) will be displayed in the image acquisition assistant and the property lists displayed within HDevelop's set_framegrabber_param and get_framegrabber_param configuration dialog.
  • Revision 4.6(Feb 23, 2011)
    • Bug fix in parameter 'do_abort_grab', which is actually working now.
  • Revision 4.5(Oct 10, 2010)
    • Bug fix for color images, where 'R' and 'B' channel where flipped. This problem was introduced in revision 4.1.
  • Revision 4.4 (Aug 2S, 2010):
    • Added support for mvIMPACT Acquire pixel format ibpfBGR888Packed.
  • Revision 4.3 (Jul 30, 2010):
    • Bug fix of a memory leak of ImageWidth * ImageHeight * BitsPerChannel * ChannelCount. Each call to close_framegrabber after a successful call to open_framegraber caused a memory leak.
    • Bug fix when passing width and height values larger then the AOI limits the open_framegrabber operator doesn't crash anymore.
    • HALCON 10 version of the interface (included in HALCON 10 DVD).
  • Revision 4.2 (Mar 16, 2010):
    • Added support for some more mvIMPACT Acquire pixel formats: ibpfRGB888Packed, ibpfYUV444Planar, ibpfRGB101010Packed, ibpfRGB121212Packed, ibpfRGB141414Packed, ibpfRGB161616Packed, ibpfYUV422Planar, ibpfYUV422Packed and ibpfYUV422Packed_UYVY.
    • Added value 'yuv' to parameter 'color_space'.
    • Changed return value of info_framegrabber(.., 'camera_type', ...) to improve the auto-detection of HDevelop.
  • Revision 4.1 (Feb 6, 2009):
    • Added support for mvBlueLYNX-M7 devices.
    • Improved syntax for parameter 'CameraType' to provide several levels of precision.
  • Revision 4.0 (Dec 1, 2008):
    • HALCON 9.0 version of the interface (included in HALCON 9.0 DVD).
    • Added support for mvBlueCOUGAR devices and mvHYPERION-CLe frame grabbers.
    • Added postfix '_access' to all parameters to query the access mode.
    • Bug fix when working with the 'MaxDelay' parameter of the grab_image_async operator deadlock situations could arise.
    • Bug fix regarding parameter 'grab_timeout'. Before calling set_framegrabber_param with 'grab_timeout' at least once the grab timeout of the camera was 2000 ms, while reading its current value returned 5000 ms.
  • Revision 3.3 (Feb 27, 2008):
  • Revision 3.2 (Oct 25, 2007):
    • Added parameter 'grab_timeout' to parameter 'available_param_names'.
    • Bug fix in parameters 'available_param_names', 'available_param_types', and 'available_param_descriptions'.
    • Bug fix in grab_image_start for Windows 32-bit operating systems.
  • Revision 3.1 (Oct 16, 2007):
    • Bug fix for timeout/trigger related situations where the system didn't recover correctly.
    • Bugfix in close_framegrabber, which left dead threads in connection with certain devices.
    • Added parameter 'do_update_digital_inputs'.
  • Revision 3.0 (May 15, 2007):
    • HALCON 8.0 version of the interface (included in HALCON 8.0 DVD).
    • Support of the Linux driver for MATRIX VISION cameras and boards.
  • Revision 2.4 (Jan 12, 2007):
    • Added parameter 'image_available' to query the status of the current grab.
  • Revision 2.3 (Apr 25, 2006):
    • Some internal modifications, no change in behaviour.
    • Added support for mvSIGMA, mvDELTA, mvTITAN, and mvGAMMA boards.
  • Revision 2.2 (Mar 27, 2006):
    • Added new parameters 'available_param_access', 'available_param_names', 'available_param_types', and 'available_param_descriptions'.
    • First official release.
  • Revision 2.1 (Aug 2, 2005):
    • Adapted to planar pixel formats.
  • Revision 2.0 (Apr 27, 2005):
    • Currently supports only mvBlueFOX devices
    • First beta release.