缩放和旋转在opencv的模板匹配 [英] scale and rotation Template matching in opencv

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

问题描述

我想使用模板图像来搜索另一幅图像中的目标。但目标具有缩放和旋转更改,还有目标混合,其颜色与目标颜色相同。
就像下面的图片

我想使用椭圆而不是矩形来获取目标。喜欢pic2。

I want to use a template image to search target in the another image.But the target have scale and rotation change,also the target mix with noise which the color is same with target. Just like the pic as follow I want to get the target by using a ellipse not rectangle.Like the pic2.

我如何做到这一点,我尝试使用matchtemplate函数,但结果不好。另外,我曾试图使用matchShapes()来做到这一点,但函数需要输入两个轮廓进行比较。由于目标混合噪声,从目标图像的coutour不是一个coutour我需要。我没有idea.Can你可以帮助我,并给我一些建议?先谢谢!

How can i do that.I try to use matchtemplate function, but the result is not good.Also,I had tried to use matchShapes() to do that,but the function need to input two contours to compare.As the target is mixed with noise,the coutour from target image is not a coutour what i need.I have no idea.Can you help me and give me some advice?Thanks in advance!!

推荐答案

尝试广义霍夫变换(GHT),使用模板查找轮廓。我记得,已经准备好在opencv(gpu)示例中使用实现了。(opencv / samples / gpu / generalized_hough.cpp在我的机器上)

You can try Generalized Hough Transform (GHT), to find contours using template. As I remember, there was ready to use implementation in opencv (gpu) examples.(opencv/samples/gpu/generalized_hough.cpp on my machine)

链接到源代码: http://www.itriacasa.it/generalized-hough- transform / instructions.html

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆