<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Vision",
  "identifier" : "/documentation/Vision/GenerateIterativeSegmentationRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Vision"
    ],
    "preciseIdentifier" : "s:6Vision36GenerateIterativeSegmentationRequestC"
  },
  "title" : "GenerateIterativeSegmentationRequest"
}
-->

# GenerateIterativeSegmentationRequest

A request that generates a segmentation mask from points, a rectangle, or a scribble.

```
final class GenerateIterativeSegmentationRequest
```

## Overview

Initialize with a seed point, a seed rectangle, or a seed scribble buffer to generate the initial segmentation mask.
Then add points to iteratively refine the segmentation mask.
The request supports a maximum of 13 points when seeded with a point or scribble,
or 11 points when seeded with a box.

## Topics

### Creating a request

[`init(seedBox: NormalizedRect, GenerateIterativeSegmentationRequest.Revision?)`](/documentation/Vision/GenerateIterativeSegmentationRequest/init(seedBox:_:))

Instantiates with a seed box.

[`init(seedPoint: NormalizedPoint, GenerateIterativeSegmentationRequest.Revision?)`](/documentation/Vision/GenerateIterativeSegmentationRequest/init(seedPoint:_:))

Instantiates with a seed point.

[`init(seedScribbleBuffer: CVReadOnlyPixelBuffer, GenerateIterativeSegmentationRequest.Revision?)`](/documentation/Vision/GenerateIterativeSegmentationRequest/init(seedScribbleBuffer:_:))

Instantiates with a scribble buffer.

[`typealias Result`](/documentation/Vision/GenerateIterativeSegmentationRequest/Result)

The result is returned as a gray mask image. It can be nil if there is nothing to segment.

### Updating the mask

[`func addExcludedPoint(NormalizedPoint) throws`](/documentation/Vision/GenerateIterativeSegmentationRequest/addExcludedPoint(_:))

Refines the mask with a point that is excluded from the desired segmentation.
Throws an error if the total number of added points exceeds the limit.
(13 points when seedPoint or seedScribbleBuffer was used, or 11 points when seedBox was used)

[`func addIncludedPoint(NormalizedPoint) throws`](/documentation/Vision/GenerateIterativeSegmentationRequest/addIncludedPoint(_:))

Refines the mask with a point that is part of the desired segmentation.
Throws an error if the total number of added points exceeds the limit.
(13 points when seedPoint or seedScribbleBuffer was used, or 11 points when seedBox was used)

### Accessing the quality level

[`var qualityLevel: GenerateIterativeSegmentationRequest.QualityLevel`](/documentation/Vision/GenerateIterativeSegmentationRequest/qualityLevel-swift.property)

Controls the resolution of the produced mask.

[`enum QualityLevel`](/documentation/Vision/GenerateIterativeSegmentationRequest/QualityLevel-swift.enum)

The resolution and quality of the segmentation mask the request produces.

### Getting the revision

[`let revision: GenerateIterativeSegmentationRequest.Revision`](/documentation/Vision/GenerateIterativeSegmentationRequest/revision-swift.property)

The request’s configured revision.

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

[`static let supportedRevisions: [GenerateIterativeSegmentationRequest.Revision]`](/documentation/Vision/GenerateIterativeSegmentationRequest/supportedRevisions)

The revisions supported by [`GenerateIterativeSegmentationRequest`](/documentation/Vision/GenerateIterativeSegmentationRequest).

### Comparing the request

[`static func == (GenerateIterativeSegmentationRequest, GenerateIterativeSegmentationRequest) -> Bool`](/documentation/Vision/GenerateIterativeSegmentationRequest/==(_:_:))

Returns a Boolean value indicating whether two instances are equal.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)