规模和旋转模板匹配 [英] scale and rotation Template matching
问题描述
我使用匹配模板的方法与 CV_TM_CCORR_NORMED
比较两个图像...我想让这个旋转和尺度不变..任何想法?
我试图对图像和模板的傅立叶变换使用相同的方法,但旋转后的结果不同
<当你的对象在场景中旋转或缩放时,与
matchTemplate
的模板匹配不好。 您应该从 Features2D
Framework中尝试openCV函数。例如 SIFT
或 SURF
描述符和 FLANN
匹配器。此外,您还需要 findHomography
方法。
更新:
总之,算法是:
-
查找对象图像的关键点
1.1。从这些关键点提取描述符 -
查找场景图像的关键点
2.1从关键点提取描述符 -
匹配符匹配描述符
-
分析匹配
有不同类的FeatureDetectors,DescriptorExtractors和DescriptorMatches,你可以阅读它们并选择适合你的任务。
- openCV FeatureDetector (上述算法中的步骤1和2) )
- openCV DescriptorExtractor (步骤1.1和2.1 in algorithm
above) - openCV DescriptorMatcher (上述算法中的步骤3)
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
Template matching with matchTemplate
is not good when your object is rotated or scaled in scene.
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.
Update:
In short, algorithm is this:
Finding keypoints of your object image 1.1. Extracting descriptors from those keypoints
Finding keypoints of your scene image 2.1 Extracting descriptors from keypoints
Match descriptors by matcher
Analyze your matches
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 (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 )
这篇关于规模和旋转模板匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!