---
title: "Segmenting objects using taps, scribbles or rectangles"
framework: vision
role: sampleCode
role_heading: Sample Code
path: sample-code/vision/segmenting-objects-using-taps-scribbles-or-rectangles
---

# Segmenting objects using taps, scribbles or rectangles

Select objects or regions in a photo using taps, scribbles, or rectangle selection, and generate a segmentation mask using the iterative segmentation API.

## Overview

Overview note: This sample code project is associated with WWDC26 session 237: What’s new in image understanding. Configure the sample code project To configure the sample code project: Open the sample with the latest version of Xcode. Set the developer team for all targets to let Xcode automatically manage the provisioning profile. For more information, see Set the bundle ID and Assign the project to a team. note: This sample code needs to run on a physical device.

## See Also

### Image segmentation and subject lifting

- [GenerateForegroundInstanceMaskRequest](vision/generateforegroundinstancemaskrequest.md)
- [GeneratePersonInstanceMaskRequest](vision/generatepersoninstancemaskrequest.md)
- [GeneratePersonSegmentationRequest](vision/generatepersonsegmentationrequest.md)
