Skip to content

Commit f90ce00

Browse files
alexarjeclaude
andcommitted
docs: explain density vs recency (motionhistory vs heatmap/average)
Clarify how motionhistory() (MHI, recency, order-dependent) differs from heatmap()/motion().average() (motion density, order-independent), and from motion().history() (a motion-trail video), with a worked example. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent cf80213 commit f90ce00

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

docs/user-guide/video-analysis.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,30 @@ These complement the motiongram (space×time) and the combined motion SSM (tempo
126126
the stroboscope and volume show the body moving through space over time, the waterfall shows
127127
spatial occupancy flowing over time, and the MHI compresses recency of motion into one frame.
128128

129+
### Density vs. recency: `motionhistory()` vs `heatmap()` / `motion().average()`
130+
131+
These single-image summaries look similar but encode different things — the distinction is
132+
**whether time order matters**:
133+
134+
| Visualisation | Each pixel encodes | Time order |
135+
|---|---|---|
136+
| `heatmap()` and `motion().average()` | **how much / how often** motion happened there (motion *density*) | **Order-independent** — reversing or shuffling the frames gives the same image |
137+
| `motionhistory()` (MHI) | **when** motion last happened there (motion *recency*: recent = bright, old = fades) | **Order-dependent** — reversing the video inverts the image |
138+
139+
Concrete example — a dancer crossing the frame left → right:
140+
141+
- `heatmap()` / `motion().average()` → a uniformly bright band along the whole path (you can't tell which way they went).
142+
- `motionhistory()` → a **gradient** along the path: dark where they were early, bright where they were recently — so you can read the **direction and progression** of the movement.
143+
144+
In short: use **`heatmap()` / `motion().average()`** for *where and how much* motion (a long-exposure of motion intensity); use **`motionhistory()`** for *where and when* (a recency map that captures the arrow of time).
145+
146+
Related but different: `motion().history()` (or `mv.show(key='motionhistory')`) is a **video** where each frame
147+
carries a short motion *trail* of the last N frames (a weighted moving average), rather than a single
148+
whole-clip summary image.
149+
150+
> Note: `motion()` applies your `threshold`/`filtertype` when defining motion, whereas `motionhistory()`
151+
> uses its own simple internal frame-difference threshold — so what counts as "motion" can differ slightly.
152+
129153
---
130154

131155
## Movement tempo

0 commit comments

Comments
 (0)