Approximate photo of a simple drawing using lines

Posted by user3704596 on Stack Overflow See other posts from Stack Overflow or by user3704596
Published on 2014-06-03T20:28:29Z Indexed on 2014/06/04 15:25 UTC
Read the original article Hit count: 208

Filed under:
|
|
|

As an input I have a photo of a simple symbol, e.g.: https://www.dropbox.com/s/nrmsvfd0le0bkke/symbol.jpg

I would like to detect the straight lines in it, like points of start and ends of the lines. In this case, assuming the top left of the symbol is (0,0), the lines would be defined like this:

start end (coordinates of beginning and end of a line)
1. (0,0); (0,10) (vertical line)
2. (0,10); (15, 15)
3. (15,15); (0, 20)
4. (0,20); (0,30)

How can I do it (pereferably using OpenCV)? I though about Hough lines, but they seem to be good for perfect thin straight lines, which is not the case in a drawing. I'll probably work on binarized image, too.

© Stack Overflow or respective owner

Related posts about opencv

Related posts about line