本文介绍了边缘检测iPhone OpenCV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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.

推荐答案

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

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.

例如,检查以下答案:简单对象检测使用OpenCV和机器学习

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.

这篇关于边缘检测iPhone OpenCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 17:13