Frequently Asked Question

How to accumulate several frames/lines into a buffer using Segments Per Buffer?
Last Updated a year ago

Description:
The stream callback is called every time a frame buffer is completely filled and the execution of the previous callback is already finished.
Nonetheless, the stream callback can't handle update rates larger than ~10,000 times per second, depending on CPU and software capabilities.

Solution:
To overcome this issue, it is possible to accumulate several frames/lines into a buffer, using “Segments Per Buffer” Grabber parameter. Using this method, the stream callback will be called at a smaller rate with a filled buffer of the specified number of frames/lines.

Setting “Segments Per Buffer” value:
API:
KYFG_SetGrabberValueInt(handle, "CameraSelector", 0); // set camera index
KYFG_SetGrabberValueInt(handle, "SegmentsPerBuffer", 1); // set “Segments Per Buffer” value

Vision Point GUI:
Frame Grabber -> Extended Stream Features -> Camera Selector - > Image Format Control -> Segments Per Buffer.

image



Remarks:
1. The “Segments Per Buffer” parameter should only be set after a Camera has already been connected and opened (camera detection process).
2. The default value of “Segments Per Buffer” is 1, meaning that the stream callback will occur for every frame/line captured.
3. “Segments Per Buffer” is a Grabber setting applied per Camera. For more information on setting grabber parameters per camera please refer to “Camera Selector” section in the KAYA Frame Grabber Feature Guide document.

4. Using an increased value of the “SegmentsPerBuffer” parameter requires a corresponding change in the size of buffers allocated for acquisition, and in this case, the amount of required memory reported by the function KYFG_StreamGetInfo() with the KY_STREAM_INFO_PAYLOAD_SIZE info command will be increased accordantly. For example, if a camera is configured for a frame size of 640x480, and the “SegmentsPerBuffer” is set to 10.



Please Wait!

Please wait... it will take a second!