The class implements document's skew checking algorithm, which is based on
The range of angles to detect is controlled by MaxSkewToDetect property.
The filter accepts 8 bpp grayscale images for processing.
Sample usage:
// create instance of skew checker DocumentSkewChecker skewChecker = new DocumentSkewChecker( ); // get documents skew angle double angle = skewChecker.GetSkewAngle( documentImage ); // create rotation filter RotateBilinear rotationFilter = new RotateBilinear( -angle ); rotationFilter.FillColor = Color.White; // rotate image applying the filter Bitmap rotatedImage = rotationFilter.Apply( documentImage );
Initial image:
Deskewed image: