Image Processing 38 Page-10
Image Processing 38 Page-10
The Hough Transform is a global method used to detect straight lines (and other shapes) in
an image by representing lines in a parametric space. Instead of working directly in the
image space, it maps each edge point into a line representation in parameter space.
Steps to Detect Straight Lines:
1. Edge Detection: Apply an edge detection algorithm (like Sobel or Canny) to highlight
edges in the image.
2. Line Parameterization: Represent a straight line in polar coordinates:
r = xcos(θ)+ysin(θ)
Where: r is the distance from the origin to the line. & θ is the angle the line makes with the
x-axis.
3. Hough Space Voting: Each edge pixel votes for all possible (r,θ) that pass through it.
These votes are accumulated in a 2D accumulator array.
4. Line Detection: Peaks in the accumulator array correspond to lines in the image, as these
indicate the most likely (r,θ) values for detected lines.
Advantages of Hough Transform: