ADRGetCloserTemplateForFile Method

See Also     Examples     Applies To

Performs a documents recognition operation from an image file and returns the document identifier template ID wich have the best similar content.

Syntax

object.ADRGetCloserTemplateForFile (sFilePath)

The ADRGetCloserTemplateForFile syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
sFilePath Required. String. The path of the image to identify.

Returns

Long. the Template ID wich have the best similar content than the specified image.

Category

Automatic Document Recognition Functions

Visual Basic Sample

How to create document templates and identify the one which have the closer similar content than an image file.


Dim nTemplateID1 As Long, nTemplateID2 As Long
Dim nCloserTemplate As Long

'We create the first template from an image
nTemplateID1 = Object.ADRCreateTemplateFromFile("template1.tif")
If nTemplateID1 = 0 Then
   MsgBox "Can't create nTemplateID1 " + "Error number: " + str(Object.GetStat)
End If

'We create the second template from an other kind of image
nTemplateID2 = Object.ADRCreateTemplateFromFile("template2.tif")
If nTemplateID2 = 0 Then
   MsgBox "Can't create nTemplateID2 " + "Error number: " + str(Object.GetStat)
End If


'Now, we will try to identify an image.
nCloserTemplate = Object.ADRGetCloserTemplateForFile("document.tif")

Select Case nCloserTemplate
       Case nTemplateID1
            MsgBox "This image seems to get best similar content as nTemplateID1. Relevance is: " + str(Object.ADRGetLastRelevance) + " %"
       Case nTemplateID2
            MsgBox "This image seems to get best similar content as nTemplateID2. Relevance is: " + str(Object.ADRGetLastRelevance) + " %"
End Select


'Release created templates from memory
Object.ADRDeleteTemplate (nTemplateID1)
Object.ADRDeleteTemplate (nTemplateID2)






© Copyright 2008 GdPicture All rights reserved.
Documentation MAP.