clear;load imagefile.mat;
figure,imagesc(X),colormap(gray),axis off
X=round(X/max(max(X))*16383)+1;
figure,hist(X(:),0.5+[0:16383])
PX=hist(X(:),0.5+[0:16383]);
FX=[0 cumsum(PX)];Y=FX(X(:));
figure,plot(FX),axis tight
PY=hist(Y,0.5+[0:16383]);
FY=[0 cumsum(PY)];
figure,plot(FY),axis tight
figure,hist(Y,0.5+[0:16383])
figure,imagesc(reshape(Y,128,128)),colormap(gray),axis off
