grab_region_async ( : Region : FGHandle, MaxDelay : )

Grab and segment an image from the specified frame grabber and start the asynchronous grab of the next image.

The operator grab_region_async grabs an image via the frame grabber specified by FGHandle, segments it, and starts the asynchronous grab of the next image. The desired operational mode of the frame grabber as well as a suitable image area can be adjusted via the operator open_framegrabber. Additional (frame grabber specific) settings might be possible via set_framegrabber_param.

The grab of the next image is finished via grab_region_async or via grab_region_async. If more than MaxDelay ms have passed since the asynchronous grab was started, a new image is grabbed (the asynchronously grabbed image is considered as too old). If a negative value is assigned to MaxDelay this control mechanism is deactivated.

Please note that if you call the operators grab_image or grab_region after grab_region_async, the asynchronous grab started by grab_region_async is aborted and a new image is grabbed (and waited for).


Parameters

Region (output_object)
region(-array) -> object
Grabbed and segmented image: Region(s).

FGHandle (input_control)
framegrabber -> integer
Handle of the frame grabber to be used.

MaxDelay (input_control)
number -> real
Maximum tolerated delay beteween the start of the asynchronous grab and the delivery of the image [ms].
Default value: -1.0
Suggested values: -1.0, 20.0, 33.3, 40.0, 66.6, 80.0, 99.9


Example
// Select a suitable frame grabber FgName
open_framegrabber(FgName,1,1,0,0,0,0,'default',-1,'default',-1.0,
                  'default','default','default',-1,-1,FgHandle)
// grab image, segment it, and start next grab
grab_region_async(Region1,FgHandle,-1.0)
// Process Region1 ...
// Finish asynchronous grab, segment this image, and start next grab
grab_region_async(Region2,FgHandle,-1.0) 
close_framegrabber(FgHandle)

Result

If the frame grabber is open the operator grab_region_async returns the value 2 (H_MSG_TRUE). Otherwise an exception handling is raised.


Parallelization Information

grab_region_async is reentrant and processed without parallelization.


Possible Predecessors

open_framegrabber, grab_image_start


Possible Successors

grab_region_async, grab_image_async, close_framegrabber


See also

open_framegrabber, info_framegrabber, set_framegrabber_param


Module

Image / region / XLD management



Copyright © 1996-2005 MVTec Software GmbH