← back to roto on ba3a.dev

RepeatPeriod

How often a figure's silhouette repeats: the autocorrelation of its root-aligned masks, scored as the mean intersection over union of every frame with the frame lag later. The best lag wins; of equally good lags the shortest, so a clip holding three repeats reports one.

Types

Link copied to clipboard
data class Repeat(val frames: Int, val score: Double)

A repeat every frames frames, the masks overlapping by score on average at that lag.

Functions

Link copied to clipboard
fun of(aligned: List<Mask>, lags: IntRange): RepeatPeriod.Repeat?

The repeat of aligned masks — already shifted so the root stands still — at a lag in lags, or null when the clip is too short to hold any lag in the range twice.