HoughCircles是否可以在opencv中检测圆内的圆? [英] Can HoughCircles function in opencv detect circles within a circle?

查看:480
本文介绍了HoughCircles是否可以在opencv中检测圆内的圆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OpenCV中遇到了HoughCircles以进行圆检测.但是它有一个参数,指定检测到的圆之间的最小距离.我担心的是,如果两个圆是同心的(即一个圆在另一个圆内),该功能会起作用吗?

谢谢 沙申克

解决方案

如果Hough变换的中心相距足够远(Hough的第五个参数),它们将仅作为两个不同的对象返回2个圆. 因此,我认为不可能以这种方式检测同心圆(因为它们的中心相同或非常接近).

我看到如何通过霍夫变换实现此效果的唯一方法是了解要查找的圆的半径,并在具有最小和最大半径(最后和下一个)变化的循环中调用HoughHough的最后一个参数),每个半径迭代都对应于您的同心圆之一.

I came across HoughCircles in OpenCV for circle detection. But it has a parameter which specifies minimum distance between detected circles. My concern is will that work in case two circles are concentric i.e. one circle within another?

Thanks Shashank

解决方案

Hough transform will only return 2 circles as two different objects if their centers are far enough apart (fifth parameter of Hough).
So I think it's not possible to detect concentric circles that way (since their centers will be the same, or very close by).

The only way I see how to do it with Hough transform is to have an idea of the radius of the circles you're looking for, and call Hough in a loop with varying min and max radius (last and next to last parameters of Hough), each radius iteration corresponding to one of your concentric circles.

这篇关于HoughCircles是否可以在opencv中检测圆内的圆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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