Hough Transform
NateC
For example, the example given has four lines that all go through the point (50,50)... one line is vertical, one horizontal, one slope +1, one slope -1. As expected the Hough Transform shows peaks at angles of 0 (180), 45, 90, and 135 degrees. 0 (180) corresponds to the vertical line, 45 to the line with slope -1, 90 to the horizontal line, and 135 to the line with slope 1 (because the angle of the line that goes through the origin and is perpendicular to the line in question).
However, all of those results say that the distance is 100/sqrt(2). They should have different distances if it's the distance from the origin to the line. The 0 (180) (vertical) line should have a distance of 50, as should the horizontal line. The slope -1 line should be 100/sqrt(2), but the slope +1 line should have a distance of 0.
Am I misunderstanding Hough Transforms or is this doing something different? How do I figure out the position of a line from the Transform information?
Feel free to contact me directly if you have any questions about this.
A.G.
WaveMetrics, Inc.
June 19, 2009 at 01:30 pm - Permalink
June 21, 2009 at 07:06 pm - Permalink
The number of rows in the output is computed as 2*r0+1. The actual computation follows the "Duda and Hart Version" (see W.K. Pratt "Digital Image Processing", 2nd Ed. P. 614). The radius (r) is calculated in the usual way and the increment to the output array is applied to element row [r0+r].
I hope this helps.
A.G.
WaveMetrics, Inc.
June 23, 2009 at 12:51 pm - Permalink
June 23, 2009 at 03:48 pm - Permalink