← back to roto on ba3a.dev

Package-level declarations

Types

Link copied to clipboard

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.

Link copied to clipboard
object RootFinder

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.

Link copied to clipboard
@Serializable
data class RootSettings(val stabilise: Boolean = true, val hipBandTop: Double = 0.45, val hipBandBottom: Double = 0.6, val smoothing: Int = 7)

How a clip's root — the point the figure stands on, horizontally — is found and held still; stored per clip in profile.json.

Link copied to clipboard
@Serializable
data class RootTrack(val rootX: List<Double?>, val smoothedX: List<Double>, val anchorX: Int, val shifts: List<Int>)

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.

Link copied to clipboard
class RootTracker(cache: StageCache)

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.

Link copied to clipboard
object Stabiliser

Horizontal stabilisation of a clip from its masks: each root found, gaps filled, smoothed, and — when stabilising — the shift that moves each smoothed root to their mean, rounded to the nearest whole pixel.

Link copied to clipboard

Gap filling and smoothing of a per-frame track; plain arithmetic in a fixed order, so exact.