Griaule Biometrics

Home » Fingerprint SDK 2009 Developer's Manual » Programming Reference Guide » Fingerprint SDK ActiveX Reference Guide » Extraction methods » Extract

Extract

 

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++.NET

int Extract (ref object RawImage, int width, int height, int res, ref byte[] tpt, ref int tptSize, int context)

C#

int Extract (ref object RawImage, int width, int height, int res, ref Array tpt, ref int tptSize, int context)

VB6

Function Extract (ByRef RawImage As Variant, ByVal width As Long, ByVal height As Long, ByVal res As Long, ByRef tpt() As Byte, ByRef tptSize As Long, ByVal context As Long) As Long

VB.NET

Function Extract (ByRef RawImage As Object, ByVal width As Integer, ByVal height As Integer, ByVal res As Integer, ByRef tpt As Array, ByRef tptSize As Integer, ByVal context As Integer) As Integer

DELPHI

function Extract(var rawimage: OleVariant; width: integer; height: integer; res: integer; var tpt: PSafeArray; var tptSize: integer; context: integer): integer;

Sample Code

C++ .NET

int result;

// set current buffer size for the extract template
_tpt->_size = GR_MAX_SIZE_TEMPLATE;

result = _grfingerx->Extract(&_raw->img, _raw->width, _raw->height, _raw->Res, &_tpt->_tpt, &_tpt->_size, GR_DEFAULT_CONTEXT);

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

C#



int result;

// set current buffer size for the extract template
_tpt._size = (int)GRConstants.GR_MAX_SIZE_TEMPLATE;
result = (int)_grfingerx.Extract(
ref _raw.img, _raw.width, _raw.height, _raw.Res,
ref _tpt._tpt,ref _tpt._size,
(int)GRConstants.GR_DEFAULT_CONTEXT);
// if error, set template size to 0
if (result < 0)
{
// Result < 0 => extraction problem
_tpt._size = 0;
}


VB6



Dim ret As Integer
' Set initial buffer size and allocate it
template.Size = GR_MAX_SIZE_TEMPLATE
' reallocate template buffer
ReDim Preserve template.tpt(template.Size)
ret = GrFingerXCtrl1.Extract(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
' Set real buffer size and free unnecessary data
ReDim Preserve template.tpt(template.Size)

VB .NET



Dim ret As Integer
' set current buffer size for the extract template
template.Size = template.tpt.Length
ret = _GrFingerX.Extract(raw.img, raw.width, raw.height, raw.res, template.tpt, template.Size, GRConstants.GR_DEFAULT_CONTEXT)
' if error, set template size to 0
' Result < 0 => extraction problem
If ret < 0 Then template.Size = 0

DELPHI

Var
  ret: Integer;
Begin
  // set current buffer size for the extract template
  template.size := GR_MAX_SIZE_TEMPLATE;
  ret := GrFingerXCtrl1.Extract(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;