public class PhotoDetector extends Detector
Detector.FaceListener, Detector.ImageListener
Constructor and Description |
---|
PhotoDetector(android.content.Context context)
Creates a PhotoDetector
|
Modifier and Type | Method and Description |
---|---|
void |
process(Frame photo)
Processes a photo.
|
void |
start()
Initializes the PhotoDetector in preparation for handling photos subsequently pushed via
process(com.affectiva.android.affdex.sdk.Frame) |
void |
stop()
Notifies the PhotoDetector that the last photo has been pushed via
process(com.affectiva.android.affdex.sdk.Frame) , allowing it to
deallocate resources. |
getDetectAnger, getDetectAttention, getDetectBrowFurrow, getDetectBrowRaise, getDetectChinRaiser, getDetectContempt, getDetectDisgust, getDetectEngagement, getDetectEyeClosure, getDetectFear, getDetectGender, getDetectInnerBrowRaiser, getDetectJoy, getDetectLipDepressor, getDetectLipPress, getDetectLipPucker, getDetectLipSuck, getDetectMouthOpen, getDetectNoseWrinkler, getDetectSadness, getDetectSmile, getDetectSmirk, getDetectSurprise, getDetectUpperLipRaiser, getDetectValence, getPercentFaceDetected, isRunning, reset, setAllEmotions, setAllExpressions, setDetectAnger, setDetectAttention, setDetectBrowFurrow, setDetectBrowRaise, setDetectChinRaiser, setDetectContempt, setDetectDisgust, setDetectEngagement, setDetectEyeClosure, setDetectFear, setDetectGender, setDetectInnerBrowRaiser, setDetectJoy, setDetectLipDepressor, setDetectLipPress, setDetectLipPucker, setDetectLipSuck, setDetectMouthOpen, setDetectNoseWrinkler, setDetectSadness, setDetectSmile, setDetectSmirk, setDetectSurprise, setDetectUpperLipRaiser, setDetectValence, setFaceListener, setImageListener, setLicensePath, setLicenseStream
public PhotoDetector(android.content.Context context)
context
- application's context.NullPointerException
- if context
is null
.public void start()
process(com.affectiva.android.affdex.sdk.Frame)
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)
, allowing it to
deallocate resources.stop
in class Detector
IllegalStateException
- if called before Detector.start()
.Detector.getPercentFaceDetected()
public void process(Frame photo)
Callers may pass photos to this method at any rate that is suitable for them. The detector expects subsequent photos to be unrelated to previous ones (e.g. a series of still photos).
photo
- A Frame
to process. Must be right side up: use rotateImage before calling.NullPointerException
- if photo
is null
.Copyright © 2015. All rights reserved.