Description
Discussed in #4060
Originally posted by andreas-kupries July 20, 2024
See CC dev docs for a description of my take on calculating labeled regions / connected components in a horizontally threaded manner.
Example results at:
Hopefully this inspires ideas for how VIPS can do this as well.
My primary function (See 1 above) actually does not return an image. It instead returns a data structure describing the regions (area, bounding box, and the range pieces it consists of).
The secondary function (See 2 above) uses (1), transforms the data structure it gets a bit, then feeds the result into from sparse ranges, a virtual image taking range information to describe its content. The other, non-range information, is placed into the image meta data.
See https://core.tcl-lang.org/akupries/aktive/file?ci=7215f3713794bae4&name=etc/transformer/cc.tcl&ln=34-45 for the implementation.