LEADTOOLS Forms (Leadtools.Forms.Recognition assembly)

ComparePage(FormRecognitionAttributes,Int32,FormRecognitionAttributes,Int32) Method

Show in webframe
Example 





The attributes of the Master Form.
The reference Master Form page. The page number is a 1-based index.
The Form attributes object.
The page of the form being aligned. The page number is a 1-based index.
Returns a PageRecognitionResult object that describes how close the specified Form page is in comparison to the specified Master Form page.
Syntax
'Declaration
 
Public Overloads Function ComparePage( _
   ByVal masterAttributes As FormRecognitionAttributes, _
   ByVal masterPageNumber As Integer, _
   ByVal formAttributes As FormRecognitionAttributes, _
   ByVal formPageNumber As Integer _
) As PageRecognitionResult
'Usage
 
Dim instance As FormRecognitionEngine
Dim masterAttributes As FormRecognitionAttributes
Dim masterPageNumber As Integer
Dim formAttributes As FormRecognitionAttributes
Dim formPageNumber As Integer
Dim value As PageRecognitionResult
 
value = instance.ComparePage(masterAttributes, masterPageNumber, formAttributes, formPageNumber)

            

            

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.
Remarks
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).
Example
Copy Code  
Imports Leadtools
Imports Leadtools.Barcode
Imports Leadtools.Codecs
Imports Leadtools.Forms
Imports Leadtools.Forms.Ocr
Imports Leadtools.Forms.Processing
Imports Leadtools.Forms.Recognition
Imports Leadtools.Forms.Recognition.Barcode
Imports Leadtools.Forms.Recognition.Ocr

'''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
using Leadtools;
using Leadtools.Barcode;
using Leadtools.Codecs;
using Leadtools.Forms;
using Leadtools.Forms.Ocr;
using Leadtools.Forms.Processing;
using Leadtools.Forms.Recognition;
using Leadtools.Forms.Recognition.Barcode;
using Leadtools.Forms.Recognition.Ocr;

///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;
}
Requirements

Target Platforms

See Also

Reference

FormRecognitionEngine Class
FormRecognitionEngine Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 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