Thunder SDK is a development kit that allows you to build your own applications with various functions to Sense Thunder. It enables unique development that is optimal for stores and facilities, such as attribute detection function, UI change, and QR code reading function.
Opening AI capabilities such as face recognition/temperature measurement in SensePass, SenseThunderE, SenseThunderE-mini, SenseThunderAir.
Face Algorithms
- 1:1 face recognition
- 1:N face recognition
- Liveness detection
- Mask detection
- Server-side FR
Temp Measurement
- Temperature measurement
Senselink Connection
- Public cloud (Senselink Cloud 2.4.0)
- Register device
- User log in
- Data synchronization
- Record upload
- Configuration delivery
HW Control
- Camera management
- Thermal imaging system management
- Door access control (relay, Wiegand)
2021/4/28
Sample Software Introduction
Introduction to the main functions of the software
Face recognition: 1:1 verification, 1:N identification, server identification, QR code identification, temperature measurement + identification
2.0.0
Add Japanese documentation
2021/4/30
2.1.0
Support out video stream (combined RGB and IR)
Support image rotation
Support face recognition image calibration check
Update temperature algorithm
Support attribute recognition and detection
2021/6/30
2.1.1
Revise sample code
Revise an API of the camera
Operate hardware peripherals
Access SenseLink
The running result is shown below:
Face Recognition
It includes 1:1 face verification, 1:N face identification, server-side identification, QR code identification, and temperature measurement + identification, as shown below:
1:1 Face Verification
The “1:1 Face verification" is a process of proving "you are you", which means that you already have someone's identity information to determine whether the person's face information in the camera view matches the existing identity information.
You need to add a photo of the target person before using it, as shown below:
Then enter the 1:1 matching
1:N Face Identification
The “1:N Face identification” refers to registering the set of face images to be recognized into the local face feature library, and comparing them with the set of face features in the face feature library when the camera acquires the face information to derive the identification result.
Build a facial feature database before using it, as shown below:
Then enter the 1:N identification
Server-side Identification
Server identification is also a 1:N recognition mode, which only replaces the local execution with the remote execution in the "face comparison" link. Since face features are stored on the server, you do not need to build the face feature library at this point, but just enter it directly, as shown below:
Please note that you, as a user, need to implement your own server comparison logic. Please refer to for details.
QR Code Identification
It features parsing of QR code content, placing the QR code in the preview screen to ensure clear imaging of the QR code, and if identification is successful, the QR code content will be displayed on the screen, as shown below:
Temperature Measurement + Identification
Through the Face recognition function and temperature measurement module, the face and thermodynamic diagram data are processed by the algorithm to get the final face temperature. Currently, the temperature measurement modules supported are Arrow module, Guide 120 module, and Guide 256 module. It should be noted that the final face temperature value may deviate depending on the ambient temperature, module model, and usage strategy.
The "Temperature Measurement+Identification" is equipped with a 1:N face feature library. So before using it, you need to go to 1:N Face Identification to set the face features, and then enter the "Temperature Measurement + Identification" function after the setting is completed.
Operate hardware devices
It’s compatible with some peripherals of Pass and Thunder series. The peripherals supported are shown in the following figure:
Login SenseLink
If newDeviceKey is true, it means the current device has not logged into SenseLink. Input the server address, account name, and password, then click login. If the following graph is shown, the login is successful.
Upload record and TSL model
Upload the record obtained from face recognition, QR code, and etc. to SenseLink. Upload TSL model to SenseLink. Please check the following graph for detail.
This document, which describes the functions of a single type, is mainly for developers. The main purpose is to let developers understand the specific purpose and functions provided by each type.
Version
Revision Date
Revision Content
2.0.0
03/01/2021
First Draft
Thunder SDK Package Introduction
The Thunder SDK Package (zip file) has the contents shown below.
dev-documents
: English version of the developer's manual.
2.1.0
04/30/2021
Added an API for video stream output
Added APIs for attribute detection
Added an API for FR face calibration check
Added an API for image rotation
Updated the temperature detection model
2.1.1
06/30/2021
Revised camera function description
Updated the temperature detection model
: English version of the api introduction document for Thunder SDK.
: English version of link api developer's manual.
: English version of Thing Specification Language developer's manual.
model: It stores the algorithm model available to the public and selects the appropriate model to apply to the project according to the requirements. For more information on how to choose the model, please see .
sample: a sample program that demonstrates the basic functionality of Thunder SDK. You need to copy relevant resources into the sample based on the access steps described in to compile and run normally.
jniLibs: It stores the dynamic libraries of core algorithms for multiple devices and platforms available to the public and selects the appropriate dynamic library to apply to the project according to the requirements. For more information on how to choose the library, please see .
license: It contains the test certificates that need to be used on different hardware platforms, which can only be used for testing and need to be applied separately when the product is officially released. For more information on how to use it, please see .
thunder-android*.aar: Thunder SDK development kit. You need to copy the aar into the project at development time. For more information on how to use it, please see .
Return 0 if delete operation is successful, otherwise return
-1 if invalid parameters
-260 if face feature library is empty
-261 if can't find
Exception
None
byte[] getFeature(Bitmap avatar)
Get face feature of the image
Parameter
Parameter Name
Type
Description
Note
Version Introduced
avatar
Bitmap
Clear image of the face for a single person
None
Return
Return face feature byte array
Exception
None
int insert(int userId, byte[] feature)
Insert feature library
Parameter
Parameter Name
Type
Description
Note
Version Introduced
userId
int
Face feature ID
None
Return
Return 0 if the insert operation is successful, otherwise return
-1 if invalid parameters
-259 if face feature fails to add into libary
-262 if can't get UUID
Exception
None
int insert(int userId, byte[] feature)
Insert feature library
2.0.0
2.0.0
2.0.0
2.0.0
feature
byte[]
Face feature byte array
None
2.0.0
Temperature Measurement
Temperature measurement algorithm initialization and calculation
Description of Class
TemperatureActionProxy
Description of Member Function
int init(TempMeasureVersion algorithmVersion,TemperConvertCallback temperConvertCallback )
Initialize temperature measurement algorithm
ThunderAir supports model 1.7.0 (summer mode) and 1.8.0 (normal mode)
ThunderMini supports model 1.3.0 (summer mode), 1.5.0 (normal mode), 1.10.0 (winter mode), 1.11.0 (auto mode)
Thunder-E supports model 1.2.0 (summer mode), 1.5.0 (normal mode)
Parameter
Return
Return 0 if the init operation is successful, otherwise return negative value
Exception
None
TemperInfo temperCalculateObtainRect(FaceInfo faceInfo, float[] imageData, int width, int height, int orient, float envTemper, float topN)
Calculate temperature
Parameter
Return
If the calculate operation is successful, return temperature data and region (the region is the face rectangle region where to measure the temperature), otherwise return null
Exception
None
TemperInfo[] multiTemperCalculate(MatchFace[] matchFaces, float[] temperatureData,int temperatureWidth, int temperatureHeight, float envTemper, int orient, float topN)
Calculate temperature
Parameter
Return
If the calculate is successful, return result array, otherwise return null array
Exception
None
void release()
Release temperature measurement resource
Parameter
None
Return
None
Exception
None
Measure temperature of multi persons on SenseThunderAir
2.0.0
void release()
Release temperature measurement resource
2.0.0
temperConvertCallback
TemperConvertCallback
Temperature measurement callback
None
2.0.0
imageData
float[]
Image data
None
2.0.0
width
int
Image width
None
2.0.0
height
int
Image height
None
2.0.0
orient
int
Face orientation
None
2.0.0
envTemper
float
Environment temperature
None
2.0.0
topN
float
Face information(The temperature detection model detects temperature based on the points on the face. TOP N refers to a portion. Input is float such as 100%, 50%.)
None
2.0.0
temperatureData
float[]
Image data
None
2.0.0
temperatureWidth
int
Image width
None
2.0.0
temperatureHeight
int
Image height
None
2.0.0
orient
int
Face orientation
None
2.0.0
envTemper
float
Environment temperature
None
2.0.0
topN
float
Face information
None
2.0.0
Member Function
Description
Version Introduced
int init(TempMeasureVersion algorithmVersion,iTemperConvertCallback temperConvertCallback )
Initialize temperature measurement algorithm
2.0.0
TemperInfo temperCalculateObtainRect(FaceInfo faceInfo, float[] imageData, int width, int height, int orient, float envTemper, float topN)
Measure temperature of single person on Sensepass, SenseThunderE, SenseThunderE-mini
2.0.0
Parameter Name
Type
Description
Note
Version Introduced
algorithmVersion
TempMeasureVersion
Algorithm version
None
Parameter Name
Type
Description
Note
Version Introduced
faceInfo
FaceInfo
Face information
None
Parameter Name
Type
Description
Note
Version Introduced
MatchFace[]
matchFaces
Matched face information array
None
TemperInfo multiTemperCalculate(MatchFace[] matchFaces, float[] temperatureData,int temperatureWidth, int temperatureHeight, float envTemper, int orient, float topN)
2.0.0
2.0.0
2.0.0
Introduction to Thing Specification Language
The Thing Specification Language (TSL) refers to a description file provided for the configuration between the end-side and the server, which is used to describe the configuration items supported by the end-side and the constraints corresponding to the configuration items.
Overview
The SenseLink platform supports devices to define the TSL. The data model consisting of the configuration (properties, status) of the actual device facilitates the management of the device through the cloud.
TSL
TSL is a JSON format file that is reported by the device when it first accesses SenseLink and is stored in the backend. As you open the details of a device on the web, the web can then dynamically load the TSL and TSL values corresponding to the device. This allows you to ensure consistency between the remote configuration function in the cloud and the local function of the device without upgrading the backend service.
TSL Usage Flow
1.Add TSL to the app and complete the creation based on TSL Data Structure
2.Create the required language pack. For its format, please see TSL internationalization.
3.After completing the development, you can report properties and events on the device, and set properties and invoke services on the cloud, and view the interface call steps Update Process
4.The attributes, events and completed service call data reported from the device will be displayed on the Device Settings tab of Device Details page of the corresponding device in the SenseLink console after passing the data verification.
TSL Structure
TSL is a json file containing "engineVersion", "modelVersion" at the top level: "0.0.1", "deviceType" basic information and related setting status "properties", "status" composition:
Properties
Properties is composed of several modules, each containing multiple set items. Each setting item, also known as fields element, is a description and function definition for each setting item.
Field is composed of key and value. Key describes the name of the configuration item, and Value is the definition including the optional value, style, status of the configuration item. The following is an explanation of some fields. For more configuration, please see [TSL data structure] (# TSL data structure).
type: required, the type of the configuration item value, which can be int, float, string, boolean and others
ranges: optional, to express the interval of the value when the type is int, float, etc., including min: minimum value, max: maximum value, default: default value.
ui: optional, default as text, used to indicate web/device input control style.
List of available values for ui:
options: optional, used when Value is exhaustible (such as wiegand32, wiegand34, and wiegand2602), generally used with select for ui.
Status
Refers to the status of a peripheral component of a device. The platform only reads and does not write, and only maintains the latest state. The JSON file contains name, enable, and options, corresponding to the name, display or not, and optional values. For more information, please see [TSL data structure] (# TSL data structure).
TSL Internationalization
Defines the display names of device types, attributes, and status of all TSL in the system on the device/web, and stores them separately by different languages. TSL internationalization is to explain the TSL values and names in layman's terms for the cloud console and reduce the difficulty of operation. Each language pack is composed of files in JSON format, and the corresponding Key is a translation for the corresponding part of the TSL.
For more information on data structure, please see .
Appendix
Update Process
Data structure of language pack
An example of the data structure of the language pack is as follows.
TSL Data Structure
An example of the JSON field structure for TSL is as follows:
Senselink connection
radio
radio button
date
time picker
text
single-line text input
textarea
multi-line text input
image
image upload and display
values
the value corresponding to the configuration, all values in TSL, including the value in Status
status
the display name of the device peripheral status, the "name" field under Status
common
common translation, e.g. "modelVersion": "Device model version"
Function Type
Description
Properties
Include parameter naming, parameter types, control types, check rules for each function of the product. Triggered by the device or platform to modify
Status
The status of a peripheral component of the device. The platform only reads but does not write, and only maintains the latest status, such as door magnetism status, thermal imaging system connection status, bluetooth lock battery
ui optional values
description
number
number picker
select
drop-down box
checkbox
multi-select box
Field
Description
deviceTypes
set of device types, e.g.: "deviceType": "spse"
groups
TSL categorization name, translation of name in Properties, e.g.: properties[{"name": "general", ...}]
fields
name of the configuration item, all "name" fields of fields under Properties
Add an introduction to the usage of personnel data synchronization
v2.1.0
2021/04/30
Second version
An introduction of Link API
Link API is a series of interface methods for cloud capability encapsulation of SenseLink platform (For JCV Senselink Cloud, please refer to https://docs.japancv.co.jp/senselink/ (Japanese only)). There are two major types of interface methods, one is encapsulation for the platform RESTful interface, and the other is encapsulation for the platform’s Mqtt message push mechanism. Users can use the cloud capability provided by the platform just like calling common Java methods.
Use of Link API
The Link API mainly provides two core types, namely, HttpApiClient and MqttApiClient, and by using the methods provided by these two types, direct communication with the SenseLink platform can be achieved. The brief introduction is as follows:
HttpApiClient: For encapsulation of platform RESTful API, use Http protocol for communication, both are synchronized methods and need to be used in the worker thread;
MqttApiClient: For encapsulation of the platform message push mechanism, use Mqtt protocol for communication, and receive platform message push by establishing a long connection and subscribing to the message Topic.
For the detailed definition of the RESTful API interface and Mqtt Topic involved in the interface method, please refer to the "Thunder SDK API Document".
Initialization of Link API
Link API provides a unified initialization entry, you need to set the Url of the server, the read and write timeout of the request, the language type returned by the interface, etc. The specific use is as follows:
After initialization, specific methods can be called to perform specific services.
RESTful API encapsulation method
Each RESTful API interface encapsulates the corresponding Java method execution. Specific entities class was encapsulated by both the parameter passing value required by the request and the result data of the request. For example, when executing the v2/record request to upload the identification record
Multiple parameters can be passed in directly to the API interface with relatively simple parameters for execution, specified as below:
Device login operation
Get detailed user information based on the user ID
For more details on "RESTful API interface definition" and "correspondence between API and methods", please refer to the Thunder SDK API Document .
Mqtt push mechanism encapsulation method
Each Mqtt message push Topic encapsulates the corresponding Java method. Topic subscribed messages are received by registering callbacks, specified as below
Establish a Mqtt long connection with the server, shown as below:
Subscribe to the personnel group change of the device
Unsubscribe to the personnel group change of the device
For more details on "Mqtt Topic definition" and "correspondence between topic subscribe and methods", please refer to the Thunder SDK API Document.
Introduction of key use processes
Link API provides easy communication with Senselink platform, however, certain process steps need to be followed while using some functions, in other words, both the use of RESTful API interface and the subscriptions to MQTT topics follow a sequence. Below mainly describes the main functional flow steps from the perspective of the sequence of use.
Login and registration steps
Login and registration operations are required to use the functions of SenseLink platform, so that device can be included into the platform for unified management. A brief communication process is stated as follows:
The main steps are described below:
(1) Device login: requestHttpApiClient.getRsa() interface to obtain a public key from the platform first, then use the public key to encrypt the cleartext password, and then request HttpApiClient.login() interface for login operation. The two steps are completed by using the HttpApiClient.login () method, which only needs to pass in the account number, encrypted password, device type and device DUID as method parameters.
token: all interface requests need to use token, which is valid for 7 days. After expiration, 403 error will be returned, in this case, you need to log in again to obtain it;
newDeviceKey: If it is true, it means that the current device has not been included in the unified management of the platform, in this case, device registration operation needs to be performed.
(2) Device registration: the HttpApiClient.register() interface should be requested first for registration, and then the HttpApiClient.bindDefaultGroup() interface should be requested to bind the device and personnel group after successful registration (for subsequent personnel data distribution management). The two steps are completed by applying HttpApiClient.register () method, and parameters such as device name, device location, entrance and exit direction of access control need to be passed in.
device ldid: the unique identification code of the device on the platform, which is used to distinguish device;
companyId: the company id corresponding to the device, and each company has several personnel groups.
Synchronization strategy of object model
Object model related functions are only supported in SenseLink 2.3.0 and above versions. You need to determine the version number of the server before using these functions. On the premise that the server supports these functions, object model can be synchronized without unexpected exceptions. This operation should be placed before the configuration synchronization, the flow chart is shown in the figure below.
(1) Get the version number of the currently connected server by calling HttpApiClient.getServerVersion() to determine whether or not object model related functions are supported by the server. If the version number of the server is greater than or equal to 2.3.0, these functions are supported and you can continue the subsequent operations, otherwise skip directly to step (5);
(2) Calculate the MD5 of the local object model, and call HttpApiClient.checkTslExist() as an input parameter to get the flag zone bit and check whether the local object model exists in the cloud at the same time. When flag==1, it means that the object model already exists and does not need to be uploaded. Otherwise, call HttpApiClient.uploadTsl() to upload the object model;
(3) Call HttpApiClient.checkTslLanguageExist( language ) (zh: Simplified Chinese, zh-tw: Traditional Chinese, en: English) Check whether there is a corresponding language package in the cloud, and get the zone bit and MD5 of the cloud language package. When flag==1 and the MD5 of the cloud language package is consistent with the MD5 of the local language package, it means that the language package already exists and does not need to be uploaded. Otherwise, call HttpApiClient.uploadTslLanguage() to upload the language package;
(4) If there are multiple language packages, repeat step (3);
(5) Perform related operations for configuration synchronization.
Device configuration synchronization strategy
There are two ways to set device configuration parameters: set through the UI interface and set and issue via SenseLink cloud. The brief communication is shown in the figure below:
(1) After the user modifies the configuration through the setting page, the system setting module will upload the modified configuration parameters to the background, and finally broadcast the configuration change;
(2) When the configuration is modified in the background, it will send a configuration change push through MQTT. After receiving the notification, the system setting module will obtain the latest server configuration through HTTP, update the device configuration parameters, and finally broadcast the configuration change;
(3) When the device configuration is reset in the background, it will send a restore default configuration push through MQTT. The system setting module will reset all configurations after receiving the notification, upload the reset configuration to the background, and finally broadcast the configuration change.
Personnel data synchronization strategy
Personnel data synchronization means that the device side obtains the company's corresponding personnel data from the platform side, the data mainly includes the basic information of the personnel and the face photo library required for recognition. The brief communication process of data synchronization is as follows:
(1) After the device logs in successfully and establishes a long Mqtt connection with Mqtt Broker, you need to actively subscribe to the "Device Personnel Group Change Topic". After subscribing, you can immediately receive the message push and obtain all the personnel group information belonging to the device (the key field is the id of the personnel group). You can unsubscribe to the Topic after receiving the data;
(2) With all the personnel group ids obtained in (1), continue to subscribe to "Single personnel group under all personnel data Topic", after subscribing, all personnel information of the personnel group can be obtained (key fields are user_id and image_url). You can unsubscribe to the Topic after receiving the personnel information of all groups
(3) With the user_id and image_url obtained in (2), detailed personnel information and avatars can be obtained through the RESTFul interface. This step needs to be repeated to obtain all the personnel data;
(4) After initial acquisition of personnel data, it is necessary to subscribe to the "Topic of personnel data change under the single person group". After the subscription, the personnel increment list and the change type will be returned immediately, then you need to process the data correspondingly according to the change type.
Version
Revision Date
Revision Content
v1.1.0
7/16/2020
First Draft
v1.2.1
2020/11/10
{
"engineVersion": "0.0.1",//Engine version
"modelVersion": "0.0.1", //Model version
"deviceType": "sps", // Device type
"properties": [/*... */], // Function configuration items
"status": [/*...*/]// Device peripheral status
}
{
"properties": [{
"name": "group-name",
"fields": [{ // Collection of configuration items
"key": { // Description of the name of configuration items
"name": "product_customer", // Name
"desc": "vendor-customer" // used to describe name, with no real purpose
},
"value": {} // Description of optional values for configuration items
]
}]
}
{
"engineVersion": "0.0.1",//Engine version
"modelVersion": "0.0.1", //Model version
"deviceType": "sps",
"properties": [{
"name": "features",
"fields": [{
"key": {
"name": "identify_mode",
"desc": "Enabled State"
},
"value": {
"required": true, // required or not. It’s non-required by default if not set.
"type": "int", //data type, must be set, including numeric, boolean, and string.
"editable": true, // Editable or not. It cannot be edited by default if not set,
/*
** UI components must be set with the following types
*** Number picker number
*** Drop-down box select
*** Multi-select box checkbox
*** Radio button radio
*** Time picker date
*** Single line text input text
*** Multi-line text input textarea
*** Image upload and display image
*** Default is text
*/
"ui": "select",
"ranges": [{
"min": 1,
"max": 2,
"enable": "{open_way}==2", //js expression string or boolean value. It is enabled by default if not set. The fields in curly braces indicate the value to be replaced, e.g. if the open_way value is 2, the expression is parsed as "2==2".
"default": 1.5
},{
"min": 3,
"max": 4,
"enable": "{open_way}==3",//js expression string or Boolean value. It is enabled by default if not set.
"default": 3.5
}],
"step": 0.5,// Step size, only for values
"precision": 1, // Precision, indicates the exact number of decimal places, non-negative integer, and works only for numeric values, not required
"mult": true, //multiple-choice or not, not required. The passing parameter is a single value by default if it’s not set. Multiple values only work for dropdown and multi-select boxes.
"enable": "{open_way}==1", // js expression string or boolean value, not required, indicates the display and hiding of the field via linkage control. If the enable property is not set, it is available by default.
"size": 20, // string length, not required, only works for string and image base64
"timeFormat": "yyyy-MM-dd HH:mm:ss", //if ui is date, the time format must be filled in. hh means 12 hours, HH means 24 hours
"options": [{
"value": 0,
"name": "off",
"enable": "{open_way}==2", // js expression string or boolean value. Returns true, indicating that the selected value can be used in the candidate item. If the enable property is not set, it is available by default.
}, {
"value": 1,
"name": "on", // js expression string or boolean value. Returns true, indicating that the selected value can be used in the candidate item. If the enable property is not set, it is available by default.
"enable": "{open_way}==3"
}],
//watch: indicates status listening
/*
** The following example indicates that the value of the current field is associated with the use_mode field.
** When the use_mode field changes, the value of the current field is equal to the value after the expression is executed "{use_mode}==2?1.5:{use_mode}==1?2:{recognition_distance}"
*/
"watch":{
"use_mode": "{use_mode}==2?1.5:{use_mode}==1?2:{recognition_distance}"
}
},
}]
}],
"status": [{
"name": "wifi",
"enable": true, // js expression string or boolean value. Controls the display condition of this field. If the enable property is not set, it is available by default.
"options": [{
"value": 0,
"name": "off",
"enable": "{open_way}==2", // js expression string or boolean value. Returns true, indicating that the selected value can be used in the candidate item. If the enable property is not set, it is available by default.
},{
"value": 1,
"name": "on",
"enable": "{open_way}==1", // js expression string or boolean value. Returns true, indicating that the selected value can be used in the candidate item. If the enable property is not set, it is available by default.
}],
}]
}
MqttApiClient.connectMqtt(new IMqttActionListener() {
@Override
public void onSuccess(IMqttToken iMqttToken) {
// Connection successful
}
@Override
public void onFailure(IMqttToken iMqttToken, Throwable throwable) {
// Connection failed
}
}, new IConnectionLost() {
@Override
public void onConnectionLost(Throwable cause) {
// Connection lost
}
});
// Initialize
LinkSDKHelper.getInstance().init(“https://link.japancv.co.jp/sl/”, this)
.setConnectTimeout(10 * 1000)
.setReadTimeout(30 * 1000)
.setWriteTimeout(10 * 1000)
.setLanguage(LinkSDKHelper.LanguageTypeEnum.ZH) // Set the language of return information from the server
.addInterceptor(new ResponseInterceptor()) // Set interceptors
.setDebug(true);
// Parameter entity class
RecordParameter recordParameter = new RecordParameter();
recordParameter.setUserId(2547);
recordParameter.setMode(2);
recordParameter.setSignTime((int) (System.currentTimeMillis() / 1000));
recordParameter.setType(1);
recordParameter.setInTime(0);
recordParameter.setEntryMode(1);
Bitmap bitmap = BitmapFactory.decodeStream(mAppContext.getAssets().open("test.jpg"));
recordParameter.setUsername("testUserName");
// Error occurs when uploading incorrect base64 string
recordParameter.setSignBgAvatar(Base64Utils.bitmapToBase64(bitmap));
recordParameter.setSignAvatar(Base64Utils.bitmapToBase64(bitmap));
recordParameter.setDocPhoto(Base64Utils.bitmapToBase64(bitmap));
recordParameter.setIcNumber("235113");
recordParameter.setIdNumber("460003199809086744");
// Call the encapsulated method to execute the specific request. Result refers to the unified wrapper class for the result of the request
Result<RecordResult> recordResultResult = HttpApiClient.uploadRecord(recordParameter);
if(recordResultResult.isSuccess()){
// Get the request result data and process it, RecordResult refers to the entity class of the request result data
RecordResult body = recordResultResult.getBody(RecordResult.class);
// todo: the execution of specific operations
} else {
// Request exception. Please see the API documentation for details
}
}
// Request parameters
// Synchronize method calls, which need to be executed in the work thread
Result<LoginResult> loginResult = HttpApiClient.login(
"account", "password", "SPS", AppUtils.getAndroidId(ContextUtils.getContext()));
int userId = 5;
Result result = HttpApiClient.getUserInfo(userId);
// Subscribe to the personnel group change
MqttApiClient.registerGroupChangeListener(new MessageCallback() {
@Override
public void success(MqttMessage msg) {
// json data is the body of the push message.
String json = new String(msg.getPayload());
// Delete the device in the background and push an empty string without processing.
if (TextUtils.isEmpty(json)) {
return;
}
// Get the data. Group class is the entity class corresponding to the message data.
Pair<List<Group>, Boolean> pushGroupList =
DataConverter.convertJsonToGroupList(json);
// Process data according to specific business
}
@Override
public void error(int code, String msg, Throwable throwable) {
// Subscription exceptions / Message push exceptions
}
});
MqttApiClient.unRegisterGroupChangeListener();
LinkSDKHelper
Initialize LinkSDK, set network request parameters
void onTemperaturePreviewData(Bitmap temperatureBitmap, float[] temperatureValue, int width, int height)
Temperature Preview Data Callback: Thermal imaging system outputs the image orientation as the same as its phisical orientation. For example, the human face will output with the vertical orientation.
Parameter
TemperatureCameraConfig
Thermal imaging system Configuration
Description of Properties
CameraType
Thermal imaging system Type(Enumeration Type)
Description of Properties
float getCameraBodyTemperature()
get Camera Body Temperature
2.0.0
void addTemperaturePreviewDataCallback
(ITemperaturePreviewDataCallback callback)
add Thermal imaging system Preview Data Callback
2.0.0
void initCamera(Context context)
Initialize the Thermal imaging system
2.0.0
void releaseCamera()
release Thermal imaging system
2.0.0
void removeTemperaturePreviewDataCallback
(ITemperaturePreviewDataCallback callback)
remove Thermal imaging system Preview Data Callback
Calculate the Actual Temperature from the Temperature Data
Parameter Name
Type
Description
Note
Version Introduced
y16Frame
float[]
Original Temperature Chart
None
Returned Value
Description
Version Introduced
true
Converted
2.0.0
false
Not Convered
Parameter Name
Type
Description
Note
Version Introduced
temperatureData
float
Temperature Data on Each Pixel, Such as Energy Value
None
Parameter Name
Type
Description
Note
Version Introduced
callback
ITemperaturePreviewDataCallback
Preview Data Callback
None
Parameter Name
Type
Description
Note
Version Introduced
context
Context
Context
None
Parameter Name
Type
Description
Note
Version Introduced
callback
ITemperaturePreviewDataCallback
Temperature Preview Data Callback
None
Parameter Name
Type
Description
Note
Version Introduced
textureView
TextureView
Android System Native (Used for Data Processing)
None
Parameter Name
Type
Description
Note
Version Introduced
config
TemperatureCameraConfig
Thermal imaging system Configuration
None
Parameter Name
Type
Description
Note
Version Introduced
enable
boolean
Set Auto Shutter Enable
None
Parameter Name
Type
Description
Note
Version Introduced
temperatureBitmap
Bitmap
Temperature rgb Picture
None
Member
Type
Description
Note
Version Introduced
environmentTemperature
float
Environment Temperature
None
Member
Description
Note
Version Introduced
IRAY
IRAY
None
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
GUIDE120
Camera
An instance of quick access to the camera is provided, an interface for previewing data is obtained, method of managing the life cycle of the camera is encapsulated, and the monitoring of the camera.
Result uploadDeviceVersionInfo(DeviceVersionInfoParameter deviceInfoParameter)
Upload Device Version Info
2.0.0
Result uploadConfig(String deviceConfigKey, Object config)
Upload Configuration
2.0.0
Result uploadTsl(TslUploadParameter parameter)
upload Tsl
2.0.0
Result uploadTslLanguage(TslLanguageUploadParameter parameter)
upload Tsl Language Package
2.0.0
Parameter Name
Type
Description
Note
Version Introduced
type
int
Image Type
1-Base Image in Senselink, 2-Recognition Image
Parameter Name
Type
Description
Note
Version Introduced
reportParameter
AlarmReportParameter
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
password
String
password
None
Parameter Name
Type
Description
Note
Version Introduced
md5
String
File md5
None
Parameter Name
Type
Description
Note
Version Introduced
lang
String
Language
None
Parameter Name
Type
Description
Note
Version Introduced
searchParameter
FaceSearchParameter
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
parameter
UserInfoParameter
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
id
long
User ID
None
Parameter Name
Type
Description
Note
Version Introduced
id
long
Guest ID
None
Parameter Name
Type
Description
Note
Version Introduced
timetableId
long
Pass Time Table ID
None
Parameter Name
Type
Description
Note
Version Introduced
parameter
IdentifyQRCodeParameter
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
account
String
Device Login Account
None
Parameter Name
Type
Description
Note
Version Introduced
registerParameter
RegisterParameter
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
userStatusParameter
UserStatusParameter
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
userSyncStatusParameter
UserSyncStatusParameter
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
connectConfig
ConnectConfigEntity
Configuration
None
Parameter Name
Type
Description
Note
Version Introduced
param
DeviceReportEventParamer
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
recordParameter
RecordParameter
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
deviceInfoParameter
DeviceVersionInfoParameter
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
deviceConfigKey
String
Device config key
None
Parameter Name
Type
Description
Note
Version Introduced
parameter
TslUploadParameter
Parameter
None
Parameter Name
Type
Description
Note
Version Introduced
parameter
TslLanguageUploadParameter
Parameter
None
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
Door Access
Door Access Device Controling Pass and Thunder series devices
Description of functional types
DoorDeviceAccessProxy
Control the overall initialization, configuration, and resource release operations of communication devices such as GPIO ports and serial ports of the control device, and perform specific door opening operations.
Description of Member Function
DoorAccessConfig getConfig()
Get Door Access Configuration
Parameter
None
Return
Exception
None
DoorAccessDevice getDevice(int deviceType)
Get device reference according to device type
Parameter
Return
Exception
None
void changeOpenDoorDevice(int mode)
Change Open Door Mode
Parameter
Return
None
Exception
None
void closeRelayDoor()
Close Relay Door
Parameter
None
Return
None
Exception
None
void init()
Initialization without serial port number, refer to [void init(String uartName)](#void init(String uartName))
Parameter
None
Return
None
Exception
None
void init(String uartName)
Initialization with serial port number
Parameter
Return
None
Exception
None
void openDoor(String cardNumber)
Open the door, execute the door opening action according to the set open door mode
cardDataString card Data String Return the custom Wiegand data corresponding to the card
2.0.0
Member Function
Description
Note
Version Introduced
void onDoorStateChanged(int state)
Door Magnetism State Callback
state 0-OFF, 1-ON
2.0.0
Member Function
Description
Note
Version Introduced
void onReceive()
Fire Sign Listener
None
2.0.0
Member Function
Description
Note
Version Introduced
void onReceive()
Dismantle Sign Listener
None
2.0.0
Member Function
Description
Note
Version Introduced
void onSensorChanged(String value)
Data Change Callback
None
2.0.0
Member Function
Description
Note
Version Introduced
void onInfraredSignalRead()
Ir Callback
None
2.0.0
Member Function
Description
Note
Version Introduced
void onReceive(byte[] data,long dataLength)
RS485 Data Read Listener
dataLength: Data Length; data: Data Read
2.0.0
Member Function
Description
Note
Version Introduced
void onTimeout(byte[] data,long dataLength)
RS485 Data Read Time Out Callback
dataLength: Data Length; data: Data read when timeout
2.0.0
Member Function
Description
Note
Version Introduced
void onClick()
Door Button On Click Callback
None
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
2.0.0
static final int OPEN_DOOR_MODE_IP_RELAY
static final int WIEGAND26_8_16_BIT
static final int GPIO_IN_DOOR_MAGNETISM
int mOpenDoorMode
void setConfig(DoorAccessConfig config)
Development manual
Add an introduction to door access function
v1.2.0
10/14/2020
Add an introduction to face temperature measurement function
v2.0.0
02/05/2021
Add an introduction to camera call process and thermal camera call process, improve the description of face temperature measurement related interfaces
v2.0.0
04/10/2021
Revise the description of support device
v2.1.0
04/30/2021
Revise the typos
Change the package name
Add the algorithm version of temperature detection in devices
Thunder SDK Development Manual
Thunder SDK [hereinafter referred to as "SDK"] is an Android SDK based on AI face algorithm and its derived functions, and takes the intelligent hardware device [hereinafter referred to as the "hardware device"] as the running carrier. It can be used for rapid development of liveness detection, 1:N face identification, 1:1 Face Verification, face temperature measurement, mask detection, access control and other functions.
This document is intended to describe the integration steps of the SDK and how to use the key functions, mainly for development engineers.
SDK Business Capabilities Introduction
This SDK is used for offline identification, capturing faces through device cameras for face identification, and its general flow is shown in the figure below
Based on this generic process, it may be 1 vs 1 or 1 vs N in face matching, so the process is subdivided into 1:1 matching and 1:N identification. Both are used in different scenarios, and 1:1 is not the case where N is set to 1 in 1:N, as defined below.
Call Camera
Quickly access the camera and get the preview callback data, encapsulate methods to manage the camera lifecycle, and support monitoring of the camera status.
Call Thermal imaging system
The characteristics of abstract Thermal imaging system used in traffic scenes, support Thermal imaging system preview and get the data callback, manage its lifecycle, monitor its status, and auto connection after hot plug.
The Thermal imaging system models supported are Arrow, Guide 120 and Guide 256.
1:1 Face Verification
The “1:1 Face Matching" is a process of proving "you are you", which means that you already have someone's identity information to determine whether the person's face information in the camera view matches the existing identity information.
The “1:1 Face Matching" is an authentication operation, which is often used in scenarios requiring identity verification, such as real-name authentication in mobile carrier shop, bank, and authentication scenarios in stations, airports, hotels, and Internet cafes.
1:N Face Identification
The “1:N Face Identification” refers to registering the set of face images to be recognized into the local face feature library, and comparing them with the set of face features in the face feature library when the camera acquires the face information to derive the identification result.
The “1:N Face Identification” is often used in scenarios that require multi-person identification, such as access control and attendance check-in for communities, buildings, schools, etc.
Mask Detection
The “Mask Detection” refers to the rapid detection of whether a person is wearing a mask by analyzing the face information captured by the camera, which is used in scenarios where masks are required, such as hospitals, manufacturing plants, and construction sites with large amounts of dust.
Server 1:N Identification
In the general process mentioned above, face matching can be performed either locally or remotely (via Http network requests). In the remote execution, the user needs to implement the comparison logic by himself, and the user can consider to achieve this function under the premise of the existing face identification backend server.
Door Access Function
The “Door Access Function" refers to the control function of the SDK for door access devices. Different hardware devices have different ranges of support for door access devices. To facilitate the description of the correspondence, the following concepts are defined:
"Door Access Device" - as a collective term for all devices including hardware accessories included in the hardware device of SenseTime and peripheral devices that can be connected and used by the hardware expansion interface.
Hardware Accessories: including screen backlight, IR fill light,light sensor, distance sensor, buzzer,local relays, loudspeakers, force removal and alarm button;
Peripheral Devices: door open buttons, fire signals, door magnets, door bells, alarms, Wiegand card readers, network relays, Wiegand door open controllers, etc.
“Door Access Function” - mainly refers to the use of "Door Access Device", such as opening the door with local relays, opening the door with Wiegand controller, turning off screen fill lights, controlling the doorbell ringing, and sensing the distance of human body with distance sensor.
SDK's support for the "Door Access Function" of different hardware devices varies, as follows (the following table is described only from the perspective of SDK (not hardware) adaptation:
Device Model
Open Button
Fire Signal
Door Sensor
Doorbell
Alarm
Wiegand Reader
Wiegand Controller
Local Relay
For the purpose of description, this document is defined as follows:
Pass Access Control Function: refers to the access control function used by the remaining devices in the Pass and Thunder series (the device models above).
Please pay attention to the following distinction between different devices when the use of the access control function is described.
QR Code Identification
The "QR Code Identification" refers to the function of parsing the content of QR code, which is used in the scenario of QR code identification. There are two codec libraries ZXing and ZBar built into the SDK, which can be selected by yourself when used.
Face Temperature Measurement
The "Face Temperature Measurement" means that through the face identification function and temperature measurement module, the face and thermodynamic diagram data are processed by the algorithm to get the final face temperature. Currently, the temperature measurement modules supported are Arrow module, Guide 120 module, and Guide 256 module. It should be noted that the final face temperature value may deviate depending on the ambient temperature, module model, and usage strategy.
Introduction to Devices Suitable for SDK
Device Model
Device Category
Platform
Android Version
Camera Type
SensePass
Pass Series
RK3399-arm64-v8a
Android 7.1
Introduction to Face Camera Imaging
For the purpose of illustrating camera imaging, the following definition is made.
Horizontal Imaging: means that the width of the camera imaging picture is greater than the height.
Vertical Imaging: means that the width of the camera imaging image is less than the height.
Imaging Mirroring :refers to the camera image in which the real moving direction of the object is opposite to the direction in which the picture is presented. If a person walks to the left, he or she goes to the right in the preview screen.
Face Orientation: refers to the direction that the face points to in the camera image, as shown below from left to right UP, DOWN, LEFT, RIGHT, in that order.
The following table indicates the imaging characteristics of the face camera corresponding to the specific device model.
Device model
Imaging direction
Face orientation
Imaging mirroring
SensePass
Vertical Imaging
LEFT
No
Access Instructions
The SDK is provided as a.zip package file, which includes the.aar package,.so file, algorithm model file, sample project and development documentation. The SDK requires the following environment:
you need to apply for authorized .lic certificate so that your application can run in the intelligent hardware
Start Integration
Copy the .aar file to the project libs folder, as shown in the figure below.
Select the corresponding model file in the "model file" folder of the zip package according to the device type, as shown in the figure below.
Device type
Corresponding model
Pass series
.model file in the root of the model folder + all files in the pass_ext folder
Thunder series
.model file in the root of the model folder + all files in the pass_ext folder
Copy the corresponding model file in the zip package to the actual project assets/model folder.
Select the corresponding so library in the "so library" folder of the package according to the device type, as shown in the table below
Device type
Corresponding so
Pass series
Pass-series-rk3399-general(arm64-v8a only)
Thunder series
Pass-series-rk3399-general(arm64-v8a only)
and copy the so in the folder to the /src/main/jniLibs folder.
And the final folder structure should be like this:
Add the following configuration to the build.gradle file
Add the following permission declaration in AndroidManifest.xml file
Copy the .lic certificate to the assets folder (there is a debug certificate in Sample, which is for testing purposes only, and a separate application is required for the official production environment certificate), as shown in the following sample image.
Sample Project
The Sample project can be opened in Android Studio. Copy aar, model, so and other files to the corresponding folder according to the documentation, and run debugging with pass series and thunder series of hardware devices. The Sample project mainly demonstrates 1:N identification, 1:1 matching, mask detection, access control and other functions.
SDK usage
In this section, the use of key api and processes in the SDK will be mainly described.
SDK initialization
Before using the SDK, please make sure that the aar, model, so and .lic files are properly stored and configured. Once the files are ready, the initialization can be performed as follows:
Authorization can be made after successful initialization:
In general, there is no need to perform a release operation before the application exits after successful SDK authorization. Specifically, when it is necessary to restart the application, the SDK resources can be released at the end of the application, as follows:
Call Camera
The CameraTextureView and CameraManager classes in the SDK make it easy to manage the camera life cycle and related preview operations. The following is an example of using a face camera (RGB) to introduce the use of the camera. CameraTextureView can be used in the layout file as follows (full screen preview).
Then initialize the camera (Please check the following code for detail. 1280*720 preview resolution is highly recommended), as follows,
Control Camera Lifecycle, as follows:
Call Thermal imaging system
Before calling the relevant interface of the thermal camera, get the instance of the thermal camera first. TemperatureCameraFactory is provided in the SDK to obtain different instances of the Thermal imaging system, shown as follows:
Initialize the Thermal imaging system configuration
Add Thermodynamic Diagram and Callback of Temperature Data
Get the partial status of the Thermal imaging system
Manage the lifecycle of the Thermal imaging system
In addition, the SDK provides a number of methods to operate the Thermal imaging system, shown as below:
1:N Face Identification Flow
The business process of face identification contains several steps such as Camera management, face feature library creation, liveness detection, face comparison, and result processing, which involves many details of SDK usage. The following article introduces the details of SDK usage, taking the process of "1:N identification" as an example.
Create Face Feature Library
The "1:N identification" requires a face feature library as the "database" for face feature retrieval, so the face feature library needs to be built before the process starts. The SDK has FeatureManagerProxy for feature library creation, which is briefly used as follows.
N face features (a maximum of 5W features) can be inserted in the feature library. After the construction is completed, the Identify Manager automatically obtains the inserted facial feature data of 'FeatureManagerProxy' during the identification process for personnel identification.
Start Camera Preview
Please check Call Camera section for detail to turn on the RGB camera. If liveness detection is enabled, you also need to turn on the IR camera again and modify the preview data callback to pass the preview data into the Identify Manager, as follows:
Start the Identify Manager
The Identify Manager has built-in "1:N", "1:1" and "server 1:N" identification processes, and you can switch the internal identification logic by switching the Identify Manager mode. The Identify Manager modes are as follows.
VerifyModeEnum.MODE_1_N: 1:N identification mode, corresponding to 1:N identification process.
VerifyModeEnum.MODE_1_1: 1:1 comparison mode, corresponding to 1:1 comparison process.
VerifyModeEnum.MODE_SERVER_1_N: server 1:N identification mode, corresponding to the server 1:N identification process;
Before use, set the configuration as follows:
After the initial setup, the Identify Manager can be turned on/off to control identification, as follows
The identification process can control the details through the parameters, and the Identify Manager parameters can be configured individually according to the specific business, as follows. (In the code annotation below, if there are notes for a series different from the pass and thunder series, please skip them as appropriate.)
Process Identification Result
The Identify Manager transmits the identification result to the upper business by the way of interface callback, and the upper business only needs to process the result in the callback interface, shown as follows:
When the result callback is not required, set null as follows:
At this point, the process of "1:N identification" has been preliminarily built.
1:1 Face Verification Process
In the above description, the Identify Manager in the "1:N identification" process uses the mode VerifyModeEnum.MODE_1_N, which is the "1:N identification" mode. In the face "1:1 matching" process, the Identify Manager needs to be switched to "1:1 matching" mode, as follows:
Server 1:N Identification
When the identification step is executed on the remote server, you need to modify the configuration of the Identify Manager to enable the server identification based on 1:N identification, and then use the IServerVerifyAction class to implement the identification logic. The specific use is as follows:
Mask Detection
Based on the identification of "1:N", "1:1" and "server 1:N", the corresponding mask detection results can be obtained from the identification results by configuring to open the mask detection. If the mask detection function is not enabled, the default mask detection result is true, enabled as follows:
Face Temperature Measurement
Based on the identification of "1:N", "1:1" and "server 1:N", the temperature measurement configuration item of the Identify Manager needs to be enabled before the face temperature measurement function is used, as shown below
It should be especially noted that the Identify Manager needs temperature data to work properly after the temperature measurement function is turned on, and no identification will be made before the temperature data is obtained, but face tracking will be carried out normally. In addition, when the temperature measurement function is turned on, it is recommended to set the rectangle for face recognition and a stricter angle of the front face to try to identify the face in the center of the field of view, so as to increase the accuracy of face identification and temperature measurement, as follows
The temperature measurement function requires a temperature measurement module (Thermal imaging system), which can be initialized by obtaining the corresponding Thermal imaging system object through the TemperatureCameraFactory class. Note that the Thermal imaging system takes several seconds to initialize, as follows
After the temperature data are obtained, the temperature value needs to be calibrated by the temperature measurement algorithm, which needs to be initialized manually, as follows
Set Temperature Sdk Action to the Identify Manager,
Get the thermal camera preview data (thermodynamic diagram). Once the temperature data is acquired, it needs to be injected into the Identify Manager in time, as follows
Get personal temperature data from the identification callback results:
Use of Pass Access Control
The use of the Pass access control feature requires a global initialization configuration, which is initialized as follows.
The configuration for using the Pass access control function can be dynamically modified by DoorDeviceAccessProxy.setConfig(config).
Key categories of Pass access control function:
DoorDeviceAccessProxy: responsible for global initialization, resource release, configuration usage, door opening control.
DoorAccessConfig: Categories of Door Access Configuration.
PassDoorDeviceAccessProxy: Manage access control functions available to SensePass/SensePassPro devices, such as door chimes, RS485 protocols, alarms, and tamper alarm lights.
Open Door via Local Relay
The "local relay" is a hardware device with its own accessories, used to control the opening of the door and set the door opening time (i.e. open the door for a number of seconds and then close it). The hardware models supporting this function are SensePass, SensePassPro.
The Pass access control function is used as follows:
DoorDeviceAccessProxy.openDoor() automatically acquires the configured door opening method and the delayed closing time, and then automatically executes the door opening action. The user does not need to care about the specific way to open the door, which is automatically controlled by the method. The same is true of door openning with the network relay and the Wiegand controller below.
Specifically, when the delayed closing time needs to be greater than 30 seconds, it is necessary to open the door in the following ways
If the local relay needs to be closed immediately, the following method can be called manually.
Open Door via Network Relay
The "Network Relay" is a peripheral device. The hardware device connects to the network relay through the network, and controls the door opening and delayed closing time by sending door opening commands to the network relay. The hardware models supporting this function are Pass and Thunder series.
The Pass access control function is used as follows:
Open Door via Wiegand Controller
The "Wiegand Controller" is a peripheral device that connects to the hardware device through an expansion interface and uses the Wiegand protocol for data communication, which can be used to control the door opening. SDK currently supports Wiegand 26, Wiegand 32 and Wiegand 34, and the hardware models that support this function are Pass and Thunder series device.
The maximum card number supported by the standard Wiegand 26 protocol is 8 bits, and the card number data transmission is divided into HID and PID. According to the generation mode of HID and PID, Wiegand 26 is subdivided into two modes, "Wiegand 26 (24bit)" and "Wiegand 26 (8+16bit)”, whose difference is as follows:
Wiegand 26 (24bit): For ordinary use mode, the card number is converted to int, divided by 2^16 to take an integer as HID, and the remainder of 2^16 is taken as PID.
Wiegand 26 (8+16bit): For special use mode, the first 3 digits of the card number are converted to int as HID, and the last 5 digits are converted to int as PID.
The Pass access control function is used as follows:
Open Door via Wiegand 26
Open Door via Wiegand 32/34
Wiegand card reading
The "Wiegand card reading" needs to be configured with a Wiegand reader, which is a peripheral device. It connects with the device through the extended interface and uses the Wiegand protocol for data communication to read the IC card number. It supports Wiegand 26 (consistent with the above description), Wiegand 32 and Wiegand 34. The hardware device models supporting this function are Pass and Thunder series device.
The Pass access control function is used as follows:
Once the setup is complete, you can listen to the Wiegand read callback. The code is used as follows.
GPIO Input Devices
"GPIO input devices" refer to a class of devices that send GPIO signals to hardware devices through the GPIO port connection, including door opening buttons, fire signals and door magnets. When used, the hardware device serves as the receiver and the "GPIO input device” serves as the sender, and the two communicate through the GPIO input port. The hardware device models that support this feature are Pass and Thunder series device.
Pass access control function supports the use of dual GPIO, divided into B and C. configuration. Before use, set the relevant access control configuration, and its code is as follows:
Once the setup is complete, you can listen to the relevant signal input. The code is used as follows.
GPIO Output Devices
"GPIO output devices" refers to peripheral devices connected through GPIO output port for receiving GPIO signals from hardware devices, including doorbell, and alarm. When used, the hardware device serves as the sending end and the "GPIO output type device" serves as the receiving end, and the two communicate through the GPIO output port. The hardware device models that support this feature are Pass and Thunder series.
Before use, set the relevant access control configuration, and its code is as follows:
Specifically, when using the alarm, you need to manually control the alarm and turn off the alarm. The code is used as follows:
Light Control
"Lighting Control" mainly controls the lighting accessories of hardware devices, including RGB fill light, IR fill light and screen backlight.
IR Fill Light
The "IR fill light" is part of the IR camera module and is used to enhance the IR image. To increase its lifetime, it can be dynamically controlled to turn off when not in use. The hardware device models that support this feature are Pass and Thunder series.
The code is used as follows:
Screen Backlight
The "screen backlight" is an accessory that comes with the hardware device to turn off the screen light when the software application is in a dormant state (such as late at night when the software application is no longer needed), increasing the life of the hardware device and reducing energy consumption. The hardware device models that support this feature are Pass and Thunder series.
The code is used as follows:
RS485 Protocol
The "RS485 protocol" refers to a serial communication protocol standard. The RS485 interface is provided in the hardware device to support its communication in half-duplex mode, Half-duplex data read-only and write-only are controlled automatically by the rom, and the upper business only needs to pay attention to the serial communication. The hardware device models that support this feature are Pass and Thunder series.
Before use, first turn on the RS485 function, and set the baud rate, data buffer, and data transceiver timeout length according to the use scene.The code is used as follows:
To send data, use the following code:
Tamper alarm button
The "tamper alarm button” is an accessory that comes with the hardware device, located on the back of the device as a raised button. When the button is pressed during normal operation, the button will pop up when the hardware device is removed, and the Rom level will sense it and issue a "tamper alarm" for alerting when the hardware device is removed abnormally.
The Rom level converts the "tamper alarm" into an input event of the "F2 button", i.e. when the "tamper alarm" occurs, the system layer sends the "F2 button" input event. F2 button" input event, so you can listen to the "tamper alarm" by listening to whether the "F2 button" is pressed or not. The code is used as follows:
Sensor
"Sensors" refers to the sensors that come with the hardware device, such as light sensors, and distance sensors. For the passage scenario, the role of sensors is as follows:
Light sensor: senses light intensity and can set "fill light mode" for applications in low light conditions.
Distance sensor: senses the proximity of a person to trigger certain specific operations (e.g. waking up a device in a dormant state when the person is close).
Sensors can be used through the SensorManager class in the Android native SDK, whose code is used as follows:
Buzzer
The "buzzer" is an accessory that comes with the hardware device and is mainly used for beeping when an alarm occurs on the hardware device. Currently, only SensePass and SenseThunderE-mini devices support this feature. Using the buzzer requires manual control to turn it on and off, and the code is as follows:
Application System Signature
The system signature file sensetime.jks is placed in the sample project of the SDK. Using this file as the application signature allows the application to gain system privileges, which allows the application to perform more operations that require high privileges, such as setting system events, and modifying system settings.
To use it, please copy sensetime.jks to the root of the main module of the project, and then add the following configuration to the build.gradle file.
And add the system application declaration android:sharedUserId="android.uid.system" to the AndroidManifest.xml file, as follows:
QR Code Identification
The QR code recognition function can recognize ordinary QR codes normally. When using it, you can select ZXing or ZBar encoding and decoding library. It is recommended to use ZBar, which is more suitable for end-to-side device identification and faster. For more information on how to use it, please see the Sample code. The brief usage is as follows:
// Specify the model used by the SDK. Here, take initialization on SensePass devices as an example. For more information, please see the Sample code.
model.mMode = SDKMode.PASS;
model.mAlignmentModel = "model/M_Align_occlusion_106_1.20.0.model";
model.mSmallDetectModel = "model/M_Detect_Hunter_LargeFaceSelfie_Gray_11.2.0.model";
model.mVerifyModel = "model/M_Verify_Mobilenetv2Pruned_BGR_Surveillance_4.13.0_v2_weak.model";
model.mDoubleHackModel = "model/pass_ext/M_Liveness_Antispoofing_Binocular_3.28.0.model";
model.mVerifyFinanceModel = "model/M_Verify_Mobilenetv2Pruned_BGR_Surveillance_4.13.0_v2_weak.model";
model.mAttributeModel = "model/M_Attribute_MTNet_2.1.1.model";
// The name of the license file
String licenseName = "sensepass.lic";
String productName = null;
WuKong.auth(licenseName, productName, model, new IAuthCallback() {
@Override
public void onSuccess() {
// Authorization successful
}
@Override
public void onFail(int code, String errMsg) {
// Authorization failed
}
});
CameraTextureView mCameraView = findViewById(R.id.camera_view);
Camera.PreviewCallback mRgbCallback = new Camera.PreviewCallback() {
@Override
public void onPreviewFrame(byte[] data, Camera camera) {
// Preview data callback, which can be passed to the Identify Manager
// IdentifyManager.getInstance().handleRgbData(data);
}
};
// Take setting up a face camera as an example
CameraManager faceCameraManager = CameraManager.getInstance(CameraUtils.getFaceCameraIndex());
// Add preview data callback
faceCameraManager.addPreviewCallbackWithBuffer(mRgbCallback);
// Open Camera
faceCameraManager.openCamera(getApplicationContext());
// Set preview-related parameters, such as preview width and height, and face orientation.
faceCameraManager.initParameters(1280, 720, 0, mCameraView.getSurfaceTexture());
// Get Thermal imaging system Type
CameraType cameraType = TemperatureCameraUtils.getCameraType();
// Get the instance of the corresponding Thermal imaging system by camera type
ITemperatureCamera temperatureCamera = TemperatureCameraFactory.getTemperatureCamera(cameraType);
Initialize Thermal imaging system
temperatureCamera.initCamera(context);
// Set the relevant parameters of the Thermal imaging system (needs to be executed after initialization)
temperatureCamera.setConfig(config);
// Set whether the shutter is enabled automatically. It is true by default (Enabling the shutter improves the accuracy of temperature measurement, but shortens the service life of the device)
temperatureCamera.setAutoShutterEnable(true);
ITemperaturePreviewDataCallback dataCallback = new ITemperaturePreviewDataCallback() {
@Override
public void onTemperaturePreviewData(Bitmap temperatureBitmap, float[] temperatureValue, int width, int height) {
// Thermodynamic Diagram and Callback of Temperature Data
}
};
// Add Data Callback
temperatureCamera.addTemperaturePreviewDataCallback(dataCallback);
// Remove the callback when the data are not in use
temperatureCamera.removeTemperaturePreviewDataCallback(dataCallback);
// It is worth noting that the temperature data does not refer to Celsius degrees, which can be obtained from the temperature data by the following method
temperatureCamera.getCentigradeFromTemperatureData(temperatureValue);
// Alternatively, it can be converted by batch
temperatureCamera.matrixTemperature(temperatureValue,width,height,distance,x,y,w,h,tempArray);
// Get Body Temperature of Thermal imaging system
temperatureCamera.getCameraBodyTemperature();
// Start Preview of Thermal imaging system
temperatureCamera.startPreview(textureView);
// Stop Preview of Thermal imaging system
temperatureCamera.stopPreview();
// Release Camera Resources of Thermal imaging system
temperatureCamera.releaseCamera();
// Enable Shutter (Enabling the shutter improves the accuracy of temperature measurement, but shortens the service life of the device)
temperatureCamera.shutter();
// Frontal Clear Single Photo
Bitmap avatar = BitmapFactory.decode(R.id.avatar);
int userId = 123;
if (avatar != null) {
// Get Features of the Face in the Picture
byte[] feature = FeatureManagerProxy.getInstance().getFeature(avatar);
// Insert Feature Library (native memory). Data persistence requires processing by upper business.
int result = FeatureManagerProxy.getInstance().insert(userId, feature);
if (result == 0) {
Log.d(TAG, "Face Feature Inserted Successfully");
}
}
// Delete Person Characteristics
int result = FeatureManagerProxy.getInstance().delete(userId);
if (result == 0) {
Log.d(TAG, "Face Feature Deleted Successfully");
}
Camera.PreviewCallback mRgbCallback = new Camera.PreviewCallback() {
@Override
public void onPreviewFrame(byte[] data, Camera camera) {
// Transfer RGB Preview Data Callback to the Identify Manager
IdentifyManager.getInstance().handleRgbData(data);
}
};
Camera.PreviewCallback mIrCallback = new Camera.PreviewCallback() {
@Override
public void onPreviewFrame(byte[] data, Camera camera) {
// Transfer IR Preview Data Callback to the Identify Manager
IdentifyManager.getInstance().handleIrData(data);
}
};
// Please configure the image related settings according to the device hardware environment
ImageConfig imageConfig = new ImageConfig.Builder()
.previewW(1280)
.previewH(720)
.faceOrientation(FaceOrientation.UP)
.pixelFormat(MidPixelFormat.NV21)
.build();
// Initialize
IdentifyManager.getInstance().init(imageConfig,identifyCallback);
// Set Identification Mode of the Identify Manager
IdentifyManager.getInstance().setVerifyMode(VerifyModeEnum.MODE_1_N);
// Set Result Callback
IdentifyManager.getInstance().setIdentifyCallback(identifyCallback);
IdentifyConfig identifyConfig = IdentifyManager.getInstance().getIdentifyConfig();
IdentifyConfig.hasLiveness = true; // Enable liveness detection
identifyConfig.isSingleLiveness = DeviceInfoUtils.isSenseIDProduct(); // For monocular liveness detection, this item should be enabled only for ID series devices
identifyConfig.isSenseGateConfig = DeviceInfoUtils.isSenseGateProduct(); // Turn this on only if the device used is SenseGate series
identifyConfig.isContinueVerify = true; // IdentifyConfig.isContinueVerify = true; / / Whether to recognize continuously. If enabled, it will be recognized continuously (the face needs to be in the camera field of view). It is used together with the continueVerifyIntervalTime parameter.
identifyConfig.continueVerifyIntervalTime = 3000L; // Interval for continuous identification of the same face, which takes effect when isContinueVerify is set to true
identifyConfig.hasTemperatureDetection = false;
identifyConfig.isServerVerify = false;
IdentifyManager.getInstance().setIdentifyConfig(identifyConfig);
// The modifications are shown here - In 1:N matching, the matching threshold is changed to 0.83f and the liveness filtering threshold is 0.95f (if exceeded, it is non-liveness), with a minimum identification of 100 pixels of the face
ThresholdConfig thresholdConfig = IdentifyManager.getInstance().getThresholdConfig();
thresholdConfig.verifyScore = 0.83f;
thresholdConfig.livenessScore = 0.95f;
thresholdConfig.faceMinWidth = 100;
thresholdConfig.verifyAreaRect = new RectF(0, 0, mPreviewHeight, mPreviewWidth);
IdentifyManager.getInstance().setThresholdConfig(thresholdConfig);
IIdentifyResultCallback identifyCallback = new IIdentifyResultCallback() {
@Override
public void onDrawFaces(@Nullable List<FaceInfo> list) {
// Face Detection Callback, which can be used to draw a face calibration frame.
// Please note that the callbakc occurs when identification is paused, which means that faces are still being tracked in the process, but just not recognized
}
@Override
public void onClearScreen() {
// Clear Screen Callback. Clear the screen with this callback when there appears no face in the field of view
}
Please note that the callbakc o
public void onUnknown(float faceW) {
// If the face is too large or too small to determine whether it is liveness or not, notice is given with this method
}
@Override
public void onIdentifyResult(List<FrameIdentifyResult> frameIdentifyResults) {
// Identify Result Callback
}
};
// Set Result Callback
IdentifyManager.getInstance().setIdentifyCallback(identifyCallback);
// Initialization of the Identify Manager is the same as that of 1:N
// When the Identify Manager is switched from 1:N to 1:1, it is necessary to set the single identification feature first, and then switch the mode
Bitmap singleTarget = BitmapFactory.decodeResource(getResource(), R.mipmap.face);
boolean setupResult = IdentifyManager.getInstance().setIdentifyTarget(singleTarget);
// Set Identification Mode of the Identify Manager. Before setting it, make sure that the individual identification feature is set successfully.
if (setupResult) {
IdentifyManager.getInstance().setVerifyMode(VerifyModeEnum.MODE_1_1);
}
// 1. Enable Server Verify Mode
IdentifyManager.getInstance().setVerifyMode(VerifyModeEnum.MODE_SERVER_1_N);
// 2. Implement Server Verify Action
IServerVerifyAction serverVerify = new IServerVerifyAction() {
@Override
public <T extends FaceSearchResult> T verify(@NonNull byte[] cameraData, byte[] feature, @Nullable FaceInfo rgbFace,int width, int height) {
// Upload Data via http Request and Get Identification Result (note to set a reasonable request timeout).
// ..code
// Build Face Search Result and Return It, as shown in the following example
FaceSearchResult result = new FaceSearchResult();
result.score = 0.93f;
result.userID = 12345;
return (T) result;
}
};
// 3. Set Server Verify Action
IdentifyManager.getInstance().setServerVerifyAction(serverVerify);
// Open Wear Mask Identify
IdentifyConfig identifyConfig = IdentifyManager.getInstance().getIdentifyConfig();
identifyConfig.isOpenWearMaskIdentify = true;
IdentifyManager.getInstance().setIdentifyConfig(identifyConfig);
// Get Face Identify Result Through Identify Result Callback Interface
IIdentifyResultCallback identifyCallback = new IIdentifyResultCallback() {
@Override
public void onDrawFaces(@Nullable List<FaceInfo> list) {
// Face Detection Callback, which can be used to draw a face calibration frame.
// Please note that this callback still occurs when identification is paused, which means that faces are still being tracked in the process, but just not recognized
}
@Override
public void onClearScreen() {
// Clear Screen Callback. Clear the screen with this callback when there appears no face in the field of view
}
@Override
public void onUnknown(float faceW) {
// If the face is too large or too small to determine whether it is liveness or not, notice is given with this method
}
@Override
public void onIdentifyResult(List<FrameIdentifyResult> frameIdentifyResults) {
// Identify Result Callback
for (int i = 0; i < frameIdentifyResults.size(); i++) {
FrameIdentifyResult frameIdentifyResult = frameIdentifyResults.get(i);
List<FaceIdentifyResult> faceIdentifyResults = frameIdentifyResult.faceIdentifyResults;
for (int j = 0; j < faceIdentifyResults.size(); j++) {
FaceIdentifyResult faceIdentifyResult = faceIdentifyResults.get(j);
// Get Face Identify Result
boolean mask = faceIdentifyResult.isMask();
}
}
}
};
// Set Result Callback
IdentifyManager.getInstance().setIdentifyCallback(identifyCallback);
ThresholdConfig thresholdConfig = IdentifyManager.getInstance().getThresholdConfig();
thresholdConfig.faceMinWidth = 200; // In the temperature measurement, it needs to be closer, and the width of the face needs to be set larger.
thresholdConfig.pitch = 20; // In the temperature measurement, the requirements are more stringent, and face facing forward helps to measure the temperature more accurately
thresholdConfig.roll = 20;
thresholdConfig.yaw = 20;
thresholdConfig.verifyAreaRect = new RectF(125, 400, 565, 835); // Take the SensePass device as an example
IdentifyManager.getInstance().setThresholdConfig(thresholdConfig);
// Get Camera Type
CameraType type = TemperatureCameraUtils.getCameraType();
// Create Thermal imaging system Object
ITemperatureCamera mTemperatureCamera = TemperatureCameraFactory.getTemperatureCamera(type);
// Initialize
mTemperatureCamera.initCamera(this);
// Initialize Temperature Comparison Algorithm (for calibration temperature)
TemperConvertCallback temperConvertCallback = new TemperConvertCallback() {
private float[] tempArray;
@Override
public float temperConvertCentigrade(float temper) {
return TemperatureCameraFactory.getTemperatureCamera(type).getCentigradeFromTemperatureData(temper);
}
@Override
public float[] getTempMatrix(float[] y16Frame, int y16W, int y16H, float distance, int x, int y, int w, int h) {
int size = w * h;
if (tempArray == null || tempArray.length != size) {
tempArray = new float[size];
}
TemperatureCameraFactory.getTemperatureCamera(type).matrixTemperature(y16Frame, y16W, y16H, distance, x, y, w, h, temperConvertCallback = tempArray);
return tempArray;
}
};
// Note: different devices have different versions of the algorithm
// Currently, Thunder-E supports:TempMeasureVersion.TempMeasure_1_2_0、TempMeasureVersion.TempMeasure_1_5_0、TempMeasureVersion.TempMeasure_1_6_0、TempMeasureVersion.TempMeasure_1_7_0
// Thunder Air supports:TempMeasureVersion.TempMeasure_1_7_0、TempMeasureVersion.TempMeasure_1_8_0
// Thunder mini supports:TempMeasureVersion.TempMeasure_1_5_0、TempMeasureVersion.TempMeasure_1_11_0、TempMeasureVersion.TempMeasure_1_10_0、TempMeasureVersion.TempMeasure_1_3_0
// For details, please refer to the implementation in TemperatureMeasureVersionUtils.getTempMeasureVersionByDevice()
TempMeasureVersion algorithmVersion = TemperatureMeasureVersionUtils.getTempMeasureVersionByDevice();
int ret = TemperatureActionProxy.init(algorithmVersio, temperConvertCallbackn);
if(ret == 0) {
Log.d(TAG, "Temperature Measurement Algorithm Initialized Successfully");
}
ITemperatureSdkAction action = new ITemperatureSdkAction() {
@Override
public <T extends TrackAndTemperatureResult> List<T> temperCalculateAir(MatchFace[] matchFaces, @Nullable Bitmap temperatureBitmap, float[] temperatureData, int temperatureWidth, int temperatureHeight, FaceOrientation temperatureOrientation) {
// Ambient temperature of equipment in use
// when CameraType is CameraType.GUIDE120 or CameraType.IRAY,Examples code
MatchFace matchFace = matchFaces[0];
float envTemperature = 25.1f;
TemperInfo temperInfo = TemperatureActionProxy.temperCalculateObtainRect(matchFace.rgbFace, temperatureData,
temperatureWidth, temperatureHeight, FaceOrientation.UP.getValue(), envTemperature, 0.1f);
TrackAndTemperatureResult trackAndTemperatureResult = new TrackAndTemperatureResult();
trackAndTemperatureResult.setFaceInfo(matchFace.rgbFace);
trackAndTemperatureResult.setIrFaceInfo(matchFace.irFace);
trackAndTemperatureResult.setTemperature(temperInfo.temper);
List<T> ts = new ArrayList<>();
ts.add((T) trackAndTemperatureResult);
return ts;
}
};
}
};
// Set Temperature Sdk Action
IdentifyManager.getInstance().setTemperatureSdkAction(action);
ITemperaturePreviewDataCallback mPreviewDataCallback =
new ITemperaturePreviewDataCallback() {
@Override
public void onTemperaturePreviewData(
Bitmap temperatureBitmap, float[] temperatureValue, int width, int height) {
// temperatureBitmap - thermodynamic diagram, which can be used to draw a temperature bitmap preview
// temperatureValue - Temperature Data
// width, height - heat Width and height of Thermodynamic Diagram
// Inject temperature data into the Identify Manager (if temperature data are not injected after the temperature measurement function is enabled, no recognition will be performed)
IdentifyManager.getInstance().handleTemperatureData(
temperatureBitmap, temperatureValue,width, height, mCameraUseConfig.faceOrientation);
}
};
// Set Callback
mTemperatureCamera.addTemperaturePreviewDataCallback(mPreviewDataCallback);
// Get Face Identify Result Through Identify Result Callback Interface
IIdentifyResultCallback identifyCallback = new IIdentifyResultCallback() {
@Override
public void onDrawFaces(@Nullable List<FaceInfo> list) {
// Face Detection Callback, which can be used to draw a face calibration frame.
// It should be noted that this callback still occurs when identification is paused, which means that faces are still being tracked in the process, but just not recognized
}
@Override
public void onClearScreen() {
// Clear Screen Callback. Clear the screen with this callback when there appears no face in the field of view
}
@Override
public void onUnknown(float faceW) {
// If the face is too large or too small to determine whether it is liveness or not, notice is given with this method
}
@Override
public void onIdentifyResult(List<FrameIdentifyResult> frameIdentifyResults) {
// Identify Result Callback
for (int i = 0; i < frameIdentifyResults.size(); i++) {
FrameIdentifyResult frameIdentifyResult = frameIdentifyResults.get(i);
if (frameIdentifyResult == null
|| frameIdentifyResult.faceIdentifyResults == null
|| frameIdentifyResult.faceIdentifyResults.size() <= 0) {
continue;
}
List<FaceIdentifyResult> faceIdentifyResults = frameIdentifyResult.faceIdentifyResults;
for (int j = 0; j < faceIdentifyResults.size(); j++) {
FaceIdentifyResult faceIdentifyResult = faceIdentifyResults.get(j);
if (faceIdentifyResult == null || faceIdentifyResult.getIdentifyResultTypeEnum() == null) {
continue;
}
TrackAndTemperatureResult trackAndTemperatureResult = faceIdentifyResult.getTrackAndTemperatureResult();
float temperature = 0;
if (trackAndTemperatureResult != null) {
temperature = trackAndTemperatureResult.getTemperature();
}
Log.i(TAG, String.format(Locale.getDefault(), "userId-%d temperature is %f",
faceIdentifyResult.getUserId(), temperature));
}
}
}
};
// Set Result Callback
IdentifyManager.getInstance().setIdentifyCallback(identifyCallback);
// Pass access control function initialization, must be called before use of the access control function
DoorDeviceAccessProxy.init();
final DoorAccessConfig config = new DoorAccessConfig.Builder()
// Set GPIO B port input type, which can be set to GPIO_IN_NONE by default
.setGpioInB(DoorAccessConfig.GPIO_IN_NONE)
// Set GPIO C port input type, which can be set to GPIO_IN_NONE by default
.setGpioInC(DoorAccessConfig.GPIO_IN_NONE)
// Set Open Door Time, only for local relays (here set to close after 5 seconds of opening)
.setOpenDoorTime(5)
// Set GPIO Output Type
.setGpioOutA(DoorAccessConfig.GPIO_OUT_NONE)
// Control RS485 data reading and writing by the Rom itself (Rom support is required. Please set it to false if Rom does not support)
.setIsSupportRS485GpioAutoControl(true)
// Set Wiegand Input Protocol Type
.setWiegandInput(DoorAccessConfig.WIEGAND26_24_BIT)
// Set Open Door Mode
.setOpenDoorMode(DoorAccessConfig.OPEN_DOOR_MODE_RELAY)
.Setthe Serial Port Baud Rate for RS485 Protocol
.setRS485BaudRate(9600)
.build();
DoorDeviceAccessProxy.setConfig(config);
// Set Open Door Mode to "Local Relay"
DoorAccessConfig mDoorAccessConfig = DoorDeviceAccessProxy.getConfig();
mDoorAccessConfig.setOpenDoorMode(DoorAccessConfig.OPEN_DOOR_MODE_RELAY);
DoorDeviceAccessProxy.setConfig(mDoorAccessConfig);
// This method is a global door opening method, which will automatically execute the door opening action according to the door opening method set in the config
// The IC card number is only used when the input parameter is Wiegand Open Door. Transfer it directly here. “
DoorDeviceAccessProxy.openDoor("");
// Open the door until opDoorTime time before closing the door. The delayed opening time is directly determined by
DoorDeviceAccessProxy.openDoorWithRelay(openDoorTime * 1000);
DoorDeviceAccessProxy.closeRelayDoor();
DoorAccessConfig mDoorAccessConfig = DoorDeviceAccessProxy.getConfig();
// Just fill in the IP, the port has been defaulted to 12345. If it was set during initialization, no need set repeatedly here
mDoorAccessConfig.setRelayIp("192.168.12.11");
// Set Open Door Mode as Network Relay
mDoorAccessConfig.setOpenDoorMode(DoorAccessConfig.OPEN_DOOR_MODE_IP_RELAY);
DoorDeviceAccessProxy.setConfig(mDoorAccessConfig);
// The parameter is the delayed closing time, which can be set freely
DoorDeviceAccessProxy.openDoor("");
String cardNumver = "12345678";
// Open Door via Wiegand 26 (24bit)
DoorDeviceAccessProxy.openDoor(cardNumber);
DoorAccessConfig config = DoorDeviceAccessProxy.getConfig();
// This is set to the Wiegand 26 standard card reader
config.setWiegandInput(DoorAccessConfig.WIEGAND26_24_BIT);
DoorDeviceAccessProxy.setConfig(config);
DoorDeviceAccessProxy.setCardReaderCallback(
new WiegandReaderDevice.CardReaderCallback() {
@Override
public void onRead(String cardNumber) {
// The card number is read successfully, and the cardNumber is the card number
}
});
DoorAccessConfig mDoorAccessConfig = DoorDeviceAccessProxy.getConfig();
// Here it is assumed that the peripheral device is connected to port B to connect to the door button. If you use port C, please set doorAccessConfig.setGpioInC()
mDoorAccessConfig.setGpioInB(DoorAccessConfig.GPIO_IN_DOOR_BUTTON);
DoorDeviceAccessProxy.setConfig(mDoorAccessConfig);
// When Using Door Button
PassDoorDeviceAccessProxy.setOnClickDoorButtonListener(
new DoorButtonDevice.DoorButtonOnClickListener() {
@Override
public void onClick() {
// Receive Door Opening Signal
}
});
// When Using Receive Fire Sign Listener
PassDoorDeviceAccessProxy.setReceiveFireSignListener(
new FireSignalDevice.ReceiveFireSignListener() {
@Override
public void onReceive() {
// Receive Fire Signal
}
});
// When using door sensors
PassDoorDeviceAccessProxy.setDoorStateCallback(
new PassDoorDeviceAccessProxy.DoorMagnetismStateCallback() {
@Override
public void onDoorStateChanged(int state) {
if (state == '0') {
// Door Magnetism State- Off
} else {
// Door Magnetism State- On
}
}
});
DoorAccessConfig sgDoorAccessConfig = DoorDeviceAccessProxy.getConfig();
// It is assumed here that the doorbell is used
sgDoorAccessConfig.setGpioOutA(DoorAccessConfig.GPIO_OUT_DOOR_BELL);
DoorDeviceAccessProxy.setConfig(sgDoorAccessConfig);
// When the doorbell rings, the parameter is the time (the actual ringing time may have errors, because the doorbell manufacturer may set the ringing according to the number of times, rather than the specific length of time)
PassDoorDeviceAccessProxy.pressDoorBell(2000);
// Alarm goes off
PassDoorDeviceAccessProxy.pressAlarmBell();
// Manually turn off the alarm
PassDoorDeviceAccessProxy.releaseAlarmBell();
// Turn on IR fill light
PassDoorDeviceAccessProxy.turnOnIrLight();
// Turn off IR fill light
PassDoorDeviceAccessProxy.turnOffIrLight();
// Turn off screen backlight
PassDoorDeviceAccessProxy.closeBackLight();
// Turn on screen backlight
PassDoorDeviceAccessProxy.openBackLight();
// Start rs485, baud rate 9600, read buffer size 32, timeout 3s
PassDoorDeviceAccessProxy..enableRS485(9600, 32,
new RS485Device.RS485ReceiveListener() {
@Override
public void onReceive(byte[] data, long dataLength) {
// Received data
}
}, 3000, new SerialPortReader.OnReadTimeOutListener() {
@Override
public void onTimeout(byte[] data, long dataLength) {
// Data read timeout
}
}
});
PassDoorDeviceAccessProxy.sendDataByRS485(data);
// Listen to it in the Activity via the onKeyUp() event
public class ForceDisassemblyDemoActivity extends AppCompatActivity {
// Omit redundant code
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_F2) {
// Listen to tamper alarm
}
return super.onKeyUp(keyCode, event);
}
}
SensorManager mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
// Use the light sensor. To use a distance sensor, use the parameter Sensor.TYPE_PROXIMITY
Sensor lightSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
if (lightSensor != null) {
mSensorManager.registerListener(new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
// Get the specific value via event.value[0] and do specific processing
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
}, lightSensor, SensorManager.SENSOR_DELAY_NORMAL);
} else {
// Sensor not available
}
// Turn on Buzzer
PassDoorDeviceAccessProxy.pressBuzzer();
// Turn off Buzzer
PassDoorDeviceAccessProxy.releaseBuzzer();
QRCodeDecoderProxy qRCodeDecoder = new QRCodeDecoderProxy(new ZBarDecoderImpl());
// previewData is the camera preview frame data
qRCodeDecoder.decodeQRCode(previewData, 1280, 720);
✓
✓
✓
×
✓
×
✓
×
✓
✓
✓
×
✓
×
✓
×
✓
✓
✓
×
✓
✓
✓
×
✓
✓
✓
×
✓
✓
✓
×
Network Relay
Buzzer
Infrared Human Sensor
Distance Sensor
Light Sensor
IR Fill Light
RGB Fill Light
Screen Backlight
Speaker
Tamper Alarm Button
NFC Reader
SensePass
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
SenseThunderE-mini
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
SenseThunderE
✓
✓
✓
✓
✓
✓
✓
✓
✓
×
SenseThunderAir
✓
✓
✓
✓
✓
✓
✓
✓
✓
×
RGB Face + IR
SenseThunderE
Thunder Series
RK3399-arm64-v8a
Android 7.1
RGB Face + IR + Thermal
SenseThunerE-Mini
Thunder Series
RK3399-arm64-v8a
Android 7.1
RGB Face + IR + Thermal
SenseThunderAir
Thunder Series
RK3399-arm64-v8a
Android 7.1
RGB Face + IR + Thermal
SenseThunderE
Vertical Imaging
LEFT
No
SenseThunderE-Mini
Vertical Imaging
LEFT
No
SenseThunderAir
Vertical Imaging
LEFT
No
IDE Development
Android Studio 3.5.3 and above
×
×
×
×
Identify Manager
Support Human Face 1:1 Verification, Local 1:N Identification, Server 1:N Identification and Face Mask Detection.
Rotation and Conversion to Other Formats are not Provided
2.0.0
RGB565
RGB 5:6:5
None
2.0.0
ABGR8888
ABGR 8:8:8:8
None
2.0.0
Face Left
None
2.0.0
DOWN
Face Down
None
2.0.0
RIGHT
Face Right
None
2.0.0
imageConfig
ImageConfig
Identify Frame Information Configuration
None
2.0.0
thresholdConfig
ThresholdConfig
Identify Threshold Configuration
None
2.0.0
hasLiveness
boolean
Liveness ON/OFF
None
2.0.0
isAlwaysLiveness
boolean
Will the Liveness Identification Always be Conducted for the Same trackID
None
2.0.0
isSingleLiveness
boolean
Is it Single Liveness
None
2.0.0
hasTemperatureDetection
boolean
Temperature Detection ON/OFF
None
2.0.0
isMultiTemperatureDetection
boolean
Multi Person Temperature Detection ON/OFF
None
2.0.0
hackNoPassCountThreshold
int
Number of Liveness Identifications Required to Determine Non-liveness
None
2.0.0
strangerCountThreshold
int
Number of Comparisons Required to Determine a Stranger
None
2.0.0
irNoFaceCountThreshold
int
Non-liveness can be Determined After Successive N Frames
None
2.0.0
irAndRgbFaceMinDist
float
Threshold for the minimum distance between RGB camera and IR camera
None
2.0.0
isContinueVerify
boolean
Will the Identification be Continued after the Recognition Result of the Same trackID Comes Out
None
2.0.0
irAndRgbFaceSizeThreshold
float
RGB and IR Face SizeThreshold
None
2.0.0
continueVerifyIntervalTime
long
The Time Interval to Continue the Recognition after the Recognition Result of the Same trackID Comes Out
None
2.0.0
samePersonContinuousRecognitionInterval
long
Continuous Identification Interval of the Same userID()
This parameter is personnel targeted, and is higher than the continueVerifyIntervalTime control
2.0.0
isServerVerify
boolean
is it Server Verification
None
2.0.0
isMultiFaceVerify
boolean
is it Multi Face Verification Senario
None
2.0.0
detectSerialMultiFace
int
An Interval of How Many Frames is Kept for Detection While Tracking
None
2.0.0
isSenseGateConfig
boolean
is it SenseGate Device
SenseGateBD Baseline Distance Calculation is Different from Pass Series
2.0.0
isCheckCameraRotate
boolean
is Camera Rotation Checked
None
2.0.0
isDoVerify
boolean
Face Identification Yes or No
None
2.0.0
isOpenWearMaskIdentify
boolean
Open Wear Mask Identification
None
2.0.0
isInnerEyeTempDetect
boolean
is Inner Eye Temperature Detected
None
2.0.0
unSuccessTimeoutTimeThreshold
int
The timeout period of unsuccessful recognition, that is, only successful recognition will return the result immediately, otherwise it will return the failed result after the timeout
Default-1, means this function is closed
2.0.0
faceMinWidth
int
Recognizable minimum face width
None
2.0.0
faceMaxWidth
int
Recognizable maximum face width
None
2.0.0
alignmentScore
float
Marked Face Alignment Score
None
2.0.0
sharpness
float
Face Ambiguity
None
2.0.0
yaw
float
yaw angle
Profile
2.0.0
pitch
float
pitch angle
Look down and up
2.0.0
roll
float
roll angle
Tilt head
2.0.0
livenessScore
float
Recognition of liveness threshold
None
2.0.0
verifyScore
float
Comparison threshold
None
2.0.0
maskVerifyScore
float
Comparison threshold for wearing a mask
None
2.0.0
facePoints
PointF[]
Face Points
None
2.0.0
occlusion
int[]
Face Occlusion
None
2.0.0
id
int
track id
None
2.0.0
detectionScore
float
Detection Score
None
2.0.0
alignmentScore
float
Alignment Score
None
2.0.0
pointsCount
int
Face Points Count
None
2.0.0
yaw
float
yaw angle
None
2.0.0
pitch
float
pitch angle
None
2.0.0
roll
float
roll angle
None
2.0.0
1:1 Comparison Mode
None
2.0.0
MODE_SERVER_1_N
Server identification 1:N Mode
None
2.0.0
No Face Callback Detected within the Specified Time
None
2.0.0
void onClearScreen()
No Face Callback
None
2.0.0
void onDrawFaces(List<FaceInfo> faceInfoList)
Callback for drawing faces in the screen
None
2.0.0
void onUnknown(float faceW)
Callback Abnormal Faces
Callback when a Person Stands Far Away and the Liveness Judgment is Inaccurate
0-Pass, Filtered if it is not 0. If it is filtered, then the developer should customize it in the interceptor API
Member
Type
Description
Note
Version Introduced
code
int
Result Code
0-Pass, Filtered if it is not 0, specifically customized by each interceptor
Member
Type
Description
Note
Version Introduced
rgbFace
FaceInfo
Face Info
None
Member
Type
Description
Note
Version Introduced
frameId
int
Frame ID
None
Member
Type
Description
Note
Version Introduced
faceInfo
FaceInfo
RGB Face Info
None
Member
Type
Description
Note
Version Introduced
faceInfo
FaceInfo
RGB Face Info
None
Member
Description
Note
Version Introduced
NON_LIVENESS
NON_LIVENESS
None
2.0.0
Member
Type
Description
Note
Version Introduced
userID
int
Index value defined when inserting into the database
None
Member Function
Description
Note
Version Introduced
T verify( byte[] cameraData, byte[] feature,FaceInfo rgbFace, int width, int height)
Face Search Identification
None
2.0.0
Member Function
Description
Note
Version Introduced
List temperCalculateAir(MatchFace[] matchFaces, Bitmap temperatureBitmap, float[] temperatureData, int temperatureWidth, int temperatureHeight, FaceOrientation temperatureOrientation)
Unregister Device Server End Notification Push Callback
Parameter
None
Return
None
Exception
None
void unRegisterKeepDoorOpenOrCloseSchedule()
Unregister Device Keep Door Open Or Close Schedule Push Callback
Parameter
None
Return
None
Exception
None
Description of Entities
LanguageTypeEnum
Description of Properties
ConnectConfigEntity
Description of Properties
Result
Description of Properties
Description of Method
AlarmReportParameter
Description of Properties
VerticesItem
Description of Properties
GuestDetailInfo
Description of Properties
GroupsItem
Description of Properties
TslCheckExistResult
Description of Properties
TslLanguageCheckExistResult
Description of Properties
FaceSearchResult
Description of Properties
SearchResultItem
Description of Properties
Content
Description of Properties
FaceSearchParameter
Description of Properties
ImagesItem
Description of Properties
TargetInfo
Description of Properties
Angle
Description of Properties
Rectangle
Description of Properties
VerticesItem
Description of Properties
LandmarksItem
Description of Properties
CameraInfo
Description of Properties
GroupIndex
Description of Properties
UserIndex
Description of Properties
UserInfoResult
Description of Properties
UserInfoParameter
Description of Properties
DeviceGroups
Description of Properties
DeviceDetailInfo
Description of Properties
DeviceTypeMaxOnline
Description of Properties
ServiceConfigItem
Description of Properties
Options
Description of Properties
Company
Description of Properties
RsaResult
Description of Properties
UserDetailInfo
Description of Properties
DeptItem
Description of Properties
ServerVersion
Description of Properties
TimeTable
Description of Properties
SpecialDay
Description of Properties
QRResult
Description of Properties
IdentifyQRCodeParameter
Description of Properties
LoginResult
Description of Properties
UserRspVO
Description of Properties
DepartmentRouteItem
Description of Properties
Device
Description of Properties
MisrecognitionRecordParameter
Description of Properties
RegisterResult
Description of Properties
RegisterParameter
Description of Properties
UserStatusParameter
Description of Properties
ExceptionListItem
Description of Properties
UserSyncStatusParameter
Description of Properties
UserStatusListItem
Description of Properties
DeviceReportEventParamer
Description of Properties
DoorMagnetismReportEventContent
Description of Properties
BluetoothReportEventContent
Description of Properties
ThermalImagerReportEventContent
Description of Properties
RecordResult
Description of Properties
RecordParameter
Description of Properties
DeviceVersionInfoParameter
Description of Properties
IdentifyDataParameter
Description of Properties
Depth
Description of Properties
TslUploadParameter
Description of Properties
TslLanguageUploadParameter
Description of Properties
MessageParameter
Description of Properties
MessageEventEnum
Description of Properties
IConnectionLost
Description of Method
MessageCallback
Description of Method
connectionLost
IConnectionLost
Connection Lost Callback
None
2.0.0
useTokenConnect
boolean
Use Token Connect
None
2.0.0
socketFactory
SocketFactory
The verification method used to build https
certificate not verified by default
2.0.0
callback
MessageCallback
Callback
None
2.0.0
callback
MessageCallback
Callback
None
2.0.0
Traditional Chinese
None
2.0.0
EN
English
None
2.0.0
JP
Japanese
None
2.0.0
KO
Korean
None
2.0.0
password
String
Password
None
2.0.0
identifier
String
Device Identifier
None
2.0.0
duid
String
Device SN
None
2.0.0
token
String
Device Token
None
2.0.0
ldid
String
Device Background Identification Number
None
2.0.0
companyId
int
Company ID
None
2.0.0
isNewDevice
boolean
Is New Device
None
2.0.0
data
T
Data
None
2.0.0
message
String
message
None
2.0.0
desc
String
Description
None
2.0.0
originData
String
Origin Data
None
2.0.0
rawData
byte[]
Binary Data
None
2.0.0
2.0.0
Y
alarmPhoto
String
Alarm Photo
None
2.0.0
N
code
int
Alarm Code
10001 stands for disassembly alarm, 10002 stands for forced door open alarm, 10003 stands for door magnetism overtime alarm, 10004 is password attack alarm, 10005 is Bluetooth power shortage, 10006 indicates thermal imager connection exception, 20001 shows camera contamination, 20002 means a non-liveness attack, 20003 is fire alarm and 40001 stands for feature extraction failure
2.0.0
If the parameter "status" is 1, then the parameter "code" is necessary, otherwise it is optional
description
String
Alarm Description
None
2.0.0
N
eventTime
Long
Event Time
millisecond precision
2.0.0
Y
status
int
Alarm Report Event
1 means there is an alarm, 2 means alarm clearance failed, 3 means alarm clearance successful
2.0.0
Y
rectangle
List<VerticesItem>
rectangle coordinate
The first is the upper left corner coordinates, the second is the lower right corner coordinates
2.0.0
N
userId
long
User ID
None
2.0.0
N
2.0.0
Y
y
int
y Coordinate
None
2.0.0
Y
avatar
String
Compare Avatar
None
2.0.0
showAvatar
String
Show Avatar
None
2.0.0
name
String
Name
None
2.0.0
groups
List<GroupsItem>
Group
None
2.0.0
mobile
String
Contact Info
None
2.0.0
guestCompany
String
Guest Company
None
2.0.0
birthday
String
Birthday
None
2.0.0
position
String
Position
None
2.0.0
idNumber
String
ID Number
None
2.0.0
icNumber
String
ic Card Number
None
2.0.0
mail
String
Mail
None
2.0.0
guestPurpose
String
Guest Purpose
None
2.0.0
receptionUserId
long
reception User id
None
2.0.0
receptionUserName
String
reception User Name
None
2.0.0
dateTimeFrom
String
Effective Time From
None
2.0.0
dateTimeTo
String
Effective Time To
None
2.0.0
level
int
level
None
2.0.0
remark
String
Note
None
2.0.0
name
String
Group Name
None
2.0.0
type
int
Group Type
1:User Group, 2: Guest Group, 5: deny list Group
2.0.0
personCount
int
person Count
None
2.0.0
md5
String
File md5
None
2.0.0
gateCtrl
boolean
Door Open
None
2.0.0
timestamp
long
Timestamp uploaded when requested by the client
None
2.0.0
passRuleType
int
Pass Rule Type
0: Local Pass Rule 1: Server Pass Rule
2.0.0
sign
String
md5, check note for detail
The md5 Value of {timestamp}-{ldid}-{gateCtrl}-{passRuleType}
2.0.0
score
float
Verify Score
None
2.0.0
userId
int
User ID
None
2.0.0
userCardId
String
User Door Access Card ID
None
2.0.0
userImage
Content
User Library Image
None
2.0.0
trackId
int
id for Face Tracking
None
2.0.0
userName
String
User Name
None
2.0.0
displayMsg
String
display Msg
None
2.0.0
displayColor
String
display Color
None
2.0.0
verifyCode
int
Verification Code
1: Unactivated, 2: activated, 3: Unauthorized 4: Match failed, 5: Not within the passable time range
2.0.0
type
int
Type
None
2.0.0
idNumber
String
id Number
None
2.0.0
sign
String
md5
the md5 Value of {verifyCode}-{timestamp}-{ldid}-{userId}
1-Pass; 2-QR code illegal; 3-QR code decryption failed; 4-QR code content error; 5-QR code invalid; 6-QR code is not within the validity period; 7-QR code has no passes; 8-The user corresponding to the QR code is invalid
2.0.0
sign
String
md5
The md5 Value of {entryStatus}-{timestamp}-{ldid}-{userId}-{passRuleType}
1:Staff; 2:Guest; 3: Stranger; 4: Non Liveness; 999: Others
2.0.0
Y
abnormalType
int
Abnormal Record Type
0-No; 10001-Person and ID mismatch;10002-Person and Card mismatch;10003-Person and Code mismatch;20001-The guest is not within the validity period; 20002-Not within the passable time range; 30001-Invalid id card; 30002-Invalid IC Card; 30003-Invalid QR Code
2.0.0
N
idNumber
String
ID Number
None
2.0.0
N
icNumber
String
work card
None
2.0.0
N
idInfo
String
other information of ID card
Json String
2.0.0
N
inTime
int
Whether uploaded timely
Yes: 1; No: 0
2.0.0
Y
mode
int
Device Mode
1: Swipe Face or Card; 2: Swipe Face+Card; 3: Swipe Face or ID Card; 4: Swipe Face+ID Card; 5: Swipe Face+ID Card for Appointment; 6: Swipe Face or QR Code; 7: Swipe Face and QR Code; 8: Bluetooth; 9: Face; 10: Face or QR Code or Swipe Card
2.0.0
Y
rectangle
List<VerticesItem>
rectangle
Coordinates of the upper left corner, coordinates of the lower right corner
2.0.0
N
entryMode
int
Entry Mode
1: Swipe Face; 2: QR Code; 3: Swipe Card; 4: Swipe Face+Card; 5: Swipe ID Card; 6: Swipe Face+ID Card; 7: Swipe Face+ID Card for Appointment; 8: Swipe Face and QR Code; 9: Bluetooth
2.0.0
N
pushOption
int
Push Record
1, Yes, 0 No
2.0.0
N
wearMaskType
int
Mask Status
0: No Status (Mask Identification not activated) 1: Without Mask 2: With Mask
2.0.0
N
verifyScore
float
Verify Score
None
2.0.0
N
docPhoto
String
ID card photo
None
2.0.0
N
heatAvatar
String
thermodynamic diagram
None
2.0.0
N
bodyTemperature
float
Body Temperatur
None
2.0.0
N
remark
String
Note
None
2.0.0
N
2.0.0
Y
romHardwareVersion
String
ROM Hardware Version
None
2.0.0
Y
apkVersionCode
String
apk Version Code
None
2.0.0
Y
packageName
String
package Name
None
2.0.0
Y
model
String
Model
None
2.0.0
Y
serialNumber
String
Device serial Number
None
2.0.0
Y
romSoftwareVersion
String
ROM Software Version
None
2.0.0
Y
manufacturer
String
manufacturer
None
2.0.0
Y
depth
Depth
Depth Data
None
2.0.0
userId
int
User ID
None
2.0.0
recordId
int
Recordid
None
2.0.0
type
int
Data Type
1-In the Library, 2-Stranger, 3-Liveness, 4-Non-liveness
Unregister Device Server End Notification Push Callback
2.0.0
void unRegisterKeepDoorOpenOrCloseSchedule()
Unregister Device Keep Door Open Or Close Schedule Push Callback
2.0.0
Parameter Name
Type
Description
Note
Version Introduced
listener
IMqttActionListener
Callback
None
Parameter Name
Type
Description
Note
Version Introduced
listener
IMqttActionListener
Callback
None
Parameter Name
Type
Description
Note
Version Introduced
groupId
int
Group ID
None
Parameter Name
Type
Description
Note
Version Introduced
callback
MessageCallback
Callback
None
Parameter Name
Type
Description
Note
Version Introduced
groupId
int
Group ID
None
Parameter Name
Type
Description
Note
Version Introduced
callback
MessageCallback
Callback
None
Parameter Name
Type
Description
Note
Version Introduced
callback
MessageCallback
Callback
None
Parameter Name
Type
Description
Note
Version Introduced
callback
MessageCallback
Callback
None
Parameter Name
Type
Description
Note
Version Introduced
callback
MessageCallback
Callback
None
Parameter Name
Type
Description
Note
Version Introduced
callback
MessageCallback
Callback
None
Parameter Name
Type
Description
Note
Version Introduced
callback
MessageCallback
Callback
None
Parameter Name
Type
Description
Note
Version Introduced
callback
MessageCallback
Callback
None
Parameter Name
Type
Description
Note
Version Introduced
groupId
int
Group ID
None
Parameter Name
Type
Description
Note
Version Introduced
groupId
int
Group ID
None
Member
Description
Note
Version Introduced
ZH
Simplified Chinese
None
2.0.0
Member
Type
Description
Note
Version Introduced
account
String
Account
None
Member
Type
Description
Note
Version Introduced
code
int
Status Code
None
Member Function
Description
Note
Version Introduced
boolean isSuccess()
Request Success
true-success, false-fail
2.0.0
Member
Type
Description
Note
Version Introduced
is it necessary
traceId
String
Alarm Serial Number
Member
Type
Description
Note
Version Introduced
is it necessary
x
int
x Coordinate
Member
Type
Description
Note
Version Introduced
id
long
Guest id
None
Member
Type
Description
Note
Version Introduced
id
int
Group ID
None
Member
Type
Description
Note
Version Introduced
flag
int
Flag
0 Not Exist, 1 Exist
Member
Type
Description
Note
Version Introduced
flag
int
Flag
0 Not Exist, 1 Exist
Member
Type
Description
Note
Version Introduced
searchResult
List<SearchResultItem>
Search Result
None
Member
Type
Description
Note
Version Introduced
faceCutImage
Content
Face Cut Image
None
Member
Type
Description
Note
Version Introduced
data
String
Original Image Data
Choose it or url
Member
Type
Description
Note
Version Introduced
Is it necessary
targetImages
ImagesItem
Capture several groups of small pictures
Member
Type
Description
Note
Version Introduced
detectionMode
String
detection Mode
DETECT_MODE_AUTO: Automatically select the detection frame according to TargetAnnotation.rectangle and the size of the captured image.DETECT_MODE_BOUNDING_ONLY: Only use TargetAnnotation.rectangle.Rectangle must be passed in, otherwise it is an invalid target.DETECT_MODE_FORCE_DETECTION: Mandatory use of detection model for detection
Member
Type
Description
Note
Version Introduced
trackId
int
Track id
None
Member
Type
Description
Note
Version Introduced
roll
int
Face roll angle
None
Member
Type
Description
Note
Version Introduced
vertices
List<VerticesItem>
Target rectangular area
coordinates of the upper left corner, coordinates of the lower right corner