← back to roto on ba3a.dev

MaskSettings

@Serializable
data class MaskSettings(val lightnessWeight: Double = 0.25, val low: Double = 0.045, val high: Double = 0.1, val openRadius: Int = 1, val closeRadius: Int = 2)

How a clip's figure is told apart from its clean plate; stored per clip in profile.json.

  • lightnessWeight scales the lightness part of the OKLab difference, against a weight of 1 for the colour part. Below 1, a soft shadow — the wall a little darker, its colour unchanged — counts for less than a change of colour, and drops out of the mask.

  • low and high are the Hysteresis thresholds on that weighted difference.

  • openRadius removes specks and spurs up to about twice its size; closeRadius fills gaps of the same size. Zero turns either off.

Constructors

Link copied to clipboard
constructor(lightnessWeight: Double = 0.25, low: Double = 0.045, high: Double = 0.1, openRadius: Int = 1, closeRadius: Int = 2)

Properties

Link copied to clipboard

the radius of the morphological closing, 0..16

Link copied to clipboard

the upper hysteresis threshold, not below low

Link copied to clipboard

the weight of the lightness part of the difference, 0..1

Link copied to clipboard
val low: Double

the lower hysteresis threshold

Link copied to clipboard

the radius of the morphological opening, 0..16

Functions

Link copied to clipboard

These settings with high changed, low following it down if it has to stay below.

Link copied to clipboard

These settings with low changed, high following it up if it has to stay above.