computeColorBasedScore method

ColorBasedPadResult computeColorBasedScore(
  1. Image image,
  2. DetectedFace detectedFace
)

Computes the PAD score and confidence of a detected face using only the color image. A high score means a high probability for the face to be bona-fide, hence not an attack. The minimum recommended score is 90. A low confidence means that the quality of the image is not sufficient enough to take a decision. The minimum recommended confidence is 70. Warning: A minimum IOD (64 pixels per default) for the detected face is required for this function, below this value it will output an error. Important: Loading the FaceColorBasedPad model is required to use this function.

param image Source image to process. param detectedFace Detected face to process. return The computed PAD result including score and confidence. throws FaceException An error has occurred during Face Library execution.

Implementation

ColorBasedPadResult computeColorBasedScore(Image image, DetectedFace detectedFace) {
  Pointer<id3FaceColorBasedPadResult> pColorBasedPadResult = calloc();
  var err = faceSDK.id3FacePad_ComputeColorBasedScore(_pHandle.value, image.handle, detectedFace.handle, pColorBasedPadResult);
  if (err != FaceError.success.value) {
  	calloc.free(pColorBasedPadResult);
  	throw FaceException(err);
  }
  return ColorBasedPadResult(pColorBasedPadResult);
}