[iadftview] [Up] [iaplot] | Visualization |
Displays the labeled input image (uint8 or uint16) with a pseudo color where each label appears with a random color.
>>> f = iaread('blobs.pbm')
>>> g = ialabel(f);
>>> iashow(g)
(128, 128) Min= 0 Max= 18 Mean=4.940 Std=6.23
>>> iashow(ialblshow(g))
(3, 128, 128) Min= 0.0 Max= 254.0 Mean=62.281 Std=83.79
g | ialblshow(g) |
def ialblshow(f): from Numeric import ravel, floor, concatenate from MLab import rand nblobs = max(ravel(f)) r = floor(0.5 + 255*rand(nblobs, 1)) g = floor(0.5 + 255*rand(nblobs, 1)) b = floor(0.5 + 255*rand(nblobs, 1)) ct = concatenate((r,g,b), 1) ct = concatenate(([[0,0,0]], ct)) g = iaapplylut(f, ct) return g
[iadftview] [Up] [iaplot] | |