Document images produced by scanners or digital cameras usually have photometric and geometric distortions. If either of these effects distorts document, recognition of words from such a document image using OCR is subject to errors. In this paper we propose a novel approach to significantly remove geometric distortion from document images. In this method first we extract document lines from document using morphological operators. Then, extracted document lines are divided into a number of equal size column strips.
This allows to assume that each segment of line document is not curved. Each extracted document line segment is aligned horizontally. For this purpose, a segment line of document is rotated at different angels and for each rotation horizontal projection is obtained. The rotation angle with maximum peak at the corresponding projection signal is selected to align the line segment, horizontally. In order to estimate the geometrical distortion, for each document line a reference point is extracted from each line segment. These points indicate the position of a document line at starting column of line segments. Using reference points of a document line a polynomial function is fitted to each document line. At the end, geometric distortion for each part of the document is eliminated using a perspective transformation.
This transformation is estimated based on the extracted polynomial function. To increase the stability of the proposed method for short text lines, the curve of adjacent text lines of longer length is used. A post processing stage is required after applying perspective transformation on document patches. Since this transformation is a continuous mapping but it is applied on digital images. To remove this distortion from the result, the consistency of each pixel value with the value of neighboring pixels are considered to correct the value of inconsistence pixels.
The proposed method is implemented on Persian and English databases and has been compared with the existing methods. The results indicate the efficiency and accuracy of the proposed method in elimination of geometric distortions.