detectFaceMask method

int detectFaceMask(
  1. Image image,
  2. DetectedFace detectedFace
)

Detects the presence of a face mask on a detected face. A high score means that there is a high chance that the person is wearing a mask. The minimum recommended threshold is 15. Important: Loading the FaceMaskClassifier, model is required to use this function.

param image Source image to process. param detectedFace Detected face to process. return The face mask presence score of the detected face. throws FaceException An error has occurred during Face Library execution.

Implementation

int detectFaceMask(Image image, DetectedFace detectedFace) {
  Pointer<Int> pScore = calloc();
  try {
    var err = faceSDK.id3FaceAnalyser_DetectFaceMask(_pHandle.value, image.handle, detectedFace.handle, pScore);
    if (err != FaceError.success.value) {
      throw FaceException(err);
    }
    final vScore = pScore.value;
    return vScore;
  } finally {
    calloc.free(pScore);
  }
}