Hough transform help [message #31817] |
Fri, 16 August 2002 21:18 |
mperrin+news
Messages: 81 Registered: May 2001
|
Member |
|
|
I'm attempting to use the new HOUGH function in IDL 5.5 to detect
linear features in an image. However, I don't understand the scaling
it applies to its results.
I have a 256x256 floating-point image. I am doing this:
edge_enh = sobel(image)
h = hough(edge_enh,/gray,rho=rho,theta=theta)
and it very nicely detects the lines in the image as bright
points in the Hough transform. However, I want to extract the slopes
and intercepts of those lines (in standard y=mx+b format). Well, that
should be easy given rho and theta for each line - except that
the rho which is being returned ranges from -181 to 181.
Negative values don't make any sense to me, particularly given
that my image looks something like
+-----------+
| \ | |
| \ | |
| \ \ | |
| \ \ | |
+-----------+
..all of which are clearly to the right of the origin and thus should
have positive rho. It's getting the thetas perfectly correct as far
as I can tell.
Does anyone have any better explanation of the way that Hough calculates
the rho values? I can provide more details if it's useful, but as I've never
used Hough transforms before I assume there's just something I'm
misinterpreting.
- Marshall
|
|
|