我迫切需要 opencv 拼接模块的帮助。我需要使用 opencv 中的“stitch”方法创建全景摄影。以下是我到目前为止的内容.. 但是当我运行程序时出现此错误:需要更多图像。是否有 OpenCV 专家可以帮助我解决此错误?
IplImage* img1 = cvLoadImage("/Users/myName/Desktop/image1.jpg", CV_LOAD_IMAGE_COLOR);
IplImage* img2 = cvLoadImage("/Users/myName/Desktop/image2.jpg", CV_LOAD_IMAGE_COLOR);
Mat vecImg1 = img1;
Mat vecImg2 = img2;
Mat allImages;
allImages.push_back(vecImg1);
allImages.push_back(vecImg2);
Mat outputImage;
Stitcher stitchImg = Stitcher::createDefault();
Stitcher::Status s = stitchImg.stitch(allImages, outputImage);
cout << "status: " << s << endl;
cvNamedWindow("stitch images", CV_WINDOW_AUTOSIZE);
cvShowImage("stitch images", &outputImage);
cvWaitKey(0);
cvDestroyWindow("stitch images");