Leadtools.Forms.Recognition Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
ComparePage(FormRecognitionAttributes,Int32,FormRecognitionAttributes,Int32,PageProgressCallback) Method
See Also  Example
Leadtools.Forms.Recognition Namespace > FormRecognitionEngine Class > ComparePage Method : ComparePage(FormRecognitionAttributes,Int32,FormRecognitionAttributes,Int32,PageProgressCallback) Method



masterAttributes
The attributes of the Master Form.
masterPageNumber
The reference Master Form page. The page number is a 1-based index.
formAttributes
The Form attributes object.
formPageNumber
The page of the form being aligned. The page number is a 1-based index.
callback
Optional callback to show operation progress.
masterAttributes
The attributes of the Master Form.
masterPageNumber
The reference Master Form page. The page number is a 1-based index.
formAttributes
The Form attributes object.
formPageNumber
The page of the form being aligned. The page number is a 1-based index.
callback
Optional callback to show operation progress.
Returns a PageRecognitionResult object determines how close is the specified Form page to the specified Master Form page.

Syntax

Visual Basic (Declaration) 
Overloads Public Function ComparePage( _
   ByVal masterAttributes As FormRecognitionAttributes, _
   ByVal masterPageNumber As Integer, _
   ByVal formAttributes As FormRecognitionAttributes, _
   ByVal formPageNumber As Integer, _
   ByVal callback As PageProgressCallback _
) As PageRecognitionResult
Visual Basic (Usage)Copy Code
Dim instance As FormRecognitionEngine
Dim masterAttributes As FormRecognitionAttributes
Dim masterPageNumber As Integer
Dim formAttributes As FormRecognitionAttributes
Dim formPageNumber As Integer
Dim callback As PageProgressCallback
Dim value As PageRecognitionResult
 
value = instance.ComparePage(masterAttributes, masterPageNumber, formAttributes, formPageNumber, callback)

Parameters

masterAttributes
The attributes of the Master Form.
masterPageNumber
The reference Master Form page. The page number is a 1-based index.
formAttributes
The Form attributes object.
formPageNumber
The page of the form being aligned. The page number is a 1-based index.
callback
Optional callback to show operation progress.

Example

For a complete example on using the forms recognition and processing, refer to the FormRecognitionEngine example.

This example adds a page to the form

Visual BasicCopy Code
'''This method compares the first page of a Form to the first page of a Master Form.
Private Function CompareFirstPage(ByVal recognitionEngine As FormRecognitionEngine, ByVal master As FormRecognitionAttributes, ByVal form As FormRecognitionAttributes) As FormRecognitionResult
   Dim resultPage As PageRecognitionResult = recognitionEngine.ComparePage(master, 1, form, 1)
   Dim result As FormRecognitionResult = New FormRecognitionResult()
   result.Confidence = resultPage.Confidence
   result.LargestConfidencePageNumber = 1
   result.PageResults.Add(resultPage)
   result.Reason = FormRecognitionReason.Success
   Return result
End Function
C#Copy Code
///This method compares the first page of a Form to the first page of a Master Form. 
FormRecognitionResult CompareFirstPage(FormRecognitionEngine recognitionEngine, FormRecognitionAttributes master, FormRecognitionAttributes form) 

   PageRecognitionResult resultPage = recognitionEngine.ComparePage(master, 1, form, 1); 
   FormRecognitionResult result = new FormRecognitionResult(); 
   result.Confidence = resultPage.Confidence; 
   result.LargestConfidencePageNumber = 1; 
   result.PageResults.Add(resultPage); 
   result.Reason = FormRecognitionReason.Success; 
   return result; 
}

Remarks

Comparison should be done between two attributes that has been generated using the Default Manager Objects, for example if the Master Form attributes has been generated using the BarcodeManager and the Form attributes has been generated using the OcrManager then the Form will not be recognized since the Master Form attributes do not have the text features of the Form.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

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