This operator is used to set interface parameters or to write directly into the NxLib API Tree.
set_framegrabber_param (AcqHandle, Parameter, Value)
Parameter |
Description |
---|---|
AcqHandle |
An acquisition handle obtained via 'open_framegrabber'. |
Parameter |
This can either be an interface parameter or an item path for direct tree item access. |
Value |
A variable or constant to be written to the item. |
Parameter |
Values |
Type |
Description |
'auto_grab_data' |
'true', 'false', 0, 1 |
string, integer |
Set the 'auto_grab_data' flag for the given handle. |
'do_open_tcp_port' |
<port> |
integer |
Opens a TCP port. Note: Only one port can be open per NxLib instance. |
'do_close_tcp_port' |
[] |
Closes open TCP port. |
|
'do_execute' |
'<command>' |
string |
Executes '<command>' in the NxLib. More information about this parameter can be found here. Note: This parameter is only supported on handles referencing the tree's root node. |
'generate_regions' |
'true', 'false', 0, 1 |
string, integer |
Set the 'generate_regions' flag for the given handle. |
'grab_data_items' |
['<binary_node_path>'] |
string, tuple |
List of binary nodes which will be provided when using 'grab_data' on the given handle. |
'replace_nans' |
'true', 'false', 0, 1 |
string, integer |
Set the 'replace_nans' flag for the given handle. |
set_framegrabber_param(AcqHandle, ItemPath, Value)
set_framegrabber_param(AcqHandle, ItemPath, [TypeSpecifier, Value])
Parameter |
Values |
Description |
||||||||
---|---|---|---|---|---|---|---|---|---|---|
AcqHandle |
An acquisition handle obtained via 'open_framegrabber'. |
|||||||||
ItemPath |
A path to a tree item to be written. The item path is relative to the path with which the handle is associated. |
|||||||||
TypeSpecifier |
'string', 'json', 'apply', 'image' |
A string specifying how the Value is to be interpreted and stored. For further information read the section below.
|
||||||||
Value |
A variable or constant to be written to the item. |
When setting a tree item with 'set_framegrabber_param', the HALCON parameter types int and double are written as JSON type Number.
But a HALCON string as parameter could have different meanings:
•It could be a string that should be set on the specified item
•It could be a JSON representation to be stored in the specified item
•It could be a JSON representation to be 'applied' at the specified item, skipping read-only nodes without raising an error
When specifying a string parameter, the order of interpretation is as follows:
•Try to interpret the given string as JSON. If successful, store the given JSON structure at the specified item.
•If the JSON interpretation failed, store the string in the specified item
The interpretation can be specified explicitly using the TypeSpecifier parameter.
* Open default stereo camera
open_framegrabber('Ensenso-NxLib', 0, 0, 0, 0, 0, 0, 'default', 0, 'Raw', -1, 'false', 'Stereo', '', 0, 0, AcqHandle)
* Open and close TCP port 24000
set_framegrabber_param (AcqHandle, 'do_open_tcp_port', 24000)
set_framegrabber_param (AcqHandle, 'do_close_tcp_port', [])
* Set a Handle Parameter
set_framegrabber_param (AcqHandle, 'replace_nans', 'false')
set_framegrabber_param (AcqHandle, 'grab_data_items', ['Images/DisparityMap','Images/PointMap'])
* Tree Access
set_framegrabber_param (AcqHandle, 'Parameters/Capture/AutoExposure', 'false')
set_framegrabber_param (AcqHandle, 'Parameters/Capture/Exposure', 5)
* with JSON string
set_framegrabber_param (AcqHandle, 'Parameters', ['apply','{"Capture":{"AutoExposure":false, "Exposure":5}}'])
* Write an image into a binary node
read_image(Image, 'example.png')
obj_to_integer (Image, 1, -1, SurrogateTuple)
set_framegrabber_param(AcqHandle, '/Images/Raw/Left', ['image', SurrogateTuple])