Hough Transform

So I've recently learned about Hough Transforms and was pleased to see that Igor has its own built in operation (under imageTransform Hough for anyone else interested). Of course, in using the Hough Transform I'm not seeing the output that I'm expecting, in particular I don't understand how Igor determines the radial component. I thought that the output should give the angle and length of a line that goes through the origin and is perpendicular to the line in question... and while it appears to give the angle that I am expecting it does not give the distance that I'm expecting.

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?
I assume you have looked at the example in the Image Processing Tutorial. That experiment has two graphs and the procedure window has a hook function which maps the pixel that the cursor is on (in transform space) to a line in object space.

Feel free to contact me directly if you have any questions about this.

A.G.
WaveMetrics, Inc.
I did look at the example, that is what I was referring to in my post. I can make the Hough Transform work just fine, but I don't understand the radial portion of the output. It definitely isn't what I learned the radial component is supposed to be, and I can't reverse engineer what Igor calculates.
The radial offset if computed as r0=int(0.5*sqrt(rows^2+cols^2)) where rows and cols are the rows and columns of the input image.

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.
Oh... the origin of the original image is at (rows/2,cols/2)... I kept assuming it was at (0,0). Awesome! Thanks!