Convert grayscale or binary image to indexed image
Code:
Code:
Code:
Code:
I = imread('cameraman.tif');
[X, map] = gray2ind(I, 16);
imshow(X, map);
Convert indexed image to grayscale imageCode:
load trees I = ind2gray(X,map); imshow(X,map); figure,imshow(I);Convert matrix to grayscale image
Code:
I = imread('rice.png'); J = filter2(fspecial('sobel'),I); K = mat2gray(J); imshow(I), figure, imshow(K)
Convert grayscale image to indexed image using multilevel thresholding
Code:
I = imread('snowflakes.png'); X = grayslice(I,16); imshow(I) figure, imshow(X,jet(16))
No comments:
Post a Comment
Note: only a member of this blog may post a comment.