Measurement preparation
After successfully installing, initializing and optionally configuring the SDK, your app should be ready to start the video measurement.
Preparing for measurement
Before starting the measurement, the user’s face:
- should be in the correct position and distance from the camera so that its view on the screen matches the marked frame;
- should be dry and free of heavy make-up and any dirt;
- should not be covered by hair, a mask, glasses or any other objects; remove the mask and glasses and move the hair away from the forehead.
In order to maintain measurement accuracy, ensure that the Shen.AI (CE) device is used in conditions of constant and, as far as possible, unchanging lighting.
It is not recommended to take measurements while in motion, e.g. while travelling by means of transport, due to the possibility of vibrations (difficult image stabilisation) and the possibility of dynamic changes in the background and lighting.
Performing the measurement
During the measurement, do not chew gum, tobacco, food or other products. The device used for measurement should have a clean camera and be in a stable position (otherwise, the measurement may not be performed or will be subject to a greater error than a fully stable measurement).
When using a mobile device (phone, tablet), rest it against any stable object or place it on a stand, rack, etc. Holding the device in your unsupported hand(s) is not recommended due to micro-vibrations that may adversely affect the accuracy of the measurement.
When using a laptop, it is recommended to place it on a table, desk, etc. Holding the laptop in your hands, on your lap or in any other way is not recommended due to micro-vibrations that may adversely affect the accuracy of the measurement.
When using an external camera connected to a desktop computer or laptop, it is recommended to attach the camera to a stable object or one that is held in a stable position. As with mobile devices, holding an external camera in your hand(s) is not recommended due to micro-vibrations that may adversely affect the accuracy of the measurement.
The face should be facing the camera directly. Once the face is correctly positioned in relation to the camera, the measurement can be started using the START button. The measurement takes about 1 minute, and the progress of the measurement is shown in the form of a bar filling with green colour. The measurement can be stopped at any time using the STOP button. The quality level of the measurement performed by the device is indicated by 5 stars at the top of the screen (the more stars filled in, the better the measurement quality).
In order to ensure that the measurement is performed correctly, pay particular attention to:
Adequate lighting of the face
- Diffused daylight or artificial light of sufficient intensity to allow comfortable reading.
- Uniform lighting of the entire face (without visible shadows).
- No visible reflections on the skin of the face.
Appropriate camera operating conditions
- Stable camera position.
- Clean camera lens.
- No direct light falling on the camera lens (especially from behind the person being examined).
- No other persons (faces) in the camera frame.
Appropriate head position and unobstructed view of the facial skin
- Face positioned perpendicular to the camera (both cheeks equally visible).
- No obstruction of the facial skin by hair, glasses, mask, dressing or any other objects.
- No heavy facial make-up.
- No visible moisture or dirt on the skin of the face.
- Stable head position.
- Keep your face still (avoid talking and facial expressions).
In case of inadequate lighting conditions, a corresponding message will be displayed on the screen. In order to improve the lighting of the face, an additional light source may be used, maintaining even lighting of the face and avoiding reflections.
If, during recording, the subject’s head or the camera changes position so that the face in the frame no longer matches the border marked on the screen, the border will turn red, signalling the need to change the position of the head relative to the camera (i.e. move it closer, further away or in the appropriate direction).
In the event of insufficient exposure of clean and unobstructed facial skin, or in the event of other circumstances preventing measurement, a corresponding warning message will also appear at the bottom of the screen.
The language of the Shen.AI (CE) medical device interface depends on the application in which the device is available. By default, the interface is displayed in the system language of the device (e.g. phone, tablet or computer) or in the language set in the application.
Initial conditions
After initialization, the SDK will start to analyze the video stream from the camera.
In order for the measurement to begin, the user needs to locate their face in the middle of the screen, in good lighting conditions. The embedded user interface displays face positioning hints, but you can also use the GetFaceState() and GetNormalizedFaceBbox() methods to check the current face position.
import 'package:shenai_sdk/shenai_sdk.dart';
// Get the current face state
final faceState = await ShenaiSdk.getFaceState();
switch (faceState) {
case FaceState.ok:
print("Face detected and centered");
break;
case FaceState.notCentered:
print("Face detected but not centered");
break;
case FaceState.tooClose:
print("Face is too close");
break;
case FaceState.tooFar:
print("Face is too far");
break;
case FaceState.notVisible:
print("Face is not visible");
break;
case FaceState.unknown:
print("Unknown face state");
break;
}
// Get the normalized bounding box of the face
final bbox = await ShenaiSdk.getNormalizedFaceBbox();
if (bbox != null) {
print("normalized face bounding box: ${bbox.x} ${bbox.y} ${bbox.width} ${bbox.height}");
}