The AutoZone(OcrProgressCallback) Method is available as an add-on to the LEADTOOLS Document and Medical Imaging toolkits.
- callback
- Optional callback to show operation progress.
Visual Basic (Declaration) | |
---|---|
Overloads Sub AutoZone( _ ByVal callback As OcrProgressCallback _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As IOcrPage Dim callback As OcrProgressCallback instance.AutoZone(callback) |
C# | |
---|---|
void AutoZone( OcrProgressCallback callback ) |
C++/CLI | |
---|---|
void AutoZone( OcrProgressCallback^ callback ) |
Parameters
- callback
- Optional callback to show operation progress.
You can use the OcrProgressCallback to show the operation progress or to abort it. For more information and an example, refer to OcrProgressCallback.
The zones found by this method are added to the Zones collection of this page. Any previously added zones will be removed from Zones first.
This method finds the zone coordinates (OcrZone.Bounds which will always have units of LogicalUnit.Pixels) and type (OcrZone.ZoneType). The type of the zone determines its role in the page layout and can be classified into three different groups:
- The flowed text zone types: OcrZoneType.Text, OcrZoneType.Column, OcrZoneType.Header, OcrZoneType.Footer, OcrZoneType.Caption, OcrZoneType.Title, OcrZoneType.VerticalText, OcrZoneType.LeftRotatedText, OcrZoneType.RightRotatedText and OcrZoneType.Other. These types mean that the zone contains textual information without a table type structure inside (it is flowed text). These types listed above are considered the same, they will not be differentiated from each other during the later processing stages.
Note: Only OcrZoneType.Text is currently supported for the LEADTOOLS OCR Advantage Engine.
- The OcrZoneType.Table type. A zone having this type means that the zone is detected as containing a table, i.e. with columns, with or without a grid. Such zones will be handled differently from those of flowed text type zones.
- The OcrZoneType.Graphic type means a zone contains graphics, i.e. this zone will not be recognized at all. The only reason to have such a zone is to save or export the image inside the zone area.
The new zones found by this method will always have the OcrZone.FillMethod and OcrZone.RecognitionModule set to OcrZoneFillMethod.Default and OcrZoneRecognitionModule.Auto respectively. In order to override this automatic fill method and recognition module, you must update each zone in Zones by getting the zone with the Leadtools.Forms.Ocr.IOcrZoneCollection getter, update and set it back with the setter. You can get the number of zones found by this method with the Zones.Count property.
New zones created by this method will always have an empty string in its OcrZone.UserDictionarySectionName property which means the use of the default section of the User dictionary. For more information, refer to IOcrUserDictionary.
The AutoZone(OcrZoneParser zoneParser, OcrZoneFillMethod fillMethod, LogicalUnit zonesUnit, OcrProgressCallback callback) override of this method lets you control the zone parser, default fill method and the units of the zones found.
To update the zones of a page with fill method set to OcrZoneFillMethod.Default, use UpdateFillMethod.
To detect the global fill method of a page, use DetectFillMethod.
Note: If this IOcrPage is an empty page, in other words, when the OCR engine performs automatic page decomposing with the AutoZone method and could not find any zones in it, the IOcrPage.Recognize or RecognizeText methods will fail with an exception. It is recommended you call AutoZone and then check if there is at least one zone found by the engine (using Zones.Count). If the count is zero, do not call IOcrPage.Recognize or or RecognizeText.
If a recognition module is not able to recognize an object (i.e. character, or checkmark etc.), this object will be marked as a rejected one. It will become marked by a rejection symbol during conversion to the final output document. Note that IOcrDocumentManager.RejectionSymbol can be set to specify the rejection symbol used in the final document.
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7