Video measurement

During the measurement

Shen.AI is performing the measurement in the background and rendering the blood flow on the given surface, but you can still provide user feedback about their face position and lighting conditions.

To see what is happening underneath you should be calling getEngineState(). It returns the following enum informing you about the state of the Shen.AI engine and the measurement.

enum EngineState {
    notReady,              // Not ready (generic)
    notReadyNoFace,        // Face not detected
    notReadyPartialFace,   // Face is not fully in the frame
    ready,                 // Face detected in acceptable position, ready to start
    performingInitialFit,  // Facial model fitting in progress
    trackingSignalShort,   // Tracking active, signal too short for any conclusions
    trackingBadSNR,        // Tracking active, last frames have poor signal quality
    trackingGoodSNR,       // Tracking active, last frames have good signal quality
    trackingLost,          // Tracking lost, trying to relocate
    finalizing,            // Measurement has satisfied end conditions and is performing final computations
    success,               // Measurement has satisfied end conditions and finished
    failure,               // Measurement has failed and finished
    engineNotInitialized,  // Engine not initialized

In particular, you should wait for FINALIZING, SUCCESS or FAILURE values, because they indicate that the measurement has finished.

For first 5-10 seconds you can call getHeartRateProgressPercentage() returning float between 0 and 100 informing about progress of heart rate calibration. When the value is 100 you can check current heart rate in real-time using getLatestHeartRate() call. Other metrics, such as HRV, are available after the full measurement is completed.

To check the progress of the whole measurement you can call getMeasurementProgressPercentage() returning float from 0 to 100.

For measured values to be accurate the quality of the extracted blood flow signal is important. You can check how this quality varies calling getCurrentSignalQualityMetric() returning float value representing how good was last 5 seconds of the signal. If the quality is too low, you will see no progress in the measurement completeness.

Measurement success

When the Shen.AI SDK engine enters the success state it means that the measurement has finished and computed metrics are available.

See Results to see how to access the results.