FDX SDK Pro Programming Manual (Android) SG1-0036A-009
FDX SDK Pro Programming Manual (Android) SG1-0036A-009
FDX SDK Pro Programming Manual (Android) SG1-0036A-009
Copyright © 1998-2021 SecuGen Corporation. ALL RIGHTS RESERVED. Information in this document is subject to
change without notice. The software described in this document is furnished under a license agreement or
nondisclosure agreement. The software may be used only in accordance with the terms of the agreement. SecuGen,
Auto-On, FDU03, FDU04, SDU03, SDU04, U10, U20, U30, UPx and U-AIR are trademarks or registered trademarks of
SecuGen Corporation. All other brands or product names may be trademarks, service marks or registered trademarks
of their respective owners.
Chapter 1. Overview
SecuGen’s FDx SDK Pro is designed to provide low level access to SecuGen’s fingerprint readers using
SecuGen’s next-generation algorithm module. Programming with SecuGen’s FDx SDK Pro is simple and
easy to program and gives the most development flexibility among all SecuGen SDKs.
1.1. Features
• Uses SecuGen’s new and improved next-generation algorithms
• Supports three kinds of fingerprint minutiae formats (or templates):
o SG400: SecuGen’s proprietary fingerprint minutiae format
o ANSI378: Finger Minutiae Format for Data Exchange (ANSI INCITS 378-2004)
o ISO19794-2: Biometric Data Interchange Formats--Finger Minutiae Data (ISO/IEC 19794-
2:2005)
• Provides low-level APIs for image capture, feature extraction and matching
o The following extraction and matching algorithms, which are incorporated in sgfpamx.dll in
this SDK, support the ANSI INCITS 378-2004 standard and have been tested and proven
to be MINEX Compliant (http://fingerprint.nist.gov/MINEX/):
▪ SecuGen ANSI INCITS 378 Template Generator v3.5 (feature extraction
algorithm)
▪ SecuGen ANSI INCITS 378 Template Matcher v3.5 (matching algorithm)
• Gives a high degree of flexibility to developers of all kinds of applications and is easy to use
Development Environment
• Android Studio 4.2.2 or later
Android Device
• Android tablet or smart phone with Android 8.1 or later
• USB host controller on device
• Standard USB port, Micro-USB OTG adapter, or USB Type C OTG adapter
• Android OS Version 8.1 (Oreo Cookie) or later
Chapter 2. Installation
2.1. Installation
1. Open the "SecuGenUSBFDDist" sample project in the SDK distribution in Android Studio.
2. Select Build->Rebuild to build the sample application.
javadoc directory HTML java documentation for the SecuGen class library
jniLibs directory Native libraries used by this SDK. The following targets are supported:
arm64-v8a
armeabi-v7a
x86
x86_64
SecuGenUSBFDDist directory Contains Android Studio project for the Android demo application
}
else
Log.e(TAG, "mUsbReceiver.onReceive() permission denied for device "
+ device);
}
}
}
};
The table below summarizes the correlation among device name (device type), loaded device driver and
initial image size when the Init(JSGFPLibDeviceName devName) function is called.
• JSGFPLib.Init()
If only one USB fingerprint reader is connected to the Android device, devId will be 0. If multiple USB
fingerprint readers are connected to one Android device, devId can range from 0 to 9. In the current
implementation, only one SecuGen fingerprint device can be connected to an Android device concurrently,
so a value of (0) should be used.
SGDeviceInfoParam device_info;
error = JSGFPLib.GetDeviceInfo(device_info);
if (error == SGFDxErrorCode.SGSGFDX_ERROR_NONE)
{
m_ImgWidth = device_info.ImageWidth;
m_ImgHeight = device_info.ImageHeight;
}
JSGFPLib.GetImage() captures an image without checking for the presence of a finger or checking image
quality.
• JSGFPLib.GetImage()
[Example]
Byte[] buffer = new byte[m_ImageWidth*m_ImageHeight];
if (JSGFPLib.GetImage(buffer) == SGFDxErrorCode.SGSGFDX_ERROR_NONE) // Get image
data from device
{
// Display image
// Process image
}
JSGFPLib.GetImageEx() captures fingerprint images continuously, checks the image quality against a
specified quality value and ignores the image if it does not contain a fingerprint or if the quality of the
fingerprint is not acceptable. If a quality image is captured within the given time (the second parameter),
JSGFPLib.GetImageEx() ends its processing.
• JSGFPLib.GetImageEx()
[Example]
byte[] buffer = new byte[m_ImageWidth*m_ImageHeight];
long timeout = 10000;
• JSGFPLib.GetImageQuality()
Int[] img_qlty;
JSGFPLib.GetImageQuality(ImageWidth, m_ImageHeight, fp_image, mg_qlty);
if (img_qlty[0] < 80)
// Capture again
To manually control the quality of a captured image, the image brightness should be adjusted by changing
the brightness setting of the reader using JSGFPLib.SetBrightness(). This function is ignored if Smart
Capture is enabled. Smart Capture can be disabled using JSGFPLib.WriteData().
• JSGFPLib. SetBrightness()
JSGFPLib.SetBrightness(70); // Set from 0 to 100.
Use JSGFPLib.CreateTemplate() to extract minutiae from a fingerprint image to form a template. The
buffer should be assigned by the application. To get the buffer size of the minutiae, call
JSGFPLib.GetMaxTemplateSize(). It will return the maximum buffer size for data in one template. The
actual template size can be obtained by calling JSGFPLib.GetTemplateSize() after the template is created.
The JSGFPLib.CreateTemplate() API creates only one set of data from an image.
• JSGFPLib.CreateTemplate()
During verification, newly input minutiae data is compared against registered minutiae data. Similar to the
registration process, verification requires the capture of a fingerprint image followed by extraction of the
minutiae data from the captured image into a template.
To match templates, FDx SDK Pro provides four kinds of matching functions. Each function requires two
sets of template data for matching.
JSGFPLib.MatchTemplate(): This function matches templates having the same format as the default
format. When calling this function, each template should include only one sample (or view) per template.
The default format is SG400 (SecuGen proprietary format) but can be changed by calling
JSGFPLib.SetTemplateFormat().
JSGFPLib.MatchTemplateEx(): This function can match templates having different template formats. This
function can also specify the template format for each template and can match templates that have multiple
views per template.
• JSGFPLib.MatchTemplate()
byte[]RegTemplate1= new byte[maxTemplateSize[0]];
byte[]RegTemplate2= new byte[maxTemplateSize[0]];
…
// Getfirst fingerprint image and create template from the image
err = JSGFPLib.GetImage(m_ImgBuf);
err = JSGFPLib.CreateTemplate(null, m_ImgBuf, m_RegTemplate1);
// Get second fingerprint image and create template from the image
err = JSGFPLib.GetImageEx(m_ImgBuf);
err = JSGFPLib.CreateTemplate(null, m_ImgBuf, m_RegTemplate2);
• JSGFPLib.MatchTemplateEx()
byte[]RegTemplate1= new byte[maxTemplateSize[0]];
byte[]RegTemplate2= new byte[maxTemplateSize[0]];
…
// Make SG400 template
err = JSGFPLib.SetTemplateFormat(SGFDxTemplateFormat.TEMPLATE_FORMAT_SG400);
err = JSGFPLib.GetImage(m_ImgBuf, 5000, NULL, qlty);
err = JSGFPLib.CreateTemplate(null, m_ImgBuf, m_RegTemplate1);
• JSGFPLib.MatchAnsiTemplate()
Long err err;
boolean[] matched = new boolean[1];
matched[0] = false;
SGANSITemplateInfo sample_info = new SGANSITemplateInfo();
err = JSGFPLib.GetAnsiTemplateInfo(m_EnrollTemplate, sample_info);
finger_found = true;
err = JSGFPLib.MatchAnsiTemplate(m_EnrollTemplate,
i,
m_FetBufM,
0,
SGFDxSecurityLevel.SL_NORMAL
matched);
if (matched)
break;
}
}
• JSGFPLib.MatchIsoTemplate()
long err;
boolean[] matched = new boolean[1];
matched[0] = false;
// ISO19794-2
SGISOTemplateInfo sample_info = new SGISOTemplateInfo();
err = JSGFPLib.GetIsoTemplateInfo(m_StoredTemplate, sample_info);
err = JSGFPLib.GetMaxTemplateSize(m_MaxTemplateSize);
byte[] m_RegTemplate1 = new byte [MaxTemplateSize[0]];
BYTE* m_RegTemplate2 = new byte [MaxTemplateSize[0]];
// Get first fingerprint image and create template from the image
err = JSGFPLib.GetImage(m_ImgBuf);
err = JSGFPLib.CreateTemplate(null, m_ImgBuf, m_RegTemplate1);
// Get second fingerprint image and create template from the image
err = JSGFPLib.GetImage(m_ImgBuf);
err = JSGFPLib.CreateTemplate(null, m_ImgBuf, m_RegTemplate2);
if (matched)
// Save these templates somewhere
- Adjust the security level according to the type of application. For example, if fingerprint-
only authentication is used, set the security level higher than SL_NORMAL to reduce false
acceptance (FAR).
Example: Input minutiae data is matched against two registered minutiae data samples
DWORD err;
err = JSGFPLib.GetMaxTemplateSize(m_hFPM, &m_MaxTemplateSize);
byte[] m_ VrfTemplate1= new byte[m_MaxTemplateSize];
// Get first fingerprint image and create template from the image
err = JSGFPLib.GetImage(m_ImgBuf);
err = JSGFPLib.CreateTemplate(null, m_ImgBuf, m_ VrfTemplate1);
if (err == SGFDxErrorCode.SGSGFDX_ERROR_NONE)
{
if (matched1 && matched2)
// Matched
else
// Not matched
}
To understand how the matching scores correlate with typical security levels, refer to the chart below.
Corresponding Matching
Constant Value
Score
SL_NONE 0 0
SL_LOWEST 1 30
SL_LOWER 2 50
SL_LOW 3 60
SL_BELOW_NORMAL 4 70
SL_NORMAL 5 80
SL_ABOVE_NORMAL 6 90
SL_HIGH 7 100
SL_HIGHER 8 120
SL_HIGHEST 9 140
SG400 templates are encrypted for high security and have a size of 400 bytes. ANSI378 templates are not
encrypted, and their size is variable depending on how many fingers are registered in the structure and how
many minutiae points are found.
For more information about the ANSI378 template, refer to the standard document titled “Information
technology - Finger Minutiae Format for Data Interchange,” document number ANSI INCITS 378-2004,
available at the ANSI website http://webstore.ansi.org.
For more information about the ISO19794-2 template, refer to the standard document titled “Information
technology -- Biometric Data Interchange Formats -- Part 2: Finger Minutiae Data,” document number
ISO/IEC 19794-2:2005, available at the ISO website under Subcommittee JTC 1 / SC 37 (Biometrics):
http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=38746.
Once the template format is set, it will affect the execution of the JSGFPLib module.
The following APIs work only when the template format is TEMPLATE_FORMAT_ANSI378:
- JSGFPLib.GetTemplateSizeAfterMerge()
- JSGFPLib.MergeAnsiTemplate()
- JSGFPLib.GetAnsiTemplateInfo()
- JSGFPLib.MatchAnsiTemplate()
- JSGFPLib.GetAnsiMatchingScore()
The following APIs work only when the template format is TEMPLATE_FORMAT_ISO19794:
- JSGFPLib.GetIsoTemplateSizeAfterMerge()
- JSGFPLib.MergeIsoTemplate()
- JSGFPLib.GetIsoTemplateInfo()
- JSGFPLib.MatchIsoTemplate()
- JSGFPLib.GetIsoMatchingScore()
- JSGFPLib.GetTemplateSizeAfterMerge()
- JSGFPLib.MergeAnsiTemplate()
- JSGFPLib.GetAnsiTemplateInfo()
- JSGFPLib.MatchAnsiTemplate()
- JSGFPLib.GetAnsiMatchingScore()
// Get first fingerprint image and create template from the image
err = JSGFPLib.GetImage(m_ImgBuf);
err = JSGFPLib.CreateTemplate(null, m_ImgBuf, m_Template1);
// Get second fingerprint image and create template from the image
err = JSGFPLib.GetImage(m_ImgBuf);
err = JSGFPLib.CreateTemplate(null, m_ImgBuf, m_Template2);
long err;
int matched_samples = 0;
if (err == SGFDxErrorCode.SGFDX_ERROR_NONE)
{
if (matched_samples > 0)
System.out.writeln("Found “ + matched_samples + “matched samples");
else
System.out.writeln("Cannot find matching sample");
}
else
System.out.writeln("MatchTemplate() failed. Error = “ + err);
- JSGFPLib.GetIsoTemplateSizeAfterMerge()
- JSGFPLib.MergeIsoTemplate()
- JSGFPLib.GetIsoTemplateInfo()
- JSGFPLib.MatchIsoTemplate()
- JSGFPLib.GetIsoMatchingScore()
// Get first fingerprint image and create template from the image
err = JSGFPLib.GetImage(m_ImgBuf);
err = JSGFPLib.CreateTemplate(null, m_ImgBuf, m_Template1);
// Get second fingerprint image and create template from the image
err = JSGFPLib.GetImage(m_ImgBuf);
err = JSGFPLib.CreateTemplate(null, m_ImgBuf, m_Template2);
DWORD err;
BOOL matched = FALSE;
// ISO19794-2
SGISOTemplateInfo sample_info = {0};
err = JSGFPLib.GetIsoTemplateInfo(m_hFPM, m_StoredTemplate, &sample_info);
matched = FALSE;
int found_finger = -1;
for (int i = 0; i < sample_info.TotalSamples; i++)
{
// ISO19794-2
err = JSGFPLib.MatchIsoTemplate(m_hFPM, m_StoredTemplate, i, m_FetBufM, 0,
SL_NORMAL,
&matched);
if (matched)
{
found_finger = sample_info.SampleInfo[i].FingerNumber;
break;
}
}
if (err == SGFDX_ERROR_NONE)
{
if (found_finger >= 0)
m_ResultEdit.Format("The fingerprint data found. Finger Position: %s",
g_FingerPosStr[found_finger]);
else
m_ResultEdit.Format("Cannot find matched fingerprint data");
}
else
{
m_ResultEdit.Format("MatchIsoTemplate() failed. Error = %d ", err);
}
• Parameters
manager
A fully initialized Android USB manager object. USB services must be initialized before the
JSGFPLib object is instantiated.
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_CREATION_FAILED = Failed to instantiate object
• Return values
SGFDX_ERROR_NONE = No error
• Return values
SGFDX_ERROR_NONE = No error
4.2. Initialization
public long Init(long devName)
Initializes JSGFPLib with device name information. The JSGFPLib object loads appropriate drivers with
device name (devName) and initializes fingerprint algorithm module based on the device information.
• Parameters
devName
Specifies the device name
SG_DEV_FDU03: device name for USB SDU03-based readers
SG_DEV_FDU04: device name for USB SDU04-based readers
SG_DEV_FDU05: device name for USB U20-based readers
SG_DEV_FDU06: device name for USB UPx-based readers
SG_DEV_FDU07: device name for USB U10-based readers
SG_DEV_FDU08: device name for USB U20-A-based readers
SG_DEV_FDU08A: device name for USB U20-AP-based readers
SG_DEV_FDU09A: device name for USB U30-based readers
SG_DEV_FDU10A: device name for USB U-AIR-based readers
SG_DEV_AUTO: automatically determines the device name
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_CREATION_FAILED = Failed to create JSGFPLib object
SGFDX_ERROR_INVALID_PARAM = Invalid parameter used
• Parameters
format
Specifies template format
TEMPLATE_FORMAT_ANSI378: ANSI INCITS 378-2004 format
TEMPLATE_FORMAT_ISO19794: ISO/IEC 19794-2:2005 format
TEMPLATE_FORMAT_SG400: SecuGen proprietary format
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_CREATION_FAILED = Failed to create JSGFPLib object
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template format
• Parameters
devId
Specifies the device ID for USB readers. The value can be from 0 to 9. The maximum number of
supported readers attached at the same time is 10.
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_PARAM = Invalid parameter used
SGFDX_ERROR_SYSLOAD_FAILED = Failed to loading system files
SGFDX_ERROR_INITIALIZE_FAILED = Failed to initialize chip
SGFDX_ERROR_DEVICE_NOT_FOUND = Device not found
• Parameters
• Return values
SGFDX_ERROR_NONE = No error
• Parameters
info
An instantiated SGDeviceInfoParam object.
• Return values
SGFDX_ERROR_NONE = No error
• Parameters
brightness
Must be set to a value from 0 to 100
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_PARAM = Invalid parameter used
• Parameters
index
Key being changed
value
New value for selected key
• Allowed values
index=5, data=0 - Disable Smart Capture
index=5, data=1 - Enable Smart Capture
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_PARAM = Invalid parameter used
• Parameters
on
True: Turns on LED
False: Turns off LED
• Return values
SGFDX_ERROR_NONE = No error
• Parameters
pFPM
The handle of the JSGFPLib object
buffer
A pointer to the buffer containing a fingerprint image. The image size can be retrieved by calling
GetDeviceInfo().
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_WRONG_IMAGE = Capture image is not a real fingerprint image
SGFDX_ERROR_INVALID_PARAM = Invalid parameter used
SGFDX_ERROR_LINE_DROPPED = Image data lost
Note: The returned quality value is different from the value used in SGFPM_GetImage(). The quality
value in GetImageEx() represents only the ratio of the fingerprint image area to the whole scanned area.
• Parameters
buffer:
A byte array containing a fingerprint image. The image size can be retrieved by calling
GetDeviceInfo().
timeout:
The timeout value (in milliseconds) used to specify the amount of time the function will wait for a
valid fingerprint to be input on the fingerprint reader
quality:
The minimum quality value of an image, used to determine whether to accept the captured image
(0 – 100)
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_PARAM = Invalid parameter used
SGFDX_ERROR_LINE_DROPPED = Image data lost
SGFDX_ERROR_TIME_OUT = No valid fingerprint captured in the given time
public long GetImageQuality(long width, long height, byte[] imgBuf, int[] quality)
Gets the quality of a captured (scanned) image. The value is determined by two factors. One is the ratio of
the fingerprint image area to the whole scanned area, and the other is the ridge quality of the fingerprint
image area. A quality value of 50 or higher is recommended for registration. A quality value of 40 or higher
is recommended for verification.
• Parameters
width
Image width in pixels
height
Image height in pixels
imgBuf
Fingerprint image data
quality
The single element array to contain image quality
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_PARAM = Invalid parameter used
public long ComputeNFIQEx(byte[] imgBuf, long width, long height, long dpi)
Compute NIST Fingerprint Image Quality score for an 8 bit grayscale fingerprint image.
• Parameters
imgBuf
Fingerprint image data
width
Image width in pixels
height
Image height in pixels
dpi
Image resolution in dots (pixels) per inch
• Return values
NFIQ score for the image that was processed
1 = highest quality fingerprint image
2 = high quality fingerprint image
3 = medium quality fingerprint image
4 = low quality fingerprint image
5 = lowest quality fingerprint image
-1 = An error occurred
Note: The returned template size means the maximum size of one view or sample.
• Parameters
size
The single element array to contain template size
• Return values
SGFDX_ERROR_NONE = No error
• Parameters
fpInfo
Fingerprint information stored in a template. For ANSI378 templates, this information can be
retrieved from the template using GetAnsiTemplateInfo(). For ISO19794 templates, this
information can be retrieved from the template using GetIsoTemplateInfo(). For SG400
templates, this information cannot be seen in the template.
rawImg
A byte array containing 256 Gray-level fingerprint image data
minTemplate
A byte array containing minutiae data extracted from a fingerprint image
• Return values
SGFDX_ERROR_NONE = No error
• Parameters
minTemplate
A byte array containing minutiae data extracted from a fingerprint image
size
A byte array that will contain template size
• Return values
SGFDX_ERROR_NONE = No error
It returns TRUE or FALSE as a matching result (matched). Security level (secuLevel) affects matching
result. The security level may be adjusted according to the security policy required by the user or
organization.
• Parameters
minTemplate1
A byte array containing minutiae data extracted from a fingerprint image
minTempate2
A byte array containing minutiae data extracted from a fingerprint image
secuLevel
A security level as specified in “SGFDxSecurityLevel” by one the following nine security levels:
SL_LOWEST, SL_LOWER, SL_LOW, SL_BELOW_NORMAL, SL_NORMAL,
SL_ABOVE_NORMAL, SL_HIGH, SL_HIGHER and SL_HIGHEST. SL_NORMAL is
recommended in usual case.
matched
A byte array that contains matching result. If passed templates are matching templates, TRUE is
returned. If not, FALSE is returned.
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in minTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in minTemplate2
• Parameters
minTemplate1
A byte array containing minutiae data extracted from a fingerprint image
templateType1
Specifies format of minTemplate1. Should be either TEMPLATE_FORMAT_SG400 or
TEMPLATE_FORMAT_ANSI378.
sampleNum1
Position of a sample to be matched in minTemplate1. If templateType1 is
TEMPLATE_FORMAT_ANSI378, it can have a value from 0 to (number of samples -1) in
minTemplate1. If templateType1 is TEMPLATE_FORMAT_SG400, this value is ignored.
minTemplate2
A byte array containing minutiae data extracted from a fingerprint image
templateType2
Specifies format of minTemplate2. Should be either TEMPLATE_FORMAT_SG400 or
TEMPLATE_FORMAT_ANSI378.
sampleNum2
Position of a sample to be matched in minTemplate2. If templateType2 is
TEMPLATE_FORMAT_ANSI378, it can have a value from 0 to (number of samples -1) in
minTemplate2. If templateType2 is TEMPLATE_FORMAT_SG400, this value is ignored.
secuLevel
A security level as specified in “fplibnew.h” by one the following nine security levels: SL_LOWEST,
SL_LOWER, SL_LOW, SL_BELOW_NORMAL, SL_NORMAL, SL_ABOVE_NORMAL,
SL_HIGH, SL_HIGHER, and SL_HIGHEST. SL_NORMAL is recommended in usual case.
matched
TRUE: Same template
FALSE: Not same template
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in minTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in minTemplate2
• Parameters
minTemplate1
A pointer to the buffer containing minutiae data extracted from a fingerprint image
minTemplate2
A pointer to the buffer containing minutiae data extracted from a fingerprint image
score
Matching score. Returned score has a value from 0 to 199.
• Returned values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in minTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in minTemplate2
• Parameters
minTemplate1
A byte array containing minutiae data extracted from a fingerprint image
templateType1
Specifies format of minTemplate1. Should be either TEMPLATE_FORMAT_SG400 or
TEMPLATE_FORMAT_ANSI378.
sampleNum1
Position of a sample to be matched in minTemplate1. If templateType1 is
TEMPLATE_FORMAT_ANSI378, it can have a value from 0 to (number of samples -1) in
minTemplate1. If templateType1 is TEMPLATE_FORMAT_SG400, this value is ignored.
minTemplate2
A byte array containing minutiae data extracted from a fingerprint image
templateType2
Specifies format of minTemplate2. Should be either TEMPLATE_FORMAT_SG400 or
TEMPLATE_FORMAT_ANSI378.
sampleNum2
Position of a sample to be matched in minTemplate2. If templateType2 is
TEMPLATE_FORMAT_ANSI378, it can have a value from 0 to (number of samples -1) in
minTemplate2. If templateType2 is TEMPLATE_FORMAT_SG400, this value is ignored.
score
Matching score. Returned score has a value from 0 to 199.
• Returned values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in minTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in minTemplate2
• Parameters
ansiTemplate1
A byte array containing minutiae data. A template can have more than one sample.
ansiTempate2
A byte array containing minutiae data. A template can have more than one sample.
size
Template size if two templates are merged
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in minTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in minTemplate2
• Parameters
ansiTemplate1
A byte array containing minutiae data. A template can have more than one sample.
asniTempate2
A byte array containing minutiae data. A template can have more than one sample.
outTempate
The byte array containing merged data. The buffer should be assigned by the application. To
determine the exact buffer size, call JSGFPLib.GetTemplateSizeAfterMerge().
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in minTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in minTemplate2
• Parameters
anisiTemplate
ANSI378 template
templateInfo
The object that contains template information. For more information see SGANSITemplateInfo
structure.
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_PARAM = Invalid parameter used
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
• Parameters
ansiTemplate1
A byte array containing minutiae data. A template can have more than one sample.
sampleNum1
Position of sample to be matched in ansiTemplate1. It can be from 0 to (number of samples -1)
in ansiTemplate1
ansiTempate2
A byte array containing minutiae data. A template can have more than one sample.
sampleNum2
Position of sample to be matched in ansiTemplate2. It can be from 0 to (number of samples -1)
in ansiTemplate2
secuLevel
A security level as specified in SGFDxSecurityLevel by one the following nine security levels:
SL_LOWEST, SL_LOWER, SL_LOW, SL_BELOW_NORMAL, SL_NORMAL,
SL_ABOVE_NORMAL, SL_HIGH, SL_HIGHER and SL_HIGHEST. SL_NORMAL is
recommended in usual case.
matched
TRUE: Same template
FALSE: Not same template
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in ansiTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in ansiTemplate2
• Parameters
ansiTemplate1
A byte array containing minutiae data. A template can have more than one sample.
sampleNum1
Position of sample to be matched in ansiTemplate1. It can be from 0 to (number of samples -1)
in ansiTemplate1
ansiTempate2
A byte array containing minutiae data. A template can have more than one sample.
sampleNum2
Position of sample to be matched in ansiTemplate2. It can be from 0 to (number of samples -1)
in ansiTemplate2
score
Matching score. Returned score has a value from 0 to 199.
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in ansiTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in ansiTemplate2
• Parameters
isoTemplate1
A byte array containing minutiae data. A template can have more than one sample.
isoTempate2
A byte array containing minutiae data. A template can have more than one sample.
size
Template size if two templates are merged
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in minTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in minTemplate2
• Parameters
isoTemplate1
A byte array containing minutiae data. A template can have more than one sample.
isoTempate2
A byte array containing minutiae data. A template can have more than one sample.
outTempate
The byte array containing merged data. The buffer should be assigned by the application. To
determine the exact buffer size, call GetIsoTemplateSizeAfterMerge().
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in minTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in minTemplate2
• Parameters
isoTemplate
ISO19794-2 template
templateInfo
The object that contains template information. For more information see SGISOTemplateInfo
structure.
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_PARAM = Invalid parameter used
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
• Parameters
isoTemplate1
A byte array containing minutiae data. A template can have more than one sample.
sampleNum1
Position of sample to be matched in isoTemplate1. It can be from 0 to (number of samples -1)
in isoTemplate1
isoTempate2
A byte array containing minutiae data. A template can have more than one sample.
sampleNum2
Position of sample to be matched in isoTemplate2. It can be from 0 to (number of samples -1)
in isoTemplate2
secuLevel
A security level as specified in SGFDxSecurityLevel by one the following nine security levels:
SL_LOWEST, SL_LOWER, SL_LOW, SL_BELOW_NORMAL, SL_NORMAL,
SL_ABOVE_NORMAL, SL_HIGH, SL_HIGHER and SL_HIGHEST. SL_NORMAL is
recommended in usual case.
matched
TRUE: Same template
FALSE: Not same template
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in isoTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in isoTemplate2
• Parameters
isoTemplate1
A byte array containing minutiae data. A template can have more than one sample.
sampleNum1
Position of sample to be matched in isoTemplate1. It can be from 0 to (number of samples -1)
in isoTemplate1
isoTempate2
A byte array containing minutiae data. A template can have more than one sample.
sampleNum2
Position of sample to be matched in isoTemplate2. It can be from 0 to (number of samples -1)
in isoTemplate2
score
Matching score. Returned score has a value from 0 to 199.
• Return values
SGFDX_ERROR_NONE = No error
SGFDX_ERROR_INVALID_TEMPLATE_TYPE = Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 = Error in isoTemplate1
SGFDX_ERROR_INVALID_TEMPLATE2 = Error in isoTemplate2
4.8. Other
public long GetMinexVersion(long[] extractor, long[] matcher)
Gets version of MINEX Compliant algorithms used in this SDK.
• Parameters
extractor
Version of MINEX Compliant extractor (template generator)
matcher
Version of MINEX Compliant matcher (template matcher)
• Return values
SGFDX_ERROR_NONE = No error
Chapter 6. Constants
6.1. SGFDxDeviceName
6.2. SGFDxSecurityLevel
Security Level Value Description
SL_NONE 0 No Security
SL_LOWEST 1 Lowest
SL_LOWER 2 Lower
SL_LOW 3 Low
SL_BELOW_NORMAL 4 Below normal
SL_NORMAL 5 Normal
SL_ABOVE_NORMAL 6 Above normal
SL_HIGH 7 High
SL_HIGHER 8 Higher
SL_HIGHEST 9 Highest
6.3. SGFDxTemplateFormat
Template Format Value Description
TEMPLATE_FORMAT_ANSI378 0x0100 ANSI INCITS 378-2004 format
TEMPLATE_FORMAT_SG400 0x0200 SecuGen proprietary format
TEMPLATE_FORMAT_ISO19794 0x0300 ISO/IEC 19794-2:2005 format
6.4. SGImpressionType
Security Level Value Description
SG_IMPTYPE_LP 0x00 Live-scan plain
SG_IMPTYPE_LR 0x01 Live-scan rolled
SG_IMPTYPE_NP 0x02 Non-live-scan plain
SG_IMPTYPE_NR 0x03 Non-live-scan rolled
6.5. SGFingerPosition
Security Level Value Description
SG_FINGPOS_UK 0x00 Unknown finger
SG_FINGPOS_RT 0x01 Right thumb
SG_FINGPOS_RI 0x02 Right index finger
SG_FINGPOS_RM 0x03 Right middle finger
SG_FINGPOS_RR 0x04 Right ring finger
SG_FINGPOS_RL 0x05 Right little finger
SG_FINGPOS_LT 0x06 Left thumb
SG_FINGPOS_LI 0x07 Left index finger
SG_FINGPOS_LM 0x08 Left middle finger
SG_FINGPOS_LR 0x09 Left ring finger
SG_FINGPOS_LL 0x0A Left little finger
6.6. SGFDxErrorCode
Error Code Value Description
General Error Codes
SGFDX_ERROR_NONE 0 No error
SGFDX_ERROR_CREATION_FAILED 1 JSGFPLib object creation failed
SGFDX_ERROR_FUNCTION_FAILED 2 Function call failed
SGFDX_ERROR_INVALID_PARAM 3 Invalid parameter used
SGFDX_ERROR_NOT_USED 4 Not used function
SGFDX_ERROR_DLLLOAD_FAILED 5 DLL loading failed
SGFDX_ERROR_DLLLOAD_FAILED_DRV 6 Device driver loading failed
SGFDX_ERROR_DLLLOAD_FAILED_ALGO 7 Algorithm DLL loading failed
Device Driver Error Codes
SGFDX_ERROR_SYSLOAD_FAILED 51 Cannot find driver sys file
SGFDX_ERROR_INITIALIZE_FAILED 52 Chip initialization failed
SGFDX_ERROR_LINE_DROPPED 53 Image data lost
SGFDX_ERROR_TIME_OUT 54 GetImageEx() timeout
SGFDX_ERROR_DEVICE_NOT_FOUND 55 Device not found
SGFDX_ERROR_DRVLOAD_FAILED 56 Driver file load failed
SGFDX_ERROR_WRONG_IMAGE 57 Wrong image
SGFDX_ERROR_LACK_OF_BANDWIDTH 58 Lack of USB bandwidth
SGFDX_ERROR_DEV_ALREADY_OPEN 59 Device is already opened
SGFDX_ERROR_GETSN_FAILED 60 Serial number does not exist
SGFDX_ERROR_UNSUPPORTED_DEV 61 Unsupported device
Extract & Matching Error Codes
SGFDX_ERROR_FEAT_NUMBER 101 Inadequate number of minutiae
SGFDX_ERROR_INVALID_TEMPLATE_TYPE 102 Wrong template type
SGFDX_ERROR_INVALID_TEMPLATE1 103 Error in decoding template 1
SGFDX_ERROR_INVALID_TEMPLATE2 104 Error in decoding template 2
SGFDX_ERROR_EXTRACT_FAIL 105 Extraction failed
SGFDX_ERROR_MATCH_FAIL 106 Matching failed
6.7. SGFDxConstant
• DEV_SN_LEN 15 // Device serial number length
2. To use Auto-On, the host application must implement the SGFingerPresentEvent interface. The
SGFingerPresentCallback() method must be implemented.
Example:
public class JSGDActivity extends Activity
implements View.OnClickListener, java.lang.Runnable, SGFingerPresentEvent {
…
…
private SGAutoOnEventNotifier autoOn;
private boolean mAutoOnEnabled;
private JSGFPLib sgfplib;
…
…
//This message handler is used to access local resources not
//accessible by SGFingerPresentCallback() because it is called by
//a separate thread.
public Handler fingerDetectedHandler = new Handler(){
// @Override
public void handleMessage(Message msg) {
//Handle the message
CaptureFingerPrint();
}
};
}
}