Question
How to improve the OCR quality if the input image is skewed?
Answer
Most images, scanned in a flatbed scanner or photographed by a digital camera, are slightly skewed.
In order to improve OCR quality, FineReader Engine deskews the image automatically. It is possible to turn off automatic skew correction by setting PrepareImageMode.CorrectSkew = false and PagePreprocessingParams.CorrectSkew = false;
Here is the result sample of the skew correction:
The deskew edge applied is stored in the property ImageDocument.SkewAngle.
After the deskew, the coordinates of OCRed text correspond to the deskewed image plane, not to the initial ones. In order to access initial coordinates, use the ConvertCoordinates Method of the CoordinatesConverter Object. This method works only if the KeepOriginalCoordinatesInfo property of the PrepareImageMode object is true.
Please note, that the resulting image is larger than the initial one. The extended fields are highlighted in yellow. At the moment, FineReader Engine does not support automatic cropping.
To change the field's color please set the PrepareImageMode.BackgroundFillingColor property. By default, it's the same as the color of the image edges (white or light gray for most cases).
Comments
0 comments
Please sign in to leave a comment.