LEADTOOLS OCR (Leadtools.Forms.Ocr assembly)

AutoZone(OcrZoneParser,OcrZoneFillMethod,LogicalUnit,OcrProgressCallback) Method

Show in webframe







The parser used for auto zoning.

Note: This parameter will always contain OcrZoneParser.Default when using the LEADTOOLS OCR Advantage Engine.

The fill method used in the zones found.
The units for the bounding rectangle of the new zones.
Optional callback to show operation progress.
Performs auto decomposition of the page to find the text and graphics zones using specified parameters.
Syntax
'Declaration
 
Overloads Sub AutoZone( _
   ByVal zoneParser As OcrZoneParser, _
   ByVal fillMethod As OcrZoneFillMethod, _
   ByVal zonesUnit As LogicalUnit, _
   ByVal callback As OcrProgressCallback _
) 
'Usage
 
Dim instance As IOcrPage
Dim zoneParser As OcrZoneParser
Dim fillMethod As OcrZoneFillMethod
Dim zonesUnit As LogicalUnit
Dim callback As OcrProgressCallback
 
instance.AutoZone(zoneParser, fillMethod, zonesUnit, callback)
- (BOOL)autoZone:(LTOcrZoneFillMethod)fillMethod
          target:(id)target
        selector:(SEL)selector
           error:(NSError**)outError;
            
public void autoZone(OcrZoneFillMethod fillMethod,
                     OcrProgressListener callback)
            
function Leadtools.Forms.Ocr.IOcrPage.AutoZone(OcrZoneParser,OcrZoneFillMethod,LogicalUnit,OcrProgressCallback)( 
   zoneParser ,
   fillMethod ,
   zonesUnit ,
   callback 
)

Parameters

zoneParser
The parser used for auto zoning.

Note: This parameter will always contain OcrZoneParser.Default when using the LEADTOOLS OCR Advantage Engine.

fillMethod
The fill method used in the zones found.
zonesUnit
The units for the bounding rectangle of the new zones.
callback
Optional callback to show operation progress.
Remarks

This method differs from AutoZone as follows:

  1. The new zones found by this method will always have the OcrZone.FillMethod value set to fillMethod instead of OcrZoneFillMethod.Default.
  2. The new zones found will have their bounding rectangle (the value of the OcrZone.Bounds in the units specified by zonesUnit instead of LogicalUnit.Pixels. For example, you can specify LogicalUnit.Inch and the zones coordinates will be in inches using the page DPI value (DpiX and DpiY) to calculate the values.

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) and type (OcrZone.ZoneType). The type of the zone determines the role of the zone in the page layout and can be classified into three different groups:

  1. 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.

  2. 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.
  3. 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 fillMethod 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 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.

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 Recognize or 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 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.

Note on AutoZone/Recognize and the page image: In certain cases, AutoZone and Recognize will perform image processing on the page that might result in the page being manipulated. For example, if you add a zone of type table, the engine might automatically deskew the page if required. This result in the image representation of the image to be different after AutoZone or Recognize is called. If your application has a requirement to view the image of the page, then call GetRasterImage after AutoZone or Recognize to get the latest version of the image representation of the page in case it has changed. The LEADTOOLS Main OCR C# and VB demos do exactly that.

Example
For an example, refer to AutoZone.
Requirements

Target Platforms

See Also

Reference

IOcrPage Interface
IOcrPage Members
Overload List
IOcrPageCollection Interface
IOcrZoneCollection Interface
OcrZone Structure
Recognize Method
Programming with the LEADTOOLS .NET OCR

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.

AutoZone(OcrZoneParser,OcrZoneFillMethod,LogicalUnit,OcrProgressCallback) requires an OCR module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features