Detect contours
Try it interactively →POST /api/image-detect-contoursFind contours (closed outlines) in an image. Returns each contour as a polygon, plus area and bounding rectangle. Useful for shape analysis and ROI extraction.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| image* | file | — | Input image bytes. |
| threshold | number (0…255) | 127 | Binarisation threshold for the grayscale source (0-255). |
| minArea | number | 100 | Drop contours whose pixel area is below this. |
| mode | enum (external | tree) | "external" | RETR_EXTERNAL (outer only) or RETR_TREE (full hierarchy). |
| approxEpsilon | number (0…1) | 0 | Polygon-approx epsilon as fraction of perimeter (0 = no approx). |
Response
Modes: json. Cache: yes (24h TTL).