I have an image segmentation and I'd like to label with a SwatchLegend[]
. Here's a MWE:
SwatchLegend[Colorize[ImageData[Rasterize@Graphics@Annulus[], "Bit"]], {"0", "1"}]
The second example from the Colorize
reference page:
cols = Range[Max[labels] + 1];
Legended[Colorize[labels],
SwatchLegend[Map[RGBColor, ImageData[Colorize[{cols}]][[1]]], cols]]
Is there a solution that doesn't entail manually extracting the colors? How would one label the color regions with callouts or other labeling techniques?