knip
knip copied to clipboard
Labeling to Image: do not assume that a label is mapped to the same value for different images
Currently, Labeling to Image uses the value from the backing image to convert the RAI<LabelingType> to an RAI<? extends RealType>. This can result in inconsistent behavior when two RAI<LabelingType> have the same labels but use a different LabelingMapping.
This happens for example when a pixel-based classifier is applied to tiles of an image: whatever label the first pixel belongs to will be mapped to 1. Hence, the "meaning" of a1 in the backing image changes with the contents of the image and produces inconsistencies when using Labeling to Image.