Affdex SDK
Technical Reference (C++)
Public Member Functions | List of all members
affdex::CameraDetector Class Reference

A detector used to acquire and process frames from a physical camera. More...

#include <CameraDetector.h>

Inheritance diagram for affdex::CameraDetector:
affdex::FrameDetector affdex::Detector

Public Member Functions

AFFDEXSDK CameraDetector (const int cameraId=0, const double cameraFPS=15, const double processFPS=DEFAULT_PROCESSING_FRAMERATE, const unsigned int maxNumFaces=DEFAULT_MAX_NUM_FACES, const FaceDetectorMode faceConfig=affdex::FaceDetectorMode::LARGE_FACES)
 Creates a CameraDetector. This class acquires the device camera and will immediately start processing frames from the camera feed. Processing is asynchronous so some frames may be dropped.

Parameters
cameraIdDevice id for the camera.
cameraFPSCapture framerate from the camera. Must be positive.
processFPSMaximum framerate from processing. Must be positive.
maxNumFacesThe max number of faces to be tracked.
faceConfigMaximum processing framerate.
More...
 
virtual AFFDEXSDK ~CameraDetector () override
 Finalizes an instance of the CameraDetector class. More...
 
virtual AFFDEXSDK void start () override
 Initializes the CameraDetector and starts producing frames and results immediately. More...
 
virtual AFFDEXSDK void stop () override
 Notifies the CameraDetector to stop processing frames. Immediately stops processing. More...
 
AFFDEXSDK void setCameraFPS (const double cameraFPS)
 Set/reset the camera framerate. Must be positive.

Parameters
cameraFPSCapture framerate from the camera. Must be positive.
Exceptions
AffdexExceptionAffdexException on an invalid FPS value
More...
 
AFFDEXSDK void setCameraId (const int cameraId)
 Set/reset the camera id. Must be positive.

Parameters
cameraIdDevice id for the camera.
Exceptions
AffdexExceptionAffdexException on an invalid value
More...
 
- Public Member Functions inherited from affdex::FrameDetector
AFFDEXSDK FrameDetector (const int bufferSize, const float processFrameRate=DEFAULT_PROCESSING_FRAMERATE, const unsigned int maxNumFaces=DEFAULT_MAX_NUM_FACES, const FaceDetectorMode faceConfig=affdex::FaceDetectorMode::LARGE_FACES)
 Creates a FrameDetector. More...
 
virtual AFFDEXSDK ~FrameDetector () override
 Finalizes an instance of the FrameDetector class. More...
 
virtual AFFDEXSDK void reset () override
 Re-initializes the FrameDetector in preparation for handling frames subsequently pushed via process This can be called between camera sessions / videos without having to re-initialize the detector (stop/start). After this call, Frame timestamps can begin at 0 again. More...
 
virtual AFFDEXSDK void process (Frame frame)
 Provide a frame for the detector to process. Callers may pass frames to this method at any rate that is suitable for them. The detector expects subsequent frames to be related to previous frames (e.g. a video stream). More...
 
- Public Member Functions inherited from affdex::Detector
AFFDEXSDK Detector ()
 Constructor. More...
 
virtual AFFDEXSDK ~Detector ()
 Virtual destructor. More...
 
virtual AFFDEXSDK bool isRunning ()
 Returns the state of the detector. More...
 
virtual AFFDEXSDK FaceDetectorMode getFaceDetectorMode () const
 Gets the face detector configuration in use More...
 
virtual AFFDEXSDK unsigned int getMaxNumberFaces () const
 Gets the max number of faces to be tracked. More...
 
AFFDEXSDK virtual DEPRECATED void setLicensePath (const affdex::path &licensePath)
 Sets the path to the license file used to verify the sdk. More...
 
AFFDEXSDK virtual DEPRECATED void setLicenseString (const char *licenseString)
 Sets the license string used to verify the sdk. More...
 
virtual AFFDEXSDK void setClassifierPath (const affdex::path &classifierPath)
 Sets the classifier path. More...
 
virtual AFFDEXSDK void setFaceListener (FaceListener *listener)
 Sets the FaceListener listener. More...
 
AFFDEXSDK FaceListenergetFaceListener ()
 Gets the current FaceListener. More...
 
virtual AFFDEXSDK void setImageListener (ImageListener *listener)
 Sets the image listener. More...
 
AFFDEXSDK ImageListenergetImageListener ()
 Gets the current ImageListener. More...
 
virtual AFFDEXSDK ProcessStatusListenergetProcessStatusListener ()
 Gets the current ProcessStatusListener. More...
 
virtual AFFDEXSDK void setProcessStatusListener (ProcessStatusListener *listener)
 Sets the Processing Status listener. More...
 
virtual AFFDEXSDK void setDetectAllExpressions (bool detectAllExpressions)
 Configure the detection state of all expressions. More...
 
virtual AFFDEXSDK void setDetectAllEmotions (bool detectAllEmotions)
 Configure the detection state of all expressions. More...
 
virtual AFFDEXSDK void setDetectAllEmojis (bool detectAllEmojis)
 Configure the detection state of all emojis. More...
 
virtual AFFDEXSDK void setDetectAllAppearances (bool detectAllAppearances)
 Configure the detection state of all appearances. More...
 
virtual AFFDEXSDK bool getDetectGender ()
 Gets the current state of gender detection. More...
 
virtual AFFDEXSDK void setDetectGender (bool activate)
 Configure the gender detection state. More...
 
virtual AFFDEXSDK bool getDetectGlasses ()
 Gets the current state of glasses detection. More...
 
virtual AFFDEXSDK void setDetectGlasses (bool activate)
 Configure the glasses detection state. More...
 
virtual AFFDEXSDK bool getDetectAge ()
 Gets the current state of age detection. More...
 
virtual AFFDEXSDK void setDetectAge (bool activate)
 Configure the age detection state. More...
 
virtual AFFDEXSDK bool getDetectEthnicity ()
 Gets the current state of ethnicity detection. More...
 
virtual AFFDEXSDK void setDetectEthnicity (bool activate)
 Configure the ethnicity detection state. More...
 
virtual AFFDEXSDK bool getDetectEngagement ()
 Gets the current state of engagement detection. More...
 
virtual AFFDEXSDK void setDetectEngagement (bool activate)
 Configure the engagement detection state. More...
 
virtual AFFDEXSDK bool getDetectLipCornerDepressor ()
 Gets the current state of lip corner depressor detection. More...
 
virtual AFFDEXSDK void setDetectLipCornerDepressor (bool activate)
 Configure the lip corner depressor detection state. More...
 
virtual AFFDEXSDK bool getDetectSmile ()
 Gets the current state of smile detection. More...
 
virtual AFFDEXSDK void setDetectSmile (bool activate)
 Configure the smile detection state. More...
 
virtual AFFDEXSDK bool getDetectAttention ()
 Gets the current state of attention detection. More...
 
virtual AFFDEXSDK void setDetectAttention (bool activate)
 Configure the attention detection state. More...
 
virtual AFFDEXSDK bool getDetectValence ()
 Gets the current state of valence detection. More...
 
virtual AFFDEXSDK bool getDetectJoy ()
 Gets the current state of joy detection. More...
 
virtual AFFDEXSDK void setDetectJoy (bool activate)
 Configure the joy detection state. More...
 
virtual AFFDEXSDK bool getDetectFear ()
 Gets the current state of fear detection. More...
 
virtual AFFDEXSDK void setDetectFear (bool activate)
 Configure the fear detection state. More...
 
virtual AFFDEXSDK bool getDetectDisgust ()
 Gets the current state of disgust detection. More...
 
virtual AFFDEXSDK void setDetectDisgust (bool activate)
 Configure the disgust detection state. More...
 
virtual AFFDEXSDK bool getDetectSadness ()
 Gets the current state of sadness detection. More...
 
virtual AFFDEXSDK void setDetectSadness (bool activate)
 Configure the sadness detection state. More...
 
virtual AFFDEXSDK bool getDetectAnger ()
 Gets the current state of anger detection. More...
 
virtual AFFDEXSDK void setDetectAnger (bool activate)
 Configure the anger detection state. More...
 
virtual AFFDEXSDK bool getDetectSurprise ()
 Gets the current state of surprise detection. More...
 
virtual AFFDEXSDK void setDetectSurprise (bool activate)
 Configure the surprise detection state. More...
 
virtual AFFDEXSDK bool getDetectContempt ()
 Gets the current state of contempt detection. More...
 
virtual AFFDEXSDK void setDetectContempt (bool activate)
 Configure the contempt detection state. More...
 
virtual AFFDEXSDK void setDetectValence (bool activate)
 Configure the valence detection state. More...
 
virtual AFFDEXSDK bool getDetectBrowRaise ()
 Gets the current state of eyebrow raise detection. More...
 
virtual AFFDEXSDK void setDetectInnerBrowRaise (bool activate)
 Configure the inner eyebrow raise detection state. More...
 
virtual AFFDEXSDK bool getDetectInnerBrowRaise ()
 Gets the current state of inner eyebrow raise detection. More...
 
virtual AFFDEXSDK void setDetectBrowRaise (bool activate)
 Configure the eyebrow raise detection state. More...
 
virtual AFFDEXSDK bool getDetectBrowFurrow ()
 Gets the current state of eyebrow furrow detection. More...
 
virtual AFFDEXSDK void setDetectBrowFurrow (bool activate)
 Configure the eyebrow furrow detection state. More...
 
virtual AFFDEXSDK bool getDetectNoseWrinkle ()
 Gets the current state of nose wrinkler detection. More...
 
virtual AFFDEXSDK void setDetectNoseWrinkle (bool activate)
 Configure the nose wrinkler detection state. More...
 
virtual AFFDEXSDK bool getDetectUpperLipRaise ()
 Gets the current state of upper lip raiser detection. More...
 
virtual AFFDEXSDK void setDetectUpperLipRaise (bool activate)
 Configure the upper lip raiser detection state. More...
 
virtual AFFDEXSDK bool getDetectChinRaise ()
 Gets the current state of chin raiser detection. More...
 
virtual AFFDEXSDK void setDetectChinRaise (bool activate)
 Configure the chin raiser detection state. More...
 
virtual AFFDEXSDK bool getDetectLipPucker ()
 Gets the current state of lip pucker detection. More...
 
virtual AFFDEXSDK void setDetectLipPucker (bool activate)
 Configure the lip pucker detection state. More...
 
virtual AFFDEXSDK bool getDetectLipPress ()
 Gets the current state of lip press detection. More...
 
virtual AFFDEXSDK void setDetectLipPress (bool activate)
 Configure the lip press detection state. More...
 
virtual AFFDEXSDK bool getDetectMouthOpen ()
 Gets the current state of mouth open detection. More...
 
virtual AFFDEXSDK void setDetectMouthOpen (bool activate)
 Configure the mouth open detection state. More...
 
virtual AFFDEXSDK bool getDetectLipSuck ()
 Gets the current state of lip suck detection. More...
 
virtual AFFDEXSDK void setDetectLipSuck (bool activate)
 Configure the lip suck detection state. More...
 
virtual AFFDEXSDK bool getDetectSmirk ()
 Gets the current state of smirk detection. More...
 
virtual AFFDEXSDK void setDetectSmirk (bool activate)
 Configure the smirk detection state. More...
 
virtual AFFDEXSDK bool getDetectEyeClosure ()
 Gets the current state of eye closure detection. More...
 
virtual AFFDEXSDK void setDetectEyeClosure (bool activate)
 Configure the eye closure detection state. More...
 
virtual AFFDEXSDK bool getDetectEyeWiden ()
 Gets the current state of eye widen detection. More...
 
virtual AFFDEXSDK void setDetectEyeWiden (bool activate)
 Configure the eye widen detection state. More...
 
virtual AFFDEXSDK bool getDetectCheekRaise ()
 Gets the current state of cheek raise detection. More...
 
virtual AFFDEXSDK void setDetectCheekRaise (bool activate)
 Configure the cheek raise detection state. More...
 
virtual AFFDEXSDK bool getDetectLidTighten ()
 Gets the current state of lid tighten detection. More...
 
virtual AFFDEXSDK void setDetectLidTighten (bool activate)
 Configure the lid tighten detection state. More...
 
virtual AFFDEXSDK bool getDetectDimpler ()
 Gets the current state of dimpler detection. More...
 
virtual AFFDEXSDK void setDetectDimpler (bool activate)
 Configure the dimpler detection state. More...
 
virtual AFFDEXSDK bool getDetectLipStretch ()
 Gets the current state of lip stretch detection. More...
 
virtual AFFDEXSDK void setDetectLipStretch (bool activate)
 Configure the lip stretch detection state. More...
 
virtual AFFDEXSDK bool getDetectJawDrop ()
 Gets the current state of jaw drop detection. More...
 
virtual AFFDEXSDK void setDetectJawDrop (bool activate)
 Configure the jaw drop detection state. More...
 

Additional Inherited Members

- Protected Member Functions inherited from affdex::Detector
 Detector (const bool useStaticClassifiers, const float processFrameRate, const unsigned int maxNumFaces, const FaceDetectorMode faceConfig)
 Initializes a new instance of the Detector class. More...
 
 Detector (const bool useStaticClassifiers, const float processFrameRate, const FaceDetectorMode faceConfig)
 Initializes a new instance of the Detector class. More...
 
- Protected Attributes inherited from affdex::Detector
std::shared_ptr< affdex::DetectorBase > mDetectorBase
 Smart pointer to underlying DetectorBase More...
 

Detailed Description

A detector used to acquire and process frames from a physical camera.

Constructor & Destructor Documentation

AFFDEXSDK affdex::CameraDetector::CameraDetector ( const int  cameraId = 0,
const double  cameraFPS = 15,
const double  processFPS = DEFAULT_PROCESSING_FRAMERATE,
const unsigned int  maxNumFaces = DEFAULT_MAX_NUM_FACES,
const FaceDetectorMode  faceConfig = affdex::FaceDetectorMode::LARGE_FACES 
)

Creates a CameraDetector. This class acquires the device camera and will immediately start processing frames from the camera feed. Processing is asynchronous so some frames may be dropped.

Parameters
cameraIdDevice id for the camera.
cameraFPSCapture framerate from the camera. Must be positive.
processFPSMaximum framerate from processing. Must be positive.
maxNumFacesThe max number of faces to be tracked.
faceConfigMaximum processing framerate.

virtual AFFDEXSDK affdex::CameraDetector::~CameraDetector ( )
overridevirtual

Finalizes an instance of the CameraDetector class.

Member Function Documentation

AFFDEXSDK void affdex::CameraDetector::setCameraFPS ( const double  cameraFPS)

Set/reset the camera framerate. Must be positive.

Parameters
cameraFPSCapture framerate from the camera. Must be positive.
Exceptions
AffdexExceptionAffdexException on an invalid FPS value

AFFDEXSDK void affdex::CameraDetector::setCameraId ( const int  cameraId)

Set/reset the camera id. Must be positive.

Parameters
cameraIdDevice id for the camera.
Exceptions
AffdexExceptionAffdexException on an invalid value

virtual AFFDEXSDK void affdex::CameraDetector::start ( )
overridevirtual

Initializes the CameraDetector and starts producing frames and results immediately.

Reimplemented from affdex::FrameDetector.

virtual AFFDEXSDK void affdex::CameraDetector::stop ( )
overridevirtual

Notifies the CameraDetector to stop processing frames. Immediately stops processing.

Reimplemented from affdex::FrameDetector.


The documentation for this class was generated from the following file: