且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在另一个图像中找到一个图像?

更新时间:2021-07-13 08:50:12

  1. 那么 ImageA 中的 ImageB 是否有任何变形?
  2. 图像的精确度"如何,例如,在逐个像素时,它们将相同?
  3. 您有多少计算能力?

如果前两个问题的答案是 NoYes,那么您的问题很简单.了解Q3的答案也很有帮助.

If the answers to the first two questions are No and Yes, then you have a simple problem. It also helps to know the answer to Q3.

更新:

基本思想是这样的:不是将 imageB 中每个像素周围的窗口与 imageA 中的每个像素匹配并检查相关性,而是让我们确定两个图像中的兴趣点(或特征),这些点将可跟踪.所以看起来角落真的是可追踪的,因为它周围的区域有点相似(不详述) - 因此,让我们在两个图像中找到一些真正的角落,并搜索看起来最相似的角落.

The basic idea's this: instead of matching a window around every pixel in imageB with every pixel in imageA and checking the correlation, let's identify points of interest (or features) in both images which will be trackable. So it looks like corners are really trackable since the area around it is kinda similar (not going into details) - hence, let's find some really strong corners in both images and search for corners which look most similar.

这减少了用 A 搜索 B 中的每个像素的问题,例如,搜索 B 中的 500 个角和 A 中的 1000 个角(或类似的东西) - 快得多.

This reduces the problem of searching every pixel in B with A to searching for, say, 500 corners in B with a 1000 corners in A (or something like that) - much faster.

最棒的是,您可以在 OpenCV.如果您不觉得使用 emguCV (C# varriant),请使用 FAST 检测器可以找到匹配的角点,从而在图像之间定位多个特征.完成后,您可以找到图像左上角的位置.

And the awesome thing is you have several such corner detectors at your disposal in OpenCV. If you don't feel using emguCV (C# varriant), then use the FAST detector to find matching corners and thus locate multiple features between your images. Once you have that, you can find the location of the top-left corner of the image.