Separating two stereo camera images using opencv
I am using opencv with my stereo camera (LI-USB30-V024 STEREO). I want to print two images of my stereo camera in two windows. So first I printed the images in a window like this.
void main(){
IplImage* frame1;
IplImage* frame2;
CvCapture* cam1;
CvCapture* cam2;
cam1 = cvCaptureFromCAM(0);
cam2 = cvCaptureFromCAM(1);
cvNamedWindow("sample1", CV_WINDOW_AUTOSIZE);
cvNamedWindow("sample2", CV_WINDOW_AUTOSIZE);
while (1){
cvGrabFrame(cam1);
frame1 = cvRetrieveFrame(cam1);
cvGrabFrame(cam2);
frame2 = cvRetrieveFrame(cam2);
if (!frame1)
break;
cvShowImage("sample1", frame1);
cvShowImage("sample2", frame2);
if (cvWaitKey(10) >= 0)
break;
}
cvReleaseCapture(&cam1);
cvReleaseCapture(&cam2);
cvDestroyWindow("sample1");
cvDestroyWindow("sample2");
}
But my problem is that 2 camera images are being printed together in one window. How can I separate each of these two images?
+3
source to share
1 answer
User interface , Especially imShow()
and namedWindow()
.
In case you are on an Android device, as the tag indicates that the answer is: No, you can't do without huge binding.
+1
source to share