iOS Developer Library

Developer

Core Image Reference Collection CIFaceFeature Class Reference

Options
Deployment Target:

On This Page
Language:

CIFaceFeature

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.

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

    Declaration

    Swift

    var bounds: CGRect { get }

    Objective-C

    @property(readonly, assign) CGRect bounds

    Availability

    Available in iOS 7.0 and later.

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

    Declaration

    Swift

    var hasFaceAngle: Bool { get }

    Objective-C

    @property(readonly, assign) BOOL hasFaceAngle

    Availability

    Available in iOS 7.0 and later.

  • The rotation of the face. (read-only)

    Declaration

    Swift

    var faceAngle: Float { get }

    Objective-C

    @property(readonly, assign) float faceAngle

    Discussion

    Rotation is measured counterclockwise in degrees, 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.

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

    Declaration

    Swift

    var hasLeftEyePosition: Bool { get }

    Objective-C

    @property(readonly, assign) BOOL hasLeftEyePosition

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    var hasRightEyePosition: Bool { get }

    Objective-C

    @property(readonly, assign) BOOL hasRightEyePosition

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    var hasMouthPosition: Bool { get }

    Objective-C

    @property(readonly, assign) BOOL hasMouthPosition

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    var leftEyePosition: CGPoint { get }

    Objective-C

    @property(readonly, assign) CGPoint leftEyePosition

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    var rightEyePosition: CGPoint { get }

    Objective-C

    @property(readonly, assign) CGPoint rightEyePosition

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    var mouthPosition: CGPoint { get }

    Objective-C

    @property(readonly, assign) CGPoint mouthPosition

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    var hasSmile: Bool { get }

    Objective-C

    @property(readonly, assign) BOOL hasSmile

    Discussion

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

    Availability

    Available in iOS 7.0 and later.

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

    Declaration

    Swift

    var leftEyeClosed: Bool { get }

    Objective-C

    @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 YEStrue in the dictionary passed to a detector’s featuresInImage:options: method.

    Availability

    Available in iOS 7.0 and later.

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

    Declaration

    Swift

    var rightEyeClosed: Bool { get }

    Objective-C

    @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 YEStrue in the dictionary passed to a detector’s featuresInImage:options: method.

    Availability

    Available in iOS 7.0 and later.

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

    Declaration

    Swift

    var hasTrackingID: Bool { get }

    Objective-C

    @property(readonly, assign) BOOL hasTrackingID

    Availability

    Available in iOS 6.0 and later.

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

    Declaration

    Swift

    var trackingID: Int32 { get }

    Objective-C

    @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.

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

    Declaration

    Swift

    var hasTrackingFrameCount: Bool { get }

    Objective-C

    @property(readonly, assign) BOOL hasTrackingFrameCount

    Availability

    Available in iOS 6.0 and later.

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

    Declaration

    Swift

    var trackingFrameCount: Int32 { get }

    Objective-C

    @property(readonly, assign) int trackingFrameCount

    Availability

    Available in iOS 6.0 and later.