Skip to main content

BlobTrack

A real-time motion blob tracker built with Dear PyGui and OpenCV. Load any video file (or a live camera feed), and BlobTrack detects moving objects via background subtraction, then overlays customizable bounding shapes, labels, and network-style connection lines between detected blobs.

Python License

Features

  • Live motion detection using MOG2 background subtraction
  • Customizable overlays — square/circle/no outline, adjustable size, thickness, and color per blob
  • Bounding box filters — apply Invert, Blur, Pixelate, Thermal, or Edge effects inside each detected region
  • Mesh connection lines — link each blob to its k nearest neighbors with distance-based fade, for a network/web visualization
  • Adjustable playback speed (1x–2x) for file sources
  • Live Resolution scaling (Native/75%/50%/25%) to trade preview quality for performance without affecting export quality
  • Broad video format support — MP4, MOV, AVI, MKV, WEBM, M4V, WMV, FLV (case-insensitive extension matching)
  • One-click webcam access — jump straight to a live camera feed from the video panel, no CLI needed
  • Letterboxed preview — video always keeps its native aspect ratio inside the panel, with black bars filling any leftover space instead of stretching
  • Video export/recording — save the processed feed (with all overlays) to .mp4, always at full native resolution regardless of preview settings
  • Fullscreen toggle and a responsive video panel that resizes cleanly with the window

Installation

Install as an isolated CLI tool with pipx (recommended):

pipx install blobtrack

Or with pip into your own environment:

pip install blobtrack

Usage

Run with no arguments and use the Load button to pick a video file:

blobtrack

Or pass a video path or camera index directly:

blobtrack --source path/to/video.mp4
blobtrack --source 0   # webcam

You can also switch to your webcam at any time from inside the app using the Cam button in the video panel — no need to relaunch with --source.

Controls

Control Description
Minimum Area Filters out blobs smaller than this pixel area
Max Blobs Caps how many blobs are tracked per frame
Shape Bounding shape drawn around each blob (Square / Circle / None)
Bounding Size / Thickness Size 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
Bounding Box Filter Visual effect applied inside each bounding box
Font Size Size of the confidence-score label per blob
Bounding Box / Connection Line Color Preset colors or a custom color picker
Playback Speed Preview and export playback rate (locked during recording)
Live Resolution Preview processing resolution (export always stays native)
Record Opens a save dialog to choose where to export the processed feed, then starts/stops recording
Save Preset Opens a save dialog to save your current settings (thresholds, shape, filter, colors, speed, resolution) as a .json preset file
Load Preset Opens a file dialog to load a previously saved .json preset and instantly apply all its settings

Floating buttons on the video panel: Load (open a video file), Cam (switch to webcam), Pause/Play, Full (fullscreen toggle).

How it works

Each frame runs through OpenCV's BackgroundSubtractorMOG2 to isolate moving regions, followed by thresholding, morphological opening, and dilation to clean up the mask. Contours are extracted, filtered by minimum area, and the largest N are kept as tracked blobs. Overlays 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.

Notes

  • Recording locks the Playback Speed selector since the export FPS is fixed at recording start.
  • Reaching the end of a file loop automatically stops any active recording and restarts playback from frame 0.

Built by @rileriaaa

Release files for blobtrack 1.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blobtrack 1.2.8
File Size Uploaded
blobtrack-1.2.8.tar.gz 156.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for blobtrack 1.2.8
File Interpreter ABI Platform
blobtrack-1.2.8-py3-none-any.whl Python 3 none any Details

Total release size: 310.6 kB

Release files / blobtrack-1.2.8.tar.gz

Download URL blobtrack-1.2.8.tar.gz
Size 156.0 kB
Tags Source
SHA-256 checksum
How to use checksums
31d10ff1ed7f954fd3cb33661016101cb61bdc3d2251ba2bb5ba4a0a6a46c1f0
BLAKE2b-256 checksum
How to use checksums
be8bffeff2dce9f891604239604719cde6970597aec0ae8d3e3dd19e5eecbab4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / blobtrack-1.2.8-py3-none-any.whl

Download URL blobtrack-1.2.8-py3-none-any.whl
Size 154.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3132b1425bcc8edb52ac971178ea2f15ab404686d1a6e68b815685a6ecbdfd30
BLAKE2b-256 checksum
How to use checksums
44f47375c58e5d6e07f2c498e5f9354610d46d9393e87dbaf7050afcd0ede24c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

1.2.8 This release

2 release files

1.1.8

2 release files

1.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page