You are on page 1of 1

Use label2rgb to customize display of labelmatrix.

I = imread('rice.png'); imshow(I) BW = im2bw(I, graythresh(I)); CC = bwconncomp(BW); L = labelmatrix(CC); RGB = label2rgb(L); figure, imshow(RGB) RGB2 = label2rgb(L, 'spring', 'c', 'shuffle'); figure, imshow(RGB2)

You might also like