I am working on finger print reader. I working on Webservice which will compare the fingerprint reader. But i am getting an exception like
Object reference not set to instance of an object at _GrFingerX.IdentifyPrepare(tmpTpt, GRConstants.GR_DEFAULT_CONTEXT). Code as follows
Public Function CompareImages1(ByVal template As TTemplate, ByVal score As Integer) As Integer
Dim ret As Integer
Dim i As Integer
Try
If Not template.Size > 0 Then Return ERR_INVALID_TEMPLATE
Dim tmpTpt As Array = Array.CreateInstance(GetType(Byte), template.Size)
Array.Copy(template.tpt, tmpTpt, template.Size)
ret = _GrFingerX.IdentifyPrepare(tmpTpt, GRConstants.GR_DEFAULT_CONTEXT)
If ret < 0 Then Return ret
Dim templates As TTemplates() = GetTemplates()
For i = 1 To templates.Length
If Not (templates(i - 1).template Is Nothing) Then
Dim tempTpt As Array = Array.CreateInstance(GetType(Byte), templates(i - 1).template.Size)
Array.Copy(templates(i - 1).template.tpt, tempTpt, templates(i - 1).template.Size)
ret = _GrFingerX.Identify(tempTpt, score, GRConstants.GR_DEFAULT_CONTEXT)
End If
If ret = GRConstants.GR_MATCH Then
Return templates(i - 1).ID
End If
If ret < 0 Then Return ret
Next
Return GRConstants.GR_NOT_MATCH
Catch ex As Exception
throw ex
End Try
End Function
Please anyone can help me about how to come over this exception.