Deskewing

Scanned documents often become skewed (slanted) during scanning because of misfeeds or other alignment errors. Skew is the amount of rotation necessary to return an image to horizontal and vertical alignment. Skew is measured in degrees. Deskewing is a process whereby skew is removed by rotating an image by the same amount as its skew but in the opposite direction. This results in a horizontally and vertically aligned image where the text runs across the page rather than at an angle.

When an image is not aligned correctly, optical character recognition (OCR) is more difficult and becomes slower and less accurate. Deskewing the documents beforehand can make the OCR process faster and more accurate.

LEADTOOLS offers three functions that can automatically straighten scanned documents:

LBitmap::Deskew

LBitmap::DeskewCheck

LBitmap::DeskewExt

All three functions have the following features:

Ability to deskew documents containing pictures

Option to use high-speed rotation with 1-bit images (faster than normal rotation)

Option to report the skew angle without performing deskew.

Use the LBitmap::Deskew function to automatically straighten scanned documents of any kind. Images can be rotated by as much as 20 degrees in either direction to remove the skew.

Use the LBitmap::DeskewExt function when more rotation may be necessary (as much as 45 degrees in either direction) or it is desired to specify the maximum angle/resolution of deskew.

Use the LBitmap::DeskewCheck function when performing bank check scanning to obtain more accuracy than provided by the other two classes. Images can be rotated by as much as 20 degrees in either direction. This class provides three different algorithms for performing deskew:

The same algorithm as the one used in the LBitmap::Deskew function

The bank check algorithm, which considers many features common to standard bank checks in order to determine orientation

The line detection algorithm, which is an algorithm based on finding the lines in an image