opencv2.4 image stitching test2

範例程式來源:C:\OpenCV2.4beta\samples\cpp\stitching_detailed.cpp

總共有以下參數可設定:

  • Flags:

–preview
–try_gpu (yes|no)

  • Motion Estimation Flags:

–work_megapix <float>
–features (surf|orb)
–match_conf <float>
–conf_thresh <float>
–ba (reproj|ray)
–ba_refine_mask (mask)
–wave_correct (no|horiz|vert)
–save_graph <file_name>

  • Compositing Flags:

–warp (plane|cylindrical|spherical|fisheye|stereographic|compressedPlaneA2B1|
compressedPlaneA1.5B1|compressedPlanePortraitA2B1|compressedPlanePortraitA1.5B1|
paniniA2B1|paniniA1.5B1|paniniPortraitA2B1|paniniPortraitA1.5B1|mercator|transve
rseMercator)
–seam_megapix <float>
–seam (no|voronoi|gc_color|gc_colorgrad)
–compose_megapix <float>
–expos_comp (no|gain|gain_blocks)
–blend (no|feather|multiband)
–blend_strength <float>
–output <result_img>

前文代码無法處理垂直拼接,這個程式有了wave_correct這個參數可設定,我們來看第二組與第四組的拼接效果吧!default為horiz。

第二組:

設定為vert的結果:

 

 

第四組:

設定為vert的結果:

設定為no的結果:

喜歡哪個效果就選哪個用吧:P~

使用save_graph這個參數,得到這樣子的檔案內容:

graph matches_graph{
“a.jpg" — “b.jpg"[label="Nm=129, Ni=62, C=1.32762"];
“b.jpg" — “c.jpg"[label="Nm=158, Ni=103, C=1.85921"];
}

Nm is number of matches, Ni is number of inliers, C is confidence.

執行顯示的訊息變得相當完整:

  • StitchTest.exe a.jpg b.jpg c.jpg

Finding features…
Features in image #1: 1250
Features in image #2: 1744
Features in image #3: 1441
Finding features, time: 3.66008 sec
Pairwise matching
1->2 matches: 10

1->2 matches: 83

1->2 matches: 114
1->2 & 2->1 matches: 52
.1->2 & 2->1 matches: 159
.1->2 & 2->1 matches: 141
.Pairwise matching, time: 152.073 sec
Estimating rotations…
Estimating rotations, time: 0.000403724 sec
Initial intrinsics #1:
[513.025011282021, 0, 400;
0, 513.025011282021, 267;
0, 0, 1]
Initial intrinsics #2:
[513.025011282021, 0, 400;
0, 513.025011282021, 267;
0, 0, 1]
Initial intrinsics #3:
[513.025011282021, 0, 400;
0, 513.025011282021, 267;
0, 0, 1]
Camera #1:
[726.7302324596924, 0, 400;
0, 726.7302324596924, 267;
0, 0, 1]
Camera #2:
[725.3095937708318, 0, 400;
0, 725.3095937708318, 267;
0, 0, 1]
Camera #3:
[733.7915866555516, 0, 400;
0, 733.7915866555516, 267;
0, 0, 1]
Wave correcting…
Wave correcting, time: 0.0172826 sec
Warping images (auxiliary)…
Warping images, time: 0.422173 sec
Exposure compensation…
Exposure compensation, time: 0.300704 sec
Finding seams…
Finding seams, time: 0.534436 sec
Compositing…
Compositing image #1
Multi-band blender, number of bands: 5
Compositing image #2
Compositing image #3
Compositing, time: 2.38835 sec
Finished, total time: 159.879 sec

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值