---
title: "polygonApproximation(epsilon:)"
framework: vision
role: symbol
role_heading: Instance Method
path: "vision/vncontour/polygonapproximation(epsilon:)"
---

# polygonApproximation(epsilon:)

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

## Declaration

```swift
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

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

## See Also

### Inspecting the Contour

- [aspectRatio](vision/vncontour/aspectratio.md)
- [indexPath](vision/vncontour/indexpath.md)
- [normalizedPath](vision/vncontour/normalizedpath.md)
- [pointCount](vision/vncontour/pointcount.md)
- [normalizedPoints](vision/vncontour/normalizedpoints-8n2s5.md)
