-
Essay / Straightening using binary and grayscale images - 1686
Therefore, for each pixel in the image, we use the following observation window: where c is the current pixel. We then calculate the following products: Finally, the algorithm checks if up > down and down > 127. The main drawback of this algorithm is low contrast images where too many pixels are removed from the original image. Therefore, the Hough transform is not able to correctly estimate the tilt angle. 1.3 The Hough Transform The Hough Transform is an algorithm invented by Paul Hough in 1962. It was designed to detect particular characteristics of common shapes like circles or lines in scanned images. The classical transformation is limited to features that can be described in parametric form. Therefore, the generalized Hough transform was introduced for entities with a more complex analytical form. In this section, we will only describe the classical Hough transform for straight line detection. 1.3.1 Hough space In a 2-dimensional space, a line can be represented by the two parameters x and y: and can be drawn for each pair (x, y) of image points. The main idea of the Hough transform for detecting straight lines is to consider each line with its slope parameter a and its original parameter b, instead of the x and y coordinates. However, this representation has some weaknesses, particularly when it comes to representing a vertical line. In this case, the slope parameter tends to infinity. Thus, for computational purposes, it is simpler to represent a line with the common parameters ρ and θ, where ρ is the distance of the line from the origin, and θ the angle of the line. Now, using this parameterization, the line equation can be rewritten as: An infinity...... middle of paper ...... histogram is taken as the estimated tilt angle. 1.6.2 Straightening using grayscale images This algorithm only uses information from the grayscale image to estimate the tilt angle. It is based on the grayscale image filtering algorithm 1.2.2, the Sobel edge detection filter and the classical Hough transform. The input image is first filtered using the grayscale image filter. For each pixel satisfying the filtering conditions, the Sobel edge detection algorithm is applied and the gradient repertoire φ is calculated using equation (1.4). An estimate of the tilt angle at the current point is: Therefore, instead of voting in all directions, voting can be done for only a few values of θ. To maintain accuracy, votes are performed between θ − 2◦ and θ + 2◦. The peaks in the accumulator are located using the method proposed in 1.5.2.