I have stereo cameras systems.
In my program I catch the images from each camera in two threads. (one thread per camera).
After I receive the images from each camera, I want to process them with OpenCV. How I can say to my program, that the both camera threads got images and I can go to process them?
I have another question. Every received frame from the camera has a timestamp, which is specified by camera. How I can match the timestamp, so that I get images from two cameras, which were caught at the same time?
Have you ever wrote an application using OpenCV to display the frames captured by the camera? Start from there. The application below does that and convert each frame to it’s grayscale version:
Keep in mind that the frames are being retrieved inside a loop, and if you quit the loop you’ll stop receiving data from the camera. It makes sense, right? This leaves you with 2 options:
Process the frame right way. But if this processing is slow, you’ll probably miss a few frames from the camera until the next cvQueryFrame() operation.
Store the frame using some buffer mechanism so you can do the processing on another thread. This is a good approach if your processing technique is demanding on the CPU and if you don’t want to loose any frames.
About your second question, its not clear to me what you mean. Please elaborate further.