detectionOverlay
Draw computer-vision style detection boxes over whatever the child contains.
detectionOverlay(slots: DetectionOverlaySlots): (params: GpuFragmentParams) => ExprT
Import effects from shaders/std and use effects.overlay.detectionOverlay.
A whole fragment for a gpu: definition. The canvas is cut into cells (layout, cellSize, maxDepth); each cell that holds content of the chosen kind (detectionMode above threshold) gets a box drawn tight around that content, with an optional label showing its size or coverage. The child shows through underneath. Every slot is a prop ref; the field list on DetectionOverlaySlots gives units and options.
Parameters
| Name | Type | Notes |
|---|---|---|
slots | DetectionOverlaySlots |
Example
gpu: {fragment: detectionOverlay({detectionMode: p('detectionMode'), threshold: p('threshold'), layout: p('layout'), cellSize: p('cellSize'), maxDepth: p('maxDepth'), boxStyle: p('boxStyle'), lineWidth: p('lineWidth'), cornerRadius: p('cornerRadius'), strokeColor: p('strokeColor'), fillColor: p('fillColor'), labelColor: p('labelColor'), labelBackgroundColor: p('labelBackgroundColor'), labelMode: p('labelMode'), labelPosition: p('labelPosition'), labelInset: p('labelInset'), labelRadius: p('labelRadius'), fontFamily: p('fontFamily'), fontWeight: p('fontWeight'), fontSize: p('fontSize'), letterSpacing: p('letterSpacing')})}
Tip. Cost grows with
maxDepth; 2 is plenty for most layouts. SetlabelModeto'none'to skip the text pass entirely.
See also
motionTrackerHud— Draw motion-tracker gizmos that chase content across the child, leaving keyframe trails.