detectAttackSupport method
- Image image,
- DetectedFace detectedFace
Detects if an attack support surrounds the detected face.
The recommended usage is to consider the image to be an attack as soon as an attack support is detected.
Important: Loading the FaceAttackSupportDetector model is required to use this function.
param image Source image to process. param detectedFace Detected face to process. return The detected face attack support. throws FaceException An error has occurred during Face Library execution.
Implementation
DetectedFaceAttackSupport detectAttackSupport(Image image, DetectedFace detectedFace) {
Pointer<id3DetectedFaceAttackSupport> pDetectedFaceAttackSupport = calloc();
var err = faceSDK.id3FacePad_DetectAttackSupport(_pHandle.value, image.handle, detectedFace.handle, pDetectedFaceAttackSupport);
if (err != FaceError.success.value) {
calloc.free(pDetectedFaceAttackSupport);
throw FaceException(err);
}
return DetectedFaceAttackSupport(pDetectedFaceAttackSupport);
}