0% found this document useful (0 votes)
90 views193 pages

RealScan Basic SDK Reference Manual V1.8.7

The RealScanBasic SDK Reference Manual provides detailed information on the SDK's features, including device support, API specifications, and usage instructions. It includes a revision history, important notices regarding liability and usage, and a quick start guide for developers. The document outlines the structure of the SDK, including directories for documentation, libraries, and examples, as well as specific API functions for image acquisition and processing.

Uploaded by

abdelcaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views193 pages

RealScan Basic SDK Reference Manual V1.8.7

The RealScanBasic SDK Reference Manual provides detailed information on the SDK's features, including device support, API specifications, and usage instructions. It includes a revision history, important notices regarding liability and usage, and a quick start guide for developers. The document outlines the structure of the SDK, including directories for documentation, libraries, and examples, as well as specific API functions for image acquisition and processing.

Uploaded by

abdelcaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 193

RealScanBasic SDK

Reference Manual

Rev. 1.8.7

Copyright © 2020 by Suprema ID Inc.


Revision History

Rev No. Issued date Description


1.0 Feb. 2009 Initial Release.
1.0.1 Mar. 2009 Manual capture is supported.
1.0.2 Apr. 2009 Capture callback is supported.
1.1 May 2009 RealScan-D is incorporated.
1.2 Sep. 2009 Automatic calibration and contrast enhancements are added.
1.3 Jan. 2010 Segmentation and sequence checking are incorporated.
1.4 Jun. 2010 RealScan-F is incorporated.
1.45 Jan. 2011 Default settings are changed.
1.5 Dec. 2011 RealScan-G10is incorporated.
1.6 Mar. 2012 RealScan-G1 is incorporated.
1.7 Mar. 2014 RS_SDK_64.dll is provided to support windws 64 bit platform.
Some bugs realted to memory leak are fixed.
1.8 Oct. 2014 New capture callback function incorporated to support frame-
wise quality check. (advanced capture callback)
Pre-processing supportsan additional (balanced) mode.
Halo-processing mode added.
1.8.2 Apr. 2015 Capture / preview custom size is supported.
Segmentation custom size is supported.
Missing finger capture is supported.
1.8.3 May 2015 Capture direction setting is supported.
Sequence checking is supported.
Auto capture guide is supported (Refer to
RS_RegisterAdvPreviewCallback).
Auto/Manual contrast options are removed (obsolete).
RS_SegmentMask, RS_SegmentMissingFinger,
RS_SegmentImagesMissingFinger,
RS_SequenceCheckMissingFinger,
RS_Segment_HandDecision APIs are added.
1.8.5 Sept. 2015 RS_RegisterAdvCaptureDataCallback (for advenced capture
callback) API is added.
1.8.5 Feb. 2016 RS_SetParam, RS_GetParam (for preview type)

Copyright © 2020 by Suprema ID Inc. 2


1.8.5 Sept. 2016 When calling RS_InitDevice and capturing, enable to adjust
the dirty sensitivity.
RS_TakeImageDataSegmentWithSize
RS_FindTarget
RS_IsFinger
RS_IsCapturing
RS_FreeImageData
RS_RegisterFingerOnCallback
RS_GetImageQualityScore
RS_GetCurrentProcessedImage
RS_GetCurrentSynthesisImage APIs are added.
1.8.5 Jul. 2017 RS_EncodeWSQ
RS_DecodeWSQ APIs are added.
1.8.7 Sep. 2020 RS_GetLFDResult API is added.

Important Notice
Information in this document is provided in connection with Suprema products. No license, express
or implied, by estoppel or otherwise, to any intellectualproperty rights is granted by this document.
Except as provided in Suprema’s Terms and Conditions of Sale for such products, Suprema assumes
no liabilitywhatsoever, and Suprema disclaims any express or implied warranty, relating to sale
and/or use of Suprema products including liability or warranties relating tofitness for a particular
purpose, merchantability, or infringement of any patent, copyright or other intellectual property
right. Suprema products are notintended for use in medical, life saving, life sustaining applications,
or other applications in which the failure of the Supremaproduct could create a situation where
personal injury or death may occur.Should Buyer purchase or use Supremaproducts for any such
unintended or unauthorized application, Buyer shall indemnify and hold Supremaand its officers,
employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and
expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal
injury or death associated with such unintended or unauthorized use, even if such claim alleges that
Supremawas negligent regarding the design or manufacture of the part.
Supremareserves the right to make changes to specifications and product descriptions at any time
without notice to improve reliability, function, or design.
Designers must not rely on the absence or characteristics of any features or instructions marked
"reserved" or "undefined." Suprema reserves these forfuture definition and shall have no
responsibility whatsoever for conflicts or incompatibilities arising from future changes to them.
Contact your local Suprema sales office or your distributor to obtain the latest specifications and
before placing your product order.

Copyright © by Suprema Inc., 2015

*Third-party brands and names are the property of their respective owners.

Copyright © 2020 by Suprema ID Inc. 3


RealScan Basic SDK Reference Manual

Contents

1. Introduction ........................................................................ 9
1.1. Contents of the SDK .............................................................. 9
1.2. Usage ................................................................................. 9
1.2.1. Compilation ............................................................................... 9

1.2.2. Using the DLL ...........................................................................10

1.3. Supported Devices .............................................................. 11

2. QuickStart Guide ............................................................... 12


2.1. Image Acquisition Procedures ............................................... 12
2.1.1. Initialize the SDK and the Device ................................................13

2.1.2. Configure Capture Mode .............................................................13

2.1.3. Configure Preview Window .........................................................13

2.1.4. Capture Images ........................................................................14

2.2. Demo Project ..................................................................... 16

3. API Specification................................................................ 19
3.1. Return Codes ..................................................................... 19

3.2. Compatibility...................................................................... 23
3.3. Device API ......................................................................... 26
RS_InitSDK........................................................................................27

RS_InitDevice ....................................................................................28

RS_ExitDevice ....................................................................................29

RS_ExitAllDevices ...............................................................................30

RS_GetDeviceInfo ..............................................................................31

3.4. Capture API ....................................................................... 32


RS_SetCaptureMode ...........................................................................36

RS_GetCaptureMode ...........................................................................39

RS_SetCaptureModeWithDir .................................................................40

RS_GetCaptureModeWithDir.................................................................43

Copyright © 2020 by Suprema ID Inc. 4


RealScan Basic SDK Reference Manual
RS_SetManualCaptureMode .................................................................44

RS_GetManualCaptureMode .................................................................46

RS_SetMinimumFinger ........................................................................47

RS_GetMinimumFinger ........................................................................48

RS_SetRollFingerOption .......................................................................49

RS_GetRollFingerOption ......................................................................51

RS_GetImageSize ...............................................................................52

RS_StartCapture ................................................................................54

RS_AbortCapture ................................................................................56

RS_RegisterCaptureCallback ................................................................57

RS_RegisterCaptureDataCallback ..........................................................58

RS_RegisterAdvCaptureDataCallback ....................................................59

RS_RegisterPreviewCallback ................................................................61

RS_RegisterAdvPreviewCallback ...........................................................62

RS_TakeImage ...................................................................................64

RS_TakeImageData ............................................................................66

RS_TakeImageDataSegment ................................................................68

RS_TakeImageDataEx .........................................................................77

RS_TakeCurrentImage ........................................................................79

RS_TakeCurrentImageData ..................................................................81

RS_TakeCurrentImageDataSegment .....................................................83

RS_TakeCurrentImageDataSegmentWithSize .........................................86

RS_TakeCurrentImageEx .....................................................................89

RS_TakeCurrentImageDataEx ..............................................................91

RS_Segment ......................................................................................93

RS_SegmentMask ...............................................................................96

RS_Segment_HandDecision .................................................................99

RS_SegmentMissingFinger ................................................................. 101

RS_SegmentWithSize ........................................................................ 104

RS_Segment4 .................................................................................. 107

RS_Segment4WithSize ...................................................................... 111

RS_SegmentImages ......................................................................... 114


Copyright © 2020 by Suprema ID Inc. 5
RealScan Basic SDK Reference Manual
RS_SegmentImagesMissingFinger ...................................................... 115

RS_GetQualityScore .......................................................................... 116

RS_SequenceCheck .......................................................................... 117

RS_SequenceCheckMissingFinger ....................................................... 119

RS_Calibrate .................................................................................... 121

RS_SetAutomaticCalibrate ................................................................. 122

RS_GetAutomaticCalibrate ................................................................. 123

RS_SetAdvancedContrastEnhancement ............................................... 124

RS_GetAdvancedContrastEnhancement ............................................... 125

RS_SetPreProcessing ........................................................................ 126

RS_GetPreProcessing ........................................................................ 127

RS_SetHaloProcessing ....................................................................... 128

RS_GetHaloProcessing ...................................................................... 129

RS_SetPostProcessing ....................................................................... 130

RS_GetPostProcessing ....................................................................... 131

RS_SetPostProcessingEx .................................................................... 132

RS_GetPostProcessingEx ................................................................... 133

RS_SelfTest ..................................................................................... 134

RS_SetSegRotateOption .................................................................... 135

RS_SetLFDLevel ............................................................................... 136

RS_GetLFDLevel ............................................................................... 137

RS_GetLFDResult.............................................................................. 138

RS_SetParam ................................................................................... 140

RS_GetParam ................................................................................... 141

RS_FindTarget .................................................................................. 142

RS_IsFinger ..................................................................................... 144

RS_IsCapturing ................................................................................ 145

RS_RegisterFingerOnCallback ............................................................. 146

RS_GetImageQualityScore ................................................................. 147

RS_GetCurrentProcessedImage .......................................................... 149

RS_GetCurrentSynthesisImage .......................................................... 150

Copyright © 2020 by Suprema ID Inc. 6


RealScan Basic SDK Reference Manual
3.5. Preview API ..................................................................... 151
RS_SetViewWindow .......................................................................... 152

RS_StopViewWindow ........................................................................ 154

RS_AddOverlayText .......................................................................... 155

RS_AddOverlayCross......................................................................... 157

RS_AddOverlayLine........................................................................... 158

RS_AddOverlayQuadrangle ................................................................ 159

RS_ShowOverlay .............................................................................. 160

RS_ShowAllOverlay ........................................................................... 161

RS_RemoveOverlay .......................................................................... 162

RS_RemoveAllOverlay ....................................................................... 163

3.6. IO API............................................................................. 164


RS_SetActiveKey .............................................................................. 165

RS_GetKeyStatus ............................................................................. 167

RS_RegisterKeypadCallback ............................................................... 168

RS_Beep ......................................................................................... 169

RS_SetCaptureBeep .......................................................................... 170

RS_SetFingerLED.............................................................................. 171

RS_SetModeLED ............................................................................... 173

RS_SetStatusLED ............................................................................. 174

RS_PlayWav ..................................................................................... 175

RS_DisplayLCD................................................................................. 176

RS_MakeLCDData ............................................................................. 177

RS_ResetLCD ................................................................................... 178

RS_TurnOnBacklight_RSF .................................................................. 179

RS_ResetDevice ............................................................................... 180

RS_PowerCheck ............................................................................... 181

3.7. Miscellaneous API ............................................................. 182


RS_GetSDKInfo ................................................................................ 183

RS_GetErrString ............................................................................... 184

RS_GetErrStringChar ........................................................................ 185

Copyright © 2020 by Suprema ID Inc. 7


RealScan Basic SDK Reference Manual
RS_GetCaptureStatusString ............................................................... 186

RS_GetCaptureStatusStringChar ........................................................ 187

RS_FreeImageData ........................................................................... 188

RS_SaveBitmap ................................................................................ 189

RS_SaveBitmapMem ......................................................................... 190

RS_EncodeWSQ ............................................................................... 191

RS_DecodeWSQ ............................................................................... 192

Copyright © 2020 by Suprema ID Inc. 8


RealScan Basic SDK Reference Manual

1. Introduction

1.1. Contents of the SDK

Directory Sub Directory Contents


SDK Document - RealScanBasic SDK Reference Manual
- RealScan Basic SDK Revision Notes
- RealScan Basic SDK Migration Guide
Include - Header files
Lib - RS_SDK.dll: SDK DLL file
- RS_SDK.lib: import library to be linked with
C/C++ applications
- RS_SDK_64.dll: SDK DLL file for x64
- RS_SDK_64.lib: import library for x64
Example - Examples showing the usage of the SDK.
They are written in C++, C#, JAVA, Visual
Basic 6.0 and VB.NET

Table 1 Directory Structure of the SDK

1.2. Usage

1.2.1. Compilation
To call APIs defined in the SDK, RS_API.h should be included in the source files
and Include should be added to the include directories. To link user application
with the SDK, RS_SDK.libshould be added to library modules.

The following snippet shows a typical usage of the SDK.

#include “RS_API.h”
int main()
{
// First, initialize the SDK
int numOfDevice, deviceHandle;
intresult = RS_InitSDK(NULL, 0,&numOfDevice);

// Acquire the handle of the device


result = RS_InitDevice(0, &deviceHandle);

// Set a capture mode


result = RS_SetCaptureMode(deviceHandle, RS_CAPTURE_ROLL_FINGER, 0, true);

Copyright © 2020 by Suprema ID Inc. 9


RealScan Basic SDK Reference Manual
// Configure the preview window(optional)
// - IDC_VIEW_WINDOW is an example resource ID for the preview window.
// You have to change it according to your application.

RECT drawRect;
GetDlgItem(IDC_VIEW_WINDOW)->GetClientRect(&drawRect);
result = RS_SetViewWindow(deviceHandle, GetDlgItem(IDC_VIEW_WINDOW)-
>m_hWnd, drawRect, false);

// Capture images
unsigned char* imageData = NULL;
int imageWidth, imageHeight;
result = RS_TakeImageData(deviceHandle, 10000, &imageData, &imageWidth,
&imageHeight);

// Do something
// …

// Free the image pointer


if( imageData )
{
RS_FreeImageData( imageData );
}

// …
}

1.2.2. Using the DLL


To run applications compiled with the SDK, the RS_SDK.dllshould be in the system
directory or in the same directory of the application. The installer will install the
DLL to the system directory by default.

Copyright © 2020 by Suprema ID Inc. 10


RealScan Basic SDK Reference Manual

1.3. Supported Devices

RealScan SDK supports RealScan-10, RealScan-D,RealScan-F Series, RealScan-


G10 and RealScan-G1series scanners. The differences between both series are as
follows;

Device name RealScan-G1 RealScan-D RealScan-10 RealScan-F


RealScan-G10
Maximum Capture Area 500x500 900x900 1600x1500 2550x2550
Capture One rolling finger1 X O O O
Mode One flat finger O O O O
Two flat fingers X O O O
Four flat fingers X X O O
Palm X X X O
Input Switch N.A. 1 2 2(4-way
navi key &
Select key)
LED 1 Status 1 Status 4 Mode N.A.
10 Finger
1 Power
LCD N.A. N.A. N.A. 320 x 240

Misc. N.A. N.A. Play wave files Play wave


files
※N.A. : Not Available

1
RealScan-10F and RealScan-G10F models cannot capture rolling fingers.
Copyright © 2020 by Suprema ID Inc. 11
RealScan Basic SDK Reference Manual

2. QuickStart Guide
This chapter is for developers who want to get started quickly with RealScan
SDK.It shows how to do the most common tasks withRealScandevices.Only
snippets of C++ source codes will be listed below. For more detailed examples,
see the Example directory of the SDK.

2.1. Image Acquisition Procedures

There are three ways to capture fingerprint images as depicted in Figure 1 Capture
Process. You can select any method according to the requirements of your
application.

RS_InitSDK Initialize the SDK

Initialize the device and


RS_InitDevice
acquires its handle

Configures the capture


RS_SetCaptureMode
mode

Configures the preview


RS_SetViewWindow
window (optional)

RS_RegisterCapture
RS_StartCapture RS_TakeImageData
DataCallback

RS_TakeCurrent Capture
RS_StartCapture
No ImageData images

Callback is executed
after an image is
captured

Done?

Yes

RS_ExitDevice Release the device

Figure 1 Capture Process

Copyright © 2020 by Suprema ID Inc. 12


RealScan Basic SDK Reference Manual
2.1.1. Initialize the SDK and the Device
You have to initialize the SDK before calling other APIs. The RS_InitSDKfunction
will return the number of scanner devices attached to the PC. To send commands
to a specific device, you have to acquire its handle by RS_InitDevice.

// (1) Initialize the SDK


int numOfDevice;
int result = RS_InitSDK( NULL, 0, &numOfDevice );

// (2) Initialize the device


int deviceHandle;
result = RS_InitDevice( 0, &deviceHandle );

// (3) Get the device information


RSDeviceInfo deviceInfo;
result = RS_GetDeviceInfo( deviceHandle, &deviceInfo );

2.1.2. Configure Capture Mode


With RealScan-10 devices, you can capture four types of images – rolling single
finger, flat single finger, flat two fingers, and flat four fingers. RealScan-D devices
support three types of images except flat four fingers.For flat fingers, you can also
configure the sensitivity level for detecting images.

// Select rolling mode


// - turn on the mode LED
result = RS_SetCaptureMode( deviceHandle, RS_CAPTURE_ROLL_FINGER, 0,
true );

// Select four fingers mode


// - default sensitivity level
// - turn on the mode LED
result = RS_SetCaptureMode( deviceHandle,
RS_CAPTURE_FLAT_LEFT_FOUR_FINGERS, RS_AUTO_SENSITIVITY_NORMAL, true );

2.1.3. Configure Preview Window


A preview window may be configured before capturing images. It should be a valid
Win32 handle of HWND type. For MFC applications, every CWnd object has a
public member of m_hWnd. For non-MFC applications, you can get it using Win32
APIs such as FindWindow and EnumWindows.

// Configures a preview window in MFC application


RECT drawRect;
GetDlgItem( IDC_VIEW_WINDOW )->GetClientRect( &drawRect );

result = RS_SetViewWindow( deviceHandle, GetDlgItem( IDC_VIEW_WINDOW )-

Copyright © 2020 by Suprema ID Inc. 13


RealScan Basic SDK Reference Manual
>m_hWnd, drawRect, false );

2.1.4. Capture Images


You can capture images either automatically or manually. For automatic capture,
you can register a capture callback, which will be called after the capturing process
is complete. Or, you can call RS_TakeImageData, which will be blocked till it
gets the captured image. For both cases, the DLL will try to detect the fingerprint
image automatically. If it fails to acquire a stable image for the specified duration,
it will return a timeout error.

For manual capture, you have to call RS_TakeCurrentImageData, which will


capture the current fingerprint image on the scanner, regardless of its quality or
status.

The step-by-step instructions for the three methods are as follows;

1. Automatic capture using callback

// Callback function
void sampleCaptureCallback( int deviceHandle, int captureResult, unsigned
char* imageData, int imageWidth, int imageHeight )
{
// do something
}

// Register the callback


int result = RS_RegisterCaptureDataCallback( deviceHandle,
sampleCaptureCallback );

// Start automatic capture


result = RS_StartCapture( deviceHandle, true, 10000 );

// If the capture is finished within 10000msec, the callback function will


// be exectuted with the image data. Otherwise, a corrensponding error will
// be forwarded to the callback function.

2. Automatic capture using RS_TakeImageData

// You should not call RS_StartCapture.

// Capture image directly


unsigned char* imageData = NULL;
int imageWidth, imageHeight;
result = RS_TakeImageData( deviceHandle, 10000 /* timeout is 10 sec */,
&imageData, &iamgeWidth, &imageHeight );

Copyright © 2020 by Suprema ID Inc. 14


RealScan Basic SDK Reference Manual
if( result == RS_SUCCESS )
{
// do something with the image data
// …
}

if( imageData )
{
RS_FreeImageData( imageData );
}

3. Manual capture using RS_TakeCurrentImageData

// Start manual capture


result = RS_StartCapture( deviceHandle, false, 0 /* no timeout */ );

// Capture the current image on the scanner


unsigned char* imageData = NULL;
int imageWIdth, imageHeight;

result = RS_TakeCurrentImageData( devicehandle, 10000, &imageData,


&imageWidth, &imageHeight );

if( result == RS_SUCCESS )


{
// do something with the image data
// …
}

If( imageData )
{
RS_FreeImageData( imageData );
}

Copyright © 2020 by Suprema ID Inc. 15


RealScan Basic SDK Reference Manual

2.2. Demo Project

The SDK includes an example project written in C++. You can compile and test it
in Microsoft Visual Studio 2005 or later. Inspecting the source codes would be the
fastest way to be acquainted with the SDK.

You can test the demo application as follows;

(1) Press Init button to initialize the SDK. The connected devices will be
shown at the left combo box.

(2) Select a device and press Init Device button to initialize it.

(3) Select a capture mode. Then, the image size of the capture mode will be
displayed.

(4) Enable the preview window. Otherwise, the preview and captured images
will not be shown on the screen.

(5) Optionally, you can determine what to do after capturing an image.


Available optionsare as follows;

None The captured image will be shown in the


preview window. Default.
Save Save the image into a bmp file.
Enlarge Show the captured image in its original size.
Segment Segment the captured image and show the
information.
Segment & Save Segment the captured image and save the
segmented images in addition to the original
one.
By inspecting the source codes of these functions, you will be able to
understand how to handle the image data.

(6) Now, you can capture images as follows;

(6)-1 Automatic capture using callback

- Turn on the Auto checkbox.

- Press Start and place the fingers on the sensor.

- If the capture succeeds, the corresponding callback function will be

Copyright © 2020 by Suprema ID Inc. 16


RealScan Basic SDK Reference Manual
executed. Otherwise, an error message will be shown.

- You can also abort the capturing process by pressing Stop.

(6)-2 Automatic capture using RS_TakeImageData

- Press Take Auto and place the fingers on the sensor.

(6)-3 Manual capture using RS_TakeCurrentImageData

- Turn off the Auto checkbox.

- Press Start and place the fingers on the sensor.

- Press Take Manual.

(7) To test the switches and LEDs, select IO tab. You can control each I/O port
individually in the menu.

(8) To test the keypads and LCD, select IO tab. You can control each I/O port
individually in the menu.This is only for RealScan-F series.

Copyright © 2020 by Suprema ID Inc. 17


RealScan Basic SDK Reference Manual

Figure 2 Demo Program

Copyright © 2020 by Suprema ID Inc. 18


RealScan Basic SDK Reference Manual

3. API Specification

3.1. Return Codes

Every API in the SDK returns RS_SUCCESS when it succeeds. When it fails, it
returns a corresponding error code. For the API-specific meanings of these codes,
refer to Error Codes section of each API. You can also get a short description of
an error code by RS_GetErrString.

Code Value Description


Generic Errors
RS_SUCCESS 0 The function succeeds.

RS_ERR_NOT_SUPPORT -2 When LFD is not set in


RS_GetLFDResult.
RS_ERR_NO_DATA -5 When nNumofFinger is 0 in
RS_GetLFDResult.
RS_ERR_SDK_UNINITIALIZED -10 The SDK is not yet initialized.
RS_ERR_SDK_ALREADY_INITIALI -11 The SDK is already initialized.
ZED
RS_ERR_INVALID_PARAM -13 One of the parameters is invalid.
RS_ERR_MEM_FULL -14 Cannot allocate memory.
RS_ERR_NOT_YET_ SUPPORTED -15 The feature is not yet implemented.
RS_ERR_CANNOT_OPEN_FILE -16 Cannot open the specified file.
RS_ERR_CANNOT_READ_FILE -17 Cannot read the specified file.
RS_ERR_CANNOT_WRITE_FILE -18 Cannot write the specified file.
Device Related Errors
RS_ERR_NO_DEVICE -100 No RealScan device is attached.
RS_ERR_INVALID_DEVICE_INDEX -101 The device index is invalid.
RS_ERR_INVALID_HANDLE -102 The device handle is invalid.
RS_ERR_CANNOT_INIT_ DEVICE -103 Cannot initialize the device.
RS_ERR_UNSUPPORTED_DEVICE -104 The device is not RealScan-D or
RealScan-G10 in RS_GetLFDResult.
RS_ERR_CANNOT_GET_USB_ -105 Cannot connect to the device.
DEVICE
RS_ERR_DEVICE_ALREADY_ -106 The device is already initialized.

Copyright © 2020 by Suprema ID Inc. 19


RealScan Basic SDK Reference Manual

INITIALIZED
RS_ERR_CANNOT_OPEN_ DEVICE -107 Cannot open the device.
RS_ERR_CANNOT_WRITE_USB -108 Cannot write the data to the device.
RS_ERR_WRITE_USB_ TIMEOUT -109 Write timeout.
RS_ERR_CANNOT_READ_USB -110 Cannot read the data from the
device.
RS_ERR_READ_USB_TIMEOUT -111 Read timeout.
RS_ERR_INVALID_CAMERA_ -112 The camera mode is not supported.
MODE
RS_ERR_UNSUPPORTED_WAV_FO -113 The wave file is in unsupported
RMAT format.
RS_ERR_UNSUPPORTED_ -114 The command is not supported.
COMMAND
RS_ERR_SENSOR_DIRTY -115 The sensor is too dirty. This error will
be returned only if the automatic
calibration is on.
RS_ERR_FINGER_EXIST -116 Fingers are placed on the sensor
before capturing starts. This error
will be returned only if the automatic
calibration is on.
RS_ERR_TOO_STRONG_LIGHT -117 The external light is too strong to
capture images.
RS_ERR_INVALID_DEVICE_ -124 G1 only. Invalid G1 device is
CONNECTION attached.
Capture Related Errors
RS_ERR_INVALID_CAPTURE_ -200 The capture mode is not supported.
MODE
RS_ERR_CAPTURE_DISABLED -201 The capture mode is not enabled.
RS_ERR_CAPTURE_TIMEOUT -202 The capture process is not finished
within the specified timeout period.
RS_ERR_CAPTURE_ABORTED -203 The capture process is aborted.
RS_ERR_ROLL_PART_LIFT -206 A part of the finger is lifted.
RS_ERR_ROLL_DIRTY -207 The sensor surface is dirty, or more
than one finger is detected.
RS_ERR_ROLL_TOO_FAST -208 Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED -209 The rolling finger is shifted.
RS_ERR_ROLL_DRY -210 The finger could not be recognized

Copyright © 2020 by Suprema ID Inc. 20


RealScan Basic SDK Reference Manual

correctly because of bad image


contrast or smeared finger patterns
RS_ERR_ROLL_WRONG_DIR -211 The rolling does not confirm to the
specified direction.
RS_ERR_CAPTURE_IS_ RUNNING -212 The capture process is already
running.
RS_ERR_CAPTURE_IS_NOT_RUN -213 The capture process is not started
NING yet.
RS_ERR_ROLL_TOO_SHORT -214 Rolling time is too short.
RS_ERR_CANNOT_SEGMENT -215 Cannot segment the slap image.
RS_ERR_CANNOT_GET_QUALITY -216 Cannot get the quality score of the
image.
RS_ERR_SEGMENT_FEWER_FING -217 The captured slap image has fewer
ER fingers than expected.
RS_ERR_SEGMENT_WRONG_HAN -218 Left hand is captured for right hand,
D or vice versa.
RS_ERR_CANNOT_EXTRACT_TEM -219 Cannot extract template from the
PLATE image.
RS_ERR_NO_MATCH -220 Two images do not match.
RS_ERR_ROLL_NO_FINGER -221 No finger is placed on the sensor at
the moment of capturing.
RS_ERR_CAPTURE_FINGERS_MO -222 Capture failed by timeout because of
VING unstablestatus of fingers (maybe
moving)
RS_ERR_CAPTURE_NOTENOUGH_ -223 Capture failed by timeout because of
FINGERS not enough segment of fingerprints
for given capture mode
RS_ERR_CAPTURE_TOOSMALL_FI -224 Capture failed by timeout because of
NGERSAREA too small area of fingerprints for
given capture mode
RS_ERR_CAPTURE_TOOWEAK_PR -225 Capture failed by timeout because of
INT too weak contrast of fingerprints
RS_ERR_CAPTURE_TOOSTRONG_ -226 Capture failed by timeout because of
PRINT over-saturated black parts of
fingerprints (customized version
only)
RS_ERR_CAPTURE_TOOMUCH_PR -227 Capture failed by timeout because of

Copyright © 2020 by Suprema ID Inc. 21


RealScan Basic SDK Reference Manual

ESSURE too much black component of


fingerprints (maybe there are too
thick valies, customized version
only)
RS_ERR_CAPTURE_NOTENOUGH_ -228 Capture failed by timeout because of
FRAMES lack of stable frames of fingerprints.
RS_ERR_CAPTURE_WRONG_MINF -229 When a wrong finger is set.
INGER
RS_ERR_ABNORMAL_CAPTURE_S -230 When an image size that does not
IZE match the current capture mode is
input.
Preview Related Errors
RS_ERR_CANNOT_SET_VIEW_WI -300 Cannot configure the preview
NDOW window.
RS_ERR_NO_MORE_OVERLAY -301 No more overlayscan be added.
Maximum 16 overlays can be added
to the preview window.
RS_ERR_INVALID_OVERLAY_HAN -302 The overlay handle is invalid.
DLE
RS_ERR_CANNOT_SHOW_ -303 Cannot show overlay
OVERLAY
RS_ERR_CANNOT_SHOW_ -304 Cannot show preview
PREVIEW
IO Related Errors
RS_ERR_CANNOT_SET_ -400 Cannot set keypad callback
KEYPAD_CALLBACK
RS_ERR_CANNOT_MAKE_LCD_DA -401 The function cannot make LCD data
TA since the output buffer is not
prepared.
RS_ERR_INVALID_LCD_DATA -402 Making LCD data is succeeded, but
the output will not be proper to
display.

Table 2 Error Codes

Copyright © 2020 by Suprema ID Inc. 22


RealScan Basic SDK Reference Manual

3.2. Compatibility

Category Function RS-G1 RS-D RS-10 RS-F


RS-G10
Device RS_InitSDK O O O O
API RS_InitDevice O O O O
RS_ExitDevice O O O O
RS_ExitAllDevices O O O O
RS_GetDeviceInfo O O O O
Capture RS_SetCaptureMode 2
O O O O
API RS_GetCaptureMode O O O O
RS_SetCaptureModeWithDir X X O O
RS_GetCaptureModeWithDir X X O O
RS_SetManualCaptureMode O O O O
RS_GetManualCaptureMode O O O O
RS_SetMinimumFinger X O O O
RS_GetMinimumFinger X O O O
RS_SetRollFingerOption X O O O
RS_GetRollFingerOption X O O O
RS_GetImageSize O O O O
RS_StartCapture O O O O
RS_AbortCapture O O O O
RS_RegisterCaptureCallback O O O O
RS_RegisterCaptureDataCallback O O O O
RS_RegisterPreviewCallback O O O O
RS_RegisterAdvPreviewCallback O O O O
RS_TakeImage O O O O
RS_TakeImageData O O O O
RS_TakeImageDataSegment O O O O
RS_TakeImageDataSegmentWithSize O O O O
RS_TakeImageEx X X O X
RS_TakeImageDataEx X X O X
RS_TakeCurrentImage O O O O
RS_TakeCurrentImageData O O O O

2
The supported capture modes vary according to the scanner device. See
RS_SetCaptureMode for details.
Copyright © 2020 by Suprema ID Inc. 23
RealScan Basic SDK Reference Manual

RS_TakeCurrentImageDataSegment O O O O
RS_TakeCurrentImageDataSegmentWi O O O O
thSize
RS_TakeCurrentImageEx X X O X
RS_TakeCurrentImageDataEx X X O X
RS_Segment O O O O
RS_SegmentMask O O O O
RS_Segment_HandDecision O O O O
RS_SegmentMissingFinger O O O O
RS_SegmentWithSize O O O O
RS_Segment4 O O O O
RS_Segment4WithSize O O O O
RS_SegmentImages O O O O
RS_SegmentImagesMissingFinger O O O O
RS_SequenceCheck O O O O
RS_SequenceCheckMissingFinger O O O O
RS_GetQualityScore O O O O
RS_Calibrate O O O O
RS_SetAutomaticCalibrate O O O O
RS_GetAutomaticCalibrate O O O O
RS_SetAdvancedContrastEnhancement O O O O
RS_GetAdvancedContrastEnhancement O O O O
RS_SetPreProcessing O O O O
RS_GetPreProcessing O O O O
RS_SetPostProcessing O O O O
RS_GetPostProcessing O O O O
RS_SetPostProcessingEx O O O O
RS_GetPostProcessingEx O O O O
RS_SelfTest X O O O
RS_SetSegRotateOption O O O O
RS_SetLFDLevel O X X X
RS_GetLFDLevel O X X X

RS_FindTarget O O O O
RS_IsFinger O O O O
RS_IsCapturing O O O O
RS_RegisterFingerOnCallback O O O O

Copyright © 2020 by Suprema ID Inc. 24


RealScan Basic SDK Reference Manual

RS_GetImageQualityScore O O O O
RS_GetCurrentProcessedImage X X X O
RS_GetCurrentSynthesisImage X X X O
RS_SetViewWindow O O O O
RS_StopViewWindow O O O O
RS_AddOverlayText O O O O
RS_AddOverlayCross O O O O
Preview RS_AddOverlayLine O O O O
API RS_AddOverlayQuadrangle O O O O
RS_ShowOverlay O O O O
RS_ShowAllOverlay O O O O
RS_RemoveOverlay O O O O
RS_RemoveAllOverlay O O O O
RS_SetActiveKey X O O O
RS_GetKeyStatus X O O O
RS_RegisterKeypadCallback X O O O
RS_Beep X O O O
I/O API RS_SetCaptureBeep X O O O
RS_SetFingerLED X X O X
RS_SetModeLED X X O X
RS_SetStatusLED O O X X
RS_PlayWav X X O O
RS_DisplayLCD X X X O
RS_MakeLCDData X X X O
RS_ResetLCD X X X O
RS_GetSDKInfo O O O O
RS_GetErrString O O O O
RS_GetErrStringChar O O O O
RS_GetCaptureStatusString O O O O
Misc. API RS_GetCaptureStatusStringChar O O O O
RS_FreeImageData O O O O
RS_SaveBitmap O O O O
RS_SaveBitmapMem O O O O
RS_FreeImageData O O O O
RS_EncodeWSQ O O O O
RS_DecodeWSQ O O O O

Copyright © 2020 by Suprema ID Inc. 25


RealScan Basic SDK Reference Manual

3.3. Device API

You have to initialize the SDK to get the list of attached devices. To control a
device, you have to initialize it and acquire its handle. This handle will be used for
all subsequent function calls to the device.

⚫ RS_InitSDK: initializes the SDK.


⚫ RS_InitDevice: initializes a scanner device and acquires its handle.
⚫ RS_ExitDevice:closes a scanner device.
⚫ RS_ExitAllDevices: closes all initialized devices.
⚫ RS_GetDeviceInfo:gets the device information.

Copyright © 2020 by Suprema ID Inc. 26


RealScan Basic SDK Reference Manual

RS_InitSDK

Initializes the SDK. This function should be called before any other functions are
executed.In most cases, you do not have to call it more than once. However, if any
device is removed or added, you have to call it again after releasing all devices
byRS_ExitAllDevices.

RS_InitSDK( const char* configFileName, int option, int* numOfDevice )

Parameters
configFileName
Reserved for future use. It will be used for fine-tuning the device parameters
in the future revisions.
option
Reserved for future use.
numOfDevice
Number of devices connected to the PC.

Error Codes
RS_SUCCESS The SDK is successfully initialized and the
connected devices are found.
RS_ERR_CANNOT_GET_USB_DEVICE Cannot get device information from USB.
RS_ERR_SDK_ALREADY_INITIALIZED There remain unreleased devices.

Compatibility
RealScan-10,RealScan-D, RealScan-F Series,RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 27


RealScan Basic SDK Reference Manual

RS_InitDevice

Initializes a device and acquires its handle. The handle should be used for all
subsequent function calls to the device.

RS_InitDevice( int deviceIndex, int*deviceHandle )

Parameters
deviceIndex
Index of the device. It should be less than the numOfDevice returned by
RS_InitSDK.
deviceHandle
Device handle to be returned.

Error Codes
RS_SUCCESS The device is initialized successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_DEVICE_INDEX The device index is invalid.
RS_ERR_DEVICE_ALREADY_INITIALIZED The device is already initialized.
RS_ERR_CANNOT_OPEN_DEVICE Cannot connect to the device.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// (1) Initialize the SDK
int numOfDevice;
int result = RS_InitSDK( NULL, 0, &numOfDevice );

// (2) Initialize the device


int deviceHandle;
result = RS_InitDevice( 0, &deviceHandle );

Copyright © 2020 by Suprema ID Inc. 28


RealScan Basic SDK Reference Manual

RS_ExitDevice

Releases a device and its resources. After calling this function, you cannot access
the device with the handle any more.

RS_ExitDevice( int deviceHandle )

Parameters
deviceHandle
Handle of the device acquired by RS_InitDevice.

Error Codes
RS_SUCCESS The handle and resources are released
successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_IS_RUNNING A capture process is running. You have to stop
it first.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 29


RealScan Basic SDK Reference Manual

RS_ExitAllDevices

Releases all connected devices and their resources.

RS_ExitAllDevices()

Parameters
None

Error Codes
RS_SUCCESS The handles and resources are released
successfully.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 30


RealScan Basic SDK Reference Manual

RS_GetDeviceInfo

Gets the device information.

RS_GetDeviceInfo( int deviceHandle, RSDeviceInfo* deviceInfo )

Parameters
deviceHandle
Handle of the device.
deviceInfo
Pointer to the RSDeviceInfo structure, which is defined as follows;
struct RSDeviceInfo {
int deviceType;
char productName[16];
char deviceID[16];
char firmwareVersion[16];
char hardwareVersion[16];
int reserved[32];
};
Field Description
deviceType RS_DEVICE_REALSCAN_10
RS_DEVICE_REALSCAN_10F
RS_DEVICE_REALSCAN_D
RS_DEVICE_REALSCAN_DF
RS_DEVICE_REALSCAN_F
RS_DEVICE_REALSCAN_G10
productName Model name of the device.
deviceID ID of the device. Each device has a unique
device ID.
firmwareVersion Firmware version.
hardwareVersion Hardware version.

Error Codes
RS_SUCCESS The device information is read successfully.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 31


RealScan Basic SDK Reference Manual

3.4. Capture API

Both RealScan-10 and RealScan-G10 can capture four kinds of images – rolled
single finger, flat single finger, two flat fingers, and four flat fingers. RealScan-D
supports three modes except four flat fingers.To capture an image of a specific
type, you have to configure the mode first. And you can configure other options
such as automatic capture sensitivity and rolling profile. You can also register
callback functions which will be called when the specified event is occurred.

The SDK also provides several functions for enhancing the quality of the images.
These functions can be grouped into two categories – background noise reduction
and contrast enhancement. By making use of these functions carefully, you will be
able to get higher quality images from RealScan devices.

⚫ RS_SetCaptureMode: configures the capture mode.


⚫ RS_GetCaptureMode: retrieves the current capture mode.
⚫ RS_SetCaptureModeWithDir: configures the capture mode with direction.
⚫ RS_GetCaptureModeWithDir: retrieves the capture mode with direction.
⚫ RS_SetManualCaptureMode: configures the capture size.
⚫ RS_GetManualCaptureMode: retrieves the capture size.
⚫ RS_SetMinimumFinger: configures the minimum finger to capture the
image.
⚫ RS_GetMinimumFinger: retrieves the minimum finger to capture the
image.
⚫ RS_SetRollFingerOption: configures the rolloing direction and profile.
⚫ RS_GetRollFingerOption: retrieves the current rolling options.
⚫ RS_GetImageSize: gets the image size of the current capture mode.
⚫ RS_StartCapture: starts the capture process.
⚫ RS_AbortCapture: aborts the current capture process.
⚫ RS_RegisterCaptureCallback: registers a callback, which will be called
after the capture is complete.
⚫ RS_RegisterCaptureDataCallback: registers a callback, which will be
called after the capture is complete.
⚫ RS_RegisterPreviewCallback: registers a callback, which will be called
when a preview frame is captured.
⚫ RS_RegisterAdvPreviewCallback: registers a callback, which will be called
when a preview frame is captured and capture status value is gotten.
⚫ RS_TakeImage: captures an image of the selected type automatically.
⚫ RS_TakeImageData: captures an image of the selected type
Copyright © 2020 by Suprema ID Inc. 32
RealScan Basic SDK Reference Manual
automatically.
⚫ RS_TakeImageDataSegment: captures an image of the selected type
automatically and segments it into individual finger images.
⚫ RS_TakeImageDataSegmentWithSize: captures an image of the selected
type automatically and segments it into individual finger images with a
size of custom pixels.
⚫ RS_TakeImageEx: captures an image of the selected type automatically
with LED options.
⚫ RS_TakeImageDataEx: captures an image of the selected type
automatically with LED options.
⚫ RS_TakeCurrentImage: captures an image of the selected type manually.
⚫ RS_TakeCurrentImageData: captures an image of the selected type
manually.
⚫ RS_TakeCurrentImageDataSegment: captures an image of the selected
type manually and segments it into individual finger images.
⚫ RS_TakeCurrentImageDataSegmentWithSize: captures an image of the
selected type manually and segments it into individual finger images with
a size of custom pixels.
⚫ RS_TakeCurrentImageEx: captures an image of the selected type
manually with LED options.
⚫ RS_TakeCurrentImageDataEx: captures an image of the selected type
manually with LED options.
⚫ RS_Segment: segments a slap image into its finger components. The
quality of each finger is also returned
⚫ RS_SegmentMask: same as RS_Segment, but can specify lost fingers in 4
or 2 finger slap input.
⚫ RS_Segment_HandDecision: same as RS_Segment, but can get the hand
type (left or right) decision result from SDK.
⚫ RS_SegmentMissingFinger: same as RS_SegmentMask, but can give a
hint by filling the given structured missing finger information rather than
a mask.
⚫ RS_SegmentWithSize: segments a slap image into its finger components
with a size of custom pixels. The quality of each finger is also returned
⚫ RS_Segment4: segments a slap image into its finger components. The
quality of each finger is also returned. It is for C# implementation.
⚫ RS_Segment4WithSize: segments a slap image into its finger
components with a size of custom pixels. The quality of each finger is
also returned. It is for C# implementation.
Copyright © 2020 by Suprema ID Inc. 33
RealScan Basic SDK Reference Manual
⚫ RS_SegmentImages: RS_Segment which saves the result in bmp image
files.
⚫ RS_SegmentImagesMissingFinger: same as RS_SegmentImages but also
uses structured missing finger information.
⚫ RS_SequenceCheck: verifies the fingers are of the same set or not.
⚫ RS_SequenceCheckMissingFinger: same as RS_SequenceCheck, but uses
missing finger information.
⚫ RS_GetQualityScore: gets the NIST quality score of the image.
⚫ RS_Calibrate: re-calibrates the sensor for optimal results.
⚫ RS_SetAutomaticCalibrate: enables or disables the automatic calibration
option.
⚫ RS_GetAutomaticCalibrate: retrieves the current setting of the option.
⚫ RS_SetAdvancedContrastEnhancement: enables or disables the advanced
contrast enhancement.
⚫ RS_GetAdvancedContrastEnhancement: retrieves the current setting of
the option.
⚫ RS_SetPreProcessing: enables or disables the pre processing functions.
⚫ RS_GetPreProcessing: retrieves the current settings of the options.
⚫ RS_SetPostProcessing: enables or disables the post processing functions.
⚫ RS_GetPostProcessing: retrieves the current settings of the options.
⚫ RS_SetPostProcessingEx: enables or disables the post processing
functions. It can also specify the level of background noise removal.
⚫ RS_GetPostProcessingEx: retrieves the current settings of the options.
⚫ RS_SelfTest: Self-Test on conditions of scanner and its surface
⚫ RS_SetSegRotateOption: sets rotation option for segmentation
⚫ RS_SetLFDLevel: sets specific LFD level for RealScan-G1
⚫ RS_GetLFDLevel: gets current LFD level for RealScan-G1l
⚫ RS_FindTarget: Matching input image with targeted 5(maximum) images.
⚫ RS_ IsFinger: Retreivesexistence of fingerprint from input image.
⚫ RS_ IsCapturing: Check for device capturing status.
⚫ RS_ RegisterFingerOnCallback: Register a callback which will be called
when finger is on the device during capture. Please note that a crash
occurs when you free a image buffer passed by callback function.
⚫ RS_ GetImageQualityScore: Retreives quality score of fingerprint from
input image
⚫ RS_ GetCurrentProcessedImage: Get image used forroll-finger image
synthesis during the capture. Supporting ROLL_FINGER or
ROLL_FINGER_EX only.
Copyright © 2020 by Suprema ID Inc. 34
RealScan Basic SDK Reference Manual
⚫ RS_ GetCurrentSynthesisImage: Get synthesized image during capture.
ROLL_FINGER or ROLL_FINGER_EX as defined in RS_SetCaptureMode.

Copyright © 2020 by Suprema ID Inc. 35


RealScan Basic SDK Reference Manual

RS_SetCaptureMode

Configures the capture mode. This mode determines what types of images are
captured in the subsequent functions calls. In this version of SDK V1.7, an
extended roll mode is newly added, which makes a device capture a roll finger
image with the size of 800x800 pixels. The available modes for each model are as
follows;

Mode RS-G1 RS-D RS-10 RS-10F RS-F


RS-G10 RS-G10F
ROLL_FINGER X O O X O
ROLL_FINGER_EX X O O O O
FLAT_SINGLE_FINGER O O O O O
FLAT_TWO_FINGERS X O O O O
FLAT_LEFT_FOUR_FINGERS X X O O O
FLAT_RIGHT_FOUR_FINGERS X X O O O
FLAT_LEFT_PALM X X X X O
FLAT_RIGHT_PALM X X X X O
FLAT_SINGLE_FINGER_EX X X O O O
FLAT_TWO_FINGERS_EX X X O O O

RS_SetCaptureMode( int deviceHandle, int captureMode, int


captureOption, bool withModeLED )

Parameters
deviceHandle
Handle of the device.
captureMode
Available modes are as follows;
Mode Description
RS_CAPTURE_DISABLED Capture is disabled.
RS_CAPTURE_ROLL_FINGER Capture a rolling finger.
RS_CAPTURE_ROLL_FINGER_EX Extended capture mode for roll
finger
RS_CAPTURE_FLAT_SINGLE_FINGER Capture a flat finger.
RS_CAPTURE_FLAT_TWO_FINGERS Capture two flat fingers.
RS_CAPTURE_FLAT_LEFT_FOUR_ Capture four flat fingers of left
FINGERS hand except for the thumb.
Copyright © 2020 by Suprema ID Inc. 36
RealScan Basic SDK Reference Manual
RS_CAPTURE_FLAT_RIGHT_FOUR_ Capture four flat fingers of right
FINGERS hand except for the thumb.
RS_CAPTURE_FLAT_LEFT_PALM Capture a left palm.
RS_CAPTURE_FLAT_RIGHT_PALM Capture a right palm.
RS_CAPTURE_FLAT_SINGLE_FINGER Extended capture mode for
_EX single flat finger.
RS_CAPTURE_FLAT_TWO_FINGERS_ Extended capture mode for two
EX flat fingers.
captureOption
Sensitivity level for capturing flat fingers in automatic mode. This option is
ignored when capturing roll fingers.
Sensitivity Description
RS_AUTO_SENSITIVITY_NORMAL Default sensitivity.
RS_AUTO_SENSITIVITY_HIGH More sensitive for capturing
flat fingers.
RS_AUTO_SENSITIVITY_HIGHER Most sensitive for capturing
flat fingers.
RS_AUTO_SENSITIVITY_DISABLED Mode for fingers in abnormal
condition such as amputated,
bandaged, etc.
withModeLED
If true, turn on the corresponding mode LED at the indicator panel of the
scanner device. The mode LEDs can also be controlled independently by
RS_SetModeLED function. This option is for RealScan-10 only.

Error Codes
RS_SUCCESS The capture mode is set successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_CAPTURE_MODE The capture mode is not supported.
RS_ERR_INVALID_PARAM The capture option is invalid.
RS_ERR_CAPTURE_IS_RUNNING A capture process is running. You have to
stop it first.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
Copyright © 2020 by Suprema ID Inc. 37
RealScan Basic SDK Reference Manual
// Capture a roll fingerwith mode LED
int result = RS_SetCaptureMode( deviceHandle, RS_CAPTURE_ROLL_FINGER,
RS_AUTO_SENSITIVITY_NORMAL, true );

// Capture two fingers with mode LED.


result = RS_SetCaptureMode( deviceHandle, RS_CAPTURE_FLAT_TWO_FINGERS,
RS_AUTO_SENSITIVITY_NORMAL, true );

Copyright © 2020 by Suprema ID Inc. 38


RealScan Basic SDK Reference Manual

RS_GetCaptureMode

Retrieves the current capture mode.

RS_GetCaptureMode( int deviceHandle, int* captureMode, int*


captureOption )

Parameters
deviceHandle
Handle of the device.
captureMode
Capture mode to be returned.
captureOption
Capture option to be returned.

Error Codes
RS_SUCCESS The capture mode is read successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 39


RealScan Basic SDK Reference Manual

RS_SetCaptureModeWithDir

Configures the capture mode. This mode determines what types of images with
directionare captured in the subsequent functions calls. Since version of SDK V1.7,
an extended roll mode is newly added, which makes a device capture a roll finger
image with the size of 800x800 pixels. The available modes for each model are as
follows;

Mode RS-G1 RS-D RS-10 RS-10F RS-F


RS-G10 RS-G10F
ROLL_FINGER X X X X X
ROLL_FINGER_EX X X X X X
FLAT_SINGLE_FINGER X X O O O
FLAT_TWO_FINGERS X X O O O
FLAT_LEFT_FOUR_FINGERS X X O O O
FLAT_RIGHT_FOUR_FINGERS X X O O O
FLAT_LEFT_PALM X X X X O
FLAT_RIGHT_PALM X X X X O
FLAT_LEFT_SIDE_PALM X X X X O
FLAT_RIGHT_SIDE_PALM X X X X O
FLAT_LEFT_WRITERS_PALM X X X X O
FLAT_RIGHT_WRITERS_PALM X X X X O
FLAT_SINGLE_FINGER_EX X X O O O
FLAT_TWO_FINGERS_EX X X O O O

RS_SetCaptureModeWithDir( int deviceHandle, int captureMode, int


captureDirection, int captureOption, bool withModeLED )

Parameters
deviceHandle
Handle of the device.
captureMode
Available modes are as follows;
Mode Description
RS_CAPTURE_DISABLED Capture is disabled.
RS_CAPTURE_ROLL_FINGER Capture a rolling finger.
RS_CAPTURE_ROLL_FINGER_EX Extended capture mode for roll
finger
Copyright © 2020 by Suprema ID Inc. 40
RealScan Basic SDK Reference Manual
RS_CAPTURE_FLAT_SINGLE_FINGER Capture a flat finger.
RS_CAPTURE_FLAT_TWO_FINGERS Capture two flat fingers.
RS_CAPTURE_FLAT_LEFT_FOUR_ Capture four flat fingers of left
FINGERS hand except for the thumb.
RS_CAPTURE_FLAT_RIGHT_FOUR_ Capture four flat fingers of right
FINGERS hand except for the thumb.
RS_CAPTURE_FLAT_LEFT_PALM Capture a left palm.
RS_CAPTURE_FLAT_RIGHT_PALM Capture a right palm.
RS_CAPTURE_FLAT_SINGLE_FINGER Extended capture mode for
_EX single flat finger.
RS_CAPTURE_FLAT_TWO_FINGERS_ Extended capture mode for two
EX flat fingers.
captureDirection
Available modes are as follows;
Mode Description
RS_CAPTURE_DIRECTION_DEFAULT Capture direction is basic.
RS_CAPTURE_DIRECTION_LEFT Capture direction is left.
RS_CAPTURE_DIRECTION_RIGHT Capture direction is right.
captureOption
Sensitivity level for capturing flat fingers in automatic mode. This option is
ignored when capturing roll fingers.
Sensitivity Description
RS_AUTO_SENSITIVITY_NORMAL Default sensitivity.
RS_AUTO_SENSITIVITY_HIGH More sensitive for capturing
flat fingers.
RS_AUTO_SENSITIVITY_HIGHER Most sensitive for capturing
flat fingers.
RS_AUTO_SENSITIVITY_DISABLED Mode for fingers in abnormal
condition such as amputated,
bandaged, etc.
withModeLED
If true, turn on the corresponding mode LED at the indicator panel of the
scanner device. The mode LEDs can also be controlled independently by
RS_SetModeLED function. This option is for RealScan-10 only.

Error Codes
RS_SUCCESS The capture mode is set successfully.

Copyright © 2020 by Suprema ID Inc. 41


RealScan Basic SDK Reference Manual
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_CAPTURE_MODE The capture mode is not supported.
RS_ERR_INVALID_PARAM The capture option is invalid.
RS_ERR_CAPTURE_IS_RUNNING A capture process is running. You have to
stop it first.

Compatibility
RealScan-10, RealScan-G10 and RealScan-F

Example
// Capture a roll finger in left direction with mode LED
int result = RS_SetCaptureModeWithDir( deviceHandle, RS_CAPTURE_ROLL_FINGER,
RS_CAPTURE_DIRECTION_LEFT, RS_AUTO_SENSITIVITY_NORMAL, true );

// Capture two fingers in right direction with mode LED.


result = RS_SetCaptureModeWithDir( deviceHandle,
RS_CAPTURE_FLAT_TWO_FINGERS, RS_CAPTURE_DIRECTION_RIGHT,
RS_AUTO_SENSITIVITY_NORMAL, true );

Copyright © 2020 by Suprema ID Inc. 42


RealScan Basic SDK Reference Manual

RS_GetCaptureModeWithDir

Retrieves the current capture mode.

RS_GetCaptureMode( int deviceHandle, int* captureMode, int*


captureDirection, int* captureOption )

Parameters
deviceHandle
Handle of the device.
captureMode
Capture mode to be returned.
captureDirection
Capture direction to be returned.
captureOption
Capture option to be returned.

Error Codes
RS_SUCCESS The capture mode is read successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-G10 and RealScan-F

Copyright © 2020 by Suprema ID Inc. 43


RealScan Basic SDK Reference Manual

RS_SetManualCaptureMode

Configures the capture size. This mode determines what sizes of images are
captured in the subsequent functions calls. Since this version of SDK V1.8.2, this
mode is newly added, which makes a device capture the imagewith the size of
custom pixels. The range of width and height is minimum (200) and maximum
(10000).The available mode for each model is as follows;

Mode RS-G1 RS-D RS-10 RS-10F RS-F


RS-G10 RS-G10F
FLAT_MANUAL X O O O O

RS_SetManualCaptureMode( int deviceHandle, int imageX, int imageY, int


imageWidth, int imageHeight, int captureOption, bool isFlat)

Parameters
deviceHandle
Handle of the device.
captureMode
Available modes are as follows;
Mode Description
RS_CAPTURE_FLAT_MANUAL Capture whatever except for roll
image.
imageX
X point of captured image
imageY
Y point of captured image
imageWidth
Width of captured image
imageHeight
Height of captured image
captureOption
Sensitivity level for capturing flat fingers in automatic mode. This option is
ignored when capturing roll fingers.
Sensitivity Description
RS_AUTO_SENSITIVITY_NORMAL Default sensitivity.
RS_AUTO_SENSITIVITY_HIGH More sensitive for capturing
flat fingers.

Copyright © 2020 by Suprema ID Inc. 44


RealScan Basic SDK Reference Manual
RS_AUTO_SENSITIVITY_HIGHER Most sensitive for capturing
flat fingers.
RS_AUTO_SENSITIVITY_DISABLED Mode for fingers in abnormal
condition such as amputated,
bandaged, etc.
isFlat
If isFlat is true, capture mode is flat mode. Otherwise isFlat is false, capture
mode is not yet supported.

Error Codes
RS_SUCCESS The capture mode is set successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_CAPTURE_MODE The capture mode is not supported.
RS_ERR_INVALID_PARAM The capture option is invalid.
RS_ERR_CAPTURE_IS_RUNNING A capture process is running. You have to
stop it first.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series and RealScan-G10

Example
// Capture fingers with capture parameterof (0, 0, 500, 500).
int result = RS_SetManualCaptureMode( deviceHandle, 0, 0, 500, 500,
RS_AUTO_SENSITIVITY_NORMAL, true);

Copyright © 2020 by Suprema ID Inc. 45


RealScan Basic SDK Reference Manual

RS_GetManualCaptureMode

Retrieves the current capture mode.

RS_GetManualCaptureMode( int deviceHandle, int* imageX, int* imageY,


int* imageWidth, int* imageHeight, int* captureOption )

Parameters
deviceHandle
Handle of the device.
imageX
X point to be returned.
imageY
Y point to be returned.
imageWidth
Width to be returned.
imageHeight
Height to be returned.
captureOption
Capture option to be returned.

Error Codes
RS_SUCCESS The capture mode is read successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 46


RealScan Basic SDK Reference Manual

RS_SetMinimumFinger

Configures the minimum finger to capture the image.

RS_SetMinimumFinger( int deviceHandle, int minFingerCount )

Parameters
deviceHandle
Handle of the device.
minFingerCount
Capture option to capture minimum finger.

Error Codes
RS_SUCCESS The capture mode is set successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_CAPTURE_MODE The capture mode is not supported.
RS_ERR_WRONG_MIN_FINGER_COUNT The minimum finger is wrong.

Compatibility
RealScan-10, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 47


RealScan Basic SDK Reference Manual

RS_GetMinimumFinger

Retrieves the minimum finger to capture the image.

RS_GetMinimumFinger( int deviceHandle, int *minFingerCount )

Parameters
deviceHandle
Handle of the device.
minFingerCount
minimum finger to be returned.

Error Codes
RS_SUCCESS The capture mode is set successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_CAPTURE_MODE The capture mode is not supported.
RS_ERR_WRONG_MIN_FINGER_COUNT The minimum finger is wrong.

Compatibility
RealScan-10, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 48


RealScan Basic SDK Reference Manual

RS_SetRollFingerOption

Configures options for capturing rolling fingers.

RS_SetRollFingerOption( int deviceHandle, int rollDirection, int rollTime,


int rollProfile )

Parameters
deviceHandle
Handle of the device.
rollDirection
Specifies the direction of rolling.
Direction Description
RS_ROLL_DIR_L2R Left to right.
RS_ROLL_DIR_R2L Right to left.
RS_ROLL_DIR_AUTO Left-to-Right or Right-to-Left direction
isdetectable automatically. Default.
RS_ROLL_DIR_AUTO_M Middle-to-Right-to-Left or Middle-to-Left-to-
Right diection is detectable automatically.
rollTime
Roll synthesis timeout (milli seconds) for waiting following input sequence.
Lower value increases the sensitivity of checking end of roll input. Higher value
decreases the sensitivity of checking end of roll input. Available since v1.8.3.
rollProfile
Specifies the strictness of error-checking during the rolling process.
Profile Description
RS_ROLL_PROFILE_LOW Error-checking will be applied more
loosely.
RS_ROLL_PROFILE_NORMAL Default profile.
RS_ROLL_PROFILE_HIGH Error-checking will be applied more
strictly.

Error Codes
RS_SUCCESS The options are set successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_PARAM Any of the parameters are invalid.

Copyright © 2020 by Suprema ID Inc. 49


RealScan Basic SDK Reference Manual

Compatibility
RealScan-10, RealScan-D, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 50


RealScan Basic SDK Reference Manual

RS_GetRollFingerOption

Retrieves the options for capturing rolling fingers.

RS_GetRollFingerOption( int deviceHandle, int* rollDirection, int* rollTime,


int* rollProfile )

Parameters
deviceHandle
Handle of the device.
rollDirection
Rolling direction to be returned.
rollTime
Roll time to be returned.
rollProfile
Rolling profile to be returned.

Error Codes
RS_SUCCESS The options are read successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 51


RealScan Basic SDK Reference Manual

RS_GetImageSize

Retrieves the image size of the current capture mode. It varies according to the
capture mode as follows;

Mode Image Size (pixels)


RS_CAPTURE_ROLL_FINGER 800(W) x 750(H)
RS_CAPTURE_FLAT_SINGLE_FINGER 800(W) x 750(H)
500(W) x 500(H) (RS-G1)
RS_CAPTURE_FLAT_TWO_FINGERS 900(W) x 900(H)
RS_CAPTURE_FLAT_XXXX_FOUR_FINGERS 1600(W) x 1500(H)
RS_CAPTURE_FLAT_XXXX_PALM 2550(W) x 2550(H)
RS_ CAPTURE_FLAT_SINGLE_FINGER_EX 1600(W) x 1500(H)
RS_CAPTURE_FLAT_TWO_FINGERS_EX 1600(W) x 1500(H)

Figure 3 Capture Area

RS_GetImageSize( int deviceHandle, int* imageWidth, int* imageHeight )

Parameters
deviceHandle
Handle of the device.

Copyright © 2020 by Suprema ID Inc. 52


RealScan Basic SDK Reference Manual
imageWidth
Width of the image to be returned.
imageHeight
Height of the image to be returned.

Error Codes
RS_SUCCESS The image size is returned successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 53


RealScan Basic SDK Reference Manual

RS_StartCapture

You can capture images either manually or automatically. You can also select
synchronous or asynchronous APIs depending on your applications.
RS_StartCapture is used for capturing images asynchronously. It will return
immediately without waiting for the end of the capture.

The automatic capture process is as follows;


(1) Register a capture callback using RS_RegisterCaptureDataCallback.
(2) Call RS_StartCapture with autoCapturetrue.
(3) The registered function will be called when the capture succeeds or any
error occurs.

Or, you can capture images manually as follows;


(1) Call RS_StartCapture with autoCapture false.
(2) After placing fingers on the scanner, call RS_TakeCurrentImageData.

RS_StartCapture( int deviceHandle, bool autoCapture, int timeout )

Parameters
deviceHandle
Handle of the device.
autoCapture
Determines whether the image is captured automatically or manually.
timeout
Timeout period in milliseconds. If it is 0, the timeout period is infinite.

Error Codes
RS_SUCCESS Capture process is started successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_SENSOR_DIRTY The sensor surface is too dirty. See
RS_SetAutomaticCalibrate for details.
RS_ERR_FINGER_EXIST Fingers are placed on the sensor before
capturing starts. See
RS_SetAutomaticCalibrate for details.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.

Copyright © 2020 by Suprema ID Inc. 54


RealScan Basic SDK Reference Manual
RS_ERR_CAPTURE_IS_RUNNING A capture process is already running.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
See 2.1.4 Capture Images for examples.

Copyright © 2020 by Suprema ID Inc. 55


RealScan Basic SDK Reference Manual

RS_AbortCapture

Aborts the capture process started by RS_StartCapture.

RS_AbortCapture( int deviceHandle )

Parameters
deviceHandle
Handle of the device.

Error Codes
RS_SUCCESS Capture process is aborted successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_IS_NOT_RUNNING The capture process is not started yet.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 56


RealScan Basic SDK Reference Manual

RS_RegisterCaptureCallback

Registers a callback which will be called when the capture process is complete or
aborted. Please note that a crash occurs when you free a image buffer passed by
callback function.

RS_RegisterCaptureCallback( int deviceHandle, RSCaptureCallback


captureCallback )

Parameters
deviceHandle
Handle of the device.
captureCallback
RSCaptureCallbackis defined as follows;
typedef void (*RSCaptureCallback)( int deviceHandle, int errorCode,
CImage* image );
Argument Description
deviceHandle Handle of the device.
errorCode If capture succeeds, it will be RS_SUCCESS.
Otherwise, it will be the corresponding error
code.
image Pointer to the CImage object which has the
captured image. Note that, for rolling fingers,
it can return a CImage object even when the
return code is not RS_SUCCESS. This data
pointer will be expired right after the callback
function returns. DO NOT try to delete this
pointer or access in the other threads.

Error Codes
RS_SUCCESS The callback is registeredsuccessfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 57


RealScan Basic SDK Reference Manual

RS_RegisterCaptureDataCallback

Registers a callback which will be called when the capture process is complete or
aborted. The only differences between RS_RegisterCaptureCallback and
RS_RegisterCaptureDataCallback are the declarations of their callbacks. Please
note that a crash occurs when you free a image buffer passed by callback function.

RS_RegisterCaptureDataCallback( int deviceHandle,


RSRawCaptureCallback captureCallback )

Parameters
deviceHandle
Handle of the device.
captureCallback
RSRawCaptureCallbackis defined as follows;
typedef void (*RSRawCaptureCallback)( int deviceHandle, int errorCode,
unsigned char* imageData, int imageWidth, int imageHeight );
Argument Description
deviceHandle Handle of the device.
errorCode If capture succeeds, it will be RS_SUCCESS.
Otherwise, it will be the corresponding error code.
imageData Pointer to the byte array containing 8-bit gray
pixel data. Note that, for rolling fingers, it can
return pixel data even when the return code is not
RS_SUCCESS. This data pointer will be expired
right after the callback function returns. DO NOT
try to delete this pointer or access in the other
threads.
imageWidth Width of the captured image.
imageHeight Height of the captured image.

Error Codes
RS_SUCCESS The callback is registered successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 58


RealScan Basic SDK Reference Manual

RS_RegisterAdvCaptureDataCallback

Registers a callback which will be called when the capture process is complete or
aborted. This API is advanced version of RS_RegisterCaptureDataCallback.
Please note that a crash occurs when you free a image buffer passed by callback
function.

RS_RegisterAdvCaptureDataCallback( int deviceHandle,


RSAdvRawCaptureCallback captureCallback )

Parameters
deviceHandle
Handle of the device.
captureCallback
RSAdvRawCaptureCallbackis defined as follows;
typedef void (*RSRawCaptureCallback)( int deviceHandle, int errorCode,
RSFrameInfo *frameInfo );
Argument Description
deviceHandle Handle of the device.
errorCode If capture succeeds, it will be RS_SUCCESS.
Otherwise, it will be the corresponding error code.
frameInfo RSFrameInfo structure which contains image
buffer pointer with size and other quality
informations. Two data pointers (pImage,
pQuality) will be expired right after the callback
function returns. DO NOT try to delete these
pointers or access them in the other threads.

RSFrameInfostructure is defined as follows;


typedef struct tag_RSFrameInfo {
unsigned char* pImage; // finger print image pointer
unsigned char* pQualityMap; // quality map data pointer
intiWidth; // Pixel width of fingerprint and quality image data
intiHeight; // Pixel height of the same
intiNFIQ; // NFIQ metric of the same (1~5)
intiQuality; // Suprema finger print image quality (0~100)
} RSFrameInfo;

Copyright © 2020 by Suprema ID Inc. 59


RealScan Basic SDK Reference Manual
Error Codes
RS_SUCCESS The callback is registered successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 60


RealScan Basic SDK Reference Manual

RS_RegisterPreviewCallback

Registers a callback which will be called when a preview frame is captured. Please
note that a crash occurs when you free a image buffer passed by callback function.

RS_RegisterPreviewCallback( int deviceHandle, RSRawCaptureCallback


captureCallback )

Parameters
deviceHandle
Handle of the device.
captureCallback
Function pointer of preview callback. See RS_RegisterCaptureDataCallback
for details.

Error Codes
RS_SUCCESS The callback is registered successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 61


RealScan Basic SDK Reference Manual

RS_RegisterAdvPreviewCallback

Registers a callback called when a preview frame is captured, with the frame-wise
picture quality metric. Frame-wise picture quality metric refers to the automatic
capture decision. Image buffer passed by callback interface is managed by SDK.
Please note that a crash occurs when you free an image buffer passed by callback
function and this API is unsupported for specified direction capture mode (Left or
Right).

RS_RegisterAdvPreviewCallback( int deviceHandle,


RSAdvPreviewCallback captureCallback )

Parameters
deviceHandle
Handle of the device.
captureCallback
Function pointer of preview callback. See RS_RegisterCaptureDataCallback
for details.
RSAdvPreviewCallbackis defined as follows;
typedef void (*RSRawCaptureCallback)( int deviceHandle, int errorCode,
unsigned char* imageData, int imageWidth, int imageHeight, int quality, int
status );
Argument Description
deviceHandle Handle of the device.
errorCode If capture succeeds, it will be RS_SUCCESS.
Otherwise, it will be the corresponding error code.
imageData Pointer to the byte array containing 8-bit gray
pixel data. Note that, for rolling fingers, it can
return pixel data even when the return code is not
RS_SUCCESS. This data pointer will be expired
right after the callback function returns. DO NOT
try to delete this pointer or access in the other
threads.
imageWidth Width of the captured image.
imageHeight Height of the captured image.
quality Quality metric higher than 100 ignites auto-
capture
status Status code for capture guide.

Copyright © 2020 by Suprema ID Inc. 62


RealScan Basic SDK Reference Manual
Can be translated as a user-friendly status by
using RS_GetCaptureStatusString API.

Error Codes
RS_SUCCESS The callback is registered successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 63


RealScan Basic SDK Reference Manual

RS_TakeImage

Captures a fingerprint image of the specified type. The detection and capture of
the image are handledautomatically by the DLL. After calling this function, users
only have to place the required fingers on the sensor. For flat fingers, the DLL will
determine if the required fingers are placed on the sensor, and emit a beep sound
after detecting it. For roll fingers, the DLL will detect the start and the end of
rolling, and emit a beep sound for each occasion. If the capture succeeds, the
fingerprint image will be returned. Otherwise, a corresponding error code will be
returned.

RS_TakeImage( int deviceHandle, int timeout, CImage** image )

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not detected for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
image
Pointer of pointer to the captured image. Note that, for rolling fingers, it can
return a CImage object even when the return code is not RS_SUCCESS. As a
rule of thumb, you have to check the value of this pointer regardless of the
return code. And if it is not NULL, you have to delete it later. As for the
CImage class, refer to any MFC programming books or the MSDN site.

Error Codes
RS_SUCCESS An image is captured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_SENSOR_DIRTY The sensor surface is too dirty. See
RS_SetAutomaticCalibrate for details.
RS_ERR_FINGER_EXIST Fingers are placed on the sensor before capturing
starts. See RS_SetAutomaticCalibrate for
details.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the specified

Copyright © 2020 by Suprema ID Inc. 64


RealScan Basic SDK Reference Manual
timeout period.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than one
finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared finger
patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
CImage* capturedImage = NULL;

int result = RS_TakeImage( deviceHandle, 10000/* 10 sec */,


&capturedImage );

if( result == RS_SUCCESS )


{
// save the image
capturedImage->Save( “.\\capturedImage.bmp” );
}

// delete the object


if( capturedImage )
{
delete capturedImage;
}

Copyright © 2020 by Suprema ID Inc. 65


RealScan Basic SDK Reference Manual

RS_TakeImageData

Returns the captured image as a byte array, not a CImage object. Otherwise, its
operation is identical to that of RS_TakeImage.

RS_TakeImageData( int deviceHandle, int timeout, unsigned char**


imageData, int* imageWidth, int* imageHeight )

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not detected for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
imageData
Pointer of pointer to the pixel data of captured image. Note that, for rolling
fingers, it can return pixel data even when the return code is not RS_SUCCESS.
As a rule of thumb, you have to check the value of this pointer regardless of
the return code. And if it is not NULL, you have to free it by
RS_FreeImageData later.
imageWidth
Width of the captured image.
imageHeight
Height of the captured image.

Error Codes
RS_SUCCESS An image is captured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_SENSOR_DIRTY The sensor surface is too dirty. See
RS_SetAutomaticCalibrate for details.
RS_ERR_FINGER_EXIST Fingers are placed on the sensor before
capturing starts. See
RS_SetAutomaticCalibrate for details.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the specified
timeout period.

Copyright © 2020 by Suprema ID Inc. 66


RealScan Basic SDK Reference Manual
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than one
finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
unsigned char* imageData = NULL;
int imageWidth, imageHeight;

int result = RS_TakeImageData( deviceHandle, 10000/* 10 sec */, &imageData,


&imageWidth, &imageHeight );

if( result == RS_SUCCESS )


{
// do something ..

// release the memory


if( imageData )
{
RS_FreeImageData( imageData );
}

Copyright © 2020 by Suprema ID Inc. 67


RealScan Basic SDK Reference Manual

RS_TakeImageDataSegment

Same as RS_TakeImageData except that it segments the captured image into


individual fingers. It also returns the quality score of each finger according to NIST
standard.

RS_TakeImageDataSegment( int deviceHandle, int timeout, unsigned


char** imageData, int* imageWidth, int* imageHeight, int* captureResult,
int slapType, int* numOfFinger, RSSlapInfo** slapInfo, unsigned char***
fingerImageData, int** fingerImageWidth, int** fingerImageHeight )

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not detected for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
imageData
Pointer of pointer to the pixel data of captured image. Note that, for rolling
fingers, it can return pixel data even when the return code is not RS_SUCCESS.
As a rule of thumb, you have to check the value of this pointer regardless of
the return code. And if it is not NULL, you have to free it by
RS_FreeImageData later.
imageWidth
Width of the captured image.
imageHeight
Height of the captured image.
captureResult
Error code of the capturing process.
slapType
RS_SLAP_LEFT_FOUR Slap image of four fingers of left hand.
RS_SLAP_RIGHT_FOUR Slap image of four fingers of right hand.
RS_SLAP_FOUR_FINGER Slap image of four fingers.
RS_SLAP_TWO_THUMB Slap image of two thumbs.
RS_SLAP_TWO_FINGER Slap image of two fingers.
RS_SLAP_ONE_FINGER Slap image of one flat finger.
RS_SLAP_ONE_FINGER_ROLL Slap image of one rolled finger
numOfFinger
Copyright © 2020 by Suprema ID Inc. 68
RealScan Basic SDK Reference Manual
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Array of slap information, which are segmented from the original image. You
have to deallocate this pointer by RS_FreeImageData after using it.
RSSlapInfois defined as follows;
struct RSSlapInfo {
int fingerType; //
RSPoint fingerPosition[4]; // the position of the finger
// in the slap image
int imageQuality; // See RS_GetQualityScore for details
int rotation; // the rotation angle of the image. It specifies
// the clockwise rotation in degrees.
int reserved[3];
};

The fingerType will be one of the followings;


Finger Type Value
RS_FGP_UNKNOWN 0
RS_FGP_RIGHT_THUMB 1
RS_FGP_RIGHT_INDEX 2
RS_FGP_RIGHT_MIDDLE 3
RS_FGP_RIGHT_RING 4
RS_FGP_RIGHT_LITTLE 5
RS_FGP_LEFT_THUMB 6
RS_FGP_LEFT_INDEX 7
RS_FGP_LEFT_MIDDLE 8
RS_FGP_LEFT_RING 9
RS_FGP_LEFT_LITTLE 10
fingerImageData
The segmented images will be saved into memory buffers. These buffers are
allocated by the DLL and you have to free them using
RS_FreeImageDatalater.
fingerImageWidth
Array for storing the widths of the segmented images. You have to free it
using RS_FreeImageData later.
fingerImageHeight
Array for storing the heights of the segmented images. You have to free it
using RS_FreeImageData later.

Copyright © 2020 by Suprema ID Inc. 69


RealScan Basic SDK Reference Manual
Error Codes
RS_SUCCESS An image is captured and segmented
successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_SENSOR_DIRTY The sensor surface is too dirty. See
RS_SetAutomaticCalibrate for details.
RS_ERR_FINGER_EXIST Fingers are placed on the sensor before
capturing starts. See
RS_SetAutomaticCalibrate for details.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the specified
timeout period.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than one
finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.
RS_ERR_CANNOT_SEGMENT Cannot segment the captured image.

RS_ERR_CANNOT_GET_ Cannot get the quality score of the segmented


QUALITY images.

RS_ERR_SEGMENT_FEWER_ The captured image has fewer fingers than


FINGER expected.

RS_ERR_SEGMENT_WRONG_ Left hand is captured for right hand, or vice


HAND versa.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
See RS_Segment for an example.
Copyright © 2020 by Suprema ID Inc. 70
RealScan Basic SDK Reference Manual

RS_TakeImageDataSegmentWithSize

Same as RS_TakeImageDataexcept that, it segments the captured image as


custom sizedas user wants by individual fingers. It can crop to custome size or
expand with applying white background. It also returns the quality score of each
finger according to NIST standard.

RS_TakeImageDataSegmentWithSize( int deviceHandle, int timeout,


unsigned char** imageData, int* imageWidth, int* imageHeight, int*
captureResult, int slapType, int* numOfFinger, RSSlapInfo** slapInfo,
unsigned char*** pCropImageData,int nCropWidth, int nCropHeight)

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not detected for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
imageData
Pointer of pointer to the pixel data of captured image. Note that, for rolling
fingers, it can return pixel data even when the return code is not RS_SUCCESS.
As a rule of thumb, you have to check the value of this pointer regardless of
the return code. And if it is not NULL, you have to free it by
RS_FreeImageData later.
imageWidth
Width of the captured image.
imageHeight
Height of the captured image.
captureResult
Error code of the capturing process.
slapType
RS_SLAP_LEFT_FOUR Slap image of four fingers of left hand.
RS_SLAP_RIGHT_FOUR Slap image of four fingers of right hand.
RS_SLAP_FOUR_FINGER Slap image of four fingers.
RS_SLAP_TWO_THUMB Slap image of two thumbs.
RS_SLAP_TWO_FINGER Slap image of two fingers.
RS_SLAP_ONE_FINGER Slap image of one flat finger.

Copyright © 2020 by Suprema ID Inc. 71


RealScan Basic SDK Reference Manual
RS_SLAP_ONE_FINGER_ROLL Slap image of one rolled finger
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Array of slap information, which are segmented from the original image. You
have to deallocate this pointer by RS_FreeImageData after using it.
RSSlapInfois defined as follows;
struct RSSlapInfo {
int fingerType; //
RSPoint fingerPosition[4]; // the position of the finger
// in the slap image
int imageQuality; // See RS_GetQualityScore for details
int rotation; // the rotation angle of the image. It specifies
// the clockwise rotation in degrees.
int reserved[3];
};

The fingerType will be one of the followings;


Finger Type Value
RS_FGP_UNKNOWN 0
RS_FGP_RIGHT_THUMB 1
RS_FGP_RIGHT_INDEX 2
RS_FGP_RIGHT_MIDDLE 3
RS_FGP_RIGHT_RING 4
RS_FGP_RIGHT_LITTLE 5
RS_FGP_LEFT_THUMB 6
RS_FGP_LEFT_INDEX 7
RS_FGP_LEFT_MIDDLE 8
RS_FGP_LEFT_RING 9
RS_FGP_LEFT_LITTLE 10
pCropImageData
The segmented images will be saved into memory buffers. The size of buffer is
nCropWidth x nCropHeight x numOfFinger.These buffers are allocated by the
DLL and later you have to free them by using RS_FreeImageData.(Refer to
the example)
nCropWidth
Width of segmented image (pixel).
nCropHeight
Height of segmented image (pixel).

Copyright © 2020 by Suprema ID Inc. 72


RealScan Basic SDK Reference Manual
Error Codes
RS_SUCCESS An image is captured and segmented
successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_SENSOR_DIRTY The sensor surface is too dirty. See
RS_SetAutomaticCalibrate for details.
RS_ERR_FINGER_EXIST Fingers are placed on the sensor before
capturing starts. See
RS_SetAutomaticCalibrate for details.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the specified
timeout period.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than one
finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.
RS_ERR_CANNOT_SEGMENT Cannot segment the captured image.

RS_ERR_CANNOT_GET_ Cannot get the quality score of the segmented


QUALITY images.

RS_ERR_SEGMENT_FEWER_ The captured image has fewer fingers than


FINGER expected.

RS_ERR_SEGMENT_WRONG_ Left hand is captured for right hand, or vice


HAND versa.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// device handle : int nDeviceHandle
Copyright © 2020 by Suprema ID Inc. 73
RealScan Basic SDK Reference Manual
// slap type : int slapType
int captureRet;
unsigned char *pImageData;
int nImageWidth, nImageHeight;
int numOfFinger = 0;
RSSlapInfo* slapInfo;
unsigned char** fingerImageData = NULL;
int widthCrop = 500, heightCrop = 500;

nResult = RS_TakeImageDataSegmentWithSize(
nDeviceHandle, 20000,
&pImageData, &nImageWidth, &nImageHeight,
&captureRet, slapType, &numOfFinger, &slapInfo,
&fingerImageData, widthCrop, heightCrop);

for(int i=0; i<numOfFinger; i++)


{
char segFileName[512];
sprintf(segFileName, "FP_Seg(%02d).bmp", slapInfo[i].fingerType);
RS_SaveBitmap( fingerImageData[i], widthCrop, heightCrop, segFileName);
RS_FreeImageData( fingerImageData[i] );
}
if(fingerImageData) RS_FreeImageData( fingerImageData );
if(pImageData) RS_FreeImageData( pImageData );
if(slapInfo) RS_FreeImageData( slapInfo );

Copyright © 2020 by Suprema ID Inc. 74


RealScan Basic SDK Reference Manual

RS_TakeImageEx

Both RealScan-10 and RealScan-G10have10 fingerprint LED indicators. By


specifying fingerprint index, you can turn on the LEDs of required fingers. At first,
the color will be yellow. If the capture succeeds, the color will turn into green.
Otherwise, it will be changed to red. Other options are identical to those of
RS_TakeImage.

RS_TakeImageEx( int deviceHandle, int timeout, int fingerprintIndex,


bool withLED, CImage** image )

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not detected for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
fingerprintIndex
Specifies the fingers to be captured. See RS_SetFingerLED for available
options.
withLED
If true, turn on the LEDs of fingers specified by fingerprintIndex.
image
Pointer of pointer to the captured image. Note that, for rolling fingers, it can
return a CImage object even when the return code is not RS_SUCCESS. As a
rule of thumb, you have to check the value of this pointer regardless of the
return code. And if it is not NULL, you have to delete it later. As for the
CImage class, refer to any MFC programming books or the MSDN site.

Error Codes
RS_SUCCESS An image is captured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_SENSOR_DIRTY The sensor surface is too dirty. See
RS_SetAutomaticCalibrate for details.
RS_ERR_FINGER_EXIST Fingers are placed on the sensor before
capturing starts. See

Copyright © 2020 by Suprema ID Inc. 75


RealScan Basic SDK Reference Manual
RS_SetAutomaticCalibrate for details.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the
specified timeout period.
RS_ERR_INVALID_PARAM The fingerprintIndex is invalid.
RS_ERR_UNSUPPORTED_COMMAND RealScan-D does not support this command.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than
one finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.

Compatibility
RealScan-10 and RealScan-G10

Example
CImage* capturedImage = NULL;

// turn on the LED of right index finger


int result = RS_TakeImageEx( deviceHandle, 10000/* 10 sec */,
RS_FINGER_RIGHT_INDEX, true, &capturedImage );

if( result == RS_SUCCESS )


{
// save the image
capturedImage->Save( “.\\capturedImage.bmp” );
}

// delete the object


if( capturedImage )
{
delete capturedImage;
}

Copyright © 2020 by Suprema ID Inc. 76


RealScan Basic SDK Reference Manual

RS_TakeImageDataEx

Same as RS_TakeImageEx except that it returns an array of gray pixel data, not
a CImage object.

RS_TakeImageDataEx( int deviceHandle, int timeout, int fingerprintIndex,


bool withLED, unsigned char** imageData, int* imageWidth, int*
imageHeight)

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not detected for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
fingerprintIndex
Specifies the fingers to be captured. See RS_SetFingerLED for available
options.
withLED
If true, turn on the LEDs of fingers specified by fingerprintIndex.
imageData
Pointer of pointer to the pixel data of captured image. Note that, for rolling
fingers, it can return pixel data even when the return code is not RS_SUCCESS.
As a rule of thumb, you have to check the value of this pointer regardless of
the return code. And if it is not NULL, you have to free it by
RS_FreeImageData later.
imageWidth
Width of the captured image.
imageHeight
Height of the captured image.

Error Codes
RS_SUCCESS An image is captured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_SENSOR_DIRTY The sensor surface is too dirty. See
RS_SetAutomaticCalibrate for details.

Copyright © 2020 by Suprema ID Inc. 77


RealScan Basic SDK Reference Manual
RS_ERR_FINGER_EXIST Fingers are placed on the sensor before
capturing starts. See
RS_SetAutomaticCalibrate for details.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the
specified timeout period.
RS_ERR_INVALID_PARAM The fingerprintIndex is invalid.
RS_ERR_UNSUPPORTED_COMMAND RealScan-D does not support this command.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than
one finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.

Compatibility
RealScan-10 and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 78


RealScan Basic SDK Reference Manual

RS_TakeCurrentImage

For some cases, you have to capture images manually. See RS_StartCapture for
setting up the manual capture. If you call RS_TakeCurrentImage for flat fingers,
it captures the image on the sensor without any check. Therefore, you have to
place fingers on the sensor before calling this function. For roll fingers, it starts
capturing without trying to detect the start of rolling.

RS_TakeCurrentImage( int deviceHandle, int timeout, CImage** image )

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not captured for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
image
Pointer of pointer to the captured image. Note that, for rolling fingers, it can
return a CImage object even when the return code is not RS_SUCCESS. As a
rule of thumb, you have to check the value of this pointer regardless of the
return code. And if it is not NULL, you have to delete it later. As for the
CImage class, refer to any MFC programming books or the MSDN site.

Error Codes
RS_SUCCESS An image is captured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the specified
timeout period.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than one
finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared

Copyright © 2020 by Suprema ID Inc. 79


RealScan Basic SDK Reference Manual
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 80


RealScan Basic SDK Reference Manual

RS_TakeCurrentImageData

Same as RS_TakeCurrentImage except that it returns an array of gray pixel


data, not a CImage object.

RS_TakeCurrentImageData( int deviceHandle, int timeout, unsigned


char** imageData, int* imageWidth, int* imageHeight )

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not captured for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
imageData
Pointer of pointer to the pixel data of captured image. Note that, for rolling
fingers, it can return pixel data even when the return code is not RS_SUCCESS.
As a rule of thumb, you have to check the value of this pointer regardless of
the return code. And if it is not NULL, you have to free it by
RS_FreeImageData later.
imageWidth
Width of the captured image.
imageHeight
Height of the captured image.

Error Codes
RS_SUCCESS An image is captured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the specified
timeout period.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than one
finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.

Copyright © 2020 by Suprema ID Inc. 81


RealScan Basic SDK Reference Manual
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 82


RealScan Basic SDK Reference Manual

RS_TakeCurrentImageDataSegment

Same as RS_TakeCurrentImageData except that it segments the captured


image into individual fingers. It also returns the quality score of each finger
according to NIST standard.

RS_TakeCurrentImageDataSegment( int deviceHandle, int timeout,


unsigned char** imageData, int* imageWidth, int* imageHeight, int*
captureResult, int slapType, int* numOfFinger, RSSlapInfo** slapInfo,
unsigned char*** fingerImageData, int** fingerImageWidth, int**
fingerImageHeight )

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not captured for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
imageData
Pointer of pointer to the pixel data of captured image. Note that, for rolling
fingers, it can return pixel data even when the return code is not RS_SUCCESS.
As a rule of thumb, you have to check the value of this pointer regardless of
the return code. And if it is not NULL, you have to free it by
RS_FreeImageData later.
imageWidth
Width of the captured image.
imageHeight
Height of the captured image.
captureResult
Error code of the capturing process.
slapType
RS_SLAP_LEFT_FOUR Slap image of four fingers of left hand.
RS_SLAP_RIGHT_FOUR Slap image of four fingers of right hand.
RS_SLAP_FOUR_FINGER Slap image of four fingers.
RS_SLAP_TWO_THUMB Slap image of two thumbs.
RS_SLAP_TWO_FINGER Slap image of two fingers.
RS_SLAP_ONE_FINGER Slap image of one flat finger.

Copyright © 2020 by Suprema ID Inc. 83


RealScan Basic SDK Reference Manual
RS_SLAP_ONE_FINGER_ROLL Slap image of one rolled finger
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Array of slap information, which are segmented from the original image. You
have to deallocate this pointer by RS_FreeImageData after using it.
RSSlapInfois defined as follows;
struct RSSlapInfo {
int fingerType; //
RSPoint fingerPosition[4]; // the position of the finger
// in the slap image
int imageQuality; // See RS_GetQualityScore for details
int rotation; // the rotation angle of the image. It specifies
// the clockwise rotation in degrees.
int reserved[3];
};
The fingerType will be one of the followings;
Finger Type Value
RS_FGP_UNKNOWN 0
RS_FGP_RIGHT_THUMB 1
RS_FGP_RIGHT_INDEX 2
RS_FGP_RIGHT_MIDDLE 3
RS_FGP_RIGHT_RING 4
RS_FGP_RIGHT_LITTLE 5
RS_FGP_LEFT_THUMB 6
RS_FGP_LEFT_INDEX 7
RS_FGP_LEFT_MIDDLE 8
RS_FGP_LEFT_RING 9
RS_FGP_LEFT_LITTLE 10
fingerImageData
The segmented images will be saved into memory buffers. These buffers are
allocated by the DLL and you have to free them using
RS_FreeImageDatalater.
fingerImageWidth
Array for storing the widths of the segmented images. You have to free it
using RS_FreeImageData later.
fingerImageHeight
Array for storing the heights of the segmented images. You have to free it
using RS_FreeImageData later.

Copyright © 2020 by Suprema ID Inc. 84


RealScan Basic SDK Reference Manual

Error Codes
RS_SUCCESS An image is captured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the
specified timeout period.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than
one finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.
RS_ERR_CANNOT_SEGMENT Cannot segment the captured image.
RS_ERR_CANNOT_GET_QUALITY Cannot get the quality score of the
segmented images.
RS_ERR_SEGMENT_FEWER_FINGER The captured image has fewer fingers than
expected.
RS_ERR_SEGMENT_WRONG_HAND Left hand is captured for right hand, or vice
versa.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
See RS_Segment for an example.

Copyright © 2020 by Suprema ID Inc. 85


RealScan Basic SDK Reference Manual

RS_TakeCurrentImageDataSegmentWithSize

Same as RS_TakeCurrentImageData except that it segments the captured


image of a custom size user wants into individual fingers. It also returns the
quality score of each finger according to NIST standard.

RS_TakeCurrentImageDataSegmentWithSize( int deviceHandle, int


timeout, unsigned char** imageData, int* imageWidth, int* imageHeight,
int* captureResult, int slapType, int* numOfFinger, RSSlapInfo** slapInfo,
unsigned char*** pCropImageData, int nCropWidth, int nCropHeight )

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not captured for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
imageData
Pointer of pointer to the pixel data of captured image. Note that, for rolling
fingers, it can return pixel data even when the return code is not RS_SUCCESS.
As a rule of thumb, you have to check the value of this pointer regardless of
the return code. And if it is not NULL, you have to free it by
RS_FreeImageData later.
imageWidth
Width of the captured image.
imageHeight
Height of the captured image.
captureResult
Error code of the capturing process.
slapType
RS_SLAP_LEFT_FOUR Slap image of four fingers of left hand.
RS_SLAP_RIGHT_FOUR Slap image of four fingers of right hand.
RS_SLAP_FOUR_FINGER Slap image of four fingers.
RS_SLAP_TWO_THUMB Slap image of two thumbs.
RS_SLAP_TWO_FINGER Slap image of two fingers.
RS_SLAP_ONE_FINGER Slap image of one flat finger.
RS_SLAP_ONE_FINGER_ROLL Slap image of one rolled finger
numOfFinger
Copyright © 2020 by Suprema ID Inc. 86
RealScan Basic SDK Reference Manual
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Array of slap information, which are segmented from the original image. You
have to deallocate this pointer by RS_FreeImageData after using it.
RSSlapInfois defined as follows;
struct RSSlapInfo {
int fingerType; //
RSPoint fingerPosition[4]; // the position of the finger
// in the slap image
int imageQuality; // See RS_GetQualityScore for details
int rotation; // the rotation angle of the image. It specifies
// the clockwise rotation in degrees.
int reserved[3];
};
The fingerType will be one of the followings;
Finger Type Value
RS_FGP_UNKNOWN 0
RS_FGP_RIGHT_THUMB 1
RS_FGP_RIGHT_INDEX 2
RS_FGP_RIGHT_MIDDLE 3
RS_FGP_RIGHT_RING 4
RS_FGP_RIGHT_LITTLE 5
RS_FGP_LEFT_THUMB 6
RS_FGP_LEFT_INDEX 7
RS_FGP_LEFT_MIDDLE 8
RS_FGP_LEFT_RING 9
RS_FGP_LEFT_LITTLE 10
pCropImageData
The segmented images of a custom size user wantswill be saved into memory
buffers. These buffers are allocated by the DLL and you have to free them
using RS_FreeImageDatalater.
nCropWidth
The width of the segmented images user wants.
nCropHeight
The height of the segmented images user wants.

Error Codes
RS_SUCCESS An image is captured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.

Copyright © 2020 by Suprema ID Inc. 87


RealScan Basic SDK Reference Manual
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the
specified timeout period.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than
one finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.
RS_ERR_CANNOT_SEGMENT Cannot segment the captured image.
RS_ERR_CANNOT_GET_QUALITY Cannot get the quality score of the
segmented images.
RS_ERR_SEGMENT_FEWER_FINGER The captured image has fewer fingers than
expected.
RS_ERR_SEGMENT_WRONG_HAND Left hand is captured for right hand, or vice
versa.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
See RS_Segment for an example.

Copyright © 2020 by Suprema ID Inc. 88


RealScan Basic SDK Reference Manual

RS_TakeCurrentImageEx

Both RealScan-10 and RealScan-G10 have 10 fingerprint LED indicators. By


specifying fingerprint index, you can turn on the LEDs of required fingers. At first,
the color will be yellow. If the capture succeeds, the color will turn into green.
Otherwise, it will be changed to red. Other options are identical to those of
RS_TakeCurrentImage.

RS_TakeCurrentImageEx( int deviceHandle, int timeout, int


fingerprintIndex, bool withLED, CImage** image )

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not detected for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
fingerprintIndex
Specifies the fingers to be captured. See RS_SetFingerLED for available
options.
withLED
If true, turn on the LEDs of fingers specified by fingerprintIndex.
image
Pointer of pointer to the captured image. Note that, for rolling fingers, it can
return a CImage object even when the return code is not RS_SUCCESS. As a
rule of thumb, you have to check the value of this pointer regardless of the
return code. And if it is not NULL, you have to delete it later. As for the
CImage class, refer to any MFC programming books or the MSDN site.

Error Codes
RS_SUCCESS An image is captured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the
specified timeout period.
RS_ERR_INVALID_PARAM The fingerprintIndex is invalid.

Copyright © 2020 by Suprema ID Inc. 89


RealScan Basic SDK Reference Manual
RS_ERR_UNSUPPORTED_COMMAND RealScan-D does not support this command.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than
one finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.

Compatibility
RealScan-10 and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 90


RealScan Basic SDK Reference Manual

RS_TakeCurrentImageDataEx

Same as RS_TakeCurrentImageEx except that it returns an array of gray pixel


data, not a CImage object.

RS_TakeCurrentImageDataEx( int deviceHandle, int timeout, int


fingerprintIndex, bool withLED, unsigned char** imageData, int*
imageWidth, int* imageHeight )

Parameters
deviceHandle
Handle of the device.
timeout
Timeout period in milliseconds. If the selected image is not detected for the
duration, RS_ERR_CAPTURE_TIMEOUT will be returned.
fingerprintIndex
Specifies the fingers to be captured. See RS_SetFingerLED for available
options.
withLED
If true, turn on the LEDs of fingers specified by fingerprintIndex.
imageData
Pointer of pointer to the pixel data of captured image. Note that, for rolling
fingers, it can return pixel data even when the return code is not RS_SUCCESS.
As a rule of thumb, you have to check the value of this pointer regardless of
the return code. And if it is not NULL, you have to free it by
RS_FreeImageData later.
imageWidth
Width of the captured image.
imageHeight
Height of the captured image.

Error Codes
RS_SUCCESS An image is captured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_CAPTURE_TIMEOUT Cannot capture an image within the
specified timeout period.

Copyright © 2020 by Suprema ID Inc. 91


RealScan Basic SDK Reference Manual
RS_ERR_INVALID_PARAM The fingerprintIndex is invalid.
RS_ERR_UNSUPPORTED_COMMAND RealScan-D does not support this command.
RS_ERR_ROLL_PART_LIFT A part of the rolling finger is lifted.
RS_ERR_ROLL_DIRTY The sensor surface is dirty, or more than
one finger is detected.
RS_ERR_ROLL_TOO_FAST Rolling speed is too fast.
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.
RS_ERR_ROLL_DRY The finger could not be recognized correctly
because of bad image contrast or smeared
finger patterns
RS_ERR_ROLL_WRONG_DIR The rolling does not confirm to the specified
direction.
RS_ERR_ROLL_TOO_SHORT Rolling time is too short.

Compatibility
RealScan-10 and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 92


RealScan Basic SDK Reference Manual

RS_Segment

Segments a 4-finger or 2-finger slap image into its finger components. It also
returns the quality score of each finger according to NIST standard. The
segmented images are stored into separate memory buffers.

RS_Segment( unsigned char* imageData, int imageWidth, int


imageHeight, int slapType, int* numOfFinger, RSSlapInfo** slapInfo,
unsigned char*** fingerImageData, int** fingerImageWidth, int**
fingerImageHeight )

Parameters
imageData
Slap image data in memory.
imageWidth
Width of the slap image.
imageHeight
Height of the slap image.
slapType
RS_SLAP_LEFT_FOUR Slap image of four fingers of left hand.
RS_SLAP_RIGHT_FOUR Slap image of four fingers of right hand.
RS_SLAP_FOUR_FINGER Slap image of four fingers.
RS_SLAP_TWO_THUMB Slap image of two thumbs.
RS_SLAP_TWO_FINGER Slap image of two fingers.
RS_SLAP_ONE_FINGER Slap image of one flat finger.
RS_SLAP_ONE_FINGER_ROLL Slap image of one rolled finger
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Array of slap information, which are segmented from the original image. You
have to deallocate this pointer by RS_FreeImageData after using it.
RSSlapInfois defined as follows;
struct RSSlapInfo {
int fingerType; //
RSPoint fingerPosition[4]; // the position of the finger
// in the slap image
int imageQuality; // See RS_GetQualityScore for details
int rotation; // the rotation angle of the image. It specifies

Copyright © 2020 by Suprema ID Inc. 93


RealScan Basic SDK Reference Manual
// the clockwise rotation in degrees.
int reserved[3];
};
The fingerType will be one of the followings;
Finger Type Value
RS_FGP_UNKNOWN 0
RS_FGP_RIGHT_THUMB 1
RS_FGP_RIGHT_INDEX 2
RS_FGP_RIGHT_MIDDLE 3
RS_FGP_RIGHT_RING 4
RS_FGP_RIGHT_LITTLE 5
RS_FGP_LEFT_THUMB 6
RS_FGP_LEFT_INDEX 7
RS_FGP_LEFT_MIDDLE 8
RS_FGP_LEFT_RING 9
RS_FGP_LEFT_LITTLE 10
fingerImageData
The segmented images will be saved into memory buffers. These buffers are
allocated by the DLL and you have to free them using
RS_FreeImageDatalater.
fingerImageWidth
Array for storing the widths of the segmented images. You have to free it
using RS_FreeImageData later.
fingerImageHeight
Array for storing the heights of the segmented images. You have to free it
using RS_FreeImageData later.

Error Codes
RS_SUCCESS The slap image is segmented successfully.
RS_ERR_NO_DEVICE No device is connected to the PC.
RS_ERR_INVALID_PARAM The slapType is invalid.
RS_ERR_MEM_FULL Cannot allocate memory.
RS_ERR_CANNOT_SEGMENT Cannot segment the slap image.
RS_ERR_CANNOT_GET_QUALITY Cannot get the scores of the segmented
images.
RS_ERR_SEGMENT_FEWER_FINGER The captured image has fewer fingers than
expected.
RS_ERR_SEGMENT_WRONG_HAND Left hand is captured for right hand, or vice

Copyright © 2020 by Suprema ID Inc. 94


RealScan Basic SDK Reference Manual
versa.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
int imageWidth, imageHeight;
unsigned char* imageData;

// allocate and fill the above buffer

int numOfFinger;
RSSlapInfo* slapInfo;

unsigned char** fingerImageData;


int* fingerImageWidth;
int* fingerImageHeight;

int result = RS_Segment( imageData, imageWidth, imageHeight,


RS_SLAP_LEFT_FOUR, &numOfFinger, &slapInfo, &fingerImageData,
&fingerImageWidth, &fingerImageHeight );

// do something

If( result == RS_SUCCESS || result == RS_ERR_SEGMENT_FEWER_FINGER ||


result == RS_ERR_SEGMENT_WRONG_HAND )
{
// release memory
for( int i = 0; i < numOfFinger; i++ )
{
RS_FreeImageData(fingerImageData[i] );
}

if( numOfFinger > 0 )


{
RS_FreeImageData((unsigned char*)fingerImageData );
RS_FreeImageData((unsigned char*)fingerImageWidth );
RS_FreeImageData((unsigned char*)fingerImageHeight );
}

RS_FreeImageData((unsigned char*)slapInfo );
}

Copyright © 2020 by Suprema ID Inc. 95


RealScan Basic SDK Reference Manual

RS_SegmentMask

Same as RS_SegmentMask, but uses fingerMask instead of slapType. ‘fingerMask’


variable can represents all the case of finger existence by combining each bit
representing each of fingers.

RS_Segment( unsigned char* imageData, int imageWidth, int


imageHeight, int fingerMask, int* numOfFinger, RSSlapInfo** slapInfo,
unsigned char*** fingerImageData, int** fingerImageWidth, int**
fingerImageHeight )

Parameters
imageData
Slap image data in memory.
imageWidth
Width of the slap image.
imageHeight
Height of the slap image.
fingerMask
Each bit of fingerMask variable represents each finger segment of the input
fingerprint image. The following is the table of shortcut to access each of fingers.
RS_FINGER_M_LEFT_LITTLE Bitmask 0x800 represents left little finger
RS_FINGER_M_LEFT_RING Bitmask 0x400 represents left ring finger
RS_FINGER_M_LEFT_MIDDLE Bitmask 0x200 represents left middle finger
RS_FINGER_M_LEFT_INDEX Bitmask 0x100 represents left index finger
RS_FINGER_M_LEFT_THUMB Bitmask 0x080 represents left thumb
RS_FINGER_M_RIGHT_THUMB Bitmask 0x010 represents right thumb
RS_FINGER_M_RIGHT_INDEX Bitmask 0x008 represents right index finger
RS_FINGER_M_RIGHT_MIDDLE Bitmask 0x004 represents right middle finger
RS_FINGER_M_RIGHT_RING Bitmask 0x002 represents right ring finger
RS_FINGER_M_RIGHT_LITTLE Bitmask 0x001 represents right little finger
RS_FINGER_M_TWO_THUMB Combination of two thumbs
RS_FINGER_M_LEFT_FOUR Combination of all left fingers except thumb
RS_FINGER_M_RIGHT_FOUR Combination of all right fingers except thumb
RS_FINGER_M_TWO_LEFT1 Combination of left little and ring fingers
RS_FINGER_M_TWO_LEFT2 Combination of left middle and indes fingers
RS_FINGER_M_TWO_RIGHT2 Combination of right middle and indes fingers

Copyright © 2020 by Suprema ID Inc. 96


RealScan Basic SDK Reference Manual
RS_FINGER_M_TWO_RIGHT1 Combination of left right and ring fingers
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Refer to RS_Segment.
fingerImageData
The segmented images will be saved into memory buffers. These buffers are
allocated by the DLL and you have to free them using
RS_FreeImageDatalater.
fingerImageWidth
Array for storing the widths of the segmented images. You have to free it
using RS_FreeImageData later.
fingerImageHeight
Array for storing the heights of the segmented images. You have to free it
using RS_FreeImageData later.

Error Codes
RS_SUCCESS The slap image is segmented successfully.
RS_ERR_NO_DEVICE No device is connected to the PC.
RS_ERR_INVALID_PARAM ThefingerMask is invalid.
RS_ERR_MEM_FULL Cannot allocate memory.
RS_ERR_CANNOT_SEGMENT Cannot segment the slap image.
RS_ERR_CANNOT_GET_QUALITY Cannot get the scores of the segmented
images.
RS_ERR_SEGMENT_FEWER_FINGER The captured image has fewer fingers than
expected.
RS_ERR_SEGMENT_WRONG_HAND Left hand is captured for right hand, or vice
versa.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
int imageWidth, imageHeight;
unsigned char* imageData;

// allocate and fill the above buffer

Copyright © 2020 by Suprema ID Inc. 97


RealScan Basic SDK Reference Manual
int numOfFinger;
RSSlapInfo* slapInfo;

unsigned char** fingerImageData;


int* fingerImageWidth;
int* fingerImageHeight;

int result = RS_SegmentMask( imageData, imageWidth, imageHeight,


RS_FINGER_M_LEFT_FOUR&(~RS_FINGER_M_LEFT_LITTLE), &numOfFinger,
&slapInfo, &fingerImageData, &fingerImageWidth, &fingerImageHeight );

// do something

If( result == RS_SUCCESS || result == RS_ERR_SEGMENT_WRONG_HAND )


{
// release memory
for( int i = 0; i < numOfFinger; i++ )
{
RS_FreeImageData(fingerImageData[i] );
}

if( numOfFinger > 0 )


{
RS_FreeImageData((unsigned char*)fingerImageData );
RS_FreeImageData((unsigned char*)fingerImageWidth );
RS_FreeImageData((unsigned char*)fingerImageHeight );
}

RS_FreeImageData((unsigned char*)slapInfo );
}

Copyright © 2020 by Suprema ID Inc. 98


RealScan Basic SDK Reference Manual

RS_Segment_HandDecision

Same as RS_SegmentMask, but uses fingerMask instead of slapType. ‘fingerMask’


variable can represents all the case of finger existence by combining each bit
representing each of fingers.

RS_Segment_HandDecision(unsigned char* imageData, int imageWidth,


int imageHeight, int* handType, int* numOfFinger, RSSlapInfo** slapInfo,
unsigned char*** fingerImageData, int** fingerImageWidth, int**
fingerImageHeight)

Parameters
imageData
Slap image data in memory.
imageWidth
Width of the slap image.
imageHeight
Height of the slap image.
handType
Type of hand detected (output).
RS_LEFT_HAND Left hand detected.
RS_RIGHT_HAND Right hand detected.
RS_UNKOWN_HAND Cannot detect the type of hand.
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Refer to RS_Segment.
fingerImageData
The segmented images will be saved into memory buffers. These buffers are
allocated by the DLL and you have to free them using
RS_FreeImageDatalater.
fingerImageWidth
Array for storing the widths of the segmented images. You have to free it
using RS_FreeImageData later.
fingerImageHeight
Array for storing the heights of the segmented images. You have to free it
using RS_FreeImageData later.
Copyright © 2020 by Suprema ID Inc. 99
RealScan Basic SDK Reference Manual

Error Codes
Same as RS_Segment.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 100


RealScan Basic SDK Reference Manual

RS_SegmentMissingFinger

Segments a 4-finger or 2-finger slap image into its finger components. It also
returns the quality score of each finger according to NIST standard. The
segmented images are stored into separate memory buffers.

RS_SegmentMissingFinger( unsigned char* imageData, int imageWidth,


int imageHeight, int slapType, int* numOfFinger, RSSlapInfo** slapInfo,
unsigned char*** fingerImageData, int** fingerImageDataWidth, int**
fingerImageDataHeight, RSMissingInfo* missingInfo );

Parameters
imageData
Slap image data in memory.
imageWidth
Width of the slap image.
imageHeight
Height of the slap image.
slapType
Refer to RS_Segment.
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Refer to RS_Segment.
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Refer to RS_Segment.
fingerImageData
The segmented images will be saved into memory buffers. These buffers are
allocated by the DLL and you have to free them using
RS_FreeImageDatalater.
fingerImageWidth
Array for storing the widths of the segmented images. You have to free it
using RS_FreeImageData later.
fingerImageHeight

Copyright © 2020 by Suprema ID Inc. 101


RealScan Basic SDK Reference Manual
Array for storing the heights of the segmented images. You have to free it
using RS_FreeImageData later.
missingInfo
Array of missing (lost) fingers information.
RSMissingInfois defined as follows;
struct RSMissingInfo {
int firstfinger; // little finger for left 4 slap,
// left thumb for 2 thumbs,
// index finger for right 4 slap
int secondfinger; // ring finger for left 4 slap,
// right thumb for 2 thumbs,
// middle finger for right 4 slap
int thirdfinger; // middle finger for left 4 slap,
// ring finger for right 4 slap
int fourthfinger; // index finger for left 4 slap,
// little finger for right 4 slap
};

Error Codes
Refer to RS_Segment.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
int imageWidth, imageHeight;
unsigned char* imageData;

// allocate and fill the above buffer

int numOfFinger;
RSSlapInfo* slapInfo;
RSMissingInfo missingInfo;
Memset(&missingInfo, 0, sizeof(RSMissingInfo));
missingInfo.firstfinger = TRUE; // if 1st finger is lost,
// little finger for left 4 slap
// left thumb for 2 thumb
// index finger for right 4 slap

unsigned char** fingerImageData;


int* fingerImageWidth;
int* fingerImageHeight;

int result = RS_SegmentMissingFinger( imageData, imageWidth, imageHeight,


RS_SLAP_LEFT_FOUR, &numOfFinger, &slapInfo, &fingerImageData,

Copyright © 2020 by Suprema ID Inc. 102


RealScan Basic SDK Reference Manual
&fingerImageWidth, &fingerImageHeight, &missingInfo );

// do something

If( result == RS_SUCCESS || result == RS_ERR_SEGMENT_FEWER_FINGER ||


result == RS_ERR_SEGMENT_WRONG_HAND )
{
// release memory
for( int i = 0; i < numOfFinger; i++ )
{
RS_FreeImageData(fingerImageData[i] );
}

if( numOfFinger > 0 )


{
RS_FreeImageData((unsigned char*)fingerImageData );
RS_FreeImageData((unsigned char*)fingerImageWidth );
RS_FreeImageData((unsigned char*)fingerImageHeight );
}

RS_FreeImageData((unsigned char*)slapInfo );
}

Copyright © 2020 by Suprema ID Inc. 103


RealScan Basic SDK Reference Manual

RS_SegmentWithSize

Segments a 4-finger or 2-finger slap image into its finger components. It also
returns the quality score of each finger according to NIST standard. The
segmented imagesof a custom size user wants are stored into separate memory
buffers.

RS_SegmentWithSize( unsigned char* imageData, int imageWidth, int


imageHeight, int slapType, int* numOfFinger, RSSlapInfo** slapInfo,
unsigned char*** pCropImageData, intnCropWidth, int nCropHeight)

Parameters
imageData
Slap image data in memory.
imageWidth
Width of the slap image.
imageHeight
Height of the slap image.
slapType
RS_SLAP_LEFT_FOUR Slap image of four fingers of left hand.
RS_SLAP_RIGHT_FOUR Slap image of four fingers of right hand.
RS_SLAP_FOUR_FINGER Slap image of four fingers.
RS_SLAP_TWO_THUMB Slap image of two thumbs.
RS_SLAP_TWO_FINGER Slap image of two fingers.
RS_SLAP_ONE_FINGER Slap image of one flat finger.
RS_SLAP_ONE_FINGER_ROLL Slap image of one rolled finger
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Array of slap information, which are segmented from the original image. You
have to deallocate this pointer by RS_FreeImageData after using it.
RSSlapInfois defined as follows;
struct RSSlapInfo {
int fingerType; //
RSPoint fingerPosition[4]; // the position of the finger
// in the slap image
int imageQuality; // See RS_GetQualityScore for details
int rotation; // the rotation angle of the image. It specifies

Copyright © 2020 by Suprema ID Inc. 104


RealScan Basic SDK Reference Manual
// the clockwise rotation in degrees.
int reserved[3];
};
The fingerType will be one of the followings;
Finger Type Value
RS_FGP_UNKNOWN 0
RS_FGP_RIGHT_THUMB 1
RS_FGP_RIGHT_INDEX 2
RS_FGP_RIGHT_MIDDLE 3
RS_FGP_RIGHT_RING 4
RS_FGP_RIGHT_LITTLE 5
RS_FGP_LEFT_THUMB 6
RS_FGP_LEFT_INDEX 7
RS_FGP_LEFT_MIDDLE 8
RS_FGP_LEFT_RING 9
RS_FGP_LEFT_LITTLE 10
pCropImageData
The segmented images of a custom size user wants user wantswill be saved
into memory buffers. These buffers are allocated by the DLL and you have to
free them using RS_FreeImageDatalater.
nCropWidth
The width of the segmented imagesuser wants.
nCropHeight
The height of the segmented images user wants.

Error Codes
RS_SUCCESS The slap image is segmented successfully.
RS_ERR_NO_DEVICE No device is connected to the PC.
RS_ERR_INVALID_PARAM The slapType is invalid.
RS_ERR_MEM_FULL Cannot allocate memory.
RS_ERR_CANNOT_SEGMENT Cannot segment the slap image.
RS_ERR_CANNOT_GET_QUALITY Cannot get the scores of the segmented
images.
RS_ERR_SEGMENT_FEWER_FINGER The captured image has fewer fingers than
expected.
RS_ERR_SEGMENT_WRONG_HAND Left hand is captured for right hand, or vice
versa.

Compatibility
Copyright © 2020 by Suprema ID Inc. 105
RealScan Basic SDK Reference Manual
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
int imageWidth, imageHeight;
unsigned char* imageData;

// allocate and fill the above buffer

int numOfFinger;
RSSlapInfo* slapInfo;

unsigned char** fingerImageData;


int* fingerImageWidth;
int* fingerImageHeight;

int result = RS_SegmentWithSize( imageData, imageWidth, imageHeight,


RS_SLAP_LEFT_FOUR, &numOfFinger, &slapInfo, &pCropImageData, nCropWidth,
nCropHeight );

// do something

If( result == RS_SUCCESS || result == RS_ERR_SEGMENT_FEWER_FINGER ||


result == RS_ERR_SEGMENT_WRONG_HAND )
{
// release memory
for( int i = 0; i < numOfFinger; i++ )
{
RS_FreeImageData(fingerImageData[i] );
}

if( numOfFinger > 0 )


{
RS_FreeImageData((unsigned char*)fingerImageData );
RS_FreeImageData((unsigned char*)fingerImageWidth );
RS_FreeImageData((unsigned char*)fingerImageHeight );
}

RS_FreeImageData((unsigned char*)slapInfo );
}

Copyright © 2020 by Suprema ID Inc. 106


RealScan Basic SDK Reference Manual

RS_Segment4

Segments a 4-finger or 2-finger slap image into its finger components. It also
returns the quality score of each finger according to NIST standard. The
segmented images are stored into separate memory buffers.

RS_Segment4(unsigned char* imageData,


int imageWidth, int imageHeight, int slapType, int* numOfFinger,
RSSlapInfo* slapInfo,
unsigned char** fingerImageData1,
int* fingerImageDataWidth1, int* fingerImageDataHeight1,
unsigned char** fingerImageData2,
int* fingerImageDataWidth2, int* fingerImageDataHeight2,
unsigned char** fingerImageData3,
int* fingerImageDataWidth3, int* fingerImageDataHeight3,
unsigned char** fingerImageData4,
int* fingerImageDataWidth4, int* fingerImageDataHeight4 )

Parameters
imageData
Slap image data in memory.
imageWidth
Width of the slap image.
imageHeight
Height of the slap image.
slapType
RS_SLAP_LEFT_FOUR Slap image of four fingers of left hand.
RS_SLAP_RIGHT_FOUR Slap image of four fingers of right hand.
RS_SLAP_FOUR_FINGER Slap image of four fingers.
RS_SLAP_TWO_THUMB Slap image of two thumbs.
RS_SLAP_TWO_FINGER Slap image of two fingers.
RS_SLAP_ONE_FINGER Slap image of one flat finger.
RS_SLAP_ONE_FINGER_ROLL Slap image of one rolled finger
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Array of slap information thoseare segmented from the original image. You
Copyright © 2020 by Suprema ID Inc. 107
RealScan Basic SDK Reference Manual
have to deallocate this pointer by RS_FreeImageData after using it.
RSSlapInfois defined as follows;
struct RSSlapInfo {
int fingerType; //
RSPoint fingerPosition[4]; // the position of the finger
// in the slap image
int imageQuality; // See RS_GetQualityScore for details
int rotation; // the rotation angle of the image. It specifies
// the clockwise rotation in degrees.
int reserved[3];
};
The fingerType will be one of the followings;
Finger Type Value
RS_FGP_UNKNOWN 0
RS_FGP_RIGHT_THUMB 1
RS_FGP_RIGHT_INDEX 2
RS_FGP_RIGHT_MIDDLE 3
RS_FGP_RIGHT_RING 4
RS_FGP_RIGHT_LITTLE 5
RS_FGP_LEFT_THUMB 6
RS_FGP_LEFT_INDEX 7
RS_FGP_LEFT_MIDDLE 8
RS_FGP_LEFT_RING 9
RS_FGP_LEFT_LITTLE 10
fingerImageData1~4
The segmented images will be saved into memory buffers for each 4 finger.
These buffers are allocated by the DLL and you have to free them using
RS_FreeImageDatalater.
fingerImageWidth1~4
Each pointer indicates the width of the corresponding image. You have to free
it using RS_FreeImageData later.
fingerImageHeight1~4
Each pointer indicates the height of the corresponding image. You have to free
it using RS_FreeImageData later.

Error Codes
RS_SUCCESS The slap image is segmented successfully.
RS_ERR_NO_DEVICE No device is connected to the PC.
RS_ERR_INVALID_PARAM The slapType is invalid.
RS_ERR_MEM_FULL Cannot allocate memory.

Copyright © 2020 by Suprema ID Inc. 108


RealScan Basic SDK Reference Manual
RS_ERR_CANNOT_SEGMENT Cannot segment the slap image.
RS_ERR_CANNOT_GET_QUALITY Cannot get the scores of the segmented
images.
RS_ERR_SEGMENT_FEWER_FINGER The captured image has fewer fingers than
expected.
RS_ERR_SEGMENT_WRONG_HAND Left hand is captured for right hand, or vice
versa.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
int imageWidth, imageHeight;
unsigned char* imageData;

// allocate and fill the above buffer

int numOfFinger;
RSSlapInfo* slapInfo;

unsigned char* fingerImageData[4];


int* fingerImageWidth[4];
int* fingerImageHeight[4];

int result = RS_Segment4( imageData, imageWidth, imageHeight,


RS_SLAP_LEFT_FOUR, &numOfFinger, &slapInfo, &fingerImageData[0],
&fingerImageWidth[0], &fingerImageHeight[0], &fingerImageData[1],
&fingerImageWidth[1], &fingerImageHeight[1], &fingerImageData[2],
&fingerImageWidth[2], &fingerImageHeight[2], &fingerImageData[3],
&fingerImageWidth[3], &fingerImageHeight[3] );

// do something

If( result == RS_SUCCESS || result == RS_ERR_SEGMENT_FEWER_FINGER ||


result == RS_ERR_SEGMENT_WRONG_HAND )
{
// release memory
for( int i = 0; i < numOfFinger; i++ )
{
RS_FreeImageData(fingerImageData[i] );
}

if( numOfFinger > 0 )


{
RS_FreeImageData((unsigned char*)fingerImageData );
RS_FreeImageData((unsigned char*)fingerImageWidth );

Copyright © 2020 by Suprema ID Inc. 109


RealScan Basic SDK Reference Manual
RS_FreeImageData((unsigned char*)fingerImageHeight );
}

RS_FreeImageData((unsigned char*)slapInfo );
}

Copyright © 2020 by Suprema ID Inc. 110


RealScan Basic SDK Reference Manual

RS_Segment4WithSize

Segments a 4-finger or 2-finger slap image into its finger components. It also
returns the quality score of each finger according to NIST standard. The
segmented images of a custom size user wants are stored into separate memory
buffers.

RS_Segment4WithSize(unsigned char* imageData,


int imageWidth, int imageHeight, int slapType, int* numOfFinger,
RSSlapInfo* slapInfo,
unsigned char** fingerImageData1,
unsigned char** fingerImageData2,
unsigned char** fingerImageData3,
unsigned char** fingerImageData4,
int nCropWidth, int nCropHeight )

Parameters
imageData
Slap image data in memory.
imageWidth
Width of the slap image.
imageHeight
Height of the slap image.
slapType
RS_SLAP_LEFT_FOUR Slap image of four fingers of left hand.
RS_SLAP_RIGHT_FOUR Slap image of four fingers of right hand.
RS_SLAP_FOUR_FINGER Slap image of four fingers.
RS_SLAP_TWO_THUMB Slap image of two thumbs.
RS_SLAP_TWO_FINGER Slap image of two fingers.
RS_SLAP_ONE_FINGER Slap image of one flat finger.
RS_SLAP_ONE_FINGER_ROLL Slap image of one rolled finger
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Array of slap information thoseare segmented from the original image. You
have to deallocate this pointer by RS_FreeImageData after using it.
RSSlapInfois defined as follows;
Copyright © 2020 by Suprema ID Inc. 111
RealScan Basic SDK Reference Manual
struct RSSlapInfo {
int fingerType; //
RSPoint fingerPosition[4]; // the position of the finger
// in the slap image
int imageQuality; // See RS_GetQualityScore for details
int rotation; // the rotation angle of the image. It specifies
// the clockwise rotation in degrees.
int reserved[3];
};
The fingerType will be one of the followings;
Finger Type Value
RS_FGP_UNKNOWN 0
RS_FGP_RIGHT_THUMB 1
RS_FGP_RIGHT_INDEX 2
RS_FGP_RIGHT_MIDDLE 3
RS_FGP_RIGHT_RING 4
RS_FGP_RIGHT_LITTLE 5
RS_FGP_LEFT_THUMB 6
RS_FGP_LEFT_INDEX 7
RS_FGP_LEFT_MIDDLE 8
RS_FGP_LEFT_RING 9
RS_FGP_LEFT_LITTLE 10
fingerImageData1~4
The segmented images will be saved into memory buffers for each 4 finger.
These buffers are allocated by the DLL and you have to free them using
RS_FreeImageDatalater.
nCropWidth
Width of the segmented finger’s image.
nCropHeight
Height of the segmented finger’s image.

Error Codes
RS_SUCCESS The slap image is segmented successfully.
RS_ERR_NO_DEVICE No device is connected to the PC.
RS_ERR_INVALID_PARAM The slapType is invalid.
RS_ERR_MEM_FULL Cannot allocate memory.
RS_ERR_CANNOT_SEGMENT Cannot segment the slap image.
RS_ERR_CANNOT_GET_QUALITY Cannot get the scores of the segmented
images.
RS_ERR_SEGMENT_FEWER_FINGER The captured image has fewer fingers than

Copyright © 2020 by Suprema ID Inc. 112


RealScan Basic SDK Reference Manual
expected.
RS_ERR_SEGMENT_WRONG_HAND Left hand is captured for right hand, or vice
versa.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
int imageWidth, imageHeight;
unsigned char* imageData;

// allocate and fill the above buffer

int numOfFinger;
RSSlapInfo* slapInfo;

unsigned char* fingerImageData[4];


int* fingerImageWidth[4];
int* fingerImageHeight[4];
int nCropWidth = 300;
int nCropHeight = 300;

int result = RS_Segment4WithSize( imageData, imageWidth, imageHeight,


RS_SLAP_LEFT_FOUR, &numOfFinger, &slapInfo, &fingerImageData[0],
&fingerImageData[1], &fingerImageData[2], &fingerImageData[3],
nCropWidth, nCropHeight );

// do something

If( result == RS_SUCCESS || result == RS_ERR_SEGMENT_FEWER_FINGER ||


result == RS_ERR_SEGMENT_WRONG_HAND )
{
// release memory
for( int i = 0; i < numOfFinger; i++ )
{
RS_FreeImageData(fingerImageData[i] );
}

if( numOfFinger > 0 )


{
RS_FreeImageData((unsigned char*)fingerImageData );
RS_FreeImageData((unsigned char*)fingerImageWidth );
RS_FreeImageData((unsigned char*)fingerImageHeight );
}

RS_FreeImageData((unsigned char*)slapInfo );
}

Copyright © 2020 by Suprema ID Inc. 113


RealScan Basic SDK Reference Manual

RS_SegmentImages

This function is the same as RS_Segment, which is for implementation of C#


application.Only difference between two functions is output format as results.

RS_SegmentImages( unsigned char* imageData, int imageWidth, int


imageHeight, int slapType, int* numOfFinger, RSSlapInfo** slapInfo,
const char* outFilename )

Parameters
imageData
Slap image data in memory.
imageWidth
Width of the slap image.
imageHeight
Height of the slap image.
slapType
Same forRS_Segment
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Same forRS_Segment
outFilename
filename prefix for output segmented images

Error Codes
Same forRS_Segment

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 114


RealScan Basic SDK Reference Manual

RS_SegmentImagesMissingFinger

This function is the same as RS_SegmentMissingFinger, which can be used if the


final target is the bmp image file.Only difference between two functions is output
format as results.

RS_SegmentImages( unsigned char* imageData, int imageWidth, int


imageHeight, int slapType, int* numOfFinger, RSSlapInfo** slapInfo,
const char* outFilename, RSMissingInfo *missingInfo )

Parameters
imageData
Slap image data in memory.
imageWidth
Width of the slap image.
imageHeight
Height of the slap image.
slapType
Same forRS_Segment
numOfFinger
Number of fingers in the slap image. It will be returned as an output after
segmentation succeeds.
slapInfo
Same forRS_Segment
outFilename
filename prefix for output segmented images
missingInfo
Array of lost fingers information. Refer to RS_SegmentMissingFinger.

Error Codes
Same forRS_Segment

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 115


RealScan Basic SDK Reference Manual

RS_GetQualityScore

Calculates the quality score of an image as defined in NISTIR 7151: Fingerprint


Image Quality. The score would be between 1(excellent) and 5(poor).

RS_GetQualityScore( unsigned char* imageData, int imageWidth, int


imageHeight, int* nistQuality )

Parameters
imageData
Raw pixel data in memory.
imageWidth
Width of the image.
imageHeight
Height of the image.
nistQuality
NIST quality score of the image.

Error Codes
RS_SUCCESS The image score is calculated successfully.
RS_ERR_NO_DEVICE No device is connected to the PC.
RS_ERR_CANNOT_GET_QUALITY Cannot get the score of the image.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 116


RealScan Basic SDK Reference Manual

RS_SequenceCheck

To verify that all fingers are captured properly, you have to check if the sequences
of single finger iamges correspond to those in the slaps. You use
RS_SequenceCheckto check the sequences of one or more fingers in a slpa
image.

RS_SequenceCheck( int numOfFinger, unsigned char** fingerImageData,


int* fingerImageWidth, int* fingerImageHeight, unsinged char*
slapImageData, int slapImageWidth, int slapImageHeight, int slapType,
int* fingerSequenceInSlap, int securityLevel )

Parameters
numOfFinger
Number of single finger files to be checked.
fingerImageData
Array of image data to be checked.
fingerImageWidth
Array of widths of the images.
fingerImageHeight
Array of heights of the images.
slapImageData
Slap image data.
slapImageWidth
Width of the slap image.
slapImageHeight
Height of the slap image.
slapType
Type of the slap. See the slapType parameter of RS_Segment for available
options.
fingerSequenceInSlap
Array of finger sequences, which are matched in the slap. See the
slapInfo.fingerType parameter of RS_Segment for available values.
securityLevel
Specifies the FAR(False Acceptance Ratio). If it is set to 1/100,000, it means
that the probability of accepting false fingerprints is 1/100,000. The available
values are as follows;

Copyright © 2020 by Suprema ID Inc. 117


RealScan Basic SDK Reference Manual
RS_SECURITY_1_TO_10000
RS_SECURITY_1_TO_100000
RS_SECURITY_1_TO_1000000
RS_SECURITY_1_TO_10000000
RS_SECURITY_1_TO_100000000
The recommended value is 1/100,000.

Error Codes
RS_SUCCESS The sequence are checked successfully. You can
get the detailed information by inspecting the
fingerSequenceInSlap parameter.
RS_ERR_NO_DEVICE No device is connected to the PC.
RS_ERR_INVALID_PARAM The slapType is invalid.
RS_ERR_MEM_FULL Cannot allocate memory.
RS_ERR_CANNOT_SEGMENT Cannot segment the slap image.

Compatibility
RealScan-10, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 118


RealScan Basic SDK Reference Manual

RS_SequenceCheckMissingFinger

The same as RS_SequenceCheck, butcan specify the missing fingers.

RS_SequenceCheck( int numOfFinger, unsigned char** fingerImageData,


int* fingerImageWidth, int* fingerImageHeight, unsinged char*
slapImageData, int slapImageWidth, int slapImageHeight, int slapType,
int* fingerSequenceInSlap, int securityLevel, RSMissingInfo *missingInfo )

Parameters
numOfFinger
Number of single finger files to be checked.
fingerImageData
Array of image data to be checked.
fingerImageWidth
Array of widths of the images.
fingerImageHeight
Array of heights of the images.
slapImageData
Slap image data.
slapImageWidth
Width of the slap image.
slapImageHeight
Height of the slap image.
slapType
Type of the slap. See the slapType parameter of RS_Segment for available
options.
fingerSequenceInSlap
Array of finger sequences, which are matched in the slap. See the
slapInfo.fingerType parameter of RS_Segment for available values.
securityLevel
Refer to RS_SequenceCheck.
missingInfo
Array of lost fingers information. Refer to RS_SegmentMissingFinger to get
the more detailed definition.

Error Codes

Copyright © 2020 by Suprema ID Inc. 119


RealScan Basic SDK Reference Manual
RS_SUCCESS The sequence are checked successfully. You can
get the detailed information by inspecting the
fingerSequenceInSlap parameter.
RS_ERR_NO_DEVICE No device is connected to the PC.
RS_ERR_INVALID_PARAM The slapType is invalid.
RS_ERR_MEM_FULL Cannot allocate memory.
RS_ERR_CANNOT_SEGMENT Cannot segment the slap image.

Compatibility
RealScan-10, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 120


RealScan Basic SDK Reference Manual

RS_Calibrate

If the surface of the sensor gets dirty, it may have a bad effect on the capturing
performance. In that case, you can re-calibrate the sensor to minimize the bad
effect. You should not place anything on the sensor during the calibration process.

RS_Calibrate( int deviceHandle )

Parameters
deviceHandle
Handle of the device.

Error Codes
RS_SUCCESS The sensor is calibrated successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_IS_RUNNING A capture process is running. You have to stop
it first.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 121


RealScan Basic SDK Reference Manual

RS_SetAutomaticCalibrate

When the surface of a scanner is dirty, it has a bad effect on the quality of
captured images. With automatic calibration on, the DLL will try to re-calibrate the
scanner whenever it starts the capturing process. By minimizing the bad effect of
dirty background, it may contribute significantly to getting higher quality images.
There are two cases when the automatic calibration fails.

(1) If the sensor is dirtier than the internal threshold, it will return
RS_ERR_SENSOR_DIRTY error. In this case, you have to clean the sensor surface
and try again.

(2) If there are any fingers on the sensor before capturing starts,
RS_ERR_FINGER_EXIST error will be returned.

RS_SetAutomaticCalibrate( int deviceHandle, bool automatic )

Parameters
deviceHandle
Handle of the device.
automatic
If true, enables the automatic calibration option. Otherwise, it is disabled. The
default is on.

Error Codes
RS_SUCCESS The option is set successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_IS_RUNNING A capture process is running. You have to stop
it first.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 122


RealScan Basic SDK Reference Manual

RS_GetAutomaticCalibrate

Retrieves the current setting of the automatic calibration option.

RS_GetAutomaticCalibrate( int deviceHandle, bool* automatic )

Parameters
deviceHandle
Handle of the device.
automatic
Current setting of the option.

Error Codes
RS_SUCCESS The option is retrieved successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 123


RealScan Basic SDK Reference Manual

RS_SetAdvancedContrastEnhancement

For V1.3 or later versions, a new contrast enhancement algorithm is added. With it,
you can capture images even under difficult lighting conditions such as direct
sunlight. Though the new algorithm is more effective for enhancing image quality,
it consumes more CPU resources. The default is off. The option has no effect when
either automatic or manual contrast enhancement is enabled.

RS_SetAdvancedContrastEnhancement( int deviceHandle, bool enabled )

Parameters
deviceHandle
Handle of the device.
enabled
If true, enables the advanced contrast enhancement. Otherwise, it is disabled.
The default is off.

Error Codes
RS_SUCCESS The option is set successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_IS_RUNNING A capture process is running. You have to stop
it first.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 124


RealScan Basic SDK Reference Manual

RS_GetAdvancedContrastEnhancement

Retrieves the current setting of the advanced contrast enhancement.

RS_GetAdvancedContrastEnhancement( int deviceHandle, bool* enabled )

Parameters
deviceHandle
Handle of the device.
enabled
Current setting of the option.

Error Codes
RS_SUCCESS The option is retrieved successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 125


RealScan Basic SDK Reference Manual

RS_SetPreProcessing

For V1.7 or later versions, new pre-processing algorithm is applied to captured


preview and final images. The pre-processing algorithm is developed to enhance
the quality of fingerprint image, especially dry state. Three options are available
for this pre-processing algorithm. (RS_HIGH_NFIQ_SORE_PREPROCESS,
RS_HIGH_VISIBILITY_PREPROCESS or RS_BALANCED_PREPROCESS)

RS_SetPreProcessing( int deviceHandle, int preprocessMode)

Parameters
deviceHandle
Handle of the device.
preprocessMode
RS_HIGH_NFIQ_SORE_PREPROCESS
If you want to capture high NFIQ socre image, set the pre-processing option
as RS_HIGH_NFIQ_SCORE_PREPROCESS.
RS_HIGH_VISIBILITY_PREPROCESS
If you want to capture high visible image, set the pre-processing option as
RS_HIGH_VISIBILITY_PREPROCESS.
RS_BALANCED_PREPROCESS
If you want to capture the image with moderate level of NFIQ score, set the
pre-processing option as RS_BALANCED_PREPROCESS.

Error Codes
RS_SUCCESS The options are retrieved successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 126


RealScan Basic SDK Reference Manual

RS_GetPreProcessing

Retrieves the current settings of pre-processing functions.

RS_GetPreProcessing( int deviceHandle, int* preprocessMode)

Parameters
deviceHandle
Handle of the device.
preprocessMode
Current setting of pre-processing
function.RS_HIGH_NFIQ_SCORE_PREPROCESS,RS_HIGH_VISIBILITY_
PREPROCESS or
RS_BALANCED_PREPROCESS

Error Codes
RS_SUCCESS The options are retrieved successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 127


RealScan Basic SDK Reference Manual

RS_SetHaloProcessing

For V1.8 or later versions, pre-processing algorithm is enforced by new algorithm


for halo artifact caused by high humidity condition or temperature difference
between user’s hand and the device. Two options are available for this pre-
processing algorithm. (RS_DIABLE_HALOPROCESS or RS_ENABLE_HALOPROCESS)

RS_SetHaloProcessing( int deviceHandle, int haloprocessMode)

Parameters
deviceHandle
Handle of the device.
preprocessMode
RS_DIABLE_HALOPROCESS
If you want to disable ‘Halo reduction algorithm’, set the halo-processing
option as RS_DIABLE_HALOPROCESS.
RS_ENABLE_HALOPROCESS
If you want to enable ‘Halo reduction algorithm’, set the halo-processing option
as RS_ENABLE_HALOPROCESS

Error Codes
RS_SUCCESS The options are retrieved successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 128


RealScan Basic SDK Reference Manual

RS_GetHaloProcessing

Retrieves the current settings of halo-processing functions.

RS_GetHaloProcessing( int deviceHandle, int* haloprocessMode)

Parameters
deviceHandle
Handle of the device.
preprocessMode
Current setting of halo-processing function.
RS_DIABLE_HALOPROCESS or
RS_ENABLE_HALOPROCESS

Error Codes
RS_SUCCESS The options are retrieved successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 129


RealScan Basic SDK Reference Manual

RS_SetPostProcessing

Two post-processing functions can be applied to the final image. Generally,


automatic calibration would be enough to get images without background noise.
However, in some cases, additional noise could be added during the capturing
process, which cannot be removed by automatic calibration. For these cases, you
can enable the noise reduction function, which will clean up the final image. You
can also apply the contrast enhancement function to the final image.

RS_SetPostProcessing( int deviceHandle, bool contrastEnhancement, bool


noiseReduction )

Parameters
deviceHandle
Handle of the device.
contrastEnhancement
If true, apply the contrast enhancement function to the final image. The
default is off.
noiseReduction
If true, apply the noise reduction function to the final image. The default is off.

Error Codes
RS_SUCCESS The options are set successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_IS_RUNNING A capture process is running. You have to stop
it first.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 130


RealScan Basic SDK Reference Manual

RS_GetPostProcessing

Retrieves the current settings of post processing functions.

RS_GetPostProcessing( int deviceHandle, bool* contrastEnhancement,


bool* noiseReduction )

Parameters
deviceHandle
Handle of the device.
contrastEnhancement
Current setting of contrast enhancement function.
noiseReduction
Current setting of noise reduction function.

Error Codes
RS_SUCCESS The options are retrieved successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 131


RealScan Basic SDK Reference Manual

RS_SetPostProcessingEx

Same as RS_SetPostProcessing except that it can configure the level of


background noise reduction. The available values are between 10(min) and
200(max). The default is 100.

RS_SetPostProcessingEx( int deviceHandle, bool contrastEnhancement,


bool noiseReduction, int reductionLevel )

Parameters
deviceHandle
Handle of the device.
contrastEnhancement
If true, apply the contrast enhancement function to the final image. The
default is off.
noiseReduction
If true, apply the noise reduction function to the final image. The default is off.
reductionLevel
Level of noise reduction between 10(min) and 200(max). The default is 100.

Error Codes
RS_SUCCESS The options are set successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CAPTURE_IS_RUNNING A capture process is running. You have to stop
it first.
RS_ERR_INVALID_PARAM The reductionLevel is out of range.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 132


RealScan Basic SDK Reference Manual

RS_GetPostProcessingEx

Retrieves the current settings of post processing functions.

RS_GetPostProcessingEx( int deviceHandle, bool* contrastEnhancement,


bool* noiseReduction, int* reductionLevel )

Parameters
deviceHandle
Handle of the device.
contrastEnhancement
Current setting of contrast enhancement function.
noiseReduction
Current setting of noise reduction function.
reductionLevel
Current setting of noise reduction level.

Error Codes
RS_SUCCESS The options are retrieved successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 133


RealScan Basic SDK Reference Manual

RS_SelfTest

Various options of self-test can help checking conditions or status of scanner, and
determining the possibility of its malfunctioning.

RS_SelfTest( int deviceHandle, int testType )

Parameters
deviceHandle
Handle of the device.
testType
Self-Test type for the user purpose.
RS_SELFTEST_TYPE_ILLUMINATION Self-Test for checking
illumination of scanner.
RS_SELFTEST_TYPE_DIRTY Self-Test for checking dirty
surface of scanner.

Error Codes
RS_SUCCESS Self-Test process is finished successfully.
RS_ERR_SENSOR_ILLUMINATION Internal lighting is not proper to operate.
RS_ERR_TOO_STRONG_LIGHT Scanner cannot capture fingerprints due to
strong external light.
RS_ERR_SENSOR_DIRTY Scanner surface is too dirty to get good-
quality fingerprints.
RS_ERR_FINGER_EXIST Finger is detected on the surface of scanner.

Compatibility
RealScan-10, RealScan-D, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 134


RealScan Basic SDK Reference Manual

RS_SetSegRotateOption

Sets anoption of rotation for segmentation process.

RS_SetSegRotateOption( bool isRotating )

Parameters
isRotating
If true, rotated segmentation areas will be returned as results. Or if false, non-
rotated segmentation areas will be returned. The default is false.

Error Codes
RS_SUCCESS The option is set successfully.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 135


RealScan Basic SDK Reference Manual

RS_SetLFDLevel

Sets a specific Live Finger Detection(LFD) level for RealScan-G1. There are
6different levels for RealScan-G1.

RS_SetLFDLevel( int deviceHandle, intLFDLevel )

Parameters
deviceHandle
Handle of the device
LFDLevel
The LFD level setting for target implementation using RealScan-G1. Lower
level of LFD can give you lower FRR(False Reject Rate) of live fingerswith lower
fake detection rate.
RS_LFD_OFF Not using LFD functionality
RS_LFD_LEVEL_1 LFD Level 1
RS_LFD_LEVEL_2 LFD Level 2
RS_LFD_LEVEL_3 LFD Level 3
RS_LFD_LEVEL_4 LFD Level 4
RS_LFD_LEVEL_5 LFD Level 5
RS_LFD_LEVEL_6 LFD Level 6

Error Codes
RS_SUCCESS The option is set successfully.
RS_ERR_UNSUPPORTED_COMMAND Not available except for RealScan-G1

Compatibility
RealScan-G1

Copyright © 2020 by Suprema ID Inc. 136


RealScan Basic SDK Reference Manual

RS_GetLFDLevel

Gets current LFDlevel used for RealScan-G1.

RS_GetLFDLevel( int deviceHandle, int* LFDLevel )

Parameters
deviceHandle
Handle of the device
LFDLevel
The LFD level set for target implementation using RealScan-G1.

Error Codes
RS_SUCCESS The option is set successfully.
RS_ERR_UNSUPPORTED_COMMAND Not available except for RealScan-G1

Compatibility
RealScan-G1

Copyright © 2020 by Suprema ID Inc. 137


RealScan Basic SDK Reference Manual

RS_GetLFDResult

Can get LFD result.

RS_GetLFDResult( int deviceHandle, PRSLFDResult psLFDResult)

Parameters
deviceHandle
Handle of the device.
psLFDResult
LFD result to be returned.

Error Codes
RS_SUCCESS When it gets LFD result successfully.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_NOT_SUPPORT When LFD is not set.
RS_ERR_UNSUPPORTED_DEVICE When the device is not RealScan-D or
RealScan-G10.
RS_ERR_NO_DATA When nNumofFinger is 0.

Compatibility
RealScan-D, RealScan-G10

Copyright © 2020 by Suprema ID Inc. 138


RealScan Basic SDK Reference Manual
Example

#define RS_MAX_LFD_INFO 4
#define RS_LFD_LIVE 0
#define RS_LFD_FAKE 1

typedef struct _RS_LFD_INFO_


{
int nResult; //If it is live nResult is 0. If it is fake nResult is 1.
int nScore; //LFD Score
}RSLFDInfo, *PRSLFDInfo;

typedef struct _RS_LFD_RESULT_


{
int nNumofFinger; //number of LFD information
RSLFDInfo arsLFDInfo[RS_MAX_LFD_INFO];
}RSLFDResult, *PRSLFDResult;

RSLFDResult rsLFDResult;
int nRe;
nRe = GetLFDResult(deviceHandle, &rsLFDResult);
if(nRe == RS_SUCCESS)
{
//Do something..
}

Copyright © 2020 by Suprema ID Inc. 139


RealScan Basic SDK Reference Manual

RS_SetParam

Sets parameter value depending on type.

RS_SetParam( int deviceHandle, int type,void* variable )

Parameters
deviceHandle
Handle of the device
type
The type sets a value for supporting types of parameter. (i.e. preview mode).
variable
Pointer to parameter value of specified parameter type. ‘variable’ must point to
adequate storage type matched to parameter type.

Error Codes
RS_SUCCESS The option is set successfully.
RS_ERR_INVALID_PARAM One of the parameters is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// none

Copyright © 2020 by Suprema ID Inc. 140


RealScan Basic SDK Reference Manual

RS_GetParam

Gets parameter value depending on type.

RS_GetParam( int deviceHandle, int type,void* variable )

Parameters
deviceHandle
Handle of the device
type
The type sets a value for supporting types of parameter. (i.e. preview mode).
variable
Pointer to parameter value of specified parameter type. ‘variable’ must point to
adequate storage type matched to parameter type.

Error Codes
RS_SUCCESS The option is set successfully.
RS_ERR_INVALID_PARAM One of the parameters is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// none

Copyright © 2020 by Suprema ID Inc. 141


RealScan Basic SDK Reference Manual

RS_FindTarget

Matching input image with targeted 5(maximum) images.

RS_FindTarget(unsigned char* queryImageData, int queryImageWidth,


int queryImageHeight,unsigned char* targetImageData0, int
targetImageWidth0, int targetImageHeight0, unsigned char*
targetImageData1, int targetImageWidth1, int targetImageHeight1,
unsigned char* targetImageData2, int targetImageWidth2, int
targetImageHeight2, unsigned char* targetImageData3, int
targetImageWidth3, int targetImageHeight3, unsigned char*
targetImageData4, int targetImageWidth4, int targetImageHeight4, int
securityLevel, int *matchedTargetIndex)

Parameters
queryImageData
Input image to match with Target data
queryImageWidth
Width of input image (pixel)
queryImageHeight
Height of input image (pixel)
targetImageData0~4
target image data.
When the target image is less than 5, the remaining parameter shall be set as
NULL or 0.
targetImageWidth0~4
Width of target image (pixel)
targetImageHeight0~4
Height of target image (pixel)
securityLevel
Security level to use when matching Target data(template matching). Each
sercurity has level 1 to 7 and and performs as below table. As the security
level increases, the FRR(FalseReject Rate) increases accordingly.
Level FAR(False Accept Rate)
1 1/100
2 1/1000
3 1/10000

Copyright © 2020 by Suprema ID Inc. 142


RealScan Basic SDK Reference Manual

4 1/100000
5 1/1000000
6 1/10000000
7 1/100000000
matchedTargetIndex
Index of the data which showed success matching with targetImageData0~4.
Index Target data
1 targetImageData0
2 targetImageData1
3 targetImageData2
4 targetImageData3
5 targetImageData4

Error Codes
RS_SUCCESS Matching success
RS_ERR_NO_MATCH Matching Fail– No matching fingerprint from
given target data

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// none

Copyright © 2020 by Suprema ID Inc. 143


RealScan Basic SDK Reference Manual

RS_IsFinger

Retreives existence of fingerprint from input image.

RS_IsFinger(int deviceHandle, unsigned char* imageData, int imageWidth,


int imageHeight )

Parameters
deviceHandle
RealScan scanner handle.
imageData
Input image to determine existence of fingerprint
imageWidth
Width of input image
imageHeight
Height of input image

Error Codes
RS_ERR_FINGER_EXIST Fingerprint exists
RS_ERR_CAPTURE_NOTENOUGH_FINGERS No fingerprint
RS_ERR_INVALID_PARAM Wrong parameter

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// none

Copyright © 2020 by Suprema ID Inc. 144


RealScan Basic SDK Reference Manual

RS_IsCapturing

Check for device capturing status

RS_IsCapturing(int deviceHandle, BOOL *isRunning )

Parameters
deviceHandle
RealScan scanner handle.
isRunning
Result ; TRUE: capture in progress. FALSE: No capture in progress.

Error Codes
RS_SUCCESS Confirm Success
RS_ERR_SDK_UNINITIALIZED Need SDK initialize
RS_ERR_INVALID_HANDLE WrongdeviceHandle

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// none

Copyright © 2020 by Suprema ID Inc. 145


RealScan Basic SDK Reference Manual

RS_RegisterFingerOnCallback

Register a callback which will be called when finger is on the device during capture.
Please note that a crash occurs when you free a image buffer passed by callback
function

RS_RegisterFingerOnCallback( int deviceHandle, CaptureDataCallback


captureCallback)

Parameters
deviceHandle
Handle of the device.
captureCallback
Function pointer of preview callback.

Error Codes
RS_SUCCESS The callback is registered successfully.
RS_ERR_CAPTURE_IS_RUNNING A capture process is running. You have to
stop it first.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// none

Copyright © 2020 by Suprema ID Inc. 146


RealScan Basic SDK Reference Manual

RS_GetImageQualityScore

Retreives quality score of fingerprint from input image. Same as the quality
parameter of RS_RegisterAdvPreviewCallback.The score would be between
0(poor) and 200(excellent).

RS_GetImageQualityScore( unsigned char* imageData, int imageWidth,


int imageHeight, int* nQualityScore )

Parameters
imageData
Raw pixel data in memory.
imageWidth
Width of the image.
imageHeight
Height of the image.
nQualityScore
Qualityscore of the image for capture availability.

Error Codes
RS_SUCCESS The image score is calculated successfully.
RS_ERR_CAPTURE_NOTENOUGH_ Capture failed by timeout because of not
FINGERS enough segment of fingerprints for given
capture mode
RS_ERR_CAPTURE_TOOSMALL_FI Capture failed by timeout because of too
NGERSAREA small area of fingerprints for given capture
mode
RS_ERR_CAPTURE_TOOWEAK_PRI Capture failed by timeout because of too
NT weak contrast of fingerprints
RS_ERR_CAPTURE_TOOSTRONG_ Capture failed by timeout because of over-
PRINT saturated black parts of fingerprints
(customized version only)
RS_ERR_CAPTURE_TOOMUCH_PR Capture failed by timeout because of too
ESSURE much black component of fingerprints
(maybe there are too thick valies,
customized version only)

Compatibility
Copyright © 2020 by Suprema ID Inc. 147
RealScan Basic SDK Reference Manual
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// none

Copyright © 2020 by Suprema ID Inc. 148


RealScan Basic SDK Reference Manual

RS_GetCurrentProcessedImage

Get image used forroll-finger image synthesis during the capture. Supporting
ROLL_FINGER or ROLL_FINGER_EXonly.

RS_GetCurrentProcessedImage( int deviceHandle, unsigned char*


imageData )

Parameters
deviceHandle
Handle of the device.
imageData
Raw pixel data in memory.

Error Codes
RS_SUCCESS The currently processed image for
synthesizing a roll-fingeris captured
successfully.
RS_ERR_UNSUPPORTED_DEVICE Device not support for current API
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_ABNORMAL_CAPTURE_SIZE A Returning error when wrong image size
was entered for activated capture mode

Compatibility
RealScan-F Series

Example
// none

Copyright © 2020 by Suprema ID Inc. 149


RealScan Basic SDK Reference Manual

RS_GetCurrentSynthesisImage

Get synthesized image during capture. ROLL_FINGER or ROLL_FINGER_EX as


defined in RS_SetCaptureMode.

RS_GetCurrentSynthesisImage( int deviceHandle, unsigned char*


imageData )

Parameters
deviceHandle
Handle of the device.
imageData
Raw pixel data in memory.

Error Codes
RS_SUCCESS The currently synthesized image is
captured successfully.
RS_ERR_UNSUPPORTED_DEVICE Device not support for current API
RS_ERR_CAPTURE_DISABLED The capture mode is disabled.
RS_ERR_ABNORMAL_CAPTURE_SIZE A Returning error when wrong image size
was entered for activated capture mode
RS_ERR_ROLL_SHIFTED The finger is heavily shifted or rotated.

Compatibility
RealScan-F Series

Example
// none

Copyright © 2020 by Suprema ID Inc. 150


RealScan Basic SDK Reference Manual

3.5. Preview API

As an option, you can configure a preview window, which will show fingerprint
images on the sensor in real time. You can also add overlays to the preview
window.

⚫ RS_SetViewWindow: configures a preview window.


⚫ RS_StopViewWindow: stops the previewing process.
⚫ RS_AddOverlayText: adds an overlay text to the preview window.
⚫ RS_AddOverlayCross: adds an overlay cross to the preview window.
⚫ RS_AddOverlayLine: adds an overlay line to the preview window.
⚫ RS_AddOverlayQuadrangle: adds an overlay quadrangle to the preview
window.
⚫ RS_ShowOverlay: shows or hides an overlay.
⚫ RS_ShowAllOverlay: shows all the overlays added to the preview window.
⚫ RS_RemoveOverlay: removes an overlay.
⚫ RS_RemoveAllOverlay: removes all the overlays attached to the preview
window.

Copyright © 2020 by Suprema ID Inc. 151


RealScan Basic SDK Reference Manual

RS_SetViewWindow

Configures a preview window. Preview images will be shown in the specified


window in real-time. As shown in Figure 4 Preview Window, the preview images
will be resized to fill the whole surface of the preview window.
RS_SetViewWindow2 function is the same as RS_SetViewWindow, which is for
implementation of C# application.

Palm
2550 x 2550

Flat Four Fingers


1600 x 1500 Preview Window
Two Thumbs
900 x 900

Roll/Flat Single
800 x 750

Figure 4 Preview Window

RS_SetViewWindow( int deviceHandle, HWND windowHandle, RECT


drawRectangle, bool autoContrast )

Parameters
deviceHandle
Handle of the device.
windowHandle
Handle of the preview window.
drawRectangle
Client rectangle of the drawing region. The preview images will be scaled to be
fit to the rectangle.
autoContrast
Reserved for future use.

Copyright © 2020 by Suprema ID Inc. 152


RealScan Basic SDK Reference Manual
Error Codes
RS_SUCCESS The preview window is configured
successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CANNOT_SET_VIEW_WINDOW The preview window cannot be
configured. The window handle might be
invalid or not initialized.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// Configure the preview window
// - IDC_VIEW_WINDOW is an example resource ID for the preview window.
RECT drawRect;
GetDlgItem( IDC_VIEW_WINDOW )->GetClientRect( &drawRect );

result = RS_SetViewWindow( deviceHandle, GetDlgItem( IDC_VIEW_WINDOW )-


>m_hWnd, drawRect, false );

Copyright © 2020 by Suprema ID Inc. 153


RealScan Basic SDK Reference Manual

RS_StopViewWindow

Stops the previewing process.

RS_StopViewWindow( int deviceHandle )

Parameters
deviceHandle
Handle of the device.

Error Codes
RS_SUCCESS The preview is stopped.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 154


RealScan Basic SDK Reference Manual

RS_AddOverlayText

Adds an overlay text to the preview window. To show the overlay,


RS_ShowOverlayshould be called with the acquired handle.

RS_AddOverlayText( int deviceHandle, RSOverlayText* text, int*


overlayHandle )

Parameters
deviceHandle
Handle of the device.
text
RSOverlayTextis defined as follows;
struct RSOverlayText {
POINT pos;
unsigned alignment;
char text[128];
int fontSize;
char fontName[32];
COLORREF color; // 0x00bbggrr
int reserved[16];
};
overlayHandle
Handle of the overlay to be returned.

Error Codes
RS_SUCCESS An overlay text is added.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_NO_MORE_OVERLAY No more overlayscan be added.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
RSOverlayText overlayText;
overlayText.pos.x = 100;
overlayText.pos.y = 100;
overlayText.color = 0x000000ff; // red
strcpy( overlayText.text, “Sample Text” );
int overlayHandle;

Copyright © 2020 by Suprema ID Inc. 155


RealScan Basic SDK Reference Manual

int result = RS_AddOverlayText( deviceHandle, &overlayText,


&overlayHandle );

if( result == RS_SUCCESS )


{
result = RS_ShowOverlay( deviceHandle, overlayHandle );
}

Copyright © 2020 by Suprema ID Inc. 156


RealScan Basic SDK Reference Manual

RS_AddOverlayCross

Adds an overlay cross to the preview window.

RS_AddOverlayCross( int deviceHandle, RSOverlayCross* cross, int*


overlayHandle )

Parameters
deviceHandle
Handle of the device.
cross
RSOverlayCrossis defined as follows;
struct RSOverlayCross {
POINT centerPos;
int rangeX;
int rangeY;
COLORREF color;
int width;
int reserved[16];
};
overlayHandle
Handle of the overlay to be returned.

Error Codes
RS_SUCCESS An overlay cross is added.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_NO_MORE_OVERLAY No more overlayscan be added.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 157


RealScan Basic SDK Reference Manual

RS_AddOverlayLine

Adds an overlay lineto the preview window.

RS_AddOverlayLine( int deviceHandle, RSOverlayLine* line, int*


overlayHandle )

Parameters
deviceHandle
Handle of the device.
line
RSOverlayLineis defined as follows;
struct RSOverlayLine {
POINT startPos;
POINT endPos;
COLORREF color;
int width;
int reserved[16];
};
overlayHandle
Handle of the overlay to be returned.

Error Codes
RS_SUCCESS An overlay line is added.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_NO_MORE_OVERLAY No more overlayscan be added.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 158


RealScan Basic SDK Reference Manual

RS_AddOverlayQuadrangle

Adds an overlay quadrangleto the preview window.

RS_AddOverlayQuadrangle( int deviceHandle, RSOverlayQuadrangle*


quadrangle, int* overlayHandle )

Parameters
deviceHandle
Handle of the device.
quadrangle
RSOverlayQuadrangleis defined as follows;
struct RSOverlayQuadrangle {
POINT pos[4];
COLORREF color;
int width;
int reserved[16];
};
overlayHandle
Handle of the overlay to be returned;

Error Codes
RS_SUCCESS An overlay quadrangle is added.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_NO_MORE_OVERLAY No more overlayscan be added.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 159


RealScan Basic SDK Reference Manual

RS_ShowOverlay

Shows or hides an overlay on the preview window. The overlay handle should be
acquired first using one of the RS_AddOverlayXXX functions.

RS_ShowOverlay( int overlayHandle, bool show )

Parameters
overlayHandle
Handle of the overlay.
show
If true, the overlay will be shown. If false, it will be hidden.

Error Codes
RS_SUCCESS The overlay is shown/hidden successfully.
RS_ERR_INVALID_OVERLAY_HANDLE The overlay handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 160


RealScan Basic SDK Reference Manual

RS_ShowAllOverlay

Shows all the overlays attached to a device.

RS_ShowAllOverlay( int deviceHandle, bool show )

Parameters
deviceHandle
Handle of the device.
show
Shows or hides the overlays.

Error Codes
RS_SUCCESS The overlays are shown/hidden successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 161


RealScan Basic SDK Reference Manual

RS_RemoveOverlay

Removes an overlay from the preview window.

RS_RemoveOverlay( int overlayHandle )

Parameters
overlayHandle
Handle of the overlay.

Error Codes
RS_SUCCESS The overlay is removed successfully.
RS_ERR_INVALID_OVERLAY_HANDLE The overlay handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 162


RealScan Basic SDK Reference Manual

RS_RemoveAllOverlay

Removes all the overlays attached to a device.

RS_RemoveAllOverlay( int deviceHandle )

Parameters
deviceHandle
Handle of the device.

Error Codes
RS_SUCCESS The overlays are removed successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 163


RealScan Basic SDK Reference Manual

3.6. IO API

Both RealScan-10 and RealScan-G10have two input switches, four mode LEDs,
and 10 fingerprint LEDs. RealScan-D device has one input switch and one status
LED.

You can control these I/Os using the following APIs.

⚫ RS_SetActiveKey: enables/disables key inputs.


⚫ RS_GetKeyStatus: reads the current status of key inputs.
⚫ RS_RegisterKeypadCallback: registers a keypad callback function.
⚫ RS_Beep: emits a beep sound.
⚫ RS_SetCaptureBeep: configures the beep sounds emitted during the
capture process.
⚫ RS_SetFingerLED: controls the finger LEDs.
⚫ RS_SetModeLED: controls the mode LEDs.
⚫ RS_SetStatusLED: controls the status LED of RealScan-D.
⚫ RS_PlayWav: plays an wave file.
⚫ RS_DisplayLCD: displays pixel data onto LCD panel of RealScan-F.
⚫ RS_MakeLCDData: makes 16-bit RGB data for displaying onto LCD.
⚫ RS_ResetLCD: reset LCD data with 0(black) pixels.

Copyright © 2020 by Suprema ID Inc. 164


RealScan Basic SDK Reference Manual

RS_SetActiveKey

Both RealScan-10 and RealScan-G10 have two keys - RS_REALSCAN10_PLAY_KEY


and RS_REALSCAN10_STOP_KEY, while RealScan-D has only one. RealScan-F has
six keys as listed below. To receive inputs from these keys, you have to activate
them by RS_SetActiveKey.

RS_SetActiveKey( int deviceHandle, unsigned keyMask )

Parameters
deviceHandle
Handle of the device.
keyMask
RS_REALSCAN10_NO_KEY No keys are activated.
RS_REALSCAN10_PLAY_KEY The Play key is enabled.
RS_REALSCAN10_STOP_KEY The Stop key is enabled.
RS_REALSCAN10_ALL_KEYS All keys are enabled.
or
RS_REALSCAND_NO_KEY No keys are activated.
RS_REALSCAND_KEY_0 The input switchis enabled.
RS_REALSCAND_ALL_KEYS All keys are enabled.
or
RS_REALSCANF_NO_KEY No keys are activated.
RS_REALSCANF_UP_KEY The Up key is enabled.
RS_REALSCANF_DOWN_KEY The Down key is enabled.
RS_REALSCANF_LEFT_KEY The Left key is enabled.
RS_REALSCANF_RIGHT_KEY The Right key is enabled.
RS_REALSCANF_PLAY_KEY The Play key is enabled.
RS_REALSCANF_FOOTSWITCH The Footswitch is enabled.
RS_REALSCANF_ALL_KEYS All keys are enabled.

Error Codes
RS_SUCCESS The specified keys are enabled successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F and RealScan-G10
Copyright © 2020 by Suprema ID Inc. 165
RealScan Basic SDK Reference Manual

Example
// enable all keys
int result = RS_SetActiveKey( deviceHandle, RS_REALSCAN10_ALL_KEYS );

// enable only the play key


result = RS_SetActiveKey( deviceHandle, RS_REALSCAN10_PLAY_KEY );

// disable all keys


result = RS_SetActiveKey( deviceHandle, RS_REALSCAN10_NO_KEY );

Copyright © 2020 by Suprema ID Inc. 166


RealScan Basic SDK Reference Manual

RS_GetKeyStatus

Reads the current status of keypad inputs.

RS_GetKeyStatus( int deviceHandle, unsigned* keyCode )

Parameters
deviceHandle
Handle of the device.
keyCode
Pressed keys. If both keys of RealScan-10 are pressed, the code will be
RS_REALSCAN10_PLAY_KEY | RS_REALSCAN10_STOP_KEY.

Error Codes
RS_SUCCESS Key codes are read successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 167


RealScan Basic SDK Reference Manual

RS_RegisterKeypadCallback

Registers a callback function, which will be calledwhen a key is pressed.

RS_RegisterKeypadCallback( int deviceHandle, RSKeypadCallback


callback )

Parameters
deviceHandle
Handle of the device.
callback
RSKeypadCallbackis defined as follows;
typedef void (*RSKeypadCallback)( int deviceHandle, unsigned keyCode );

Error Codes
RS_SUCCESS The callback is registered successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-10, RealScan-D, RealScan-F and RealScan-G10

Example
// emit a beep sound when a key is pressed
void beepCallback( int deviceHandle, unsigned keyCode )
{
switch( keyCode ) {
caseRS_REALSCAN10_PLAY_KEY:
RS_Beep( deviceHandle, RS_BEEP_PATTERN_1 );
break;
caseRS_REALSCAN10_STOP_KEY:
RS_Beep( deviceHandle, RS_BEEP_PATTERN_2 );
break;
}
}

// register the callback


int result = RS_RegisterKeypadCallback( deviceHandle, beepCallback );

Copyright © 2020 by Suprema ID Inc. 168


RealScan Basic SDK Reference Manual

RS_Beep

Emits a beep sound. There are two pre-defined beep patterns.

RS_Beep( int deviceHandle, int beepPattern )

Parameters
deviceHandle
Handle of the device.
beepPattern
RS_BEEP_PATTERN_NONE No sound.
RS_BEEP_PATTERN_1 One short beep sound.
RS_BEEP_PATTERN_2 Two short beep sounds.

Error Codes
RS_SUCCESS Beep sound is emitted successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_PARAM Unsupported beep pattern.

Compatibility
RealScan-10, RealScan-D, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 169


RealScan Basic SDK Reference Manual

RS_SetCaptureBeep

By default, the scanner device emits predefined beep sounds as follows;


⚫ Capturing of a rolloing finger is started in automatic mode:
RS_BEEP_PATTERN_1
⚫ Capture success: RS_BEEP_PATTERN_1
⚫ Capture failure: RS_BEEP_PATTERN_2
You can change or disable these sounds using RS_SetCaptureBeep.

RS_SetCaptureBeep( int deviceHandle, int startingBeep, int successBeep,


int failBeep )

Parameters
deviceHandle
Handle of the device.
startingBeep
Beep sound for the start of rolling capture in automatic mode. It should be one
of the following values.
RS_BEEP_PATTERN_NONE No sound.
RS_BEEP_PATTERN_1 One short beep sound.
RS_BEEP_PATTERN_2 Two short beep sounds.
successBeep
Beep sound for the capture success.
failBeep
Beep sound for the capture failure.

Error Codes
RS_SUCCESS Beep sounds are configured successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_PARAM Unsupported beep pattern.

Compatibility
RealScan-10, RealScan-D, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 170


RealScan Basic SDK Reference Manual

RS_SetFingerLED

Both RealScan-10 and RealScan-G10 have 10 fingerprint LEDs. You can turn on/off
these LEDs byRS_SetFingerLED.

RS_SetFingerLED( int deviceHandle, int fingerIndex, int ledColor )

Parameters
deviceHandle
Handle of the device.
fingerIndex
RS_FINGER_ALL All 10 fingerprint LEDs.
RS_FINGER_LEFT_LITTLE The little finger LED of left hand.
RS_FINGER_LEFT_RING The ring finger LED of left hand.
RS_FINGER_LEFT_MIDDLE The middle finger LED of left hand.
RS_FINGER_LEFT_INDEX The index finger LED of left hand.
RS_FINGER_LEFT_THUMB The thumb finger LED of left hand.
RS_FINGER_RIGHT_THUMB The thumb finger LED of right hand.
RS_FINGER_RIGHT_INDEX The index finger LED of right hand.
RS_FINGER_RIGHT_MIDDLE The middle finger LED of right hand.
RS_FINGER_RIGHT_RING The ring finger LED of right hand.
RS_FINGER_RIGHT_LITTLE The little finger LED of right hand.
RS_FINGER_TWO_THUMB Two LEDs for thumbs.
RS_FINGER_LEFT_FOUR Four fingerprint LEDs of left hand
except for the thumb.
RS_FINGER_RIGHT_FOUR Four fingerprint LEDs of right hand
except for the thumb.
RS_FINGER_TWO_LEFT1 Two LEDs for the little finger and the
ring finger of left hand
RS_FINGER_TWO_LEFT2 Two LEDs for the middle finger and the
index finger of left hand
RS_FINGER_TWO_RIGHT1 Two LEDs for the little finger and the
ring finger of right hand
RS_FINGER_TWO_RIGHT2 Two LEDs for the middle finger and the
index finger of right hand
ledColor
RS_LED_OFF Turn off the LED.

Copyright © 2020 by Suprema ID Inc. 171


RealScan Basic SDK Reference Manual
RS_LED_GREEN Turn on green.
RS_LED_RED Turn on red.
RS_LED_YELLOW Turn on yellow.

Error Codes
RS_SUCCESS The LED is turned on/off successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_PARAM The fingerIndex or ledColor is invalid.
RS_ERR_UNSUPPORTED_COMMAND RealScan-D does not support this command.

Compatibility
RealScan-10 and RealScan-G10

Example
// turn on the index finger LED of the right hand
int result = RS_SetFingerLED( deviceHandle, RS_FINGER_RIGHT_INDEX,
RS_LED_GREEN );

// turn off
result = RS_SetFingerLED( deviceHandle, RS_FINGER_RIGHT_INDEX, RS_LED_OFF );

Copyright © 2020 by Suprema ID Inc. 172


RealScan Basic SDK Reference Manual

RS_SetModeLED

Both RealScan-10 and RealScan-G10 have4 mode LEDs indicating the capture
mode. You can control these LEDs by RS_SetModeLED.

RS_SetModeLED( int deviceHandle, int ledIndex, bool isOn )

Parameters
deviceHandle
Handle of the device.
ledIndex
RS_LED_MODE_ALL All four LEDs.
RS_LED_MODE_LEFT_FINGER4 LED for flat left fingers.
RS_LED_MODE_RIGHT_FINGER4 LED for flat right fingers.
RS_LED_MODE_TWO_THUMB LED for two thumbs.
RS_LED_MODE_ROLL LED for rolled finger.
isOn
If true, turn on the LED. If false, turn it off.

Error Codes
RS_SUCCESS The LED is turned on/off successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_PARAM The ledIndex is invalid.
RS_ERR_UNSUPPORTED_COMMAND RealScan-D does not support this command.

Compatibility
RealScan-10 and RealScan-G10

Example
// turn on the LED for two thumbs.
int result = RS_SetModeLED( deviceHandle, RS_LED_MODE_TWO_THUMB, true );

Copyright © 2020 by Suprema ID Inc. 173


RealScan Basic SDK Reference Manual

RS_SetStatusLED

RealScan-D has one status LED. RealScan-G1 has blue status LED and can be seen
inside the platen. You can turn it on/off by RS_SetStatusLED, also you can make
blue LED of RealScan-G1 blinking.

RS_SetStatusLED( int deviceHandle, int ledCode)

Parameters
deviceHandle
Handle of the device.
ledCode (for RealScan-D)
RS_LED_OFF Turn off the LED.
RS_LED_GREEN Turn on green.
RS_LED_RED Turn on red.
RS_LED_YELLOW Turn on yellow.
ledCode (for RealScan-G1)
RS_LED_STATUS_OFF Turn off the LED.
RS_LED_STATUS_ON Turn on the LED.
RS_LED_STATUS_BLINK Blink the LED.

Error Codes
RS_SUCCESS The LED is turned on/off successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_INVALID_PARAM The ledCodeis invalid.
RS_ERR_UNSUPPORTED_COMMAND RealScan-10, RealScan-F and RealScan-G10
do not support this command.

Compatibility
RealScan-D and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 174


RealScan Basic SDK Reference Manual

RS_PlayWav

RealScan-10, RealScan-G10 and RealScan-F can play wave files. The sound data in
the wave file should be 44100Hz 16 bit mono PCM.

RS_PlayWav( int deviceHandle, const char* wavFile )

Parameters
deviceHandle
Handle of the device.
wavFile
Filename of the wave file to be played.

Error Codes
RS_SUCCESS The wave file is played successfully.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.
RS_ERR_CANNOT_OPEN_FILE Cannot open the wave file.
RS_ERR_CANNOT_READ_FILE Cannot read the wave file.
RS_ERR_UNSUPPORTED_WAV_FORMAT The wave file is not in 44100Hz 16 bit
mono PCM format.

Compatibility
RealScan-10, RealScan-F and RealScan-G10

Copyright © 2020 by Suprema ID Inc. 175


RealScan Basic SDK Reference Manual

RS_DisplayLCD

RealScan-F has LCD panel that can display pixel data. You candisplay 16-bit RGB
data onto the LCD panel, which has a size of 320(width) x 240(height).

RS_DisplayLCD( int deviceHandle, unsigned char* data, int dataLen, int sx,
int sy, int width, int height )

Parameters
deviceHandle
Handle of the device.
data
Pointer to image data to be displayed onto LCD.
dataLen
Length of the image data to be displayed onto LCD. DataLen should be
width*height*2, since LCD can display only 16-bit RGB data.
sx
Starting point of x-position of image data to be displayed.
sy
Starting point of y-position of image data to be displayed.
width
Width of the image displayed onto LCD. The maximum size is defined as
RS_LCD_WIDTH_MAX (= 320).
height
Height of the image displayed onto LCD. The maximum size of defined as
RS_LCD_HEIGHT_MAX (= 240).

Error Codes
RS_SUCCESS Displaying pixel data onto LCD panel is
donesuccessfully.
RS_ERR_UNSUPPORTED_COMMAND RealScan-10 and RealScan-D does not
support this command.
RS_ERR_INVALID_PARAM One of the parameters is invalid.

Compatibility
RealScan-F

Copyright © 2020 by Suprema ID Inc. 176


RealScan Basic SDK Reference Manual

RS_MakeLCDData

LCD display device in RealScan-F can show the 16-bit RGB data, which means that
it can display the image data whose 2 bytes represent 1 pixel on the LCD. This
function can change a format ofimage data into the format LCD can displaywith.

RS_MakeLCDData( unsigned char* inputRData, unsigned char*


inputGData, unsigned char* inputBData, int inputWidth, int inputHeight,
unsigned char** outputData )

Parameters
inputRData
8-bit data to be the first 5 bits of 16-bit RGB data.
inputGData
8-bit data to be the next 6 bits of 16-bit RGB data.
inputBData
8-bit data to be the last 5 bits of 16-bit RGB data.
inputWidth
Width of the image to be transformed to the LCD Data.
inputHeight
Height of the image to be transformed to the LCD Data.
outputData
Pointer of pointer to the image to be displayed onto LCD panel. The size of the
image can be calculated as inputWidth*inputHeight*2.

Error Codes
RS_SUCCESS Operation is successfully done.
RS_ERR_CANNOT_MAKE_LCD_DATA The function cannot make LCD data since
the output buffer is not prepared.
RS_ERR_INVALID_LCD_DATA Making LCD data is succeeded, but the
output is not proper to display.

Compatibility
RealScan-F

Copyright © 2020 by Suprema ID Inc. 177


RealScan Basic SDK Reference Manual

RS_ResetLCD

This function will clean the LCD panel with using an image which is full of 0 pixels.

RS_ResetLCD( int deviceHandle )

Parameters
deviceHandle
Handle of the device.

Error Codes
RS_SUCCESS Displaying pixel data onto LCD panel is done
successfully.
RS_ERR_UNSUPPORTED_COMMAND RealScan-10 and RealScan-D does not
support this command.
RS_ERR_INVALID_PARAM One of the parameters is invalid.

Compatibility
RealScan-F

Copyright © 2020 by Suprema ID Inc. 178


RealScan Basic SDK Reference Manual

RS_TurnOnBacklight_RSF

This function will turn back light on or off.

RS_TurnOnBacklight_RSF( int deviceHandle, bool isOn )

Parameters
deviceHandle
Handle of the device.
isOn
If true, turn on the back light. If false, turn it off.

Error Codes
RS_SUCCESS The BLUis turned on/off successfully.
RS_ERR_UNSUPPORTED_COMMAND This commandis supported only for
RealScan-F and RealScan-F CN device.
RS_ERR_CAPTURE_IS_RUNNING Cannot turn it on/off while capture is goin
on.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-F Series

Copyright © 2020 by Suprema ID Inc. 179


RealScan Basic SDK Reference Manual

RS_ResetDevice

This function will reset the device.

RS_ResetDevice( int deviceHandle )

Parameters
deviceHandle
Handle of the device.

Error Codes
RS_SUCCESS The device is reset successfully.
RS_ERR_UNSUPPORTED_COMMAND This commandis supported only for
RealScan-F CN device.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-F Series

Copyright © 2020 by Suprema ID Inc. 180


RealScan Basic SDK Reference Manual

RS_PowerCheck

This function will check whether the power adapter is connected or not.

RS_PowerCheck ( int deviceHandle, unsigned *powerType )

Parameters
deviceHandle
Handle of the device.
powerType
If powerType is 1, Power type is USB. If 0, power adapter is connected.

Error Codes
RS_SUCCESS Power typeis read successfully.
RS_ERR_UNSUPPORTED_COMMAND This commandis supported only for
RealScan-F CN device.
RS_ERR_SDK_UNINITIALIZED The SDK is not yet initialized.
RS_ERR_INVALID_HANDLE The device handle is invalid.

Compatibility
RealScan-F (custom version only)

Copyright © 2020 by Suprema ID Inc. 181


RealScan Basic SDK Reference Manual

3.7. Miscellaneous API

These functions are used for miscellaneouspurposes.

⚫ RS_GetSDKInfo: gets the version information of SDK.


⚫ RS_GetErrString: retrives a short description of an error code.
⚫ RS_GetErrStringChar: retrives a short description of an error code for C#
implementation.
⚫ RS_GetCaptureStatusString: retrives a short description of a capture
status code.
⚫ RS_GetCaptureStatusStringChar: retrives a short description of a capture
status code for C# implementation
⚫ RS_FreeImageData: releases the memory allocated by the DLL.
⚫ RS_SaveBitmap: saves the raw pixel data into a BMP file.
⚫ RS_SaveBitmapMem: saves the raw pixel data in a memory buffer with a
BMP header
⚫ RS_ FreeImageData: Releases the memory allocated by the DLL.

Copyright © 2020 by Suprema ID Inc. 182


RealScan Basic SDK Reference Manual

RS_GetSDKInfo

Gets the version information of the SDK.

RS_GetSDKInfo( RSSDKInfo* sdkInfo )

Parameters
sdkInfo
RSSDKInfois defined as follows;
struct RSSDKInfo {
char product[16];
char version[16];
char buildDate[16];
int reserved[16];
};

Error Codes
RS_SUCCESS

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 183


RealScan Basic SDK Reference Manual

RS_GetErrString

Retrieves a short description of the specified error code.

RS_GetErrString( int errorCode, CString& errMsg )

Parameters
errorCode
Error code returned by an API.
errMsg
CString object of the error string.

Error Codes
RS_SUCCESS

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 184


RealScan Basic SDK Reference Manual

RS_GetErrStringChar

Retrieves a short description of the specified error code for C# implementation.

RS_GetErrStringChar( int errorCode, char* errMsg )

Parameters
errorCode
Error code returned by an API.
errMsg
Pointer of the error string.

Error Codes
RS_SUCCESS

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 185


RealScan Basic SDK Reference Manual

RS_GetCaptureStatusString

Retrieves a short description of the specified capture status code.

RS_GetCaptureStatusString( int statusCode, char&statusMsg )

Parameters
statusCode
Status code returned by an API.
statusMsg
Pointer of the status string.

Error Codes
RS_SUCCESS

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 186


RealScan Basic SDK Reference Manual

RS_GetCaptureStatusStringChar

Retrieves a short description of the specified capture status code for C#


implementation.

RS_GetCaptureStatusStringChar( int statusCode, char*statusMsg )

Parameters
statusCode
Status code returned by an API.
statusMsg
Pointer of the error string.

Error Codes
RS_SUCCESS

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 187


RealScan Basic SDK Reference Manual

RS_FreeImageData

Releases the memory allocated by the DLL.

RS_FreeImageData( void* imageData )

Parameters
imageData
Pointer to the image data to be freed.

Error Codes
None

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 188


RealScan Basic SDK Reference Manual

RS_SaveBitmap

Saves the raw pixel data returned by capturing functions into a BMP file.

RS_SaveBitmap( unsigned char* pixelData, int imageWidth, int


imageHeight, const char* filename )

Parameters
pixelData
Pointer to the raw pixel data.
imageWidth
Width of the image.
imageHeight
Height of the image.
filename
Name of the BMP file.

Error Codes
RS_SUCCESS The image data is saved successfully.
RS_ERR_CANNOT_WRITE_FILE Cannot write the BMP file.
RS_ERR_MEM_FULL Cannot allocate memory.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Example
// Callback function
void sampleCaptureCallback( int deviceHandle, int captureResult, unsigned
char* imageData, int imageWidth, int imageHeight )
{
if( captureResult == RS_SUCCESS )
{
RS_SaveBitmap( imageData, imageWidth, imageHeight,“Captured.bmp” );
}
if( imageData )
{
RS_FreeImageData( imageData );
}
}

Copyright © 2020 by Suprema ID Inc. 189


RealScan Basic SDK Reference Manual

RS_SaveBitmapMem

Saves the raw pixel data returned by capturing functions in a memory buffer.

RS_SaveBitmapMem( unsigned char* pixelData, int imageWidth, int


imageHeight, unsigned char* imageBuffer )

Parameters
pixelData
Pointer to the raw pixel data.
imageWidth
Width of the image.
imageHeight
Height of the image.
imageBuffer
buffer of a BMP file.

Error Codes
RS_SUCCESS The image data is saved successfully.
RS_ERR_MEM_FULL Cannot allocate memory.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 190


RealScan Basic SDK Reference Manual

RS_EncodeWSQ

Compresses the raw pixel data returned by capturing functions into a WSQ file.
See FBI’s Criminal Justice Information Services (CJIS) document, "WSQ Gray-scale
Fingerprint Compressions Specification" for details.

RS_EncodeWSQ( unsigned char* rawBuffer, int width, int height, const


float ratio, unsigned char* wsqBuffer, int* wsqBufferLen)

Parameters
rawBuffer
Raw pixel data in memory.
width
Width of the rawBuffer.
height
Height of the rawBuffer.
ratio
Specifies the bit rate of the compression. Note that it should be thought of as
the level of acceptable distortion rather than a tool to achieve a specific file
size or an exact compression ratio. For example, 2.25 and 0.75 roughly yields
5:1 and 15:1 compression respectively. However, the actual compression ratio
will vary according to the characteristics of the original image. (Range:
0.1~7.5)
wsqBuffer
Compressed WSQ pixel data in memory.
wsqBufferLen
Length of the wsq buffer.

Error Codes
RS_SUCCESS The raw image is successfully encoded.
RS_ERR_INVALID_PARAM Any of the parameters are invalid.
RS_ERR_MEM_FULL Cannot allocate memory.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 191


RealScan Basic SDK Reference Manual

RS_DecodeWSQ

Decompresses a WSQ file into raw pixel data in memory.

RS_DecodeWSQ( unsigned char* wsqBuffer, int wsqBufferLen, unsigned


char** rawBuffer, int* rawWidth, int* rawHeight)

Parameters
wsqBuffer
Compressed WSQ pixel data in memory.
wsqBufferLen
Length of the wsq buffer.
rawBuffer
Pointer of pointer to the raw pixel data of wsq buffer. And if it is not NULL, you
have to free it by RS_FreeImageData later.
rawWidth
Width of the raw buffer.
rawHeight
Height of the raw buffer.

Error Codes
RS_SUCCESS The raw image is successfully
decompressed.
RS_ERR_INVALID_PARAM Any of the parameters are invalid.
RS_ERR_MEM_FULL Cannot allocate memory.

Compatibility
RealScan-10, RealScan-D, RealScan-F Series, RealScan-G10 and RealScan-G1

Copyright © 2020 by Suprema ID Inc. 192


RealScan Basic SDK Reference Manual

Contact Info
Suprema ID Inc. (http://www.suprema-id.com)
#305~308, 3F, Building A, Tera Tower 2, 201 Songpa-daero,
Songpa-gu, Seoul, Republic of Korea
Tel: +82-31-710-5629
Fax:+82-2-881-5126
Email: [email protected], [email protected]

Copyright © 2020 by Suprema ID Inc. 193

You might also like