
Detect Object Containment
Per-rectangle polygon containment gate. Each {{type:Rectangle<Double>}} input is reduced to a single anchor (foot or centre, picked by {{param:anchor_mode}}) and tested against the polygon registered in {{param:roi}}; the worker emits {{type:Bool}} true when the anchor lies strictly inside the polygon.
How it fits
{{type:Rectangle<Double>}} -> {{component:detect_object_containment}} -> {{type:Bool}}
|
+-- compute the anchor point per {{param:anchor_mode}}
+-- strict point-in-polygon test against {{param:roi}}
Pick this for a fast single-bbox in-zone check when the ROI is fixed at deploy time. For multi-shape ROIs (mask, ellipse, polygon) or list inputs, use {{component:check_geometry_within_roi}} which is the more general gate. For multi-zone classification or entry/exit tracking over time, see {{component:detect_zone_transition}}.
Typical backends
- Single-zone person counter: {{component:detect_objects_triton}} -> {{component:detect_object_containment}} -> {{component:filter}} -> {{component:send_object_counts_mqtt}}.
- Restricted-area alarm: {{component:detect_objects_triton}} -> {{component:detect_object_containment}} -> {{component:output_json_http}}.
- Tracker-driven gate: {{component:track_bounding_boxes_hungarian_algorithm}} -> {{component:detect_object_containment}} -> {{component:filter}}.
Caveats
- The component takes a SINGLE rectangle per call. For lists of detections fan out upstream, or use {{component:check_geometry_within_roi}} which accepts more shape types directly.
- {{param:roi}} must be defined in config at deploy time. There is NO second-input ROI source; rotating the ROI requires a redeploy.
- Containment uses a strict point-in-polygon test: a point exactly on the polygon edge counts as OUTSIDE. Inflate {{param:roi}} upstream if edge-as-inside semantics are needed.
- {{param:roi}} vertices are stored as integer pixels internally; sub-pixel polygon coordinates round to the nearest integer at load time.
- {{param:anchor_mode}}
bottomevaluates the centre of the rectangle's bottom edge (foot anchor on floor-plane layouts);centerevaluates the rectangle's geometric centre. Pick to match how the floor-plan ROI was defined. - {{param:anchor_mode}} must be exactly
centerorbottom; any other value aborts startup with an "unrecognized anchor_mode" error. - An empty {{param:roi}} aborts startup with an "ROI is empty" error.
- Both config keys are cached at first invocation; runtime changes have NO effect and require a redeploy.
Versions
- 31764fc1defaultlatestlinux/amd64
live-test prerelease 2026-05-24T17:24:56Z

