如何找到OpenCV的图像之间的重叠区域? [英] how to find overlapping region between images in opencv?

查看:2507
本文介绍了如何找到OpenCV的图像之间的重叠区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现alpha混合两个图像,图像拼接。
我的第一个形象是这样的 - >

I am trying to implement alpha blending with two images for image stitching . My first image is this ->

这是我的第二个图片 - >

here is my second image ->

下面是我的结果图片 - >

here is my result image ->

正如你所看到的结果是不是proper.I想我首先要找到重叠区域之间,然后再在重叠部分实现Alpha混合。

As you can see the result is not proper.I think I first have to find the overlapping region between then and then implement alpha blending on the overlapping part.

推荐答案

首先,你看见过的OpenCV 2.3引入了一个新的拼接的模块?

First of all, have you seen a new "stitching" module introduced in OpenCV 2.3?

它提供了拼接的管道,包括混合和发现重叠(例如注册)步骤一组构建块。这里是一个文档: http://docs.opencv.org/modules/stitching/ DOC / stitching.html 并拼接应用的一个例子:<一href=\"https://$c$c.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/stitching_detailed.cpp?rev=6906\"相对=nofollow> stitching_detailed.cpp

It provides a set of building blocks for stitching pipeline including blending and "finding an overlap" (e.g. registration) steps. Here is a documentation: http://docs.opencv.org/modules/stitching/doc/stitching.html and an example of stitching application: stitching_detailed.cpp

我建议你研究这个样本的code为更好地了解细节。

I recommend you to study the code of this sample for better understanding of the details.

关于重叠发现有计算机视觉中几种常见的方法:

Regarding the finding of overlap there are several common approaches in computer vision:


  • 光流

  • 模板匹配

  • 特征匹配

有关你的情况我建议最后一个 - 它工作得很好的照片。而这种做法是在OpenCV中已经实现 - 探索OpenCV的源代码,看看 CV ::详细:: BestOf2NearestMatcher 是如何工作的。

For your case I recommend the last one - it works very well on the photos. And this approach is already implemented in OpenCV - explore the OpenCv source and see how the cv::detail::BestOf2NearestMatcher works.

这篇关于如何找到OpenCV的图像之间的重叠区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆