<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Vision",
  "identifier" : "/documentation/Vision/VNDetectRectanglesRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Vision"
    ],
    "preciseIdentifier" : "c:objc(cs)VNDetectRectanglesRequest"
  },
  "title" : "VNDetectRectanglesRequest"
}
-->

# VNDetectRectanglesRequest

An image-analysis request that finds projected rectangular regions in an image.

```
class VNDetectRectanglesRequest
```

## Overview

A rectangle detection request locates regions of an image with rectangular shape, like credit cards, business cards, documents, and signs. The request returns its observations in the form of [`VNRectangleObservation`](/documentation/Vision/VNRectangleObservation) objects, which contain normalized coordinates of bounding boxes containing the 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 it’s that 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.

## Topics

### Configuring Detection

[`minimumAspectRatio`](/documentation/Vision/VNDetectRectanglesRequest/minimumAspectRatio)

A `float` specifying the minimum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension.

[`maximumAspectRatio`](/documentation/Vision/VNDetectRectanglesRequest/maximumAspectRatio)

A `float` specifying the maximum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension.

[`VNAspectRatio`](/documentation/Vision/VNAspectRatio)

A type alias for expressing rectangle aspect ratios in Vision.

[`quadratureTolerance`](/documentation/Vision/VNDetectRectanglesRequest/quadratureTolerance)

A float specifying the number of degrees a rectangle corner angle can deviate from 90°.

[`VNDegrees`](/documentation/Vision/VNDegrees)

A typealias for expressing tolerance angles in Vision.

[`minimumSize`](/documentation/Vision/VNDetectRectanglesRequest/minimumSize)

The minimum size of a rectangle to detect, as a proportion of the smallest dimension.

[`minimumConfidence`](/documentation/Vision/VNDetectRectanglesRequest/minimumConfidence)

A value specifying the minimum acceptable confidence level.

[`VNConfidence`](/documentation/Vision/VNConfidence)

A type alias for the confidence value of an observation.

[`maximumObservations`](/documentation/Vision/VNDetectRectanglesRequest/maximumObservations)

An integer specifying the maximum number of rectangles Vision returns.

### Accessing the Results

[`results`](/documentation/Vision/VNDetectRectanglesRequest/results)

The results of the request to detect rectangles.

[`VNRectangleObservation`](/documentation/Vision/VNRectangleObservation)

An object that represents the four vertices of a detected rectangle.

### Identifying Request Revisions

[`VNDetectRectanglesRequestRevision1`](/documentation/Vision/VNDetectRectanglesRequestRevision1)

A constant for specifying revision 1 of the rectangle detection request.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)
