public abstract class Detector
extends java.lang.Object
Enjoy the SDK!
This class utilizes Affdex's facial expression detection capabilities by analyzing video frames and returning the expressions in each frame. The Detector class analyzes successive video frames in order to measure the number and degree of facial expressions of the subject. Depending upon the initialization method used, the video frames may come from either the built-in camera of the device, via a file on the device, or pushed to the engine through a method.
Modifier and Type | Class and Description |
---|---|
static interface |
Detector.FaceListener |
static interface |
Detector.ImageListener
This interface provides methods that the Detector uses to communicate to users of the class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getDetectBrowFurrow() |
boolean |
getDetectBrowRaise() |
boolean |
getDetectEngagement() |
boolean |
getDetectLipCornerDepressor() |
boolean |
getDetectSmile() |
boolean |
getDetectValence() |
float |
getPercentFaceDetected()
The percentage of time a face was detected (reset at every
start() ). |
boolean |
isRunning()
Returns the state of the detector.
|
void |
setDetectBrowFurrow(boolean detectBrowFurrow) |
void |
setDetectBrowRaise(boolean detectBrowRaise) |
void |
setDetectEngagement(boolean detectEngagement) |
void |
setDetectLipCornerDepressor(boolean detectLipCornerDepressor) |
void |
setDetectSmile(boolean detectSmile) |
void |
setDetectValence(boolean detectValence) |
void |
setFaceListener(Detector.FaceListener listener) |
void |
setImageListener(Detector.ImageListener listener) |
void |
setLicensePath(java.lang.String licensePath)
Call this with the relative path (under /assets/Affdex/) to the license file provided by Affectiva.
|
void |
start() |
void |
stop() |
public void start()
LicenseException
- if no or invalid license was provided see: setLicensePath(String)
.AffdexException
- if the detector did not initialize successfully.public void stop()
java.lang.IllegalStateException
- if called before start()
.getPercentFaceDetected()
public boolean isRunning()
true
if Detector
is running; false
otherwise.public float getPercentFaceDetected()
start()
). Can only be called after
stop()
.public void setLicensePath(java.lang.String licensePath)
licensePath
- path of the packaged license file.LicenseException
- if license if is invalid.public void setFaceListener(Detector.FaceListener listener)
public void setImageListener(Detector.ImageListener listener)
public boolean getDetectEngagement()
public void setDetectEngagement(boolean detectEngagement)
public boolean getDetectLipCornerDepressor()
public void setDetectLipCornerDepressor(boolean detectLipCornerDepressor)
public boolean getDetectSmile()
public void setDetectSmile(boolean detectSmile)
public boolean getDetectValence()
public void setDetectValence(boolean detectValence)
public boolean getDetectBrowRaise()
public void setDetectBrowRaise(boolean detectBrowRaise)
public boolean getDetectBrowFurrow()
public void setDetectBrowFurrow(boolean detectBrowFurrow)