边缘检测 iphone opencv

发布于 2024-11-16 00:13:42 字数 173 浏览 7 评论 0原文

我的应用程序是检测硬币。我已经使用 OpenCv 完成了大部分工作。我使用 CannyDetection 和 houghTransform 来检测图像的圆圈。

但我没有得到正确的硬币圈,我认为 ThresoldValues 传递给 cannyEdgeDetector 可能有问题。谁能告诉我如何选择检测硬币圈的阈值。

My application is to detect coins. I have done most of it using OpenCv . Am using CannyDetection and houghTransform to detect circles of image.

But am not getting right circles of coins, I think it might be problem with ThresoldValues passing to cannyEdgeDetector. Can any one tell me how to choose thresold values for detecting circles of coins.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

逆光飞翔i 2024-11-23 00:13:42

不幸的是,没有神奇的数字。圆圈检测在很大程度上取决于您传递给 cvHoughCircles() 的参数,并且它们对硬币的大小很敏感,硬币的大小会根据相机的接近程度而变化。

检查这个答案,例如: 使用 OpenCV 和机器学习

这个例子对于特定大小的硬币产生了奇迹。但如果它被相机捕获并且我们移动它,硬币的大小就会改变,并且应用程序将无法再提供如此准确的结果。

我的意思是,您需要在相机和硬币之间保持固定距离才能使这种方法发挥作用。找到适合您的合适距离,然后调整函数的参数,直到您满意为止。

Unfortunately, there's no magic number for that. The circles detection depend a lot on the parameters you pass to cvHoughCircles(), and they are sensitive to the size of the coin which changes according to the proximity of the camera.

Check this answer for example: Simple object detection using OpenCV and machine learning

That example works wonders for that specific size of coins. But if it was being capture by a camera and we moved it, the size of the coins would change and the application wouldn't be able to provide such accurate results anymore.

What I'm saying is you need to work with a fixed distance between your camera and the coins for this approach to work. Find an appropriate distance that suits you and then tweak the parameters of the functions until you are satisfied.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文