LIPSFace™ SDK Overview
Last updated
Last updated
LIPSFace™ HW Series On-Device 3D Facial Recognition Camera Kit is designed for facial recognition applications. The camera kit supports both facial recogntion and liveness detection to deliver accurate and anti-spoofing 3D facial recognition. With depth accuracy of 0.3% @100cm, the camera kit effectively blocks spoofing attacks and makes user authentication more secure. Equipped with 940nm VCSEL, LIPSFace™ HW Series **** is suitable for the deployment in both indoor and outdoor environments with harsh light conditions.
LIPSFace™ HW Series enables you to build a facial authentication solution that prevents unauthorized access with a less than 0.001% Spoof Acceptance Rate, 99.00% True Acceptance Rate and a one in one million False Acceptance Rate.
With a fast and easy enrollment, only registered users are authenticated — and Face Recognition speed takes less than a second. On-device 3D facial recognition & anti-spoofing authentication could store up to 1000 IDs.
Notice: The sample codes as below are based on HW120/125 SDK v1.0.3.0 “LIPS_Samples/Ni2FaceRecognition-gl/Source/main.cpp”
Windows 10 (tested on windows 10, msvc 2017)
Linux Ubuntu 18.04/20.04 LTS (tested on ubuntu 18, gcc 7.5+)
Use CMake version 3.1 or above:
$ cd C:\Program Files\OpenNI2\LIPS_Samples\Ni2FaceRecognition-gl
$ mkdir Build
$ cd Build
$ cmake ..
5.
LIPSFace™SDK APIName
Language
Description
OS
Extra Cmake flag needed
Get serial number
C++
Get camera serial number.
Windows, Linux
None
Get firmware version
C++
Get camera firmware version
Windows, Linux
None
Get driver version
C++
Get camera driver version
Windows, Linux
None
Get supported video modes
C++
Provides a list of video modes that this camera can support
Windows, Linux
None
Face recognition
C++
Connect to device and perform face recognition
Windows, Linux
None
Face registration
C++
Enroll one face id for a new user.
Windows, Linux
None
Delete faces in face database
C++
Delete a registered user's face id from the database on device
Windows, Linux
None
Camera start/stop
C++
Start/stop data generation from this video stream
Windows, Linux
None
Get video mode
C++
Get the video mode the camera was configured to when the frame was produced and can be used
to determine the pixel format and resolution of the data. It will also provide the frame rate
that the camera was running at when it recorded this frame.
Windows, Linux
None
Set video mode
C++
Setter function for the resolution of this VideoMode
Windows, Linux
None
Query frame
C++
Read the next frame from this video stream
Windows, Linux
None
Mirror
C++
Enable or disable mirroring for this stream
Windows, Linux
None
The sample code shows how to get important device information from the library.
openni::Device devDevice;
char serialNumberBuffer[1024] = { 0 };
devDevice.getProperty( ONI_DEVICE_PROPERTY_SERIAL_NUMBER, &serialNumberBuffer );
printf( "serial number = %s\n", serialNumberBuffer );
openni::Device devDevice;
char firmwareVersionBuffer[1024] = { 0 };
devDevice.getProperty( ONI_DEVICE_PROPERTY_FIRMWARE_VERSION, &firmwareVersionBuffer );
printf( "firmware version= %s\n", firmwareVersionBuffer );
openni::Device devDevice;
OniVersion driverVersion;
devDevice.getProperty( ONI_DEVICE_PROPERTY_DRIVER_VERSION, &driverVersion );
printf( "driver version = %i.%i.%i.%i\n", driverVersion.major, driverVersion.minor, driverVersion.maintenance, driverVersion.build );
openni::Device devDevice;
const openni::SensorInfo* sinfo = devDevice.getSensorInfo( openni::SENSOR_COLOR );
const openni::Array< openni::VideoMode>& modes = sinfo->getSupportedVideoModes();
for ( int i = 0; i < modes.getSize(); i++ )
{
int xRes = modes[i].getResolutionX();
int yRes = modes[i].getResolutionY();
int fps = modes[i].getFps();
openni::PixelFormat pixelFormat = colorStream.getVideoMode().getPixelFormat();
printf( "xRes = %i, yRes = %i, fps = %i\n", xRes, yRes, fps );
}
5.2
FaceRecognitionThe sample code shows basic usage of the library. It shows how to register a new user, how to recognize a user, and how to delete faces in database.
If you use LIPSFace SDK v1.0.3.0
unsigned short face_id = 0x0000;
devDevice.setProperty( LIPS_DEVICE_FACE_RECOGNITION, &face_id, sizeof( unsigned short ) );
unsigned short int result;
devDevice.getProperty( LIPS_DEVICE_FACE_RECOGNITION, &result );
If you use LIPSFace SDK v1.0.3.1 or later
devDevice.setProperty( LIPS_DEVICE_FACE_RECOGNITION, NULL, NULL );
unsigned short int result;
devDevice.getProperty( LIPS_DEVICE_FACE_RECOGNITION, &result );
2. Face registration - Enroll one face id for a new user
If you use LIPSFace SDK v1.0.3.0
unsigned short int face_id = 0x0000;
devDevice.setProperty( LIPS_DEVICE_FACE_REGISTRATION, &face_id, sizeof( unsigned short ) );
unsigned short int result;
devDevice.getProperty( LIPS_DEVICE_FACE_REGISTRATION, &result );
If you use v1.0.3.1 or later
devDevice.setProperty( LIPS_DEVICE_FACE_REGISTRATION, NULL, NULL );
unsigned short int result;
devDevice.getProperty( LIPS_DEVICE_FACE_REGISTRATION, &result );
``
3.
Face Deletion - Delete a registered user's face id from the database on deviceunsigned short face_id = 0xFFFF;
devDevice.setProperty( LIPS_DEVICE_FACE_DELETE_DATABASE, &face_id, sizeof( unsigned short ) );
unsigned short int result;
devDevice.getProperty( LIPS_DEVICE_FACE_DELETE_DATABASE, &result );