One Logo Pool Ball
Vision · IOS API REFERENCE

DetectContoursRequest

struct · iOS 18.0+ · SDK 27.1

struct DetectContoursRequest

A request that detects the contours of the edges of an image.

Members (15)

get · iOS 18.0+

descriptor

TypeScript
get descriptor(): RequestDescriptor
Swift declaration
var descriptor: RequestDescriptor { get }

An enum that identifies the request and request revision.

get · iOS 18.0+

contrastPivot

TypeScript
get contrastPivot(): (number) | null
Swift declaration
var contrastPivot: Float?

The pixel value to use as a pivot for the contrast. Numeric values range from 0.0 to 1.0. You can also specify `nil` to have the framework automatically detect the value according to image intensity. The default value is 0.5, which indicates the pixel center.

set · iOS 18.0+

contrastPivot

TypeScript
set contrastPivot(value: (number) | null)
Swift declaration
var contrastPivot: Float?

The pixel value to use as a pivot for the contrast. Numeric values range from 0.0 to 1.0. You can also specify `nil` to have the framework automatically detect the value according to image intensity. The default value is 0.5, which indicates the pixel center.

get · iOS 18.0+

regionOfInterest

TypeScript
get regionOfInterest(): NormalizedRect
Swift declaration
var regionOfInterest: NormalizedRect

The region of the image in which Vision will perform the request. The rectangle is normalized to the dimensions of the processed image. Its origin is specified relative to the image's lower-left corner. By default, the region of interest will be the full image.

set · iOS 18.0+

regionOfInterest

TypeScript
set regionOfInterest(value: NormalizedRect)
Swift declaration
var regionOfInterest: NormalizedRect

The region of the image in which Vision will perform the request. The rectangle is normalized to the dimensions of the processed image. Its origin is specified relative to the image's lower-left corner. By default, the region of interest will be the full image.

method · iOS 18.0+

setComputeDevice

TypeScript
setComputeDevice(computeDevice: (_CoreML_MLComputeDevice) | null, computeStage: ComputeStage): void
Swift declaration
mutating func setComputeDevice(_ computeDevice: MLComputeDevice?, for computeStage: ComputeStage)

Assigns a compute device for a compute stage. If the parameter `computeDevice` is `nil`, the framework removes any explicit compute device assignment and allows the framework to select the device. Configure any compute device for a given compute stage. When performing a request, the system makes a validity check. Use `supportedComputeStageDevices` to get valid compute devices for a request’s compute stages. - Parameters: - `computeDevice: `The compute device to assign to the compute stage. - `computeStage: `The compute stage.

get · iOS 18.0+

contrastAdjustment

TypeScript
get contrastAdjustment(): number
Swift declaration
var contrastAdjustment: Float

The amount by which to adjust the image contrast. Contour detection works best with high-contrast images. The default value of this property is 2.0, which doubles the image contrast to achieve the most accurate results. This property supports a value range from 0.0 to 3.0.

set · iOS 18.0+

contrastAdjustment

TypeScript
set contrastAdjustment(value: number)
Swift declaration
var contrastAdjustment: Float

The amount by which to adjust the image contrast. Contour detection works best with high-contrast images. The default value of this property is 2.0, which doubles the image contrast to achieve the most accurate results. This property supports a value range from 0.0 to 3.0.

get · iOS 18.0+

detectsDarkOnLight

TypeScript
get detectsDarkOnLight(): boolean
Swift declaration
var detectsDarkOnLight: Bool

A Boolean value that indicates whether the request detects a dark object on a light background to aid in detection. The default value is `true`.

set · iOS 18.0+

detectsDarkOnLight

TypeScript
set detectsDarkOnLight(value: boolean)
Swift declaration
var detectsDarkOnLight: Bool

A Boolean value that indicates whether the request detects a dark object on a light background to aid in detection. The default value is `true`.

get · iOS 18.0+

supportedRevisions

TypeScript
static get supportedRevisions(): Array<DetectContoursRequest_Revision>
Swift declaration
static let supportedRevisions: [DetectContoursRequest.Revision]
get · iOS 18.0+

maximumImageDimension

TypeScript
get maximumImageDimension(): number
Swift declaration
var maximumImageDimension: Int

The maximum image dimension to use for contour detection. Contour detection is computationally intensive. To improve performance, Vision scales the input image down, while maintaining its aspect ratio, such that its maximum dimension is the value of this property. Vision never scales the image up, so specifying the maximum value ensures that the image processes in its original size and not as a downscaled version. The minimum value supported is 64. The default value is 512.

set · iOS 18.0+

maximumImageDimension

TypeScript
set maximumImageDimension(value: number)
Swift declaration
var maximumImageDimension: Int

The maximum image dimension to use for contour detection. Contour detection is computationally intensive. To improve performance, Vision scales the input image down, while maintaining its aspect ratio, such that its maximum dimension is the value of this property. Vision never scales the image up, so specifying the maximum value ensures that the image processes in its original size and not as a downscaled version. The minimum value supported is 64. The default value is 512.

get · iOS 18.0+

revision

TypeScript
get revision(): DetectContoursRequest_Revision
Swift declaration
let revision: DetectContoursRequest.Revision

The request's configured revision.

init · iOS 18.0+

init

TypeScript
static init(revision?: (DetectContoursRequest_Revision) | null): DetectContoursRequest
Swift declaration
init(_ revision: DetectContoursRequest.Revision? = nil)

- Parameters: - revision: The specific algorithm or implementation revision that is to be used to perform the request.

Skipped declarations

No declarations were skipped in this snapshot.

All Vision types →