←Select platform

DeskewDetectionDataFlags Enumeration

Summary

Flags that indicate whether to deskew the image, which background color to use, whether to deskew the image if the skew angle is very small, which type of interpolation to use, whether the image contains mostly text, and whether to use normal or fast rotation. This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Syntax
C#
C++/CLI
Python
[FlagsAttribute()] 
public enum DeskewDetectionDataFlags 
public: 
   [FlagsAttribute] 
   enum class DeskewDetectionDataFlags sealed 
class DeskewDetectionDataFlags(Enum): 
   DocumentImage = 0 
   DocumentImage = 0 
   DocumentImage = 0 
   DocumentImage = 0 
   RotateLinear, UseSelectiveDetection, None, ReturnAngleOnly = 1 
   RotateLinear, UseSelectiveDetection, None, DoNotFillExposedArea = 16 
   RotateLinear, UseSelectiveDetection, None, Threshold = 256 
   RotateLinear, UseSelectiveDetection, None, RotateResample = 4096 
   RotateLinear, UseSelectiveDetection, None, RotateBicubic = 8192 
   RotateLinear, UseSelectiveDetection, None, DocumentAndPictures = 65536 
   RotateLinear, UseSelectiveDetection, None, UseHighSpeedRotate = 1048576 
   RotateLinear, UseSelectiveDetection, None, UseCheckDeskew = 16777216 
   RotateLinear, UseSelectiveDetection, None, UseLineDetectionCheckDeskew = 33554432 
   RotateLinear, UseSelectiveDetection, None, UseExtendedDeskew = 67108864 
   RotateLinear, UseSelectiveDetection, None, DoNotPerformPreProcessing = 268435456 
   RotateLinear, UseSelectiveDetection, None, UseNormalDetection = 536870912 
Members
ValueMemberDescription
0x00000000UseSelectiveDetectionUse the selective detection technique which is faster.
0x00000000DocumentImageThe image contains only text.
0x00000000RotateLinearDo not perform any interpolation methods when rotating.
0x00000000NoneUse the default settings, such as processing image, applying linear interpolation to rotate the image, and running Document image algorithm.
0x00000001ReturnAngleOnlyDo not deskew (rotate) the image. Use this flag to find the angle of rotation.
0x00000010DoNotFillExposedAreaDetermine the suitable background color for fill areas exposed by rotation automatically. The FillColor is ignored.
0x00000100ThresholdDo not deskew the image if the deskew angle is very small (less than 0.5 degrees).
0x00001000RotateResamplePerform bilinear interpolation when rotating.
0x00002000RotateBicubicPerform bicubic interpolation when rotating.
0x00010000DocumentAndPicturesThe image contains text and pictures or light text.
0x00100000UseHighSpeedRotateUse fast rotation speed (moderate quality, only for 1-bit images).
0x01000000UseCheckDeskewUse the bank check algorithm to deskew the image. This algorithm considers many features common to standard bank checks in order to determine orientation.
0x02000000UseLineDetectionCheckDeskewUse the bank check line detection algorithm to deskew the image.
0x04000000UseExtendedDeskewIncrease the possible deskew angle (from 10 degrees to 45 degrees in either direction). In addition, it adds the capability to specify the resolution of the rotation step.
0x10000000DoNotPerformPreProcessingDo not perform pre-processing on the image before deskewing it.
0x20000000UseNormalDetectionDo not use the selective detection technique which is more accurate.
Remarks

You can use a bitwise OR ( | ) to specify one flag from each of the following groups:

Group Flags
Flags that indicate whether to deskew the image after the method finds the skew angle. ReturnAngleOnly
Flags that indicate which background color to use. DoNotFillExposedArea
Flags that indicate whether to deskew the image if the skew angle is very small. Threshold
Flags that specify which type of interpolation to use. RotateLinear, RotateResample, RotateBicubic
Flags that indicate whether the image contains mostly text, or text and pictures. DocumentImage, DocumentAndPictures
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
public void DetectDeskewOrientationCommandExample() 
{ 
   // Load an image  
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"Forms\Forms to be Recognized\OCR\FCC-107_OCR_Filled.tif")); 
 
   // Prepare the command  
   DetectDeskewOrientationCommand command = new DetectDeskewOrientationCommand(); 
   // Detect/correct skew and orientation, filling with black  
   command.DeskewDetection.FillColor = RasterColor.Black; 
   command.DeskewDetection.Flags = DeskewDetectionDataFlags.DocumentAndPictures | DeskewDetectionDataFlags.RotateBicubic; 
   command.Flags = DetectDeskewOrientationCommandFlags.None; 
   command.OrientationDetection.Flags = OrientationDetectionDataFlags.None; 
   command.Run(image);  
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.3.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Core Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.