m=480; n=480;
fin=fopen('arrayR.raw','r');
X=fread(fin,m*n,'uint8=>uint8'); fclose(fin);
Y=reshape(X,m,n);
Y=Y';
figure;
subplot(2,2,1);
imshow(histeq(Y,8)); %指定直方圖均衡後的灰度?數為8
title('arrayR.raw, level=8');
subplot(2,2,2);
histogram(histeq(Y,8)); %直方圖
subplot(2,2,3);
imshow(histeq(Y,16)); %指定直方圖均衡後的灰度?數為16
title('arrayR.raw, level=16');
subplot(2,2,4);
histogram(histeq(Y,16)); %直方圖
m=512; n=512;
fin=fopen('Whorl.raw','r');
X=fread(fin,m*n,'uint8=>uint8'); fclose(fin);
Y=reshape(X,m,n);
Y=Y';
figure;
subplot(2,2,1);
imshow(histeq(Y,8));
title('Whorl.raw, level=8');
subplot(2,2,2);
histogram(histeq(Y,8));
subplot(2,2,3);
imshow(histeq(Y,16));
title('Whorl.raw, level=16');
subplot(2,2,4);
histogram(histeq(Y,16));
m=480; n=640;
fin=fopen('gelm1.raw','r');
X=fread(fin,m*n,'uint8=>uint8'); fclose(fin);
Y=reshape(X,m,n);
Y=Y';
figure;
subplot(2,2,1);
imshow(histeq(Y,8));
title('gelm1.raw, level=8');
subplot(2,2,2);
histogram(histeq(Y,8));
subplot(2,2,3);
imshow(histeq(Y,16));
title('gelm1.raw, level=16');
subplot(2,2,4);
histogram(histeq(Y,16));
