Hough algorithm to deskew an image

In summary, the Hough transform algorithm involves finding the edges of an image using the Canny method and then representing potential lines in the image using a 2D array. Each point on an edge contributes to the array values, and lines with the highest number of points above a chosen threshold are considered reference lines. This helps to define the points to be searched for all the lines in the image.
  • #1
inotyce
43
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.
 
Technology news on Phys.org
  • #2
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.
 

Related to Hough algorithm to deskew an image

1. How does the Hough algorithm work to deskew an image?

The Hough algorithm works by transforming the image from its original Cartesian coordinates to polar coordinates. It then plots all the points that make up a straight line in the Cartesian coordinate system onto a sinusoidal curve in the polar coordinate system. By finding the peak of this sinusoidal curve, the algorithm is able to determine the angle of rotation needed to deskew the image.

2. Can the Hough algorithm be used to deskew any type of image?

Yes, the Hough algorithm can be used to deskew any type of image as long as it contains straight lines that are not parallel to the edges of the image. This includes handwritten text, printed text, and images with geometric shapes.

3. How accurate is the Hough algorithm in deskewing images?

The accuracy of the Hough algorithm depends on the amount of distortion in the image and the number of straight lines present. In ideal conditions, the algorithm can achieve a high level of accuracy, but in cases of heavy distortion or few straight lines, the accuracy may be lower.

4. Are there any limitations to using the Hough algorithm for deskewing images?

One limitation of the Hough algorithm is that it requires a significant amount of processing power and time to analyze and transform the image. This can be a challenge when working with large or complex images. Additionally, the algorithm may not be as effective in deskewing images with curved or non-linear lines.

5. Can the Hough algorithm be combined with other image processing techniques?

Yes, the Hough algorithm can be combined with other image processing techniques such as edge detection and image segmentation to improve its accuracy and performance. These techniques can help to identify and isolate the straight lines in the image before applying the Hough transform.

Similar threads

  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
1
Views
799
Replies
3
Views
1K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
6
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
30
Views
4K
  • Programming and Computer Science
Replies
2
Views
831
  • Programming and Computer Science
Replies
19
Views
2K
  • Introductory Physics Homework Help
Replies
28
Views
692
Back
Top