Page 1 of 1

trying to understand hough transform?

Posted: 2017-10-06T09:41:44-07:00
by diegomage
IM trying to do a hough transform of this image but I dont know what WxH quantity should use

this is my image

Image


PLease help me

Re: trying to understand hough transform?

Posted: 2017-10-06T10:08:13-07:00
by fmw42
The hough transform is only going to find straight lines. Just take the default values as shown at viewtopic.php?f=4&t=25476 and then adjust to see how they vary your result. But I would not expect too much from your image -- only about 2 to 4 lines will be found as the rest of your image has curves.

Re: trying to understand hough transform?

Posted: 2017-10-06T10:15:59-07:00
by diegomage
I apply the command how show in example but I obtain much lines

Code: Select all

convert  skeletonf3.jpg  -hough-lines 9x9+40    hough_lines_image.png
Image


and I apply other command and I obtain larges lines

Code: Select all

convert  skeletonf3.jpg  -hough-lines 39x39+40    hough_lines_image.png
Image

I dont know how I could delineate only the text ?

whats doing wrong ?

Im not need obtain perfect lines but I need to obtain lines of similar size of the image

HOw I could understand hough transform WxH?

Re: trying to understand hough transform?

Posted: 2017-10-06T10:41:19-07:00
by fmw42
As mentioned in the link -- The WxH specifies the filter size for locating the peaks in Hough space. The threshold is used to exclude lines whose counts are less than the argument. But your image is not made up of straight line. So it will connect all line segments that are on a given straight line even if they come from different sides of the image. I do not think your image is particularly suitable for hough transform. Nevertheless, try

Code: Select all

convert  skeletonf3.jpg -negate -threshold 10% +write tmp1.png \
\( +clone -hough-lines 9x9+60 -negate +write tmp2.png \) \
-compose multiply -composite -negate result.png
Then look at tmp2.png and result.png as you vary WxH.