LEADTOOLS OCR (Leadtools.Forms.Ocr assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
AutoPreprocess Method
See Also 
Leadtools.Forms.Ocr Namespace > IOcrPage Interface : AutoPreprocess Method



command
The preprocessing command to perform.
callback
Optional callback to show operation progress.

The AutoPreprocess Method is available as an add-on to the LEADTOOLS Document and Medical Imaging toolkits.

command
The preprocessing command to perform.
callback
Optional callback to show operation progress.
Performs automatic image processing clean up on the image to enhance the quality of the page before beginning recognition.

Syntax

Visual Basic (Declaration) 
Sub AutoPreprocess( _
   ByVal command As OcrAutoPreprocessPageCommand, _
   ByVal callback As OcrProgressCallback _
) 
Visual Basic (Usage)Copy Code
Dim instance As IOcrPage
Dim command As OcrAutoPreprocessPageCommand
Dim callback As OcrProgressCallback
 
instance.AutoPreprocess(command, callback)
C# 
void AutoPreprocess( 
   OcrAutoPreprocessPageCommand command,
   OcrProgressCallback callback
)
C++/CLI 
void AutoPreprocess( 
   OcrAutoPreprocessPageCommand command,
   OcrProgressCallback^ callback
) 

Parameters

command
The preprocessing command to perform.
callback
Optional callback to show operation progress.

Example

Remarks

Use this method to deskew, rotate or invert the image according to command. By performing auto pre-processing on a page, you can improve the image quality of draft mode faxes.

Use the OcrProgressCallback to show the operation progress or to abort it. For more information and an example, refer to OcrProgressCallback.

Call this method prior to calling IOcrPage.Recognize or RecognizeText.

This method will call GetDeskewAngle, GetRotateAngle and IsInverted to determine whether the page needs processing, if the page does, this method will internally deskews, rotates or inverts the image accordingly.

If the image is skewed, GetDeskewAngle will return the angle needed to deskew the image, if you call AutoPreprocess on the page, all subsequent calls to GetDeskewAngle will return 0 since the image is no longer skewed. Same with GetRotateAngle and IsInverted.

This method works on both the current and processing version of the image. For example, if you add a page that is skewed and call AutoPreprocess width OcrAutoPreprocessPageCommand.Deskew, then obtain either the current or processing images with GetRasterImage(OcrPageType), you will get two raster image objects that are both rotated (deskewed).

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

AutoPreprocess requires an OCR module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features