grab_image_start ( : : FGHandle, MaxDelay : )

Start an asynchronous grab of an image from the specified frame grabber.

The operator grab_image_start starts an asynchronous grab of an image via the frame grabber specified by FGHandle. The desired operational mode of the frame grabber as well as a suitable image part can be adjusted via the operator open_framegrabber. Additional (frame grabber specific) settings might be possible via set_framegrabber_param.

The grab is finished via grab_image_async or grab_region_async. If one of those operators is called more than MaxDelay ms later, a new image is grabbed (the asynchronously grabbed image is considered as to old). If a negative value is assigned to MaxDelay this control mechanism is deactivated.

Please note that the operator grab_image_start makes sense only when used together with grab_image_async or grab_region_async. If you call the operators grab_image or grab_region instead, the asynchronous grab started by grab_image_start is aborted and a new image is grabbed (and waited for).


Parameters

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

MaxDelay (input_control)
number -> real
Maximum tolerated delay between the start of the asynchronous grab and the delivery of the image [ms].
Default value: -1.0
Suggested values: 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(Img1,FgHandle) 
// Start next grab
grab_image_start(FgHandle,-1.0) 
// Process Img1 ...
// Finish asynchronous grab
grab_image_async(Img2,FgHandle,-1.0) 
close_framegrabber(FgHandle)

Result

If the frame grabber is open and supports asynchronous grabbing the operator grab_image_start returns the value 2 (H_MSG_TRUE). Otherwise an exception handling is raised.


Parallelization Information

grab_image_start is reentrant and processed without parallelization.


Possible Predecessors

open_framegrabber


Possible Successors

grab_image_async, grab_region_async, close_framegrabber


See also

open_framegrabber, info_framegrabber, set_framegrabber_param


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH