FormFix v6.0 for .NET - Updated
Detect Similar Templates after Adding to the Form Set
Developer Guide > How To > Use FormFix > Prevent & Detect Similar Templates > Detect Similar Templates with the Identification Processor > Detect Similar Templates after Adding to the Form Set

The Identify method can be used to detect presence of similar templates once they have been added to the form set as well. The technique will be a combination of the two described in Detect Similar Templates before Adding to the Form Set:

  1. Iterate through each form in the form set.
  2. Call the Identify method.
  3. Decide the level of similarity based on the confidence values returned in the IdentificationResult.

As in the use of GetSimilarFormModels, the Identify method can only find similar templates to one selected template at a time. The method must be applied for each template in the form set to generate a complete list of similar form models.

For a selected form model, the Identify method (process described above) can be used almost the same way. The exception being that the IdentificationSubset's collection must be used because the selected form model is already in the form set.

  1. Update the IdentificationSubset to contain the indices of all templates except the selected one.
  2. Set the property LimitIdentificationToSubset to true.
  3. Use the same process as described above for detecting similar templates before adding to the form set.

The code below demonstrates how to configure the identification processor to detect similar templates to a specified one already in the collection.

C# Example
Copy Code
// get index of current form model
int currentFormModelIndex = GetCurrentFormModelIndex();

// load the image of the current form model
System.Drawing.Bitmap candidateTemplateBitmap;
candidateTemplateBitmap = LoadFormModelImage(currentFormModelIndex);

// enable limiting identification to subset
myIDProc.LimitIdentificationToSubset = true;

// clear the identification subset
myIDProc.IdentificationSubset.Clear();

// add all form model indices to the identification
// subset, except for the current form model index
for (int index = 0; index < myIDProc.FormModels.Count; index++)
{
    if (index != currentFormModelIndex)
        myIDProc.IdentificationSubset.Add(index);
}

 

Is this page helpful?
Yes No
Thanks for your feedback.