<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Vision",
  "identifier" : "/documentation/Vision/VNContour/polygonApproximation(epsilon:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Vision"
    ],
    "preciseIdentifier" : "c:objc(cs)VNContour(im)polygonApproximationWithEpsilon:error:"
  },
  "title" : "polygonApproximation(epsilon:)"
}
-->

# polygonApproximation(epsilon:)

Simplifies the contour to a polygon using a Ramer-Douglas-Peucker algorithm.

```
func polygonApproximation(epsilon: Float) throws -> VNContour
```

## Parameters

`epsilon`

This parameter defines the distance threshold the algorithm uses. It preserves points whose perpendicular distance to the line segment they are on is greater than `epsilon`, and removes all others.

## Return Value

A simplified polygon contour from the points of the original contour.

## Discussion

---

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)