BioID Motion Detection
The BioID Liveness Detection analyzes the movement between two images. Therefore, the first image has to capture the face frontally. The second image has to capture the face after a SLIGHT movement.
The liveness detection algorithm will most likely NOT work as intended if you simply send two images which show the face in different positions. In most cases, the movement in the second image will be too much and thus the image cannot be used for performing the BioID liveness detection. The LivenessDetection API will give back the result “LiveDetectionFailed”. Please always make sure to use the BioID Motion Detection to ensure full functionality of the BioID Liveness Detection!
The BioID Motion Detection automatically detects the required movement and triggers the capturing of the second image.
Requirements for BioID Motion Detection
- Implement video live capturing on your client - BioID provides full sample code for HTML, iOS and Android on GitHub
- Implement/copy the Motion Detection algorithm for creating template & motion detection
How the BioID Motion Detection works
The algorithm is basically called Template Matching. This technique creates a template of a region (the face area) of the first image and tries to match each incoming image.
If the template match has enough movement (above the motion threshold) between the first image and the current image, you can use the first image and the current image as second image for the LivenessDetection API.
You can adjust the threshold for motion detection to make it more or less sensitive. Please adjust this threshold only if necessary.
For our web apps (browser apps) we use different thresholds if used on a desktop compared to a mobile device. On mobile devices we use a higher threshold because the user holds the phone and this causes additional movement compared to a fixed desktop/camera position. If the image capturing has been triggered through hand or device movement instead of head movement, Liveness Detection will most certainly fail. Thus, for web apps (browser apps) used on a mobile device, we recommend to use the motion detection with less sensitivity (higher threshold) to reduce mistakenly triggered images.
Advantages using Motion Detection
Your client is uploading 2 images instead of a video.
- The capturing of 2 images is faster and less intrusive than recording a video
- The uploading time is faster considering slow internet connections (e.g. 3G)
Motion Detection source code
Below you see the source code for creating a template and using the motion detection.
To understand how to handle this with incoming data, please take a look to GitHub for