Griaule Biometrics

Home » GrExtract

GrExtract

Extracts a fingerprint template from the supplied fingerprint raw image.

Prerequisites The Fingerprint SDK library must have been previously initialized.
The template array must be already allocated. The recommended size is GR_MAX_SIZE_TEMPLATE bytes.

Return On success, the template quality code is returned. On failure, the appropriate error code is returned.

Parameters

[in] rawImage

A raw grayscale fingerprint image.

[in] width

[in] Fingerprint image width in pixels.

[in] height

Fingerprint image height in pixels.

[in] res

Fingerprint image resolution in DPI.

[out] tpt

The byte array in which the fingerprint template will be stored.

[in,out] tptSize

[in] The maximum size in bytes of the byte array supplied.
[out] The size in bytes of the extracted template.

[in] context

Context in which the extraction will be performed.

Declaration

C++

int __stdcall GrExtract(unsigned char *rawimage, int width, int height, int res, char *tpt, int *tptSize, int context);

Delphi

function GrExtract(rawimage: Pchar; width: Integer; height: Integer; res: Integer; tpt: PChar; var tptSize: Integer; context: Integer): Integer; stdcall;

Sample Code

C++

int result;
// set current buffer size for the extract template
_tpt->_size = GR_MAX_SIZE_TEMPLATE;
result = GrExtract(_raw.img, _raw.width, _raw.height, _raw.Res, (char*)_tpt->_tpt, &_tpt->_size, GR_DEFAULT_CONTEXT);

// if error, set template size to 0
if (result < 0){
// Result < 0 => extraction problem
_tpt->_size = 0;
}

Delphi

Var
	ret: Integer;
Begin
	// set current buffer size for the extract template
	template.size := GR_MAX_SIZE_TEMPLATE;
	ret := GrExtract(raw.img, raw.width, raw.height, raw.res, template.tpt, template.size, GR_DEFAULT_CONTEXT);
	// if error, set template size to 0
	// Result < 0 => extraction problem
	if (ret < 0 ) then
		template.size := 0;
End;