Camera Sychronization OpenCV?

Start from there. The application below does that and convert each frame to it's grayscale version.

Start from there. The application below does that and convert each frame to it's grayscale version: CvCapture *capture = NULL; capture = cvCaptureFromCAM(-1); //-1 or 0 depending on your platform if (!capture) { printf("! ERROR: cvCaptureFromCAM\n"); return -1; } cvNamedWindow("video", CV_WINDOW_AUTOSIZE); while (exit_key_press!

= 'q') { /* Capture a frame */ color_frame = cvQueryFrame(capture); if (color_frame == NULL) { printf("! ERROR: cvQueryFrame\n"); break; } else { // WOW! We got a frame!

// This is the time to process it since we are not buffering // the frames to use them later. It's now or never. IplImage* gray_frame = cvCreateImage(cvSize(color_frame->width, color_frame->height), color_frame->depth, 1); if (gray_frame == NULL) { printf("!

ERROR: cvCreateImage\n"); continue; } cvCvtColor(color_frame, gray_frame, CV_BGR2GRAY); cvShowImage("Grayscale video", gray_frame); cvReleaseImage(&gray_frame); } exit_key_press = cvWaitKey(1); } 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.

4eloveg Updated answer. – karlphillip Apr 20 at 18:44 I don't use the OpenCv to capture the images. I used Camera API to get the images from the cameras.

Still I can not see here, that the code uses stereo cameras. And I don't need to process the camera images separatly. I need two camera images at the same time, to compare them with OpenCV.

Actually the code of my programm does the same like yours. At the moment I save the images from each camera. But my question, how I can say to program " the image from right and left camera is ready, compare them now".

And than pause the cameras threads and go to processing the images. – man Apr 20 at 18:48 I imagine you are storing the frames in memory, on some sort of array. You'll need another thread whose job will be to scan the array looking for matching timestamps.

When a match is found, send them to processing/compare and pause the camera while the processing is not done (is this what you want? ). When you're done with them, maybe its a good idea to pop them out of the array if you don't need them anymore and save space.

– karlphillip Apr 20 at 18:59 thank you. That's exactly what I want :-) – man Apr 20 at 19:06.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions