Griaule Biometrics

Home » Fingerprint SDK 2009 Developer's Manual » Programming Reference Guide » Fingerprint SDK DLL Reference Guide » Matching functions » GrIdentify

GrIdentify

Performs an identification by comparing the supplied reference template against the previously prepared query template.

Prerequisites The Fingerprint SDK library must have been previously initialized.
The identification must be previously prepared by calling the GrIdentifyPrepare function.
The GrVerify function must not be called beween the call to GrIdentifyPrepare function and a call to GrIdentify function.

Return On success, GR_MATCH is returned if the matching score is higher than the identification threshold, otherwise GR_NOT_MATCH is returned.
On failure, the appropriate error code is returned.

Parameters

[in] templateReference

Reference template for identification.

[out] identifyScore

Identification matching score.

[in] context

Context in which the identification will be performed.

See also

Return codes

Declaration

C++

GrIdentify (char *templateReference, int *identifyScore, int context);

Delphi

function GrIdentify(templateReference: PChar; var identifyScore: Integer; context: Integer): Integer; stdcall;

Sample Code

C++

public class TTemplate
{
	// Template data.
	public Array _tpt;
	// Template size
	public int _size;

public TTemplate(){
// Create a byte buffer for the template
_tpt = new byte[(int)GRConstants.GR_MAX_SIZE_TEMPLATE];
_size = 0;
}
}

TTemplate *tptRef;

// Checking if the template is valid.
if(!TemplateIsValid())
return ERR_INVALID_TEMPLATE;
// Starting the identification process and supplying the query //template.
result = GrIdentifyPrepare((char*)_tpt->_tpt, GR_DEFAULT_CONTEXT);
// Getting the current template from the recordset.
tptRef = _DB->getTemplate(rs);

// Comparing the current template.
result = GrIdentify((char*)tptRef->_tpt, &score, GR_DEFAULT_CONTEXT);

// Checking if the query template and the reference template match.
if(result == GR_MATCH){
id = _DB->getId(rs);
}

Delphi



type
// Class TTemplate
// Define a type to temporary storage of template
TTemplate = class
public
// Template data.
tpt: PSafeArray;
// Template size
size: Integer;
// Template ID (if retrieved from DB)
id: Integer;

// Allocates space to template
constructor Create;
// clean-up
destructor Destroy; override;
end;

Var
ret: Integer;
tptRef: TTemplate;
Begin
// Checking if the template is valid.
if not(TemplateIsValid())then
begin
Identify := ERR_INVALID_TEMPLATE;
exit;
end;

// Starting the identification process and supplying the query template.
ret := GrIdentifyPrepare(template.tpt, GR_DEFAULT_CONTEXT);
// Comparing the current template.
ret := GrIdentify(tptRef.tpt, score, GR_DEFAULT_CONTEXT);
// Checking if the query template and the reference // template match.
if (ret = GR_MATCH) then
begin
Identify := tptRef.id;
exit;
end
else if (ret < 0) then
begin
Identify := ret;
end;