简体   繁体   中英

Separating two Images of Stereo Camera with opencv

I'm using opencv with my stereo camera(LI-USB30-V024 STEREO). I want to print the two images of my stereo camera in two windows. So first I printed the images in 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 the 2 images of camera printed together in one window. How can I separate each of this 2 images?

User Interface , Especially imShow() and namedWindow() .

In case you are on an Android device as the tag indicates the answer is: No you cant without a huge affort.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM