GARAugmentedFaceSession Class

GARAugmentedFaceSession Class Reference

Overview

ARCore Augmented Face Session.

Class is used to take in a series of CVPixelBufferRefs and outputs a 3D Face Mesh for the detected face.

Inherits NSObject.

Instance Method Summary

(instancetype _Nullable) - initWithFieldOfView:error:
 Initializes a GARAugmentedFaceSession with the camera's field of view. More...
 
(BOOL) - updateWithPixelBuffer:timestamp:recognitionRotation:
 Provides the Face Mesh API with a new pixel buffer so it will capture a face frame. More...
 

Property Summary

GARAugmentedFaceFramecurrentFrame
 The most recent frame created from calling updateWithPixelBuffer:timestamp:recognitionRotation: More...
 
id
< GARAugmentedFaceSessionDelegate
delegate
 Delegate that receives callbacks from the face session. More...
 
dispatch_queue_t delegateQueue
 The dispatch queue through which the face session calls your delegate methods. More...
 

Method Detail

- (instancetype _Nullable) initWithFieldOfView: (float)  fieldOfView
error: (NSError **)  error 

Initializes a GARAugmentedFaceSession with the camera's field of view.

Parameters
fieldOfViewThe camera device's horizontal field of view in degrees.
errorOut parameter for an NSError. Possible errors: GARAugmentedFaceSessionErrorCodeDeviceNotCompatible - this device or OS version is not currently supported.
Returns
An initialized GARAugmentedFaceSession or nil if there is an error.
- (BOOL) updateWithPixelBuffer: (CVPixelBufferRef)  pixelBuffer
timestamp: (NSTimeInterval)  timestamp
recognitionRotation: (NSUInteger)  recognitionRotation 

Provides the Face Mesh API with a new pixel buffer so it will capture a face frame.

Parameters
pixelBufferCVPixelBufferRef containing camera image.
timestampTimestamp that you wish to associate with this image. Timestamps must monotonically increase on successive calls to this method.
recognitionRotationThe counter-clockwise rotation in degrees required to orient the face upwards for face detection. NOTE: The default camera orientation is landscape left. When holding the phone in portrait and taking a selfie this should be set to 270. The 270 degree rotation rotates a landscape camera image to portrait with the head pointing up.
Returns
YES if the frame was accepted for processing. NO if the frame was not accepted for processing. This will occur when the session has too many frames in the queue to process.

Property Detail

- (GARAugmentedFaceFrame*) currentFrame
readnonatomicassign

The most recent frame created from calling updateWithPixelBuffer:timestamp:recognitionRotation:

- (id<GARAugmentedFaceSessionDelegate>) delegate
readwritenonatomicweak

Delegate that receives callbacks from the face session.

- (dispatch_queue_t) delegateQueue
readwritenonatomicassign

The dispatch queue through which the face session calls your delegate methods.