Nearest Zone
object NearestZone
Splits a figure into zones by nearest prototype. Every ZoneSample is one prototype: the mean OKLab colour of the 3×3 pixels around the click, so a single noisy pixel cannot decide it. Every masked pixel then takes the zone of the prototype nearest to it, its lightness weighted as the ZoneSettings say; of prototypes equally near, the first wins.
A label map holds 0 for background and i + 1 for the ith zone.
Types
Functions
Link copied to clipboard
fun label(frame: Raster, mask: Mask, prototypes: List<NearestZone.Prototype>, lightnessWeight: Double): IndexedRaster
frame's label map: each pixel inside mask labelled with its nearest of prototypes.
Link copied to clipboard