egomotion-estimation
Installation
SKILL.md
When to use
- You need to classify camera motion (Stay/Dolly/Pan/Tilt/Roll) from video, allowing multiple labels on the same frame.
Workflow
- Feature tracking:
goodFeaturesToTrack+calcOpticalFlowPyrLK; drop if too few points. - Robust transform:
estimateAffinePartial2D(or homography) with RANSAC to get tx, ty, rotation, scale. - Thresholding (example values)
- Translate threshold
th_trans(px/frame), rotation (rad), scale delta (ratio). - Allow multiple labels: if scale and translate are both significant, emit Dolly + Pan; rotation independent for Roll.
- Translate threshold
- Temporal smoothing: windowed mode/median to reduce flicker.
- Interval compression: merge consecutive frames with identical label sets into
start->end.