public class CameraDetector extends Detector
Modifier and Type | Class and Description |
---|---|
static class |
CameraDetector.CameraType
This enumeration is used to specify which camera to use during recording.
|
Detector.FaceListener, Detector.ImageListener
Constructor and Description |
---|
CameraDetector(android.content.Context context,
CameraDetector.CameraType cameraType,
android.view.SurfaceView cameraPreviewView)
Creates a CameraDetector.
|
Modifier and Type | Method and Description |
---|---|
void |
setMaxProcessRate(float maxFramesPerSecond)
The maximum processing rate to operate in [FPS].
|
void |
setSendUnprocessedFrames(boolean sendUnprocessedFrameFlag)
When the SDK is in control of the camera, if the SDK frame rate is lower than the camera frame rate, there will
be frames that are not processed for expressions by the SDK.
|
void |
start()
Initiates processing of frames received from the device's camera.
|
void |
stop()
Stops processing frames received from the device's camera, and releases the camera to allow its use by other
apps.
|
getDetectBrowFurrow, getDetectBrowRaise, getDetectEngagement, getDetectLipCornerDepressor, getDetectSmile, getDetectValence, getPercentFaceDetected, isRunning, setDetectBrowFurrow, setDetectBrowRaise, setDetectEngagement, setDetectLipCornerDepressor, setDetectSmile, setDetectValence, setFaceListener, setImageListener, setLicensePath
public CameraDetector(android.content.Context context, CameraDetector.CameraType cameraType, android.view.SurfaceView cameraPreviewView)
SurfaceView
is much more efficient than using the returned images in the
Detector.ImageListener.onImageResults(List, Frame, float)
callback.context
- application's context.cameraType
- an enumerated value indicating which camera (front or back) to usecameraPreviewView
- a SurfaceView
to use as a camera preview, null
to let the SDK use an internal
one. When not null, face points will be oriented to the rotation of the camera preview view.NullPointerException
- if context
is null
.public void setMaxProcessRate(float maxFramesPerSecond)
Default: 5 frames per second.
maxFramesPerSecond
- the maximum frames per second the SDK can process frames, larger than or equal to zero.IllegalArgumentException
- if maxFramesPerSecond
is negative.public void setSendUnprocessedFrames(boolean sendUnprocessedFrameFlag)
sendUnprocessedFrameFlag
- Set this to true to receive unprocessed video frames.public void start()
stop()
is called.start
in class Detector
LicenseException
- if no or invalid license was provided see: Detector.setLicensePath(String)
.AffdexException
- if the detector did not initialize successfully.IllegalStateException
- if the Camera
can not be opened.public void stop()
stop
in class Detector
IllegalStateException
- if called before Detector.start()
.Detector.getPercentFaceDetected()
Copyright © 2014. All rights reserved.