?? histogram.m.txt
字號(hào):
clear all;
close all;
l=imread('forest.jpg');
l1=rgb2gray(l);
figure(1)
subplot(1,2,1)
imshow(l1)
title('Original Image');
[counts x]=imhist(l1);
counts1=counts(2:256-1,:);
x1=[2:1:255];
h=hist(counts1,x1);
p=histeq(l1,h);
subplot(1,2,2)
imshow(p);
title('Processed Image');
hold on;
figure(2)
subplot(1,2,1)
imhist(l1)
title('Histogram of Original Image');
subplot(1,2,2)
imhist(p)
title('Histogram of Processed Image');
hold on;
k=mean2(l1);
k2=mean2(p);
dev=std2(l1);
dev1=std2(p);
[co xi]=imhist(l1,8);
[co1 xi1]=imhist(p,8);
m=mean2(xi);
m2=mean2(xi1);
stdev=std2(xi);
stdev1=std2(xi1);
disp('********Comparison of Mean and Standard Deviation for Whole Image and 8x8 Block*********');
disp('Original Image');
disp('Mean of Whole Image=')
disp(k);
disp('Mean for 8x8 Sub-Block of Intensities=');
disp(m);
disp('Standard Deviation of Whole Image=')
disp(dev);
disp('Standard Deviation for 8x8 Sub-Block of Intensities=');
disp(stdev);
disp('Processed Image');
disp('Mean of Whole Image=')
disp(k2);
disp('Mean for 8x8 Sub-block of Intensities=');
disp(m2);
disp('Standard Deviation of Whole Image=')
disp(dev1);
disp('Standard Deviation for 8x8 Sub-block of Intensities=');
disp(stdev1);
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -