Ask Your Question
0

Best method to detect number of holes in part?

asked Dec 17 '16

jamey270 gravatar image

I'm working on a project that takes a picture of a part (brass part with multiple holes in it, see link) and then I would like to use OpenCV 3.1 to locate and count the holes.

I'm pretty new to OpenCV and could use some pointers into which method I should look into for accomplishing this task. Ideally, the program would locate the circles and do the work for me (I've had little luck thus far; using finding contours and hough circle sample code). Currently using C++.

Is OpenCV even capable of solving this problem?

Thanks in advance for any tips you can provide, Jamey

Preview: (hide)

1 answer

Sort by » oldest newest most voted
2

answered Dec 17 '16

LBerger gravatar image

Not the best method but a method Relative position object and camera must be fixed.

  1. do a linearpolar transform of original image.
  2. may be smooth result to decrease some artefact
  3. extract a vertical section and count maximum

image description

Preview: (hide)

Comments

I think we can maybe make this work! Thanks so much for your input! I've been messing around with this for hours and this seems like a really good option.

jamey270 gravatar imagejamey270 (Dec 17 '16)edit

Question Tools

1 follower

Stats

Asked: Dec 17 '16

Seen: 1,431 times

Last updated: Dec 17 '16