Acquisition mode
Last modified by Lev Andronov on 2024/11/03 13:42
This is a quick start guide for image acquisiton mode API sample. For more information please refer to 'Vision Point Application Acquisition Mode User Guide' PDF document.
Building an API sample
on Ubuntu
- Open Terminal app, navigate to /opt/KAYA_Instruments/Examples/Vision Point API/ and choose the desireble API sample
- Type 'make' command and ensure the 'KYFGLib_Example' executable file was created in the same directory.
on Windows
- Open project Microsoft Visual Studio 'KYFGLib_Example.vcxproj'. Note: API sample directory can be easily found using the quick search, as shown in the image below.
- Choose a solution platform according to your operation system, as shown in the image below. Please verify the selected platform is compatible with your OS.
- Build and run solution this sample
Running an API sample
- Run the application.
- Enter a device, or Demo mode, from the list.
- Enter a command. The following table describes the commands options:
- [0-4] — Device selection
- o — Open Frame Grabber
- c — Connect to camera
- s — Start the frame acquisition
- t — Stop the frame acquisition
- e — Exit the Example
Queued Buffer and Cyclic Buffer
By default, the 'KYFGLib_Example.vcxproj' project contains 'KYFGLib_Example.c', which uses Cyclic Buffer. To use Queued Buffer please change the 'KYFGLib_Example.c' file to 'KYFGLib_Example_QueuedBuffers.c' located in the same directory. Do not forget to rebuild current project.
What's the difference between Queued and Cyclic buffers?
Queued Buffer
- In a queued buffer system, buffers are organized in a queue, where each buffer holds an image frame in the order it was captured.
- Operation: Each buffer is filled sequentially. Once an image is acquired, it is placed in the next available buffer in the queue. After processing, the buffer is released and becomes available for the next incoming image.
- Advantages:
- Ensures images are processed in the exact order they were captured.
- Helps maintain image sequence and consistency, which is useful for applications requiring ordered data (e.g., video processing).
- Disadvantages:
- May lead to buffer overflow if images are acquired faster than they can be processed, causing delays or frame drops.
Cyclic Buffer
- In a cyclic buffer system, buffers are organized in a circular manner. When the end of the buffer is reached, it wraps around to the beginning, creating a continuous cycle.
- Operation: Once the buffer reaches its capacity, new images start overwriting the oldest images in the buffer.
- Advantages:
- Suitable for real-time processing where only the latest images are needed, such as live video feeds or applications where recent data is prioritized.
- Reduces the risk of overflow, as the buffer continuously cycles, allowing acquisition to continue even if processing lags.
- Disadvantages:
- Older frames can be lost if not processed in time, which may lead to data loss or dropped frames in applications requiring every frame.
- Less ideal for applications where sequential data order is critical.