I'm trying to implement a circular buffer for my program. The buffer is used to share data between two threads as shown below. I use OpenCV to grab video frames from camera (Thread 1). Then I would like to store this data in a circular buffer, so that Thread 2 can get the data from the buffer.
How can I implement a circular buffer for cv::Mat
objects in C++? I know how to create circular buffer for standard C++ objects (like int
or char
) but I can't make it work with objects of type cv::Mat
.
Any suggestions?
Solved, see Thread safe implementation of circular buffer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With