我正在使用带有 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 函数.例如SIFT 或SURF 描述符,以及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.从这些关键点中提取描述符
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.
这篇关于缩放和旋转模板匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
断言失败(size.width>0 && size.height&gAssertion failed (size.widthgt;0 amp;amp; size.heightgt;0)(断言失败(size.width0 amp;amp; size.height0))
在 C++ 中旋转图像而不使用 OpenCV 函数Rotate an image in C++ without using OpenCV functions(在 C++ 中旋转图像而不使用 OpenCV 函数)
OpenCV:处理每一帧OpenCV: process every frame(OpenCV:处理每一帧)
为什么我不能在 openCV 中打开 avi 视频?Why can#39;t I open avi video in openCV?(为什么我不能在 openCV 中打开 avi 视频?)
OpenCV 无法设置 SVM 参数OpenCV unable to set up SVM Parameters(OpenCV 无法设置 SVM 参数)
使用 cvtColor 转换单一颜色Convert a single color with cvtColor(使用 cvtColor 转换单一颜色)