LEADTOOLS Forms (Leadtools.Forms.Recognition assembly)
LEAD Technologies, Inc

CompareForm(FormRecognitionAttributes,FormRecognitionAttributes,FormProgressCallback,PageProgressCallback) Method

Example 





The Master Form attribute object.
The Form attribute object.
Status about the progress of the comparison at the form level (i.e. page by page). Set it to null to ignore the progress.
Provides status on the progress of the comparison at the page level. Set it to null to ignore the progress.
Returns a FormRecognitionResult object determines how close is the specified Form to the specified Master Form.
Syntax
'Declaration
 
Public Overloads Function CompareForm( _
   ByVal masterAttributes As FormRecognitionAttributes, _
   ByVal formAttributes As FormRecognitionAttributes, _
   ByVal formCallback As FormProgressCallback, _
   ByVal pageCallback As PageProgressCallback _
) As FormRecognitionResult
'Usage
 
Dim instance As FormRecognitionEngine
Dim masterAttributes As FormRecognitionAttributes
Dim formAttributes As FormRecognitionAttributes
Dim formCallback As FormProgressCallback
Dim pageCallback As PageProgressCallback
Dim value As FormRecognitionResult
 
value = instance.CompareForm(masterAttributes, formAttributes, formCallback, pageCallback)
 function Leadtools.Forms.Recognition.FormRecognitionEngine.CompareForm(FormRecognitionAttributes,FormRecognitionAttributes,FormProgressCallback,PageProgressCallback)( 
   masterAttributes ,
   formAttributes ,
   formCallback ,
   pageCallback 
)

Parameters

masterAttributes
The Master Form attribute object.
formAttributes
The Form attribute object.
formCallback
Status about the progress of the comparison at the form level (i.e. page by page). Set it to null to ignore the progress.
pageCallback
Provides status on the progress of the comparison at the page level. Set it to null to ignore the progress.
Remarks
The Master Form and the Form must have the same number of pages. If they do not, the result will be zero and the reason will be .InvalidNumberOfPages.

In a case that the number of pages in unKnown of the Form, such as scanner loaded with different forms, it is preferable to use ComparePage(FormRecognitionAttributes,Int32,FormRecognitionAttributes,Int32) to compare it with the first page of each Master Form then use GetFormProperties to get the number of pages of the Master Form then update your Form attributes with the required pages if needed for processing.

Comparisons should be made between two attribute sets that have been generated using the Default Manager Objects. For example, if the Master Form attribute object was generated using the BarcodeManager and the Form attribute object was generated using the OcrManager, then the Form will not be recognized (the Master Form attribute object would not have the text features of the Form object).

In order to recognize a Form, the Form attribute object must be compared with all of the Master Form attribute objects representing different types of form templates. The Form's type is that Master Form attribute object that generated the highest confidence value. If the highest confidence value is very low that means the Form is not one the types of the Master Forms (i.e. the type of this Form is not defined in the Master Form set)

Example
 
'''This method compares a Form to a Master Form using all pages.
  Private Function CompareForm(ByVal recognitionEngine As FormRecognitionEngine, _
                               ByVal master As FormRecognitionAttributes, _
                               ByVal form As FormRecognitionAttributes) As FormRecognitionResult
      Return recognitionEngine.CompareForm(master, form, Nothing)
  End Function
///This method compares a Form to a Master Form using all pages.
FormRecognitionResult CompareForm(FormRecognitionEngine recognitionEngine, 
                                  FormRecognitionAttributes master, 
                                  FormRecognitionAttributes form)
{
   return recognitionEngine.CompareForm(master, form, null);
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

FormRecognitionEngine Class
FormRecognitionEngine Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Forms requires a Forms Module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features