PatternMatchImage actions
Actions that use page 'anchors' to adjust zones.
Details
The PatternMatchImage action library contains actions that evaluate the original fingerprint image and can compare it to the current page image. The actions have a requirement that the fingerprint and current page be black and white images with a 1 bit color depth. The current page must have the same resolution, dots-per-inch, as the fingerprint used for matching. The scaling must be the identical as well. For example, if a fingerprint is an 8.5"x11" page at 300 dpi, then the image dimensions would be 2550x3300 pixels. The scanned image must be the same.
Images must also be isotropic, meaning that the x DPI is identical to the y DPI. Fax images are usually non-isotropic and must be first adjusted before fingerprinting and pattern matching. Non-isotropic images can be corrected using the action EqualizeUnbalancedImage in the ImageUtilities action library.
- Defining Anchors
-
An anchor is a mark on a page, typically a form, that is expected in a consistent spot for every page of the page type. The mark works best when it is in the corner of a page. One to three anchors can be defined for a page. The geometric shape contained in the anchor field should be bold and well defined with clear edges, with crisp black and white markings, producing a distinct shape. The shape should be thick and compact, not composed of long thin lines. To avoid false positive matches, the shape should not match other shapes or black areas that may exist nearby within the same image. If using multiple anchors, the best locations are typically near the corners of the image. Form printed text is generally not suitable for use as an anchor.
An anchor field is identified by setting the variable PatternMatch to a value of 1. This variable is typically added and configured in the SetupDCO from within Datacap Studio. An anchor field should not be used for any other purpose other than identifying the anchor mark on the page.
- Aligning Zones With Anchors
-
When one or two anchors are used on a page, all pages must be of the same scale. This means that the anchor alignment will compensate for the image needing x and y adjustment to properly align with the original fingerprint, but it does not allow for images that have been scaled larger or smaller. If images are scaled larger or smaller, then the images must first be resized so they have the same scaling. For example, when scanning pages, a page may be positioned slightly differently in the scanner, but the scaling of the text and objects on the page is the same. Only the amount of boarder along the sides of the page have been changed. Additionally, all pages should be deskewed prior to calling MatchPattern and RegisterZones.
When three anchors are used on a page, in addition to determining the x and y adjustment, RegisterZones will also attempt to correct small amounts of scaling on the page, meaning that if the page has been scaled slightly larger or smaller, the registration will attempt to compensate for a small amount of scaling when adjusting the zones.
Scaling adjustment only supports images that have a linear scale difference across the page. This means that if the page is reduced by 4%, then that scaling factor must be consistent across the entire page. The action cannot compensate for scaling that changes across the page such as the top of the page is 4% scaled and the bottom of the page is 6% scaled.
The larger the scaling difference becomes, compared to the fingerprint, the less likely the anchor will be correctly found due to the scaling difference. Scaled pages will also reduce the confidence of the found anchor, if the correct location is found.
- Anchor Alignment Guidelines
-
A field that has been designated as an anchor field must identify an object on the page that is expected to exist on every page of the same type, such as a printed form. The area of the anchor should include a crisp and distinct geometric shape, such as a square, with crisp edges, has white space around it, and does not match any nearby area of the page.
When a properly scaled page is not aligning to a fingerprint, it is likely due to the anchors not being found correctly. There are several reasons why anchors may not be found:- The METRIC is too big.
- The METRIC is too small.
- The anchor zone may need adjustment.
- The anchor is being confused with other markings on the page.
- The page scale is too different.
- The page has scan issues such as too light, too speckled, or too dark.
If the original fingerprint and the current source page are clean, sharp, and closely scaled, then it is likely that the anchor zone or METRIC may need adjustment. By default, the METRIC is 500 pixels by 500 pixels, which is a fairly large area. A good metric is one that is large enough for typical scanning alignment problems, but does not go beyond that value.
If the METRIC value appears to be appropriate, then try adjusting the area of the zone itself. Ideally, the zone should only contain the target shape along with whitespace around the object. It should be large enough to identify the object on the page without matching other black areas on the page.
If the action is finding the correct location, but does not have a high confidence, then lowering the confidence can resolve the problem. The action log for MatchPattern will indicate if an anchor match is found, but it did not have a high enough confidence. Of course, if the match found is with an incorrect marking on the page, it will also have low confidence and will cause adjusted alignments to be incorrect.