SetTemplateImage
This action sets the empty template that is used to assist recognition. This is an optional action and does not apply when validating a signature on a US check. If the page is a form, then provide a blank form to improve the accuracy of recognition.
Syntax
bool SetTemplateImage (string imageTemplatePath)
Parameters
string imageTemplatePath
imageTemplatePath: The full path to the template file to be used during recognition. You can use blank parameter to clear the current template. Smart parameters are supported.
Returns
True always.This action does not validate the file exists. If the template does not exist, or cannot be accessed, then recognition can fail.
Level
Page level.If recognizing a field, call this action on the DCO page that contains the field.
Details
When the page starts as a blank form that is completed with user text, specifying the original empty template image can provide better recognition results. The version of the page without the user text that is filled in is considered the image template. The image template is not just a plain blank page, but a version of the document with empty boxes, combs or other areas to be completed with text before user text being entered. For example, a page that provides a template for users to complete, such as a space for Name, or Address, etc.
When a form is used, this action can be used to provide the recognition action a blank version of the form in addition to the page to recognize.
Use this action to set the empty template that is used to assist recognition. While recognition can be performed without setting the template, providing a template can provide better recognition by allowing the engine to internally remove the template marks during recognition. The template must be a 1-bit black and white TIF image. If a blank image or incorrect template is provided, recognition can fail.
The template image must be at the same resolution as the page being recognized.
If you have a template image, it is highly recommended to test recognition by using multiple pages with the template specified and without the template specified. Review the recognition results to determine which mode over all works best.
Setting the template image causes the recognition engine to internally adjust the image before recognition. The original image on disk is not be updated. This also implies that it is not possible to visually see exactly how the template is being removed by the engine.
If a template file is not available, or not applicable, then do not set a template file. If you have set a template for a page, then this action can be called with a blank parameter to remove the use of the template.
Alternatively, the Image Enhancement actions can be used to per-process the images before recognition and this can include line removal before performing recognition with the Advanced Handwriting actions. It is often desirable to perform image enhancement early in the workflow, including line removal, before steps like fingerprinting, page identification, etc. If you have preprocessed the image with line removal, then typically you do not specify a template image because the template lines have been changed.
In some cases, providing a template can reduce recognition quality. Testing is recommended to determine the best settings for your specific documents.- Example:
Field level ruleset on the field to recognize.
SetFieldTtype SetWritingStylePage Level Ruleset This rule would be attached to the Page Close of the same ruleset or on a page open of a subsequent ruleset.
SetTemplateImage("C:\Datacap\MyApp\MyTemplateImage.tif") Recognize()