You are on page 1of 1

1)Convert label matrix into RGB image I = imread('rice.

png'); figure, imshow(I) 2)Convert grayscale image to indexed image using multilevel thresholding I = imread('snowflakes.png'); X = grayslice(I,16); imshow(I) figure, imshow(X,jet(16)) 3)Convert image to Java buffered image I = imread('moon.tif'); javaImage = im2java2d(I); frame = javax.swing.JFrame; icon = javax.swing.ImageIcon(javaImage); label = javax.swing.JLabel(icon); frame.getContentPane.add(label); frame.pack frame.show 4)Convert an RGB image to a grayscale image I = imread('board.tif'); J = rgb2gray(I); figure, imshow(I), figure, imshow(J); 5)Convert the colormap to a grayscale colormap. [X,map] = imread('trees.tif'); gmap = rgb2gray(map); figure, imshow(X,map), figure, imshow(X,gmap);

You might also like