Real-time pipeline that detects when a person steps into a predefined restricted zone using IM SDK foot detection — with color-coded visual alerts, bounding box status indicators, and RTSP/WebRTC output.
Introduction
Monitoring access to restricted areas is a common requirement in industrial sites, warehouses, and other controlled environments. While these zones are often clearly marked, enforcing compliance in real time remains difficult. Manual supervision and post-event video review do not scale well and cannot provide the immediate response required in safety-critical scenarios. The QIM SDK enables a shift from reactive monitoring to real-time, automated situational awareness. By using hardware-accelerated GStreamer plugins, the SDK offloads compute-intensive tasks — including video decoding, frame preparation, multi-stage AI inference, and encoding — to dedicated hardware blocks. Frame preparation includes resizing, color conversion (YUV to RGB), and pixel normalization for neural network input. At the core of this use case is a streamlined pipeline that combines machine learning with spatial reasoning. A foot detection model identifies the location of a person’s feet in each frame, providing a reliable indicator of physical position within the scene. These detections are then evaluated against a predefined restricted zone to determine, in real time, whether a boundary has been crossed. The SDK also provides hardware-accelerated visualization through overlay rendering. Detection results and zone boundaries are composited directly onto video frames, with dynamic visual cues: green bounding boxes indicate the foot is outside the restricted zone, red indicates a violation. Beyond visualization, the SDK supports AI metadata streaming, synchronizing detection and zone-evaluation results with the video stream and transmitting them in parallel for alerting, logging, or dashboard integration. The complete application source code is available here.Use Case Overview
Video Input
Foot Detection
Zone Evaluation
qtirestrictedzonedbg evaluates each detected foot position against the predefined restricted zone polygon to determine whether a boundary has been crossed.Metadata Generation
Visualization
qtivoverlay renders bounding boxes and the restricted zone polygon onto video frames. Bounding boxes are green (outside zone) or red (violation).Metadata Synchronization
qtimetamux synchronizes all inference and zone-evaluation results with the original video frames, maintaining per-frame consistency.Output
Pipeline diagram

Elements used in pipeline
How it works
Stage 1 — Foot Detection
qtimlvconverter to align with model input requirements. Preprocessed tensors are passed to qtimltflite, which runs the foot detection model and produces raw output tensors.Post-Processing
qtimlpostprocess converts the tensors into bounding box detections. qtimetamux attaches these detections to the original video frame as metadata.Stage 2 — Zone Evaluation
qtirestrictedzonedbg evaluates each detected foot position against the configured restricted zone polygon. If a foot lies inside the polygon, the pipeline flags it as a violation in real time.Tracking
qtiobjtracker maintains object identity across frames, assigning a consistent tracking ID to each detected foot for reliable zone evaluation over time.Visualization and Output
qtivoverlay renders bounding boxes and the restricted zone on the video stream. Visual cues update dynamically based on zone evaluation. The processed stream can be displayed locally, saved to file, or streamed via RTSP or WebRTC. qtimlmetaparser serializes metadata into JSON for external system integration.Run application on device
Setup Requirements
Hardware

Software
Flash your Qualcomm Edge device by following the device setup and flashing instructions here. Once your device is ready, follow the instructions below to set up the Restricted Zone pipeline.AI Model and config files
Note: A display must be connected to the device. If no display is available, use the --no-display flag.
RTSP output
RTSP output
WebRTC output
WebRTC output
Display only
Display only
Note: This example uses an offline video file as input. To use an IP/RTSP camera or USB camera instead, update the --input-type argument accordingly — refer to the Command-Line Options section below.
It produces two key output results: an AI-annotated video stream and a JSON metadata stream. To visualize these results, refer to the Host-Side Visualization section below.
Visualize the Results - Host-Side Visualization (Windows + WSL)
This section describes how to run the visualization client on a Windows host machine using WSL (Windows Subsystem for Linux). The client renders the live video stream alongside a real-time AI metadata panel. 📥 The visualization client script can be downloaded here: rtsp_webrtc_client.py It displays:- Left panel — Live video stream with AI overlays (bounding boxes and restricted zone polygon).
- Right panel — Real-time AI metadata (JSON): object detections, tracking IDs, bounding boxes, and confidence scores.
RTSP
RTSP
WebRTC
WebRTC
Command-Line Options
--input-type
--input-type
--input-config
--input-config
--input-type.--output-type
--output-type
--output-config
--output-config
--model-base-path
--model-base-path
--no-display
--no-display
--width / --height / --framerate
--width / --height / --framerate
--webrtc-id
--webrtc-id
Update Restricted Zone Area
The restricted zone can be customized by setting thezone-config property of qtirestrictedzonedbg. The configuration supports one or more zones defined as ordered polygon vertex lists.
Implementation Deep-Dive
1. Application Configuration and Runtime Context
1. Application Configuration and Runtime Context
2. Reusable Pipeline Skeleton
2. Reusable Pipeline Skeleton
3. Inference, Zone, and Overlay Configuration
3. Inference, Zone, and Overlay Configuration
4. Pipeline Linking
4. Pipeline Linking
5. WebRTC Signaling
5. WebRTC Signaling
libsoup.Build the Application
- Source code: gst-restricted-zone
- Build instructions: Steps to build custom application

