Skip to content

feat: VectorField node — grid-based motion vector visualization from tracker output - #778

Merged
hackolite merged 1 commit into
mainfrom
copilot/create-vector-field-render-node
Jul 30, 2026
Merged

feat: VectorField node — grid-based motion vector visualization from tracker output#778
hackolite merged 1 commit into
mainfrom
copilot/create-vector-field-render-node

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown

Adds a new VectorField node under the Visual menu that consumes MultiObjectTracking JSON output and renders a per-cell motion vector field overlaid on the video frame.

New node: node/VisualNode/node_vector_field.py

Inputs: IMAGE + JSON (tracker: track_ids, bboxes)
Output: IMAGE with arrow overlay

Vector field rendering

Each grid cell accumulates velocity vectors from all tracked objects whose trajectory midpoints fell within it. Per-cell arrow:

  • Direction → average velocity vector
  • Length → proportional to relative speed (0 → max observed)
  • Thickness → 1–6 px, proportional to relative speed
  • Color → blue (slow) → green → red (fast) via HSV mapping

UI controls

Control Range Purpose
Cell size (px) 10–200 Square grid resolution; field recalculates on change
Period mode Minutes / Hours / Infinite Round-robin retention unit
Duration 1–60 (min) or 1–24 (h) History window depth
Blend Alpha 0.0–1.0 Overlay weight vs. background frame

Round-robin history

Position history is stored per track_id as a deque of (cx, cy, timestamp) tuples. Old entries are pruned on every update based on the configured retention window. Velocity is computed in display-pixel/second between consecutive frames, scaled to display resolution.

Style registration: node_editor/style.py

VectorField added to VIZ list → appears in the Visual menu with the existing pink-pastel theme.

Copilot AI changed the title feat: add VectorField node for tracking-based motion vector visualization feat: VectorField node — grid-based motion vector visualization from tracker output Jul 30, 2026
Copilot AI requested a review from hackolite July 30, 2026 10:16
@hackolite
hackolite marked this pull request as ready for review July 30, 2026 10:21
@hackolite
hackolite merged commit 4720176 into main Jul 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants