⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 histogram.m.txt

📁 To develop functional modules to process grayscale image intensity data. And perform Point and spati
💻 TXT
字号:
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);
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -