Enumeration

VNImageCropAndScaleOption

An enumeration of different ways Vision can crop and scale an input image.

Declaration

typedef enum VNImageCropAndScaleOption : NSUInteger {
    ...
} VNImageCropAndScaleOption;

Overview

Scaling an image ensures that the entire image fits into the algorithm's input image dimensions, which may require a change in aspect ratio. Each crop and scale option transforms the input image in a different way:

A photo of a flower cropped and scaled according to Vision image options

Topics

Crop and Scale Options

VNImageCropAndScaleOptionCenterCrop

A scaling option that maintains aspect ratio to fit the short side, and crops the centered image on its long side.

VNImageCropAndScaleOptionScaleFit

An option that scales an image to fit the input image dimensions while maintaining aspect ratio.

VNImageCropAndScaleOptionScaleFill

A scaling option that scales an image proportionally so that its shorter dimension fills the canvas, potentially cropping along the longer dimension.

See Also

Configuring Image Options

imageCropAndScaleOption

An optional setting informing the Vision algorithm how to scale an input image.

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