简体   繁体   English

如何在OpenCV中找到两个灰度图像的重叠部分?

[英]How can I find an overlapping parts of two grayscale images in OpenCV?

I am providing the link that shows images that I am talking about. 我提供的链接显示了我正在谈论的图像。

Here is the link shows these images. 这是显示这些图像的链接。 http://imgur.com/a/nW6sx#0 http://imgur.com/a/nW6sx#0

I have two grayscale images. 我有两个灰度图像。 First and Second images in the list. 列表中的第一张和第二张图像。

They are intersecting eachother like that. 他们像这样彼此相交。 Third image in the list 列表中的第三张图片

I need to find the overlapping area. 我需要找到重叠的区域。 Then extract these areas from both images to create 2 separate equal size images. 然后从两个图像中提取这些区域,以创建2个单独的相等大小的图像。 Fourth and Fifth images in the list. 列表中的第四张和第五张图片。

How can I do this using OpenCV with C++ API? 如何将OpenCV与C ++ API结合使用? Thank you in advance. 先感谢您。

You could try to cut them up into evenly sized rectangles and do a template match with regions of interest from one image into the other. 您可以尝试将它们切成均匀大小的矩形,并与感兴趣区域从一个图像到另一个图像进行模板匹配。 The location of the template matching can then tell you something about the overlap. 模板匹配的位置可以告诉您有关重叠的信息。 So if a similar rectangle from the middle of picture A is found on the bottom left of picture B you can probably estimate the overlap. 因此,如果在图片B的左下角找到了图片A中间类似的矩形,则可以估算出重叠。 If you do this for many regions of interest you can get a pretty good estimate. 如果您对许多感兴趣的区域执行此操作,则可以得到一个很好的估计。

Another option might be to try to match points between the two images with something like SIFT 另一个选择可能是尝试使用SIFT之类的方法来匹配两个图像之间的点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM