pat_RegisterZones action to adjust the positions of individual fields
If you are using multiple anchors, you can use the pat_RegisterZones action to compute the optimum offsets for individual fields.
PatternMatch_Identify computes the offset for the entire page and stores the value in the Image_Offset variable of the page.
<V n="Image_Offset">-100,-81</V>
It also creates the page data file and stores the offset for each anchor in the Zone_Offset variable of the field.
<V n="Zone_Offset">100,10</V> <-- Offset for first anchor
Using the pat_RegisterZones action to compute handles situations where the difference between the fingerprint and the runtime image varies across the page.
| Library | Action | Description |
|---|---|---|
| PatternMatch | pat_RegisterZones | Adjusts the positions of all fields on the current page that is based on the positions of the anchor fields of the page. |
The TravelDocs application runs the pat_RegisterZones action immediately after it runs the PatternMatch_Identify action.
The following RRS log entries, which are taken from pageid_rrs.log, illustrate how pat_RegisterZones works.
Created PatternMatch Object
Aquired PM lock
Anchor Anchor_1 found. (1) Looking for offset...
Expected 1384,313,1529,392
Image_Offset
Zone_Offset 81,100 (2)
Anchor Anchor_2 found. (3) Looking for offset...
Expected 697,1988,1006,2074
Image_Offset
Zone_Offset 102,101 (4)
Register using 2 anchors
Set Arrival_Date from Position to 411,405,713,484 to 507,506,812,585
Set Departure_Date from Position to 1154,412,1450,488 to 1246,513,1532,589 (5)
Set Total_Cost from Position to 1150,781,1331,860 to 1242,882,1417,961
- (1)
- The pat_RegisterZones action locates an anchor object (Anchor_1) on the current page.
- (2)
- The pat_RegisterZones action retrieves the zone offset for this field that was computed earlier by PatternMatch_Identify.
- (3)
- The pat_RegisterZones action locates a second anchor object (Anchor_2) on the current page.
- (4)
- The pat_RegisterZones action retrieves the zone offset for this field that was computed earlier by PatternMatch_Identify.
- (5)
- The pat_RegisterZones action uses the two zone offsets to compute the new positions for each of the three data fields on the current page. It uses an algorithm that takes into account the proximity of each field to each anchor zone.