descriptor
TypeScriptget descriptor(): RequestDescriptorSwift declarationvar descriptor: RequestDescriptor { get }An enum that identifies the request and request revision.
struct · iOS 18.0+ · SDK 27.1
struct DetectRectanglesRequestAn image-analysis request that finds projected rectangular regions in an image. A rectangle-detection request locates regions of an image with a rectangular shape, like credit cards, business cards, documents, and signs. The request returns its observations in the form of [RectangleObservation](https://developer.apple.com/documentation/vision/rectangleobservation) objects, which contain normalized coordinates of bounding boxes containing a rectangle. Use this type of request to find the bounding boxes of rectangles in an image. Vision returns observations for rectangles found in all orientations and sizes, along with a confidence level to indicate how likely the observation contains an actual rectangle. To further configure or restrict the types of rectangles found, set properties on the request specifying a range of aspect ratios, sizes, and quadrature tolerance.
get descriptor(): RequestDescriptorSwift declarationvar descriptor: RequestDescriptor { get }An enum that identifies the request and request revision.
get minimumSize(): numberSwift declarationvar minimumSize: FloatThe minimum size of the rectangle detected as a proportion of the smallest dimension. The property's value defaults to `0.2`, but you can set it to any value in the range `[0.0, 1.0]`. Any smaller rectangles that Vision may detect aren’t returned.
set minimumSize(value: number)Swift declarationvar minimumSize: FloatThe minimum size of the rectangle detected as a proportion of the smallest dimension. The property's value defaults to `0.2`, but you can set it to any value in the range `[0.0, 1.0]`. Any smaller rectangles that Vision may detect aren’t returned.
get regionOfInterest(): NormalizedRectSwift declarationvar regionOfInterest: NormalizedRectThe 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 regionOfInterest(value: NormalizedRect)Swift declarationvar regionOfInterest: NormalizedRectThe 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.
setComputeDevice(computeDevice: (_CoreML_MLComputeDevice) | null, computeStage: ComputeStage): voidSwift declarationmutating 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 minimumConfidence(): numberSwift declarationvar minimumConfidence: FloatThe minimum acceptable confidence level for detected rectangles. Vision won’t return rectangles with a confidence score lower than the specified minimum. The property's default value is `0.0`, but you can set it to any value in the range `[0.0, 1.0]`. A value of `0.0` represents no confidence, while `1.0` represents full confidence.
set minimumConfidence(value: number)Swift declarationvar minimumConfidence: FloatThe minimum acceptable confidence level for detected rectangles. Vision won’t return rectangles with a confidence score lower than the specified minimum. The property's default value is `0.0`, but you can set it to any value in the range `[0.0, 1.0]`. A value of `0.0` represents no confidence, while `1.0` represents full confidence.
get maximumAspectRatio(): numberSwift declarationvar maximumAspectRatio: FloatThe largest aspect ratio the rectangle request detects. The property's value defaults to `1.0`, but you can set it to any value in the range `[0.0, 1.0]`. You can use this value to choose specific rectangles in the detection like filtering out narrow rectangles by excluding small aspect ratios, or setting a range of `0.95` to `1.0` to select mostly squares.
set maximumAspectRatio(value: number)Swift declarationvar maximumAspectRatio: FloatThe largest aspect ratio the rectangle request detects. The property's value defaults to `1.0`, but you can set it to any value in the range `[0.0, 1.0]`. You can use this value to choose specific rectangles in the detection like filtering out narrow rectangles by excluding small aspect ratios, or setting a range of `0.95` to `1.0` to select mostly squares.
get minimumAspectRatio(): numberSwift declarationvar minimumAspectRatio: FloatThe smallest aspect ratio the rectangle request detects. The property's value defaults to `0.5`, but you can set it to any value in the range `[0.0, 1.0]`. You can use this value to choose specific rectangles in the detection like filtering out narrow rectangles by excluding small aspect ratios, or setting a range of `0.95` to `1.0` to select mostly squares.
set minimumAspectRatio(value: number)Swift declarationvar minimumAspectRatio: FloatThe smallest aspect ratio the rectangle request detects. The property's value defaults to `0.5`, but you can set it to any value in the range `[0.0, 1.0]`. You can use this value to choose specific rectangles in the detection like filtering out narrow rectangles by excluding small aspect ratios, or setting a range of `0.95` to `1.0` to select mostly squares.
static get supportedRevisions(): Array<DetectRectanglesRequest_Revision>Swift declarationstatic let supportedRevisions: [DetectRectanglesRequest.Revision]The collection of revisions the request supports.
get maximumObservations(): numberSwift declarationvar maximumObservations: IntThe maximum number of rectangles the request returns. The property's default value is `1`. Setting this property to `0` will return a potentially unlimited number of observations.
set maximumObservations(value: number)Swift declarationvar maximumObservations: IntThe maximum number of rectangles the request returns. The property's default value is `1`. Setting this property to `0` will return a potentially unlimited number of observations.
get quadratureToleranceDegrees(): numberSwift declarationvar quadratureToleranceDegrees: FloatThe maximum number of degrees a rectangle corner angle deviates from 90°. The property's value defaults to `30`, but you can set it to any value in the range `[0, 45]`.
set quadratureToleranceDegrees(value: number)Swift declarationvar quadratureToleranceDegrees: FloatThe maximum number of degrees a rectangle corner angle deviates from 90°. The property's value defaults to `30`, but you can set it to any value in the range `[0, 45]`.
get revision(): DetectRectanglesRequest_RevisionSwift declarationlet revision: DetectRectanglesRequest.RevisionThe request's configured revision.
static init(revision?: (DetectRectanglesRequest_Revision) | null): DetectRectanglesRequestSwift declarationinit(_ revision: DetectRectanglesRequest.Revision? = nil)Creates a rectangle-detection request. - Parameters: - revision: The specific algorithm or implementation revision that's used to perform the request.
No declarations were skipped in this snapshot.