rs2::frame_queue
Hi,
I have a couple questions regarding rs2::frame_queue.
1. For queue.enqueue(), is the thread blocked or just overwrite the oldest frame when the queue is full?
2. For queue.poll_for_frame(), it will return immediately no matter there are frames or not in the queue?
3. Can I use this queue to do synchronization for other non-realsense smart pointer class such as the Mat of OpenCV.
Thanks.
Yixun
-
Hello Yxliuwm,
Thank you for contacting us.
1. For queue.enqueue(), is the thread blocked or just overwrite the oldest frame when the queue is full?
queue.enqueue() adds an object to the end of the Queue. When the queue becomes full, it will drop the newest frame which just arrived.
2. For queue.poll_for_frame(), it will return immediately no matter there are frames or not in the queue?
yes, Poll for frames will always return instantly. If you do use
poll_for_framesyou should manually decide when to put the CPU to sleep and for how long, otherwise you can end up using 100% of a single core.3. Can I use this queue to do synchronization for other non-realsense smart pointer class such as the Mat of OpenCV.
It might not be supported. For your info, RealSense has an OpenCV-wrapper that demonstrates how to integrate Intel RealSense cameras with
opencvin domain of computer-vision.Sincerely,
Zulkifli Halim
Please sign in to leave a comment.
Comments
1 comment