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.
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.
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).
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7