<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIRectangleFeature",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIRectangleFeature"
  },
  "title" : "CIRectangleFeature"
}
-->

# CIRectangleFeature

Information about a rectangular region detected in a still or video image.

```
class CIRectangleFeature
```

## Overview> Note: In macOS 10.13, iOS 11, and tvOS 11 or later, the Vision framework replaces these classes
> for identifying and analyzing image features.
> See <doc://com.apple.documentation/documentation/Vision/VNDetectFaceRectanglesRequest>)

A detected rectangle feature is not necessarily rectangular in the plane of the image; rather, the
feature identifies a shape that may be rectangular in space (for example a book on a desk) but which
appears as a four-sided polygon in the image. The properties of a `CIRectangleFeature` object
identify its four corners in image coordinates.

You can use rectangle feature detection together with the `CIPerspectiveCorrection` filter
to transform the feature to a normal orientation.

To detect rectangles in an image or video, choose [`CIDetectorTypeRectangle`](/documentation/CoreImage/CIDetectorTypeRectangle) when initializing a
[`CIDetector`](/documentation/CoreImage/CIDetector) object, and use the `CIDetectorAspectRatio` and `CIDetectorFocalLength` options to
specify the approximate shape of rectangular features to search for. The detector returns at
most one rectangle feature, the most prominent found in the image.

## Topics

### Locating a Detected Feature

[`bounds`](/documentation/CoreImage/CIRectangleFeature/bounds-swift.property)

A rectangle indicating the position and extent of the feature in image coordinates.

### Identifying the Corners of a Detected Rectangle

[`bottomLeft`](/documentation/CoreImage/CIRectangleFeature/bottomLeft-swift.property)

The lower-left corner of the detected rectangle, in image coordinates.

[`bottomRight`](/documentation/CoreImage/CIRectangleFeature/bottomRight-swift.property)

The lower-right corner of the detected rectangle, in image coordinates.

[`topLeft`](/documentation/CoreImage/CIRectangleFeature/topLeft-swift.property)

The upper-left corner of the detected rectangle, in image coordinates.

[`topRight`](/documentation/CoreImage/CIRectangleFeature/topRight-swift.property)

The upper-right corner of the detected rectangle, in image coordinates.



---

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)