opencv提供的带参数例程

简介: body { font-family: @微软雅黑; font-size: 8pt; line-height: 1.5 }html,body { color: inherit; background-color: inherit }h1 { font-size: 1.
     如果仅仅是简单的拼接,可以采用stitching.cpp就差不多了;但是如果采用stitching_detailed.cpp的话,首先要解决的就是"编译问题",而后解决的是分析不同参数下的拼接结果和匹配效果;最后是能够理解一些原理。
     OK,历经一些调试,编译成功,首先看一下有哪些参数可以调整。其实光靠这个就可以写一个简单的带调整的界面了。


F:\06.项目项目\opencv拼接\imageStitching\imageStitching>imageStitching.exe
Rotation model images stitcher.

stitching_detailed img1 img2 [...imgN] [flags]

Flags:
  --preview
      Run stitching in the preview mode. Works faster than usual mode,
      but output image will have lower resolution.
  --try_gpu (yes|no)
      Try to use GPU. The default value is 'no'. All default values
      are for CPU mode.

Motion Estimation Flags:

  --work_megapix <float>
      Resolution for image registration step. The default is 0.6 Mpx.
  --features (surf|orb)
      Type of features used for images matching. The default is surf.
  --match_conf <float>
      Confidence for feature matching step. The default is 0.65 for surf and 0.3 for orb.  这个我可能会单独配置
  --conf_thresh <float>
      Threshold for two images are from the same panorama confidence.
      The default is 1.0.
  --ba (reproj|ray)
      Bundle adjustment cost function. The default is ray.
  --ba_refine_mask (mask)
      Set refinement mask for bundle adjustment. It looks like 'x_xxx',
      where 'x' means refine respective parameter and '_' means don't
      refine one, and has the following format:
      <fx><skew><ppx><aspect><ppy>. The default mask is 'xxxxx'. If bundle
      adjustment doesn't support estimation of selected parameter then
      the respective flag is ignored.
  --wave_correct (no|horiz|vert)
      Perform wave effect correction. The default is 'horiz'.
  --save_graph <file_name>
      Save matches graph represented in DOT language to <file_name> file.
      Labels description: Nm is number of matches, Ni is number of inliers,
      C is confidence.

Compositing Flags:
  --warp (plane|cylindrical|spherical|fisheye|stereographic|compressedPlaneA2B1|
compressedPlaneA1.5B1|compressedPlanePortraitA2B1|compressedPlanePortraitA1.5B1|
paniniA2B1|paniniA1.5B1|paniniPortraitA2B1|paniniPortraitA1.5B1|mercator|transve
rseMercator)
      Warp surface type. The default is 'spherical'.
  --seam_megapix <float>
      Resolution for seam estimation step. The default is 0.1 Mpx.
  --seam (no|voronoi|gc_color|gc_colorgrad)
      Seam estimation method. The default is 'gc_color'.
  --compose_megapix <float>
      Resolution for compositing step. Use -1 for original resolution.
      The default is -1.
  --expos_comp (no|gain|gain_blocks)
      Exposure compensation method. The default is 'gain_blocks'.
  --blend (no|feather|multiband)
      Blending method. The default is 'multiband'.
  --blend_strength <float>
      Blending strength from [0,100] range. The default is 5.
  --output <result_img>
      The default is 'result.jpg'.

测试图片:
第一组:
img_5e3dedbead47d63b657fa37277ea7ddc.jpe img_37837edd9361b5ba2b9947a1fc66fd1a.jpe img_b6ff96c4dfc9a3d1e525af47b77c386b.jpe

--全部默认参数,80秒,结果
img_4b83f35854324e98317fb2639779020d.jpe
--preview 约80秒,这个图片拼接的不错,但是时间太长了。
img_4b83f35854324e98317fb2639779020d.jpe
  --work_megapix <float>是用于寻找的,改为0.1后时间为30秒
img_4b83f35854324e98317fb2639779020d.jpe
        --features (surf|orb) 改成orb后速度显著提升
  --match_conf <float>也应该是数值越小匹配越快,但是失败的可能也越大。这个是不断调整参数的过程。

   --ba (reproj|ray)默认是ray,改为reproj后,速度更快!更快


然后,就是   --warp  这一块,参数比较多
plane
cylindrical
fisheye
sphericalimg_4b83f35854324e98317fb2639779020d.jpe




目前方向:图像拼接融合、图像识别 联系方式:jsxyhelu@foxmail.com
目录
相关文章
|
2月前
|
计算机视觉 索引
OpenCv实时设置摄像头参数/获得摄像头参数值的方法论
这篇文章提供了一个OpenCV的实例教程,展示了如何使用`createTrackbar()`函数实时设置和获取摄像头参数值,如饱和度、Gamma和亮度,并通过回调函数在程序中连续修改这些参数。
|
2月前
|
算法 计算机视觉 Python
python利用opencv进行相机标定获取参数,并根据畸变参数修正图像附有全部代码(流畅无痛版)
该文章详细介绍了使用Python和OpenCV进行相机标定以获取畸变参数,并提供了修正图像畸变的全部代码,包括生成棋盘图、拍摄标定图像、标定过程和畸变矫正等步骤。
python利用opencv进行相机标定获取参数,并根据畸变参数修正图像附有全部代码(流畅无痛版)
|
2月前
|
存储 计算机视觉
OpenCV 中 CV_8UC1,CV_32FC3,CV_32S等参数的含义
OpenCV 中 CV_8UC1,CV_32FC3,CV_32S等参数的含义
53 3
|
2月前
|
前端开发 计算机视觉
Building wheel for opencv-python (pyproject.toml) ,安装命令增加 --verbose 参数
Building wheel for opencv-python (pyproject.toml) ,安装命令增加 --verbose 参数
117 2
|
存储 编解码 计算机视觉
项目实战:Qt+OpenCV操作摄像头拍照、调节参数和视频录制
项目实战:Qt+OpenCV操作摄像头拍照、调节参数和视频录制
项目实战:Qt+OpenCV操作摄像头拍照、调节参数和视频录制
|
计算机视觉
opencv常见方法参数说明参考
opencv常见方法参数说明参考
154 0
|
算法 C# 计算机视觉
csharp通过dll调用opencv函数,图片作为参数
[blog 项目实战派]csharp通过dll调用opencv函数,图片作为参数          ​一直想做着方面的研究,但是因为这个方面的知识过于小众,也是由于自己找资料的能力比较弱,知道今天才找到了比较好的资料。
1369 0
|
计算机视觉 资源调度 C#
opencv通过dll调用matlab函数,图片作为参数
[blog 项目实战派]opencv通过dll调用matlab函数,图片作为参数                   前文介绍了如何“csharp通过dll调用opencv函数,图片作为参数”。而在实际的代码编写过程中,很多时候想把已经写好的matlab函数融合进去,但是依然是将图片作为参数传递比较成为问题。
1459 0
|
计算机视觉
1.1.3-学习Opencv与MFC混合编程之---画图工具 通过对话框进行工具的参数设置 画曲线 绘图校正
源代码:http://download.csdn.net/detail/nuptboyzhb/3961688 l 对话框 1.“插入”->“资源”->“对话框” 2.对话框属性如下: 双击对话框,建立对话框类。
1114 0
|
28天前
|
算法 计算机视觉
opencv图像形态学
图像形态学是一种基于数学形态学的图像处理技术,它主要用于分析和修改图像的形状和结构。
34 4
下一篇
无影云桌面