1

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.

Adi Shavit
  • 16,743
  • 5
  • 67
  • 137
user481363
  • 11
  • 2

1 Answers1

0

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.

Community
  • 1
  • 1
karlphillip
  • 92,053
  • 36
  • 243
  • 426