% jpegtogray
% convert a jpeg file to a mononchrome file in uint8 form

function [M,map,caption] = jpegtogray(pic)
X = imread(pic);
R = double(X(:,:,1));
G = double(X(:,:,2));
B = double(X(:,:,3));
M = uint8(0.3*R+0.*G +0.1*B);
m = double(max(M(:)));
map = gray(m);
caption = pic;



