Hough algorithm to deskew an image

  • Thread starter Thread starter inotyce
  • Start date Start date
  • Tags Tags
    Algorithm Image
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 5K views
inotyce
Messages
43
Reaction score
1
https://en.wikipedia.org/wiki/Hough_transform
http://www.codeproject.com/Articles/13615/How-to-deskew-an-image

I follow the second link but since I am a complete novice in image processing, I am having a hard time to figure out what it is all about and how to determine the point to make the correct lines.

In the article (Points of Interest) the writer says this
To find the reference lines, we let each point vote for all the lines that pass through the point. The lines with the highest number of points are our reference lines.
Well, I don't understand. Would someone please enlighten me with a simple summary of what this algorithm actually do to define the points to search all the lines ? Thank you.
 
Physics news on Phys.org
First, find the edges of the image you are interested in (use Canny) and call this 'Edges'.
Second, you can represent any line in an image with a slope value and x-intercept (with some chosen level of granularity).
So consider a 2D array with rows representing angles, and columns representing the x-intercept, we'll call this 'Votes'.
Consider the line generated by the parameters i,j of Votes (some slope/x-intercept) and imagine it layed down upon Edges. Each point in Edges that is on this line causes the value of Votes[j] to increment.
At the end, the values in Votes that are above some threshold (that you choose) represent a line you found in the image.