Deskewing Using Binary and Grayscale Images

1686 Words4 Pages

Therefore, for each pixel of the image we use the following observation window:

where c is the current pixel.

We then compute the following products:

Finally the algorithm checks if up > down and down > 127.

The main drawback of this algorithm is for images with a low contrast where too many pixels

are deleted from the original image. Therefore, the Hough transform is not able to estimate

properly the skew angle.

1.3 The Hough transform

The Hough transform is an algorithm invented by Paul Hough in 1962. It has been designed

to detect particular features of common shapes like circles or lines in digitalized images. The

classical transform is restricted to features that can be described in a parametric form. There-

fore, the Generalized Hough transform was introduced for features with more complex analytic

form.

In this section, we will only describe the classical Hough transform for straight lines detection.

1.3.1 The Hough space

In a 2-dimensional space, a line can be represented through the two parameters x and y:

and can be plotted for each pair (x, y) image points.

The main idea of the Hough transform for straight line detection is to consider each line with

its slope parameter a and its intercept parameter b, instead of the coordinates x and y. However,

this representation has some weaknesses, especially when we need to represent a vertical line.

In this case, the slope parameter tends to infinity. Thus, for computational reasons, it is simplier

to represent a line with the common parameters ρ and θ, where ρ is the distance from the line

to the origin, and θ the line angle.

Thenceforth, by using this parametrization the line equation can be rewritten as follows:

An infinite...

... middle of paper ...

... histogram is taken as

the estimated skew angle.

1.6.2 Deskewing using grayscale images

This algorithm only uses the information of the grayscale image to estimate the skew angle. It

is based on the grayscale images filtering algorithm 1.2.2, the Sobel edge detection filter and the

classical Hough transform.

The input image is first filtered using the grayscale images filter. For each pixel satisfying the

filter conditions, the Sobel edge detection algorithm is applied and the gradient directory φ is

computed by using equation (1.4).

An estimate of the skew angle at the current point is:

Therefore, instead of voting in all directions, the vote can be performed for only a few values

of θ. In order to keep accuracy, votes are performed between θ − 2◦ and θ + 2◦ .

Peaks in the accumulator are located by using the method proposed in 1.5.2.

More about Deskewing Using Binary and Grayscale Images

Open Document