Find edges, lines, corners and surfaces in a frame
detect_geometryFind edges, straight lines, corners, quads (a sign, a screen, a poster), vanishing points and how trackable a region is, on one frame of an asset, a clip or the composed film. Deterministic image measurement, not a guess: corners are refined below a pixel, quads are scored on the edges under their sides and come with their true width over height when it can be read. Use it before a pin or a surface track to get exact corners, or to check whether a region has enough texture to track (trackability says edges, features or hybrid: a blank white sign is edges). Example: detect_geometry({assetId:"vid_street", clipId:null, at:{seconds:3, atSpace:"source"}, kinds:["quads"], roi:[], maxResults:5, minStrength:null, focal:null, edgeOf:null, space:null, detail:null, overlay:null}). Results come in source pixels and in film and film_norm when a clip shows the asset then, prose first and one json block after. Free; one frame takes under a second.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | Yes | When to read the frame. | |
| roi | Yes | [] reads the whole frame. One box, quad or polygon (any space, e.g. a box you drew on a preview with its previewId) reads only there. With trackability, a quad or box roi is scored as the region to track. | |
| focal | Yes | The camera's focal length in source pixels when you know it (a quad's true aspect is then exact). null estimates it. | |
| kinds | Yes | What to find: edges (polylines), lines (straight segments), corners (refined below a pixel, each L, T or X with its edge directions), quads (four-sided surfaces like a sign or a screen, with edge support, an even inside and the true aspect), vanishing (vanishing points, horizon, focal length), trackability (a heatmap, and with a quad or box roi which tracker to use). text and depth need models that are not deployed yet and return a note. | |
| space | Yes | The space of each result's points. null: source for an asset or clip, film for the composed film. Every result also carries source (when there is one), film and film_norm. Spaces: source, source_norm, clip, film, film_tl, film_norm, preview, preview_norm, surface, tile. | |
| clipId | Yes | A clip: reads its asset at the source second it shows, and maps the results to the film through the clip's transforms. Else null. | |
| detail | Yes | How much the answer says: brief is one line per result with its ids; normal (null) adds the transform; full adds every matrix of the chain. | |
| edgeOf | Yes | For quads, which edge of a bordered surface the sides sit on: outer, inner or auto (null): of the two, the one with clearly more support along the sides, the same kind on every side, else the outer edge. The same rule as snap, so snapping a detected quad does not move it. | |
| assetId | Yes | The video or image to read, at its own pixels (source space). null with clipId reads the clip's asset; null with both reads the composed film. | |
| overlay | Yes | Draw the results over the frame. Not drawn yet: true answers a note. null: false. | |
| projectId | Yes | The project this call runs on without changing the open project. null (or leaving it out) uses the open project. wait_for_jobs takes the projectId of the calls that started the jobs. | |
| maxResults | Yes | Results per kind, 1 to 50. null: 10. | |
| minStrength | Yes | 0 to 1: drop weaker results. null: 0.1. |