grab_data¶
This operator is used to access the binary nodes of the NxLib API Tree.
Parameters¶
grab_data (Image, Region, Contours, AcqHandle, Data)
Parameter |
Description |
---|---|
Image |
Variable where the retrieved image will be stored. Note: If ‘grab_data_items’ contains multiple items, this will be a tuple of images. |
Region |
Region which describes the valid 3D points. Note: If ‘grab_data_items’ contains multiple items, this will be a tuple of regions. |
Contours |
Not used. |
AcqHandle |
An acquisition handle obtained via ‘ open_framegrabber’. |
Data |
Not used. |
Dependencies¶
All dependencies can be manipulated with ‘ set_framegraber_param’.
Parameter |
Description |
|||
---|---|---|---|---|
grab_data_items |
Contains the list of binary nodes which will be returned in the Image value. Depending on the type of the acquisition handle following binary nodes can be accessed: |
|||
‘Stereo’ |
Binary node |
Image Type |
||
1 channel / Byte |
||||
1 channel / Byte |
||||
3 channel / Byte |
||||
1 channel / Byte |
||||
3 channel / Byte |
||||
3 channel / Byte |
||||
‘Monocular’ |
1 channel / Byte |
|||
1 channel / Byte |
||||
3 channel / Byte |
||||
‘Item’ (referring to root) |
1 channel / Byte |
|||
1 channel / Byte |
||||
3 channel / Byte |
||||
auto_grab_data |
If ‘auto_grab_data’ is set, ‘grab_data’ will also automatically capture a new image and execute all necessary commands to generate the binary nodes listed in ‘grab_data_items’. |
|||
Binary node |
Execute commands |
|||
cmdCapture, cmdComputeDisparityMap, cmdComputePointMap, cmdComputeNormals |
||||
replace_nans |
All internal binary fields use the NaN (“Not a number”) value of the IEEE floating point format to indicate that a certain point is invalid (i.e. not triangulated). Unfortunately NaN values within images cause various problems within Halcon, therefore by stetting this flag to ‘true’, ‘grab_data’ replaces NaN values within floating point images with 0. |
|||
generate_regions |
By deactivating this flag, ‘grab_data’ no longer delivers the Region value. This can be used to save computation time. |
Note
All automaticallly executed commands will be run without parameters. The operator automatically enables the projector for stereo cameras.
Example¶
* Open default stereo camera
open_framegrabber('Ensenso-NxLib', 0, 0, 0, 0, 0, 0, 'default', 0, 'Raw', -1, 'false', 'Stereo', '', 0, 0, AcqHandle)
* Set 'grab_data_items'
* 'grab_data_items' is by default 'Images/PointMap' for Stereo handles
set_framegrabber_param (AcqHandle, 'grab_data_items', ['Images/DisparityMap','Images/PointMap'])
* Grab images with 'auto_grab_data' on
grab_data (Image, Region, Contours, AcqHandle, Data)
* Without 'auto_grab_data' following commands would be needed for the same result:
* Note that in this case, you have to enable the projector manually if you need it!
set_framegrabber_param (AcqHandle, 'auto_grab_data', 'false')
open_framegrabber('Ensenso-NxLib', 0, 0, 0, 0, 0, 0, 'default', 0, 'Raw', -1, 'false', 'Item', '/', 0, 0, RootHandle)
set_framegrabber_param (RootHandle, 'do_execute', 'Capture')
set_framegrabber_param (RootHandle, 'do_execute', 'ComputeDisparityMap')
set_framegrabber_param (RootHandle, 'do_execute', 'ComputePointMap')
grab_data (Image, Region, Contours, AcqHandle, Data)