缝合器类OpenCV
Stitcher class OpenCV
本文关键字:OpenCV 更新时间:2023-10-16
我有两个重叠面积约为25%的图像,但缝合失败。我该如何处理这个问题?
我尝试使用球体和冲浪,以及更改阈值。我还有其他选择吗?
Mat pano;
Stitcher stitcher = Stitcher::createDefault(try_use_gpu=false);
//Stitcher::Status status = stitcher.stitch(imgs, pano);
//stitcher.setWarper(new PlaneWarper());
stitcher.setWarper(new SphericalWarper());
stitcher.setFeaturesFinder(new detail::SurfFeaturesFinder(1000,3,4,3,4));
//stitcher.setFeaturesFinder(new detail::OrbFeaturesFinder());
stitcher.setRegistrationResol(0.1);
stitcher.setSeamEstimationResol(0.1);
stitcher.setCompositingResol(0.6);
stitcher.setPanoConfidenceThresh(1);
stitcher.setWaveCorrection(true);
stitcher.setWaveCorrectKind(detail::WAVE_CORRECT_HORIZ);
stitcher.setFeaturesMatcher(new detail::BestOf2NearestMatcher(false,0.3));
stitcher.setBundleAdjuster(new detail::BundleAdjusterRay());
tstart = clock();
Stitcher::Status status = stitcher.stitch(imgs, pano);
25%的重叠绝对不够。40%会带来更好的结果,但仍然不够好。如果你想要很好的重叠,可以尝试60%到80%之间的重叠。重要的是,序列中要缝合在一起的下一个图像与上一个图像的中心区域重叠,因为存在/不应该有任何失真。例如,在80%重叠的情况下,不仅会发生这种情况,而且两张图像的中心区域也会非常靠近,所以你可以忽略失真,并在图像纹理质量允许的情况下找到大量匹配。我的建议是先看看库本身提供的样本。您可以在上找到最新版本https://github.com/Itseez/opencv/tree/master/samples/cpp/stitcher.cpp和https://github.com/Itseez/opencv/blob/master/samples/cpp/stitching_detailed.cpp.那么,深入挖掘源头本身也是件好事(https://github.com/Itseez/opencv/blob/master/modules/stitching/src/stitcher.cpp)也可以在OpenCV的参考手册中查找提供的文档(在线或以PDF格式下载)。
相关文章:
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 尝试导入pybind-opencv模块时出现libgtk错误
- 在编译C++代码(具有dlib和opencv)到WASM时面临问题
- 如何使用OpenCV将RBG图像转换为HSV,并将H、S和V值保存为C++中的3个独立图像
- OpenCV EqualizeHist()从彩色图像创建黑白图像
- 将OpenCV C++重写为EmguCV C#-如何使用指针
- OpenCV C++.快速计算混淆矩阵
- 在C++代码中包含opencv时,使用ctypes创建.so文件
- 哪些库可以通过Opencv调整曝光率
- 安装opencv失败-粘贴CMakeError.log的内容
- C++中的openCV Mat访问冲突
- OpenCV Android C++ imwrite not found
- 未定义的引用 .. 使用 OpenCV 编译 C++ 代码时,从命令行
- 将 OpenCV 与 CMAKE 中的项目一起构建为第三方库的正确方法
- CV_OCL_RUN宏如何在OpenCV(版本3.4.5)的goodFeaturesToTrack实现中工作?
- OpenCV 4.1.2 - 从网络摄像头获取帧并将其拆分
- C++ OpenCV 卡尔曼滤波器构造函数错误
- 使用OpenCV和覆盆子上的多个网络摄像头拍摄延时摄影,出现多个V4L错误
- 如何使用OpenCV-C++编写*.mp4视频?
- Mingw-64 在构建和安装后不会编译 openCV 代码