How to capture every frame

I deployed SAM and yolov8 in the program, because each call to the SAM segmentation model takes a long time, resulting in a large number of frames to capture the interval, please tell me how to ensure that I capture every frame?

Hi @NineSeven,

What you can do is perform both tasks in parallel: create a thread in which you capture the images from your ZED camera, and a thread that retrieves the next image whenever it has finished processing and ready to perform a new task.