Package-level declarations
Types
Moves an image sideways by whole pixels, keeping its size: what was at x lands at x + dx, and what moves in from beyond the edge is empty. Whole pixels only, so stabilising never resamples or blurs a frame.
The root of one mask: the median x of its foreground in the hip band. The band is measured on the mask's own height, so it follows the figure as it bobs. An arm swinging at hip height pulls the median by a pixel or so, where it would drag the mean or the band's extent most of the way out to the hand.
How a clip's root — the point the figure stands on, horizontally — is found and held still; stored per clip in profile.json.
Where a clip's figure stands, frame by frame. rootX is the root as found, null where a frame showed no figure; smoothedX the gaps filled and the moving average taken; anchorX the whole pixel the smoothed roots centre on; shifts the whole pixels each frame moves right (left when negative) to hold its smoothed root at anchorX — all zero when the clip is not stabilised.
The root tracking stage: a clip's RootTrack from its masks, by the Stabiliser. Cached under the masks and the RootSettings, so retuning the hip band or the smoothing touches nothing upstream.
Gap filling and smoothing of a per-frame track; plain arithmetic in a fixed order, so exact.