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 theIFaceDetection
interface- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the face detection and cleanup resourcesVerIDImage<Image>
createVerIDImage(IImage<?> source)
CreateVerIDImage
from a camera framefloat
detectFaceCovering(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 imagefloat
extractAttributeFromFace(Face face, IImageProvider image, java.lang.String classifier)
android.graphics.Bitmap
getDiagnosticImageFromFace(Face face, Image image)
java.lang.String[]
getFaceAttributeClassifiers()
float
getFaceExtractQualityThreshold()
Get face extract quality thresholdfloat
getLandmarkTrackingQualityThreshold()
Get landmark tracking quality thresholdvoid
setFaceExtractQualityThreshold(float faceExtractQualityThreshold)
Set face extract quality thresholdvoid
setLandmarkTrackingQualityThreshold(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:
detectFacesInImage
in 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:
startFaceTracking
in interfaceIFaceDetection
- Returns:
- Face tracking session
- Since:
- 1.0.0
-
close
public void close()
Close the face detection and cleanup resources- Specified by:
close
in interfaceIFaceDetection
- Since:
- 1.0.0
-
createVerIDImage
public VerIDImage<Image> createVerIDImage(IImage<?> source) throws VerIDCoreException
CreateVerIDImage
from a camera frame- Specified by:
createVerIDImage
in 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.Exception
Set 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.Exception
Get 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.Exception
Set 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.Exception
Get 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 VerIDCoreException
Detect 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
-
-