cl;
img=imread('TestDatabase/1.bmp');
imshow(img);
img=double(img);
figure,imshow(mat2gray(img))
ma=double(max(max(img)));
mi=double(min(min(img)));
img=(255/(ma-mi))*img-(255*mi)/(ma-mi);
img=uint8(img);
figure,imshow(img)
转载于:https://www.cnblogs.com/tiandsp/archive/2012/03/04/2379128.html