A real-time motion blob tracker built with Dear PyGui and OpenCV — no browser, no server, just a native desktop window running a live computer-vision pipeline frame by frame. Load any video file or a live camera feed, and BlobTrack detects moving objects via background subtraction, then overlays customizable bounding shapes, labels, network-style connection lines, and a glitchy fragment scatter effect on each detected blob, all fully adjustable while playback is running. The preview always keeps the source's native aspect ratio, letterboxed against a black background rather than stretched to fill the panel. Every visual element in the sidebar maps directly onto the same frame that gets written out when you hit Record, so what you see live is exactly what gets exported, always at full native resolution regardless of the live preview scale.
Interface: Dear PyGui, an immediate-mode GUI library that renders natively rather than through a browser or web view — chosen for how directly it can push raw frame buffers to a dynamic texture at high frame rates without the overhead a DOM-based UI would introduce. Vision pipeline: OpenCV's BackgroundSubtractorMOG2 for motion detection, followed by thresholding, morphological opening, and dilation to clean up noise before contour extraction — a classical (non-deep-learning) approach, which keeps the whole thing dependency-light and runs comfortably on CPU alone.
Frame buffers: NumPy arrays reused across frames rather than reallocated each tick, cutting allocation and garbage-collection overhead at higher resolutions. Export: OpenCV's VideoWriter, writing processed frames straight to .mp4 at a speed-adjusted FPS, locked for the duration of a recording so the exported file's timing stays consistent. Audio: ffmpeg extracts the matching audio segment, time-stretches it with atempo for non-1x speeds, and muxes it into the exported .mp4. Packaging: distributed via PyPI and installable through pipx.
Each frame runs through OpenCV's BackgroundSubtractorMOG2 to isolate moving regions, followed by thresholding, morphological opening, and dilation to clean up the mask. In the live preview, detection runs on a downscaled copy of the frame (max 640 px on the long side) and can skip frames based on the Detection Rate setting. Contours are extracted, filtered by minimum and maximum area, and the largest N are kept as tracked blobs.
Overlays (and the optional fragment effect) are drawn directly onto the frame before it's uploaded to a Dear PyGui dynamic texture for display — and, if recording, written to disk via cv2.VideoWriter at full native resolution, independent of what's shown in the live preview.
When a recording of a video file finishes, the matching audio segment is extracted with ffmpeg, time-stretched with atempo if you used a non-1x speed, and muxed into the exported .mp4.
| Control | Description |
|---|---|
| Minimum Area | Filters out blobs smaller than this pixel area. |
| Max Blobs | Caps how many blobs are tracked per frame. |
| Detection Rate | Runs detection every N frames in the live preview (higher = faster, less responsive). Recording always detects every frame. |
| Maximum Area % | Ignores blobs larger than this percentage of the frame, useful for filtering out camera shake or lighting changes. |
| Control | Description |
|---|---|
| Shape | Bounding shape drawn around each blob (Square / Circle / None). |
| Bounding Size / Thickness | Size (16–512 px presets) and stroke width of the bounding shape. |
| Connection Lines | Toggles mesh-style lines between nearby blobs. |
| Nearest Neighbors | How many neighbors each blob connects to. |
| Connection Line Thickness | Stroke width of the connection lines. |
| Bounding Box Filter | Visual effect applied inside each bounding box: Invert, Blur, Pixelate, Thermal, or Edge. |
| Font Size / Show Score Text | Size of the score label per blob, and whether it's shown at all. |
| Bounding Box / Connection Line Color | Preset colors or a custom color picker. |
| Control | Description |
|---|---|
| Playback Speed | 0.5x to 2x for file sources. Locked while recording. |
| Live Resolution | Native / 75% / 50% / 25%. Only affects the live preview; exports always render at full native resolution. |
| Save Preset | Opens a save dialog to store your current settings as a .json preset. |
| Load Preset | Opens a file dialog to load a saved .json preset and apply all its settings instantly. |
| Button | Description |
|---|---|
| Load | Opens a file picker to load a video. |
| Cam | Switches to a live webcam feed without relaunching. |
| Pause / Play | Freezes or resumes the current frame. |
| Full | Toggles fullscreen and hides the sidebar. |
Every option lives directly in the sidebar and takes effect on the next frame, since the app reads slider and button state live inside the render loop. Nothing is saved automatically — every run starts from the same defaults — but you can store and restore your whole look with Save Preset / Load Preset as a .json file. Detection Rate, Maximum Area %, and the Fragment Count / Regenerate Rate / Spread sliders are not currently included in saved presets.