spectralpython / spectral

Python module for hyperspectral image processing
MIT License
573 stars 139 forks source link

map_class_ids can produce incorrect mapping when source image has more classes than destination #53

Closed tboggs closed 8 years ago

tboggs commented 8 years ago

If the source classification image contains more class labels than the target classification image, it is possible that the mapping will be incorrect when ground truth labels are ignored.

For example, suppose we have class maps A (source) and B (destination), where A contains more class labels than B. Suppose that class 15 from A is mapped to to class 3 in B. After all of the overlaps between the two images have been exhausted, if class 3 from A has not been mapped (there are no remaining pixels of commonality), then it will retain its class value in the remapped image. The result is that the remapped image will have class values of 3 that correspond to both classes 15 (correctly) and 3 (incorrectly) from the source image.