Function

VNImagePointForFaceLandmarkPoint(_:_:_:_:)

Returns the image coordinates of a given face landmark point.

Declaration

func VNImagePointForFaceLandmarkPoint(_ faceLandmarkPoint: vector_float2, _ faceBoundingBox: CGRect, _ imageWidth: Int, _ imageHeight: Int) -> CGPoint

Parameters

faceLandmarkPoint

The location of the face landmark, as returned from a VNFaceLandmarkRegion2D instance.

faceBoundingBox

The normalized bounding box rect around the face, as obtained from a VNFaceObservation.

imageWidth

The width of the image from which the VNFaceObservation was generated.

imageHeight

The height of the image from which the VNFaceObservation was generated.

Return Value

The input face landmark point, projected into image coordinates.

Discussion

The resulting point in image coordinate space may have nonintegral (floating-point) coordinates.

See Also

Coordinate Conversion

func VNImagePointForNormalizedPoint(CGPoint, Int, Int) -> CGPoint

Projects a point from normalized coordinate space into image coordinates.

func VNImageRectForNormalizedRect(CGRect, Int, Int) -> CGRect

Projects a rectangle from normalized coordinate space into image coordinates.

func VNNormalizedRectForImageRect(CGRect, Int, Int) -> CGRect

Normalizes a rectangle from image coordinates.

let VNNormalizedIdentityRect: CGRect

The normalized identity rectangle with origin (0,0) and unit length and width.

func VNNormalizedRectIsIdentityRect(CGRect) -> Bool

Returns true if the rectangle has origin (0,0) and unit length and width.

func VNNormalizedFaceBoundingBoxPointForLandmarkPoint(vector_float2, CGRect, Int, Int) -> CGPoint

Returns the coordinates of a given face landmark point, in bounding box coordinates.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software