typedef struct _DESKEWDETECTION 
   L_UINT uStructSize; 
   L_UINT uFlags; 
   L_INT32 pnDeskewAngle; 
   L_UINT uAngleRange; 
   L_UINT uAngleResolution; 
   COLORREF crBack; 

The DESKEWDETECTION structure provides deskew detection information for the L_DetectBitmapDeskewOrientation function.

Member Description
uStructSize Size of this structure in bytes, for versioning. Use the sizeof() operator to calculate this value.
uFlags Flags that indicate whether or not to deskew the image and what background color to use. You can use a bitwise OR (|) to specify one flag from each group.
The following flags indicate whether to deskew the image after the function finds the skew angle:
Value Meaning
DSKW_PROCESS [0x00000000] Deskew (rotate) the image.
DSKW_NOPROCESS [0x00000001] Do not deskew (rotate) the image. Generally this flag is used to find the angle of rotation.
The following flags indicate what background color to use:
Value Meaning
DSKW_FILL [0x00000000] Use the color in crBack to fill areas exposed by rotation.
DSKW_NOFILL [0x00000010] Let the function automatically find the suitable background color to fill areas exposed by rotation. crBack is ignored in this case.
The following flags indicate the image type:
Value Meaning
DSKW_DOCUMENTIMAGE [0x00000000] The image contains text only.
DSKW_DOCUMENTANDPICTURE [0x00010000] The image contains text and pictures, or light text.
The following flags indicate which type of interpolation to perform:
Value Meaning
DSKW_LINEAR [0x00000000] Do not perform interpolation when rotating.
DSKW_RESAMPLE [0x00001000] Perform bilinear interpolation when rotating.
DSKW_BICUBIC [0x00002000] Perform bicubic interpolation when rotating.
The following flags indicate the rotation type:
Value Meaning
DSKW_NORMALSPEEDROTATE [0x00000000] Rotate the image at normal speed with a high rotation quality.
DSKW_HIGHSPEEDROTATE [0x00100000] Speed up image rotation with a moderate rotation quality (only for 1-bit images).
The following flags indicate whether to perform preprocessing to enhance results. Possible values are:
Value Meaning
DSKW_PERFORM_PREPROCESSING [0x00000000] Perform pre-processing operations. Use this with images that contain black borders as a result of scanning in order to enhance accuracy. Works only with 1-bit document images.
DSKW_DONT_PERFORM_PREPROCESSING [0x10000000] Do not perform pre-processing operations.
The following flags indicate how to detect the skew angle. Possible values are:
Value Meaning
DSKW_SELECTIVE_DETECTION [0x00000000] Detect the skew angle selectively using important features of the document, to enhance accuracy. Works only with 1-bit document images.
DSKW_NORMAL_DETECTION [0x10000000] Detect the skew angle normally using all the features of the document.
The following flags indicate whether to perform deskewing using the bank check algorithms:
Value Meaning
DSKW_DONT_USE_CHECK_DESKEW [0x00000000] Do not use any of the bank check algorithms. Perform ordinary deskewing. This is the default value.
DSKW_USE_CHECK_DESKEW [0x01000000] Use the bank check algorithm to deskew the bitmap. This algorithm considers many features common to standard bank checks in order to determine orientation.
DSKW_USE_CHECK_DESKEW_DETECT_LINES [0x02000000] Use the bank check line detection algorithm to deskew the image.
DSKW_USE_EXTENDED_DESKEW [0x02000000] Deskews the bitmap using an alternative algorithm that increases the possible deskew angle (from 20 degrees to 45 degrees in either direction).
pnDeskewAngle This value is updated with the angle that the image needs to be deskewed, in hundredths of degrees.
uAngleRange this value indicates the maximum angle of deskew, in hundredths of degrees.
uAngleResolution This value indicates the deskew angle precision on which the filter is applied.
crBack The value indicates the color used to fill the background following rotation.
Help Version 20.0.2019.3.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help