DocumentSkewChecker Class |
Namespace: Accord.Imaging
The DocumentSkewChecker type exposes the following members.
Name | Description | |
---|---|---|
DocumentSkewChecker |
Initializes a new instance of the DocumentSkewChecker class.
|
Name | Description | |
---|---|---|
LocalPeakRadius |
Radius for searching local peak value, [1, 10].
| |
MaxBeta | Obsolete.
Maximum angle to detect skew in degrees.
| |
MaxSkewToDetect |
Maximum skew angle to detect, [0, 45] degrees.
| |
MinBeta | Obsolete.
Minimum angle to detect skew in degrees.
| |
StepsPerDegree |
Steps per degree, [1, 10].
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetSkewAngle(Bitmap) |
Get skew angle of the provided document image.
| |
GetSkewAngle(BitmapData) |
Get skew angle of the provided document image.
| |
GetSkewAngle(UnmanagedImage) |
Get skew angle of the provided document image.
| |
GetSkewAngle(Bitmap, Rectangle) |
Get skew angle of the provided document image.
| |
GetSkewAngle(BitmapData, Rectangle) |
Get skew angle of the provided document image.
| |
GetSkewAngle(UnmanagedImage, Rectangle) |
Get skew angle of the provided document image.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
The class implements document's skew checking algorithm, which is based on Hough line transformation. The algorithm is based on searching for text base lines - black line of text bottoms' followed by white line below.
Note |
---|
The routine supposes that a white-background document is provided with black letters. The algorithm is not supposed for any type of objects, but for document images with text. |
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: