grab_data

Navigation:  Halcon Interface > Operators >

grab_data

Previous pageReturn to chapter overviewNext page

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:


Binary node

Image type

'Stereo'

Images/Raw/Left, Images/Raw/Right

1 channel / Byte


Images/Rectified/Left, Images/Rectified/Right

1 channel / Byte


Images/WithOverlay/Left, Images/WithOverlay/Right

3 channel / Byte


Images/DisparityMap

1 channel / Int2


Images/PointMap

3 channel / Real

'Monocular'

Images/Raw

1 channel / Byte


Images/Rectified

1 channel / Byte


Images/WithOverlay

3 channel / Byte

'Item' (referring to root)

Images/RenderPointMap

3 channel / Real


Images/RenderPointMapTexture

4 channel / Byte


Images/RenderView

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'.

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.

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