video-tracker
Skill4 starsChanged 24 days agoMITView on GitHub
EXPERIMENTAL. Extracts standardized motion data from experiment videos. Wraps a pluggable OpenCV tracking backend (CSRT with automatic pure template-matching fallback on OpenCV 5.x) plus template re-acquire, sub-pixel refinement, and optical-flow fallback for occlusion, FFT amplitude spectrum analysis, and CSV / JSON / PNG output. Use it when a user gives a physics-experiment video (pendulum, ballistic, projectile, oscillation, or any 1-2 tracked objects on a .mp4 / .avi / .mov file) and asks for position-vs-time data, a frequency report, or a trajectory plot. Accuracy is target-specific and the pipeline is marked unstable: expect to verify outputs on real data.
- Installs packages
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- JiamingShi-JsPhys/chelate-shelledited, first seen Oct 25, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- JiamingShi-JsPhys/chelate-shell★ 1010% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- conflict-detectorSkill
- document-evolution-trackerSkill
- formula-validatorSkill
- longitudinal-analysisSkill
- multi-dim-managerSkill
- task-organizerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 8 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 141
Before the first run, probe the runtime deps for this skill:
- Very specific: line 147
If a required dep is missing, the video steps will not run.
- Distinctive: line 151
Prefer a project-local venv.
- Distinctive: line 160
When the user asks to extract motion data from an experiment video, follow
- Distinctive: line 172
Confirm inputs: Verify a video path, the FPS, and the ROI(s) for the
- Very specific: line 208
Probe before tracking: Run python scripts/run.py probe --config cfg
- Distinctive: line 264
If no event window is declared, the full video is tracked (the
- Very specific: line 280
Track: Run python scripts/run.py track --config cfg.
- Very specific: line 304
Spectrum: Run python scripts/run.py fft --config cfg to compute the
- Very specific: line 316
Report: Run python scripts/run.py report --config cfg to produce a
- Distinctive: line 324
Physics consistency (optional): Run
- Very specific: line 344
Recover / re-tune: If tracking quality is poor, adjust params
- Very specific: line 372
Never modify the raw video: All outputs land under output/.
- Distinctive: line 380
No interactive input: Every parameter (ROI, FPS, scale, params) comes
- Distinctive: line 400
Trackers are CPU-only: No GPU acceleration is available in the Python
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
video-tracker
Status: experimental / unstable. The tracker works well on clean,
single-object footage but degrades on heavily occluded, deformable, or
fast targets. Error is target-specific — treat every run as
preliminary and verify against a known reference before trusting the
numbers.
A self-contained skill that turns an experiment video into reproducible
physics data:
Video tracking — pluggable backend per declared object (
autoCSRTwith automatic
cv2.matchTemplatefallback on OpenCV 5.x, ortemplate),with an optional template-matching re-acquire when the tracker loses the
target, plus sub-pixel refinement and an optical-flow fallback
(brief occlusion, reflective shells, flipped covers).
FFT analysis — amplitude spectrum of the tracked coordinate series;
dominant peak, period, and top-N resonances; PNG figure.
Standardized output —
frame, time_s, x_px, y_px, confidenceCSV plusa JSON summary (FPS, total frames, lost-frame lists, success rate, and cm
units when a scale is declared).
Batch mode — process several videos sequentially and roll up into one
batch JSON.
The skill is deterministic: same video + same config → same outputs. It
never modifies the raw video file.
MANDATORY WORKFLOW
Dependency bootstrap (run on first use)
Before the first run, probe the runtime deps for this skill:
- Required (video steps):
numpy,opencv-contrib-python-headless. - Optional:
matplotlib(PNG spectrum / trajectory figures),PyYAML(YAML configs; JSON works with the standard library alone).
If a required dep is missing, the video steps will not run. Do not
install automatically. Tell the user which package is missing and ask
whether to python -m pip install numpy opencv-contrib-python-headless
(or pip install -r requirements.txt); install only after they confirm.
Prefer a project-local venv. OpenCV-dependent tests skip cleanly when the
full stack is absent; the FFT / CSV / JSON / report paths are pure numpy.
When the user asks to extract motion data from an experiment video, follow
these steps in order.
Confirm inputs. Verify a video path, the FPS, and the ROI(s) for the
target object(s) are known. If the user has not declared ROIs, ask —
the tracker cannot guess where the target is in the first frame.
Load the config.
config.yaml(or a JSON equivalent) declaresvideos,objects(one ROI per object),fps, optionalscale_cm_per_px, the CSRTparamsblock, and thetracker_type/subpixel/use_optical_flow_fallback/max_dim/frame_stepknobs. YAML requires PyYAML;
JSON works with the standard library alone.
Probe before tracking. Run
python scripts/run.py probe --config cfgto print container metadata (FPS, frame count, resolution). Confirm the
video is readable and the resolution is workable (trackers are not GPU-
accelerated; 720p and below are recommended, or set
max_dim).Narrow to the event window (when applicable). For long or
multi-event videos, the whole file is rarely the part that matters — a
slow-motion falling page, a pendulum swing, or a projectile pass usually
occupies a few-seconds sub-window. Track that window, not the whole file:
The config supports a
frame_range: [start, end]list that limitstracking to
[start, end](inclusive). When set, the CSV time axisis shifted so
time_sstarts atstart/fpsinstead of 0.For experiments with a physical marker (e.g., a known cm ruler in
the frame), also declare
scale_cm_per_pxhere so the outputpositions carry a cm column.
If no event window is declared, the full video is tracked (the
default) and you should expect a runtime proportional to
n_frames × resolution— at 1080p × 60 fps × 4000+ frames thistakes 10+ minutes and is usually the wrong granularity anyway.
Track. Run
python scripts/run.py track --config cfg. For everyframe in scope, each object's tracker is updated; on a loss the
optional template-matching re-acquire fires, and if that fails an
optical-flow estimate advances the last known centre. Outputs:
<video>_tracking.csv,<video>_summary.jsonunder theoutput/directory. The raw video is never modified.
Spectrum. Run
python scripts/run.py fft --config cfgto compute theFFT amplitude spectrum of each object's x/y series and write
<video>_fft.json+<video>_spectra.png(schematics, not data).Report. Run
python scripts/run.py report --config cfgto produce aMarkdown report combining the tracking summary and spectral findings.
Physics consistency (optional). Run
python scripts/run.py physics --config cfg --family <fam>to judgewhether the track obeys Newtonian laws (teleport / conservation /
equation-of-motion probes) and write
<video>_physics.json. Pure numpy,re-uses the CSV/JSON from step 5; no reference video is needed.
Recover / re-tune. If tracking quality is poor, adjust
params(lower
psr_threshold, raisepatch_ratio) and re-run. The outputdirectory is additive: old files are not deleted unless you ask for
--force.
Hard constraints
Never modify the raw video. All outputs land under
output/; thesource file is opened read-only.
No interactive input. Every parameter (ROI, FPS, scale, params) comes
from the config. There is no
selectROI, noinput(), noimshow.Deterministic. Same video + same config → identical CSV/JSON bytes
(the PNG spectra layout is stable, but the figure itself is a schematic,
not a data source).
Trackers are CPU-only. No GPU acceleration is available in the Python
bindings; keep the resolution modest, or set
max_dimto auto-downscalelarge frames for speed.
Plugin contract
The skill exposes a single CLI entry point (scripts/run.py) with
subcommands. Exit codes:
0— success.2— usage / config / tracking error (clear message on stderr).3— internal error (bug in the skill itself).
Output products
output/
<video>_tracking.csv # frame, time_s, x_px, y_px, confidence, reinit
# (+ x_cm, y_cm when scale_cm_per_px is set)
<video>_summary.json # video, fps, n_frames, objects (success_rate,
# lost_frames, reinit_frames), scale
<video>_fft.json # per-signal spectrum: dominant freq, period, top-N
<video>_spectra.png # amplitude-spectrum + trajectory figure (matplotlib)
<video>_report.md # Markdown combining summary + FFT findings
<video>_physics.json # per-object physics-consistency probes (optional)
batch_summary.json # roll-up when processing multiple videos
Limitations
Unstable / experimental. This skill is shipped as a preliminary
tool, not a tuned production tracker. End-to-end tracking error is
target-specific and can be several pixels (observed ~2–5 px RMSE on a
clean synthetic benchmark, much larger on cluttered footage); the
template re-acquire and the FFT stage both have their own failure
modes. Verify every result against a known reference before relying on
it, and do not cite numbers without that check.
CSRT accuracy is target-specific. It excels on a single, roughly
constant-sized object per camera. Heavily occluded or deformable targets
may still drop out even with the template re-acquire fallback.
Sub-pixel and optical-flow support. Optional sub-pixel centroid
refinement (
subpixel) produces fractional-pixel centres; on a trackerloss the optical-flow fallback (
use_optical_flow_fallback) advances thelast known centre instead of freezing. The position only freezes
(
confidence = 0) when both re-acquire and flow fail. FFT resolution isbounded by the video length.
CPU-bound. A 1080p 60 fps video with 2 objects may take several
minutes to process.
YAML configs need PyYAML. JSON configs work with the standard library
alone; OpenCV is required for the video steps but not for the FFT math.
Failure handling
- A missing / unreadable video raises a clear
VideoError(exit 2). An ROI that lies outside the first frame is detected at init and fails
fast (
TrackingError).A per-object tracker loss during the run is recorded, not fatal: the
position freezes and the frame is flagged in
lost_frames. The sweepcontinues to the next object / next video.
A failed template-match re-acquire is recorded as
reinit = Falseandthe confidence drops to 0; the next frame retries.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

