Sunday, April 9, 2017

mat2gray in MATLAB: code and output

Code:


I = imread('rice.png');
J = filter2(fspecial('sobel'),I);
K = mat2gray(J);
subplot(2,1,1);
imshow(I);
title('original image');
subplot(2,1,2);
imshow(K);

title('grayscale image');

Output:



No comments:

Post a Comment