---
title: DetectRectanglesRequest
framework: vision
role: symbol
role_heading: Structure
path: vision/detectrectanglesrequest
---

# DetectRectanglesRequest

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

## Declaration

```swift
struct DetectRectanglesRequest
```

## Overview

Overview 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 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.

## Topics

### Creating a request

- [init(_:)](vision/detectrectanglesrequest/init(_:).md)

### Performing a request

- [perform(on:orientation:)](vision/imageprocessingrequest/perform(on:orientation:)-80bya.md)
- [perform(on:orientation:)](vision/imageprocessingrequest/perform(on:orientation:)-3f3f1.md)
- [perform(on:orientation:)](vision/imageprocessingrequest/perform(on:orientation:)-qxxx.md)
- [perform(on:orientation:)](vision/imageprocessingrequest/perform(on:orientation:)-xspx.md)
- [perform(on:orientation:)](vision/imageprocessingrequest/perform(on:orientation:)-3hddl.md)
- [perform(on:orientation:)](vision/imageprocessingrequest/perform(on:orientation:)-85ex1.md)

### Understanding the result

- [RectangleObservation](vision/rectangleobservation.md)

### Configuring a request

- [maximumAspectRatio](vision/detectrectanglesrequest/maximumaspectratio.md)
- [maximumObservations](vision/detectrectanglesrequest/maximumobservations.md)
- [minimumAspectRatio](vision/detectrectanglesrequest/minimumaspectratio.md)
- [minimumConfidence](vision/detectrectanglesrequest/minimumconfidence.md)
- [minimumSize](vision/detectrectanglesrequest/minimumsize.md)
- [quadratureToleranceDegrees](vision/detectrectanglesrequest/quadraturetolerancedegrees.md)

### Getting the revision

- [revision](vision/detectrectanglesrequest/revision-swift.property.md)
- [supportedRevisions](vision/detectrectanglesrequest/supportedrevisions.md)
- [DetectRectanglesRequest.Revision](vision/detectrectanglesrequest/revision-swift.enum.md)

## Relationships

### Conforms To

- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [ImageProcessingRequest](vision/imageprocessingrequest.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [VisionRequest](vision/visionrequest.md)

## See Also

### Shape and edge detection

- [DetectContoursRequest](vision/detectcontoursrequest.md)
- [DetectHorizonRequest](vision/detecthorizonrequest.md)
