CIFaceFeature Class Reference

Inherits from
Conforms to
Framework
Library/Frameworks/CoreImage.framework
Availability
Available in iOS 5.0 and later.
Declared in
CIFeature.h
Related sample code

Overview

A CIFaceFeature object describes a face detected in a still or video image. Its properties provide information about the face’s eyes and mouth. A face object in a video can also have properties that track its location over time—tracking ID and frame count.

Tasks

Locating Faces

Identifying Facial Features

Tracking Distinct Faces in Video

Properties

bounds

A rectangle indicating the position and dimensions of the face in image coordinates. (read-only)

@property(readonly, assign) CGRect bounds
Availability
  • Available in iOS 7.0 and later.
Declared In
CIFeature.h

faceAngle

The rotation of the face. (read-only)

@property(readonly, assign) float faceAngle
Discussion

Rotation is measured counterclockwise in radians, with zero indicating that a line drawn between the eyes is horizontal relative to the image orientation.

Availability
  • Available in iOS 7.0 and later.
Declared In
CIFeature.h

hasFaceAngle

A Boolean value that indicates whether information about face rotation is available. (read-only)

@property(readonly, assign) BOOL hasFaceAngle
Availability
  • Available in iOS 7.0 and later.
Declared In
CIFeature.h

hasLeftEyePosition

A Boolean value that indicates whether the detector found the face’s left eye. (read-only)

@property(readonly, assign) BOOL hasLeftEyePosition
Availability
  • Available in iOS 5.0 and later.
Declared In
CIFeature.h

hasMouthPosition

A Boolean value that indicates whether the detector found the face’s mouth. (read-only)

@property(readonly, assign) BOOL hasMouthPosition
Availability
  • Available in iOS 5.0 and later.
Declared In
CIFeature.h

hasRightEyePosition

A Boolean value that indicates whether the detector found the face’s right eye. (read-only)

@property(readonly, assign) BOOL hasRightEyePosition
Availability
  • Available in iOS 5.0 and later.
Declared In
CIFeature.h

hasSmile

A Boolean value that indicates whether a smile is detected in the face. (read-only)

@property(readonly, assign) BOOL hasSmile
Discussion

For smiles to be detected, the key CIDetectorSmile must be present with a value of YES in the dictionary passed to a detector’s featuresInImage:options: method.

Availability
  • Available in iOS 7.0 and later.
Declared In
CIFeature.h

hasTrackingFrameCount

A Boolean value that indicates the face object has a tracking frame count. (read-only)

@property(readonly, assign) BOOL hasTrackingFrameCount
Availability
  • Available in iOS 6.0 and later.
Declared In
CIFeature.h

hasTrackingID

A Boolean value that indicates whether the face object has a tracking ID. (read-only)

@property(readonly, assign) BOOL hasTrackingID
Availability
  • Available in iOS 6.0 and later.
Declared In
CIFeature.h

leftEyeClosed

A Boolean value that indicates whether the a closed left eye is detected in the face. (read-only)

@property(readonly, assign) BOOL leftEyeClosed
Discussion

“Left” is relative to the original (non-mirrored) image orientation, not to the owner of the eye.

For closed eyes to be detected, the key CIDetectorEyeBlink must be present with a value of YES in the dictionary passed to a detector’s featuresInImage:options: method.

Availability
  • Available in iOS 7.0 and later.
Declared In
CIFeature.h

leftEyePosition

The coordinates of the left eye, in image coordinates. (read-only)

@property(readonly, assign) CGPoint leftEyePosition
Availability
  • Available in iOS 5.0 and later.
Declared In
CIFeature.h

mouthPosition

The coordinates of the mouth eye, in image coordinates (read-only)

@property(readonly, assign) CGPoint mouthPosition
Availability
  • Available in iOS 5.0 and later.
Declared In
CIFeature.h

rightEyeClosed

A Boolean value that indicates whether the a closed left eye is detected in the face. (read-only)

@property(readonly, assign) BOOL rightEyeClosed
Discussion

“Right” is relative to the original (non-mirrored) image orientation, not to the owner of the eye.

For closed eyes to be detected, the key CIDetectorEyeBlink must be present with a value of YES in the dictionary passed to a detector’s featuresInImage:options: method.

Availability
  • Available in iOS 7.0 and later.
Declared In
CIFeature.h

rightEyePosition

The coordinates of the right eye, in image coordinates (read-only)

@property(readonly, assign) CGPoint rightEyePosition
Availability
  • Available in iOS 5.0 and later.
Declared In
CIFeature.h

trackingFrameCount

The tracking frame count of the face. (read-only)

@property(readonly, assign) int trackingFrameCount
Availability
  • Available in iOS 6.0 and later.
Declared In
CIFeature.h

trackingID

The tracking identifier of the face object. (read-only)

@property(readonly, assign) int trackingID
Discussion

Core Image provides a tracking identifier for faces it detects in a video stream, which you can use to identify when a CIFaceFeature objects detected in one video frame is the same face detected in a previous video frame.

This identifier persists only as long as a face is in the frame and is not associated with a specific face. In other words, if a face moves out of the video frame and comes back into the frame later, another ID is assigned. (Core Image detects faces, but does not recognize specific faces.)

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