# Is possible find arbitrary shape with Hough transform?

In imgproc.hpp are functions: HoughLines,HoughLinesP (probabilistic), HoughCircles, but I want find ellipses with narrowness, like digit 8. How can I modify sources of HoughCircles to find this?

edit retag close merge delete

Digit 8 may be considered as two circles. Show your shapes to clarify your case plz.

( 2015-01-07 15:44:56 -0500 )edit

In http://i.imgur.com/ze0Pw2v.png are unregular, 8-like are 19,222,and 231, especially 19. Rest is not 8-like. How distinguish?

( 2015-01-08 03:06:53 -0500 )edit

Sort by ยป oldest newest most voted

I am afraid there is no out of the box Hough-type solution for your case -- see Hough method description on wiki, it is not a magic wand. In your case morphology and shape analysis could help. I'd try this as:

• find bounding rectangle or ellipse (or moments) to understand shape properties like linear sizes, symmetry etc
• do some dilation iterative steps with size according to shape size ( 1/16..1/4 of height and/or width)
• check is is still one connected area or there are already 2 or more black inside areas -- if there are 2 areas, we have 8-like shape (the less dilation window size in % of shape size/width/height -- the more 8-like it is)

It is just core idea but for you 19,222,and 231 pictures it will work.

more

Official site

GitHub

Wiki

Documentation