# HALOWERK OpenCV External Contour Metrics

> HALOWERK OpenCV External Contour Metrics is a paid API for AI agents from medien.halowerk.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-30).

Accepts a binary mask and returns per-contour metrics (area, perimeter, centroid, bounding rectangle) plus total foreground pixel count using OpenCV external contour detection.

## Facts

- Endpoint: POST https://medien.halowerk.com/v1/oss-opencv-external-contour-metrics?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/halowerk-opencv-external-contour-metrics-a5fc13a1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UkKtlBdNFMGtAcbV8o0L8

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability halowerk-opencv-external-contour-metrics-a5fc13a1 -d '<json body>'
```

Example prompt: I've already segmented my image into a binary mask — can you run OpenCV external contour detection on it and give me the area, perimeter, centroid, and bounding rectangle for each contour, plus the total foreground pixel count?

## When to prefer this

Choose this endpoint when you have already performed segmentation externally and need reproducible, threshold-independent geometric measurements of object regions. It is ideal when separation of segmentation logic from measurement is important for auditability or reproducibility. Prefer it over general-purpose vision APIs when you need raw contour-level metrics (area, perimeter, centroid, bounding box) from a known binary mask rather than end-to-end object detection with integrated segmentation.

## Known failure modes

- Invalid or malformed binary mask input returns an error
- Mask with no foreground pixels returns empty contour list
- Incorrectly encoded image data causes parsing failure
- Oversized masks may time out or exceed payload limits
- Non-binary mask (e.g. grayscale with values beyond 0/255) may produce unexpected results

## How this service works

Finds the external contours in a caller-supplied binary mask and reports, for each, its area, perimeter, centroid and bounding rectangle, plus the total foreground pixel count. The division of labour is deliberate: segmentation is a domain decision, so the mask comes from you and the measurement comes from here, which keeps the numbers reproducible and independent of any threshold this service might have chosen.

## Output

A JSON response containing a list of detected external contours, each annotated with its area (pixel count enclosed), perimeter (arc length), centroid (x, y coordinates), and bounding rectangle (x, y, width, height), along with the aggregate total count of foreground pixels in the input mask.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "POST"
    },
    "bodyType": {
     "const": "json"
    },
    "schemaUrl": {
     "type": "string",
     "format": "uri"
    },
    "exampleUrl": {
     "type": "string",
     "format": "uri"
    }
   },
   "additionalProperties": true
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "example"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {}
   }
  }
 },
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/halowerk-opencv-external-contour-metrics-a5fc13a1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from medien.halowerk.com](https://www.zero.xyz/host/medien.halowerk.com/llms.txt)
