computeGlassesAttributes method
- Image image,
- DetectedFace detectedFace,
- PointList landmarks
Computes the glasses attributes of a detected face. This function must be used for a portrait image with only one face in it.
param image Source image to process. param detectedFace Detected face to process. param landmarks Estimated landmarks of the detected face. Must be computed with the face analyser. return The estimated glasses attributes of the detected face. throws FaceException An error has occurred during Face Library execution.
Implementation
GlassesAttributes computeGlassesAttributes(Image image, DetectedFace detectedFace, PointList landmarks) {
Pointer<id3FaceGlassesAttributes> pGlassesAttributes = calloc();
var err = faceSDK.id3FaceAnalyser_ComputeGlassesAttributes(_pHandle.value, image.handle, detectedFace.handle, landmarks.handle, pGlassesAttributes);
if (err != FaceError.success.value) {
calloc.free(pGlassesAttributes);
throw FaceException(err);
}
return GlassesAttributes(pGlassesAttributes);
}