Package com.appliedrec.verid.core2
Class FaceDetection
- java.lang.Object
-
- com.appliedrec.verid.core2.FaceDetection
-
- All Implemented Interfaces:
IFaceDetection
public class FaceDetection extends java.lang.Object implements IFaceDetection
Ver-ID SDK's default implementation of theIFaceDetectioninterface- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the face detection and cleanup resourcesVerIDImage<Image>createVerIDImage(IImage<?> source)CreateVerIDImagefrom a camera framefloatdetectFaceCovering(Face face, IImageProvider image)Detect whether the face is obscured by a face covering like a face mask or a scarfFace[]detectFacesInImage(IImageProvider image, int limit, int options)Detect faces in imagefloatextractAttributeFromFace(Face face, IImageProvider image, java.lang.String classifier)android.graphics.BitmapgetDiagnosticImageFromFace(Face face, Image image)java.lang.String[]getFaceAttributeClassifiers()floatgetFaceExtractQualityThreshold()Get face extract quality thresholdfloatgetLandmarkTrackingQualityThreshold()Get landmark tracking quality thresholdvoidsetFaceExtractQualityThreshold(float faceExtractQualityThreshold)Set face extract quality thresholdvoidsetLandmarkTrackingQualityThreshold(float landmarkTrackingQualityThreshold)Set landmark tracking quality thresholdIFaceTracking<Image>startFaceTracking()Start face tracking
-
-
-
Field Detail
-
detRecLib
public final DetRecLib detRecLib
Core C++ library wrapper- Since:
- 1.0.0
-
-
Method Detail
-
detectFacesInImage
public Face[] detectFacesInImage(IImageProvider image, int limit, int options) throws VerIDCoreException
Detect faces in image- Specified by:
detectFacesInImagein interfaceIFaceDetection- Parameters:
image- Image in which to detect faceslimit- Limit the number of detected faces to this valueoptions- Flags- Returns:
- Array of detected faces
- Throws:
VerIDCoreException- Error if detection fails- Since:
- 1.0.0
-
startFaceTracking
public IFaceTracking<Image> startFaceTracking()
Start face tracking- Specified by:
startFaceTrackingin interfaceIFaceDetection- Returns:
- Face tracking session
- Since:
- 1.0.0
-
close
public void close()
Close the face detection and cleanup resources- Specified by:
closein interfaceIFaceDetection- Since:
- 1.0.0
-
createVerIDImage
public VerIDImage<Image> createVerIDImage(IImage<?> source) throws VerIDCoreException
CreateVerIDImagefrom a camera frame- Specified by:
createVerIDImagein interfaceIFaceDetection- Parameters:
source- Image source- Returns:
- VerIDImage that can be used for face detection
- Throws:
VerIDCoreException- If the image creation fails
-
setFaceExtractQualityThreshold
public void setFaceExtractQualityThreshold(float faceExtractQualityThreshold) throws java.lang.ExceptionSet face extract quality thresholdFace template extraction (for face recognition) will only be run if the detected face's quality meets this threshold.
- Parameters:
faceExtractQualityThreshold- New threshold value- Throws:
java.lang.Exception- Exception- Since:
- 1.8.0
-
getFaceExtractQualityThreshold
public float getFaceExtractQualityThreshold() throws java.lang.ExceptionGet face extract quality thresholdFace template extraction (for face recognition) will only be run if the detected face's quality meets this threshold.
- Returns:
- threshold value
- Throws:
java.lang.Exception- Exception- Since:
- 1.8.0
-
setLandmarkTrackingQualityThreshold
public void setLandmarkTrackingQualityThreshold(float landmarkTrackingQualityThreshold) throws java.lang.ExceptionSet landmark tracking quality thresholdFull face detection (slower) will be run if the detected face quality falls below this threshold when tracking a face in a sequence of images
- Parameters:
landmarkTrackingQualityThreshold- New threshold value- Throws:
java.lang.Exception- Exception- Since:
- 1.8.0
-
getLandmarkTrackingQualityThreshold
public float getLandmarkTrackingQualityThreshold() throws java.lang.ExceptionGet landmark tracking quality thresholdFull face detection (slower) will be run if the detected face quality falls below this threshold when tracking a face in a sequence of images
- Returns:
- threshold value
- Throws:
java.lang.Exception- Exception- Since:
- 1.8.0
-
getDiagnosticImageFromFace
public android.graphics.Bitmap getDiagnosticImageFromFace(Face face, Image image) throws java.lang.Exception
- Throws:
java.lang.Exception
-
detectFaceCovering
@FloatRange(from=0.0, to=1.0) public float detectFaceCovering(Face face, IImageProvider image) throws VerIDCoreExceptionDetect whether the face is obscured by a face covering like a face mask or a scarf- Parameters:
face- Face on which to detect a coveringimage- Image containing the face- Returns:
- Confidence score indicating the presence of a face covering 0 = no covering, 1 = covering
- Throws:
VerIDCoreException
-
extractAttributeFromFace
@FloatRange(from=0.0, to=1.0) public float extractAttributeFromFace(Face face, IImageProvider image, java.lang.String classifier) throws VerIDCoreException- Throws:
VerIDCoreException
-
getFaceAttributeClassifiers
public java.lang.String[] getFaceAttributeClassifiers() throws VerIDCoreException- Throws:
VerIDCoreException
-
-