trying to understand hough transform?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

trying to understand hough transform?

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: trying to understand hough transform?

Post 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.
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

Re: trying to understand hough transform?

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: trying to understand hough transform?

Post 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.
Post Reply