public abstract class Detector extends 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 |
getDetectAnger() |
boolean |
getDetectAttention() |
boolean |
getDetectBrowFurrow() |
boolean |
getDetectBrowRaise() |
boolean |
getDetectChinRaiser() |
boolean |
getDetectContempt() |
boolean |
getDetectDisgust() |
boolean |
getDetectEngagement() |
boolean |
getDetectEyeClosure() |
boolean |
getDetectFear() |
boolean |
getDetectGender() |
boolean |
getDetectInnerBrowRaiser() |
boolean |
getDetectJoy() |
boolean |
getDetectLipDepressor() |
boolean |
getDetectLipPress() |
boolean |
getDetectLipPucker() |
boolean |
getDetectLipSuck() |
boolean |
getDetectMouthOpen() |
boolean |
getDetectNoseWrinkler() |
boolean |
getDetectSadness() |
boolean |
getDetectSmile() |
boolean |
getDetectSmirk() |
boolean |
getDetectSurprise() |
boolean |
getDetectUpperLipRaiser() |
boolean |
getDetectValence() |
float |
getPercentFaceDetected()
|
boolean |
isRunning()
Returns the state of the detector.
|
protected void |
reset()
Resets the baselines used to measure facial expressions and emotions.
|
void |
setAllEmotions(boolean detect) |
void |
setAllExpressions(boolean detect) |
void |
setDetectAnger(boolean detect) |
void |
setDetectAttention(boolean detect) |
void |
setDetectBrowFurrow(boolean detect) |
void |
setDetectBrowRaise(boolean detect) |
void |
setDetectChinRaiser(boolean detect) |
void |
setDetectContempt(boolean detect) |
void |
setDetectDisgust(boolean detect) |
void |
setDetectEngagement(boolean detect) |
void |
setDetectEyeClosure(boolean detect) |
void |
setDetectFear(boolean detect) |
void |
setDetectGender(boolean detect) |
void |
setDetectInnerBrowRaiser(boolean detect) |
void |
setDetectJoy(boolean detect) |
void |
setDetectLipDepressor(boolean detect) |
void |
setDetectLipPress(boolean detect) |
void |
setDetectLipPucker(boolean detect) |
void |
setDetectLipSuck(boolean detect) |
void |
setDetectMouthOpen(boolean detect) |
void |
setDetectNoseWrinkler(boolean detect) |
void |
setDetectSadness(boolean detect) |
void |
setDetectSmile(boolean detect) |
void |
setDetectSmirk(boolean detect) |
void |
setDetectSurprise(boolean detect) |
void |
setDetectUpperLipRaiser(boolean detect) |
void |
setDetectValence(boolean detect) |
void |
setFaceListener(Detector.FaceListener listener) |
void |
setImageListener(Detector.ImageListener listener) |
void |
setLicensePath(String licensePath)
Call this with the relative path (under /assets/Affdex/) to the license file provided by Affectiva.
|
void |
setLicenseStream(Reader reader)
Call this with a Reader object which contains a byte array representation of the license file.
|
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()
IllegalStateException
- if called before start()
.getPercentFaceDetected()
protected void reset()
start()
.public boolean isRunning()
true
if Detector
is running; false
otherwise.public float getPercentFaceDetected()
start()
, but not reset()
). Can only be called after
stop()
.public void setLicensePath(String licensePath)
licensePath
- path of the packaged license file.LicenseException
- if license if is invalid.public void setLicenseStream(Reader reader)
reader
- Reader object which should have already been initialized containing the license file as a byte array.LicenseException
- if license if is invalid or Reader has been improperly initialized.public void setFaceListener(Detector.FaceListener listener)
public void setImageListener(Detector.ImageListener listener)
public void setAllExpressions(boolean detect)
public boolean getDetectAttention()
public void setDetectAttention(boolean detect)
public boolean getDetectBrowFurrow()
public void setDetectBrowFurrow(boolean detect)
public boolean getDetectBrowRaise()
public void setDetectBrowRaise(boolean detect)
public boolean getDetectChinRaiser()
public void setDetectChinRaiser(boolean detect)
public boolean getDetectEyeClosure()
public void setDetectEyeClosure(boolean detect)
public boolean getDetectInnerBrowRaiser()
public void setDetectInnerBrowRaiser(boolean detect)
public boolean getDetectLipDepressor()
public void setDetectLipDepressor(boolean detect)
public boolean getDetectLipPress()
public void setDetectLipPress(boolean detect)
public boolean getDetectLipPucker()
public void setDetectLipPucker(boolean detect)
public boolean getDetectLipSuck()
public void setDetectLipSuck(boolean detect)
public boolean getDetectMouthOpen()
public void setDetectMouthOpen(boolean detect)
public boolean getDetectNoseWrinkler()
public void setDetectNoseWrinkler(boolean detect)
public boolean getDetectSmile()
public void setDetectSmile(boolean detect)
public boolean getDetectSmirk()
public void setDetectSmirk(boolean detect)
public boolean getDetectUpperLipRaiser()
public void setDetectUpperLipRaiser(boolean detect)
public void setAllEmotions(boolean detect)
public boolean getDetectAnger()
public void setDetectAnger(boolean detect)
public boolean getDetectContempt()
public void setDetectContempt(boolean detect)
public boolean getDetectDisgust()
public void setDetectDisgust(boolean detect)
public boolean getDetectEngagement()
public void setDetectEngagement(boolean detect)
public boolean getDetectFear()
public void setDetectFear(boolean detect)
public boolean getDetectJoy()
public void setDetectJoy(boolean detect)
public boolean getDetectSadness()
public void setDetectSadness(boolean detect)
public boolean getDetectSurprise()
public void setDetectSurprise(boolean detect)
public boolean getDetectValence()
public void setDetectValence(boolean detect)
public boolean getDetectGender()
public void setDetectGender(boolean detect)
Copyright © 2015. All rights reserved.