Working with Zones
Once the desired language(s) have been activated, the user can create zones to be recognized within the page(s).
Zones are optional. A page does not have to have zones in order to be recognized. Zones can be added to pages manually or automatically.
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.
For more information refer to:
An Overview of Recognition Modules
OCR Plus
Manually add one or more zones to a specific OCR page using L_DocAddZone.
Automatically find all zones on a specific page by calling L_DocFindZones. This function runs an algorithm that automatically determines the zones for the page and adds the zones it finds to the OCR document page. The options that control the algorithm used by this function can be set using L_DocSetZoneOptions. These options should be set before calling L_DocFindZones. To determine the current options for the algorithm used for automatically determining the zones of a page, call L_DocGetZoneOptions.
L_DocGetZoneCount gets the total number of zones in the zone list for the specified OCR page, while L_DocGetZone gets general zone information for a specific zone in a specific OCR page.
The zone list for a specific page may be saved to a file for later use, or for use with a different OCR document. To save a zone list to a file, call L_DocExportZones. To import a zone list that has been saved using L_DocExportZones, call L_DocImportZones.
To update the zone data of a single zone in the zone list of a specific page, call L_DocUpdateZone.
Finally, a zone may be removed from a zone list for a specific page by calling L_DocRemoveZone.
To determine whether the Parallel Recognition Mode is enabled, call L_DocIsParallelRecognitionEnabled. To enable or disable the Parallel Recognition Mode, call L_DocEnableParallelRecognition.
OCR Professional
Manually add one or more zones to a specific OCR page using L_Doc2AddZone.
Automatically find all zones on a specific page by calling L_Doc2FindZones. This function runs an algorithm that automatically determines the zones for the page and adds the zones it finds to the OCR document page. The options that control the algorithm used by this function can be set using L_Doc2SetZoneOptions. These options should be set before calling L_Doc2FindZones. To determine the current options for the algorithm used for automatically determining the zones of a page, call L_Doc2GetZoneOptions.
General Zone functions:
LEADTOOLS provides other functions that can be used with zones, regardless of how the zones were created. L_Doc2GetZoneCount gets the total number of OCR and user zones in the zone list for the specified OCR page, while L_Doc2GetZone gets general zone information for a specific zone in a specific OCR page. Also, call L_Doc2GetZoneColor to get the zone color.
The zone list for a specific page may be saved to a file for later use, or for use with a different OCR document. To save a zone list to a file, call L_Doc2ExportZones. To import a zone list that has been saved using L_Doc2ExportZones, call L_Doc2ImportZones.
To update the zone data of a single zone in the zone list of a specific page, call L_Doc2UpdateZone.
Finally, a zone may be removed from a zone list for a specific page by calling L_Doc2RemoveZone.
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: DOC2_RECOGMODULE_MTEXT_OMNIFONT, DOC2_RECOGMODULE_OMNIFONT_FRX, or DOC2_RECOGMODULE_OMNIFONT_PLUS3W.
A pizzabox shape is a union of rectangles, where the top of each rectangle in the union must touch the bottom of the rectangle above it. A rectangle can touch at most one rectangle above and one below. The following zones cannot have a pizzabox shape:
Table zones (must be rectangular)
OMR zone (can contain non-touching rectangles)
To create a pizzabox zone, add a rectangle to a user zone by calling L_Doc2AddZoneRect. To subtract a rectangle from a pizzabox zone, call L_Doc2ExcludeZoneRect. To get pizzabox points (nodes), call L_Doc2GetZoneNodes.
To get pizzabox zone rectangles (zone layout) call L_Doc2GetZoneLayout, and to set one or more rectangles to a pizzabox zone, call L_Doc2SetZoneLayout.