Function

VNNormalizedRectForImageRect(_:_:_:)

Normalizes a rectangle from image coordinates.

Declaration

func VNNormalizedRectForImageRect(_ imageRect: CGRect, _ imageWidth: Int, _ imageHeight: Int) -> CGRect

Parameters

imageRect

The input rect, in image coordinate space.

imageWidth

The width of the image in whose coordinates the input rect resides.

imageHeight

The height of the image in whose coordinates the input rect resides.

Return Value

The input rect projected into normalized 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.

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 VNImagePointForFaceLandmarkPoint(vector_float2, CGRect, Int, Int) -> CGPoint

Returns the image coordinates of a given face landmark point.

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

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