Video measurement
Preparation

Measurement preparation

After successfully installing, initializing and optionally configuring the SDK, your app should be ready to start the video measurement.

Before starting the measurement, the user should be instructed to keep a stable position without talking and changing the facial expression.

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.

enum FaceState {
  ok,
  tooFar,
  tooClose,
  notCentered,
  notVisible,
  unknown,
}
 
val faceState = ShenaiSdk.getFaceState();
 
class NormalizedFaceBbox {
  double x;
  double y;
  double width;
  double height;
}
 
val normalizedFaceBbox = ShenaiSdk.getNormalizedFaceBbox();

Starting the measurement

To allow the measurement to start, the user can click the START button in the embedded UI. Alternatively, you can attain the same effect programmatically by setting the SDK operating mode to Measure:

ShenaiSdk.setOperatingMode(OperatingMode.measure);

Note that the actual measurement will not start until the user's face is in the correct position.