<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Vision",
  "identifier" : "/documentation/Vision/DetectContoursRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Vision"
    ],
    "preciseIdentifier" : "s:6Vision21DetectContoursRequestV"
  },
  "title" : "DetectContoursRequest"
}
-->

# DetectContoursRequest

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

```
struct DetectContoursRequest
```

## Overview

This request generates a [`ContoursObservation`](/documentation/Vision/ContoursObservation) object that describes the contours in an image.

## Topics

### Creating a request

[`init(_:)`](/documentation/Vision/DetectContoursRequest/init(_:))

Creates a contour-detection request.

### Performing a request

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-80bya)

Performs the request on an image URL and produces observations.

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-3f3f1)

Performs the request on image data and produces observations.

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-qxxx)

Performs the request on a Core Graphics image and produces observations.

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-xspx)

Performs the request on a pixel buffer and produces observations.

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-3hddl)

Performs the request on a Core Media buffer and produces observations.

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-85ex1)

Performs the request on a Core Image image and produces observations.

### Understanding the result

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

An object that represents the detected contours in an image.

### Configuring a request

[`contrastAdjustment`](/documentation/Vision/DetectContoursRequest/contrastAdjustment)

The amount by which to adjust the image contrast.

[`contrastPivot`](/documentation/Vision/DetectContoursRequest/contrastPivot)

The pixel value to use as a pivot for the contrast.

[`detectsDarkOnLight`](/documentation/Vision/DetectContoursRequest/detectsDarkOnLight)

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

[`maximumImageDimension`](/documentation/Vision/DetectContoursRequest/maximumImageDimension)

The maximum image dimension to use for contour detection.

### Getting the revision

[`revision`](/documentation/Vision/DetectContoursRequest/revision-swift.property)

The algorithm or implementation the request uses.

[`supportedRevisions`](/documentation/Vision/DetectContoursRequest/supportedRevisions)

The collection of revisions the request supports.

[`Revision`](/documentation/Vision/DetectContoursRequest/Revision-swift.enum)

A type that describes the algorithm or implementation that the request performs.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

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

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

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

---

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)