AVMetadataFaceObject Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in iOS 6.0 and later.
Declared in
AVMetadataObject.h

Overview

The AVMetadataFaceObject class is a concrete subclass of AVMetadataObject that defines the features of a single detected face. You can retrieve instances of this class from the output of an AVCaptureMetadataOutput object on devices that support face detection.

Tasks

Getting the Face Identifier

Accessing the Face Detection Data

Properties

faceID

The unique ID for this face metadata object. (read-only)

@property(readonly) NSInteger faceID
Discussion

Each time a face enters the picture, it is assigned a new unique identifier, which you can use to reference the face in your code. Face IDs are not reused, and the same face leaving and entering the picture again is assigned a new identifier.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVMetadataObject.h

hasRollAngle

A Boolean value indicating whether there is a valid roll angle associated with the face. (read-only)

@property(readonly) BOOL hasRollAngle
Discussion

If the value of this property is NO, the value in the rollAngle property is invalid and must not be accessed.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVMetadataObject.h

hasYawAngle

A Boolean value indicating whether there is a valid yaw angle associated with the face. (read-only)

@property(readonly) BOOL hasYawAngle
Discussion

If the value of this property is NO, the value in the yawAngle property is invalid and must not be accessed.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVMetadataObject.h

rollAngle

The roll angle of the face specified in degrees. (read-only)

@property(readonly) CGFloat rollAngle
Discussion

The roll angle represents the side-to-side tilt of the face relative to the metadata’s bounding rectangle. A value of 0.0 yields a face that is level relative to the picture, whereas a value of 90 yields a face that is perpendicular relative to the picture.

You must check the value of the hasRollAngle property before accessing this property. If the value in the hasRollAngle property is NO, reading the value in this property raises an exception.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVMetadataObject.h

yawAngle

The yaw angle of the face specified in degrees. (read-only)

@property(readonly) CGFloat yawAngle
Discussion

The yaw angle represents the rotation of the face around the vertical axis. A value of 0.0 yields a face that is looking directly at the camera, whereas a yaw angle of 90 degrees yields a face whose eye line is perpendicular to that of the camera.

You must check the value of the hasYawAngle property before accessing this property. If the value in the hasYawAngle property is NO, reading the value in this property raises an exception.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVMetadataObject.h

Constants

Face Metadata Type

A metadata type string for face detection metadata.

NSString *const AVMetadataObjectTypeFace;
Constants
AVMetadataObjectTypeFace

The type string stored in the type property of metadata objects that contain face detection data.

Available in iOS 6.0 and later.

Declared in AVMetadataObject.h.