gpt4 book ai didi

c++ - OpenCV拼接

转载 作者:太空宇宙 更新时间:2023-11-04 16:24:46 24 4
gpt4 key购买 nike

我迫切需要有关 opencv 拼接模块的帮助。我需要在 opencv 中使用“缝合”方法创建全景摄影。以下是我目前所拥有的……但是当我运行程序时出现此错误:需要更 multimap 像。有没有 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");

最佳答案

我想“allImages”应该是 vector<Mat> 类型.

查看 OpenCV 示例“samples/cpp/stitching.cpp”。

关于c++ - OpenCV拼接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13207316/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com