简体   繁体   English

旋转模板图像并执行模板匹配

[英]to rotate template image and perform template matching

I want to rotate given template image at different angles (eg. 30, 60, 90, ...) and then I want to match the rotated images with a source image to detect objects using opencv functions (I'm writing C code)... 我想旋转给定模板图像的不同角度(例如30、60、90,...),然后我想将旋转后的图像与源图像进行匹配,以使用opencv函数检测对象(我正在编写C代码) ...

How can I do this using opencv functions? 如何使用opencv函数执行此操作? Or is there any other solution? 还是有其他解决方案?

ya i'd searched SOF and that function is not passing rotated image to the main progrm. 是的,我搜索了SOF,但该功能未将旋转的图像传递给主要程序。 . . . . and the other code given in SOF continuously rotating the image. 以及SOF中提供的其他代码会不断旋转图像。 so using this we cant do teplate matching. 所以使用这个我们不能做teplate匹配。

is there any other codes to solve this problem? 还有其他代码可以解决此问题吗?

Template matching is not a good choice to match rotated targets. 模板匹配不是匹配旋转目标的好选择。

You better check the openCV module Features2D. 您最好检查一下openCV模块的Features2D。 You'll want to take a special look at the examples for the Feature Matching and Homography . 您将要采取在为例子一个特殊的外观特征匹配单应 Both contains the functional source. 两者都包含功能源。

For furthers details and a great explanation on the topic you can check Innuendo's answer to a similar question here: scale and rotation Template matching 有关此主题的更多详细信息和详细说明,您可以在此处查看Innuendo对类似问题的答案: 比例和旋转模板匹配

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

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