Performs a verification by comparing the two templates supplied.
| Prerequisites | The Fingerprint SDK library must have been previously initialized. |
| Return | On success, GR_MATCH is returned if the matching score is higher than the verification threshold, otherwise GR_NOT_MATCH is returned. On failure, the appropriate error code is returned. |
| [in] queryTemplate |
Query template to be verified. |
| [in] referenceTemplate |
Reference template for verification. |
| [out] verifyScore |
Verification matching score. |
| [in] context |
Context in which the verification will be performed. |
C++
int __stdcall GrVerify(char *queryTemplate, char *referenceTemplate, int *verifyScore, int context);
Delphi
function GrVerify(queryTemplate: PChar; referenceTemplate: PChar; var verifyScore: Integer; context: Integer): Integer; stdcall;
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;
int result;
// Checking if the template is valid.
if(!TemplateIsValid()) return ERR_INVALID_TEMPLATE;
// Getting the template with the supplied ID from the database.
tptRef = _DB->getTemplate(id);
// Checking if the ID was found.
if ((tptRef->_tpt == NULL) || (tptRef->_size == 0)){
return ERR_INVALID_ID;
}
// Comparing the templates.
result = GrVerify((char*)_tpt->_tpt, (char*)tptRef->_tpt, score, GR_DEFAULT_CONTEXT);
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
Verify := ERR_INVALID_TEMPLATE;
exit;
end;
// Getting the template with the supplied ID from the database.
tptRef := DB.getTemplate(id);
if ((tptRef.tpt = nil) or (tptRef.size <= 0)) then
begin
Verify := ERR_INVALID_ID;
exit;
end;
// Comparing the templates.
Verify := GrVerify(template.tpt, tptRef.tpt, score, GR_DEFAULT_CONTEXT);
end;