LEADTOOLS OCR (Leadtools.Forms.Ocr assembly)
LEAD Technologies, Inc

OcrZone Structure






Members 
Represents a rectangular area on a page containing a feature of interest to the user. .NET support
Object Model
OcrZone StructureOcrZoneCell Class
Syntax
[SerializableAttribute()]
public struct OcrZone : System.ValueType 
'Declaration
 
<SerializableAttribute()>
Public Structure OcrZone 
   Inherits System.ValueType
'Usage
 
Dim instance As OcrZone
[SerializableAttribute()]
public class OcrZone
JAVASCRIPT_NOSTRUCTS
[SerializableAttribute()]
public value class OcrZone : public System.ValueType 
Remarks

The OcrZone structure contains all the necessary information for describing a zone. A zone is a rectangular area on an image containing a feature of interest to the user. The image data covered by each zone is handled and processed (typically recognized) separately.

Access the zones of an IOcrPage object with the IOcrPage.Zones property. This is a IOcrZoneCollection allowing the user to examine and modify the various zones on the page.

Zones can be divided into two basic categories: whether a zone is to be recognized or whether it should be treated as graphic. Zones containing text information can be considered to be either of the flowing type or of a table type. This basic classification of zones helps the OCR engine handle text information correctly.

Zones are always associated with a filling method (OcrZoneFillMethod) and one of the available recognition modules (OcrZoneRecognitionModule). These determine which recognition algorithm will be applied to the zone during its processing.

Use the CharacterFilters property to modify the set of valid characters for recognition of the zone. Specifying the character set correctly is a recognition accuracy issue.

Other members of the zone structure specify how the checking subsystem will function for the particular zone.

Construct the zones of a page automatically using IOcrPage.AutoZone. You must call this method and finish any modification you might have to the zones before calling IOcrPage.Recognize.

To modify a zone, use IOcrZoneCollection.Item to get the OcrZone object of interest, modify the zone then set it back through IOcrZoneCollection.Item. Note that since OcrZone is a structure (value type), use the setter. The following code snippet illustrates how to change the zone type of the 4th zone in an ocrPage:

    
            // Remember, the index is zero-based, so 4th zone has an index of 3
            OcrZone zone = ocrPage.Zones[3];
            // Prevent this zone from being recognized
            zone.ZoneType = OcrZoneType.Graphic;
            ocrPage.Zones[3] = zone;
            

  

When adding or updating a zone directly initialize the OcrZone.Bounds, OcrZone.FillMethod, OcrZone.RecognitionModule, OcrZone.CharacterFilters and the OcrZone.ZoneType properties of the zone, since they will not take on their default values.

Don't modify the OcrZone.Id property. When adding zones, leave this value to the default of 0.

The OcrZone.ZoneType property of the updating zone should be one of the following: OcrZoneType.Text, OcrZoneType.Table or OcrZoneType.Graphics.

The preferred method of updating a zone is as illustrated in the code snippet above, first get the zone of interest, update it and set it back into the collection.

It is the developers responsibility to specify a valid recognition module-filling method pair. Otherwise any incorrectly set zone will have no recognition result. For more information, refer to An Overview of OCR Recognition Modules.

LEADTOOLS OCR .NET also supports OMR (Optical Mark Recognition) in all the engines. For more information, refer to Using OMR in LEADTOOLS .NET OCR.

If the zone is a table, the you can use the OcrZone.Cells property and IOcrTableZoneManager to get information and manipulate the cells properties.

To create an OcrZone object with all values initialized to default values, use OcrTypeManager.CreateDefaultOcrZone. This is a shortcut for languages that do not automatically initialize all the members of a structure, such as JavaScript.

Example
For an example, refer to IOcrPage.AutoZone.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

OcrZone Members
Leadtools.Forms.Ocr Namespace
AutoZone Method
OcrZoneType Enumeration
OcrZoneFillMethod Enumeration
OcrZoneRecognitionModule Enumeration
OcrEngineManager Class
OcrEngineType Enumeration
IOcrPageCollection Interface
IOcrZoneCollection Interface
Programming with the LEADTOOLS .NET OCR
An Overview of OCR Recognition Modules
Working with OCR Zones
Using OMR in LEADTOOLS .NET OCR

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

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