缩放和旋转模板匹配

scale and rotation Template matching(缩放和旋转模板匹配)

本文介绍了缩放和旋转模板匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有 CV_TM_CCORR_NORMED 的匹配模板的方法来比较两个图像......我想让这个旋转和缩放不变......有什么想法吗?

I'm using the method of match template with CV_TM_CCORR_NORMED to compare two images ... I want to make to make this rotation and scale invariant .. any ideas?

图像和模板的傅里叶变换我尝试用同样的方法,但是旋转后的结果还是不一样

I tried to use the same method on the fourier transform of the image and the template , but still the result after rotation is different

推荐答案

在场景中旋转或缩放对象时,使用 matchTemplate 的模板匹配效果不佳.

Template matching with matchTemplate is not good when your object is rotated or scaled in scene.

您应该尝试 Features2D 框架中的 openCV 函数.例如SIFTSURF 描述符,以及FLANN 匹配器.此外,您还需要 findHomography 方法.

You should try openCV function from Features2D Framework. For example SIFT or SURF descriptors, and FLANN matcher. Also, you will need findHomography method.

这里是在场景中找到旋转对象的一个​​很好的例子.

Here is a good example of finding rotated object in scene.

更新:

简而言之,算法是这样的:

In short, algorithm is this:

  1. 寻找对象图像的关键点1.1.从这些关键点中提取描述符

  1. Finding keypoints of your object image 1.1. Extracting descriptors from those keypoints

寻找场景图像的关键点2.1 从关键点中提取描述符

Finding keypoints of your scene image 2.1 Extracting descriptors from keypoints

通过匹配器匹配描述符

分析你的匹配

有不同类别的 FeatureDetector、DescriptorExtractors 和 DescriptorMatches,您可以阅读它们并选择适合您的任务的那些.

There are different classes of FeatureDetectors, DescriptorExtractors, and DescriptorMatches, you may read about them and choose those, that fit good for your tasks.

  • openCV FeatureDetector(上述算法中的第 1 步和第 2 步)
  • openCV DescriptorExtractor(算法中的步骤 1.1 和 2.1上面)
  • openCV DescriptorMatcher(上述算法中的第 3 步)
  • openCV FeatureDetector (steps 1 and 2 in algorithm above)
  • openCV DescriptorExtractor ( steps 1.1 and 2.1 in algorithm above )
  • openCV DescriptorMatcher ( step 3 in algorithm above )

这篇关于缩放和旋转模板匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:缩放和旋转模板匹配

基础教程推荐