You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > Automatic Document Recognition > ADRGetCloserTemplateForFileICM Method
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.ADRGetCloserTemplateForFileICM Method

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

This function uses embedded color management (ICM).

C#
public int ADRGetCloserTemplateForFileICM(
    int FilePath
);
Visual Basic
Public Function ADRGetCloserTemplateForFileICM(
    ByVal FilePath As Integer
) As Integer
Parameters
Parameters 
Description 
FilePath 
The path of the image to identify.  
Returns

The Template ID which has the best similar content than the specified image.

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

Dim TemplateID1 As Integer, TemplateID2 As Integer
Dim nCloserTemplate As Integer
 
'We create the first template from an image
TemplateID1 = oGdPictureImaging.ADRCreateTemplateFromFileICM("template1.tif")
If TemplateID1 = 0 Then
   MsgBox "Can't create TemplateID1 " + "Error number: " + str(oGdPictureImaging.GetStat)
End If
 
'We create the second template from an other kind of image
TemplateID2 = oGdPictureImaging.ADRCreateTemplateFromFileICM("template2.tif")
If TemplateID2 = 0 Then
   MsgBox "Can't create TemplateID2 " + "Error number: " + str(oGdPictureImaging.GetStat)
End If
 
 
'Now, we will try to identify an image.
nCloserTemplate = oGdPictureImaging.ADRGetCloserTemplateForFileICM("document.tif")
 
Select Case nCloserTemplate
       Case TemplateID1
            MsgBox "This image seems to get best similar content as TemplateID1. Confidence is: " + str(oGdPictureImaging.ADRGetLastConfidence) + " %"
       Case TemplateID2
            MsgBox "This image seems to get best similar content as TemplateID2. Confidence is: " + str(oGdPictureImaging.ADRGetLastConfidence) + " %"
End Select
 
 
'Release created templates from memory
oGdPictureImaging.ADRDeleteTemplate (TemplateID1)
oGdPictureImaging.ADRDeleteTemplate (TemplateID2)
What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.