Leadtools.Forms.Recognition Namespace > FormRecognitionEngine Class > CompareForm Method : CompareForm(FormRecognitionAttributes,FormRecognitionAttributes,FormProgressCallback) Method |
public FormRecognitionResult CompareForm( FormRecognitionAttributes masterAttributes, FormRecognitionAttributes formAttributes, FormProgressCallback callback )
'Declaration Public Overloads Function CompareForm( _ ByVal masterAttributes As FormRecognitionAttributes, _ ByVal formAttributes As FormRecognitionAttributes, _ ByVal callback As FormProgressCallback _ ) As FormRecognitionResult
'Usage Dim instance As FormRecognitionEngine Dim masterAttributes As FormRecognitionAttributes Dim formAttributes As FormRecognitionAttributes Dim callback As FormProgressCallback Dim value As FormRecognitionResult value = instance.CompareForm(masterAttributes, formAttributes, callback)
If the number of pages of the Form is unknown (such as when a scanner is loaded with different forms), use the ComparePage(FormRecognitionAttributes,Int32,FormRecognitionAttributes,Int32) method to compare it with the first page of each Master Form. Then use the GetFormProperties method to get the number of pages in the Master Form. Next, update the Form attribute object with the required pages if needed for processing.
Comparisons should be made between two attribute sets that were generated using the same 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 since the Master Form attributes do not have the text features of the Form.
In order to recognize a Form, the Form attributes must be compared with all Master Forms attributes that represent the different types of form templates. The Form type is the type of the Master Form attribute object that has 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 Forms set)
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 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
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 a Form to a Master Form using all pages. FormRecognitionResult CompareForm(FormRecognitionEngine recognitionEngine, FormRecognitionAttributes master, FormRecognitionAttributes form) { return recognitionEngine.CompareForm(master, form, null); }