分离立体摄像头与OpenCV的两个图像摄像头、图像、两个、OpenCV

2023-09-07 12:05:14 作者:说爱太烫嘴

我使用OpenCV的我的立体摄像机(LI-USB30-V024立体声)。 我想在两个窗口打印我的立体相机的两个图像。 所以首先我打印窗口中的图片。

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");
}

但我的问题是,摄像头的2个图像一起打印在一个窗口。 我怎样才能将每个这种2图像?

But my problem is that the 2 images of camera printed together in one window. How can I separate each of this 2 images?

推荐答案

用户界面, 特别是 imShow() namedWindow()

如果你是在Android设备上的标签指示的回答是:不,你不能没有庞大的affort

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