public class FrameDetector extends Detector
Detector.FaceListener, Detector.ImageListener
Constructor and Description |
---|
FrameDetector(Context context)
Creates a FrameProcessor.
|
Modifier and Type | Method and Description |
---|---|
void |
process(Frame frame,
float timestamp)
Asks the Detector to process the passed facePicture.
|
void |
start()
Initializes the FrameDetector in preparation for handling frames subsequently pushed via
process(com.affectiva.android.affdex.sdk.Frame, float) |
void |
stop()
Notifies the FrameDetector that the last frame has been pushed via
process(com.affectiva.android.affdex.sdk.Frame, float) , allowing it to
deallocate resources. |
getDetectBrowFurrow, getDetectBrowRaise, getDetectEngagement, getDetectLipCornerDepressor, getDetectSmile, getDetectValence, getPercentFaceDetected, isRunning, setDetectBrowFurrow, setDetectBrowRaise, setDetectEngagement, setDetectLipCornerDepressor, setDetectSmile, setDetectValence, setFaceListener, setImageListener, setLicensePath
public FrameDetector(Context context)
context
- application's context.public void start()
process(com.affectiva.android.affdex.sdk.Frame, float)
start
in class Detector
LicenseException
- if no or invalid license was provided see: Detector.setLicensePath(String)
.AffdexException
- if the detector did not initialize successfully.public void stop()
process(com.affectiva.android.affdex.sdk.Frame, float)
, allowing it to
deallocate resources.stop
in class Detector
java.lang.IllegalStateException
- if called before Detector.start()
.Detector.getPercentFaceDetected()
public void process(Frame frame, float timestamp)
frame
- A Frame
to process. Must be right side up: use Frame.rotateImage(Bitmap, float)
before calling.timestamp
- A timestamp (non-negative), in seconds; expected to be larger than the previous call to this method.java.lang.NullPointerException
- if frame
is null
.java.lang.IllegalArgumentException
- if timestampSec
is negative or is smaller than or equal to the previous call.