Hough Transform - Detecting angled lines

7 ビュー (過去 30 日間)
Karen
Karen 2011 年 9 月 12 日
I'm using the functions hough, hough peaks, and hough lines to detect straight line segments. It's detecting lines that are either horizontal or vertical but it's have trouble picked up angled lines. It also picks up multiple lines of different lengths along the same line.
The attached picture shows an example result. I have rho and thetaresolution set to 0.05. I want it to be able to detect both long and short lines so the "MinLength" is set low. How can I get my code tp detect angled lines?

回答 (2 件)

Sean de Wolski
Sean de Wolski 2011 年 9 月 12 日
I would look at the eccentricity option in regionprops
doc regionprops

David Young
David Young 2011 年 9 月 12 日
I'm not sure how are you setting the theta resolution, but hough and houghpeaks use degrees, and if your theta resolution is 0.05 degrees that's extremely small. Likewise, if you are setting the rho resolution to 0.05 pixels that's also too small to be useful.
Try increasing the resolutions by maybe a factor of 100 and see if you get better results. Once the lines are being detected, you can then try reducing them for more accuracy.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by