Working with Zones

Once the OCR document has been populated with pages, the user can create zones within the page(s) to be recognized. Zones are optional. A page does not have to have zones in order to be recognized. Zones can be added manually, or automatically. Once zones have been added to a page the zones can be manipulated and information about those zones can be obtained. For more information, refer to the following sections:

Adding Zones Manually

Zones may be added to a page manually using the AddZone method. This method takes parameters that indicate the index of the page on which to add the zones and the index of the zone to add. In addition, the method takes a pointer to an ILTZoneData object that contains information about the zone to add. To provide this information, declare a variable of type ILTZoneData. Set the properties of that object to the desired values and pass a pointer to the object to the AddZone method. For more information on the properties accessed through the ILTZoneData object, refer to Using the ILTZoneData Properties.

A list of zones, saved using the ExportZones method , may be imported to a specific page by calling the ImportZones method.

Adding Zones Automatically

Zones may be added to a specific page automatically using the FindZones method. Zones may be detected automatically over the entire page or within a specific area, depending on the bUseImageArea parameter. If this parameter is TRUE, then zones are detected for the entire page. If this parameter is FALSE, then the engine detects zones only in the area of the page defined by the ZoneLeft, ZoneTop, ZoneHeight and ZoneWidth properties.

Regardless of the area searched for zones, other automatic zoning options are used in detecting zones on a page. These options are accessed through the following properties:

EnableZoneForceSingleColumn property

ShowZoneGridLines property

ZoneParser property

These properties are updated with the current values when the GetAutoZoneOptions method is called. To set the automatic zoning options for the OCR engine, set these same properties and call the SetAutoZoneOptions method.

Getting Information Once Zones are Established

Once zones have been established, either manually or automatically, the user can get information about one or more of those zones. The GetZoneInfo method updates a pointer to an ILTZoneData object with information about a zone at a specific index on a specific page.

In addition to the information acquired by the GetZoneInfo method, the OCR engine maintains the ZoneCount property internally, automatically updating the value when a zone is added to or removed from a page using the AddZone method or the RemoveZone method.

If the host PC has two processors or a hyper-threaded one, using the Parallel Recognition Mode can speed up the recognition process by allowing the two recognition engines to run in parallel. The Parallel Recognition Mode may be used when a zone is associated with any of the following recognition modules: RECOGMODULE_MTEXT_OMNIFONT, RECOGMODULE_OMNIFONT_FRX, or RECOGMODULE_OMNIFONT_PLUS3W. To enable or disable the Parallel Recognition Mode, call set the EnableParallelRecognition property accordingly.

Manipulating Zones

Zones on a specific page can be removed using the RemoveZone method.

Update a zone on a specific pages with new ILTZoneData information using the UpdateZone method.

Zones on a page may be filled using any of a number of filling methods. The PageFillMethod property contains the fill method used by the OCR engine to fill zones of all pages processed by the engine, until the fill method is changed. The DefaultPageFillMethod property contains the default fill method for a specific page.

When scrolling a page that contains zones, the zones must also be scrolled in order to display the zones at the proper location on the page. The OffsetZones method takes the amount the page was scrolled and scrolls the zones accordingly.