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

📄 hist.m

📁 Image enhancement in spatial domain, the sources include histogram, laplacian, unsharp mask, and spa
💻 M
字号:
% Program to compute the histogram of an Image
clear all 
clc
a=imread('Hills.bmp');
a=double(a);
[row col]=size(a);
h=zeros(1,300);
for n=1:1:row
for m=1:1:col
    if a(n,m)==0           %% To ensure that the values of a are not zero
           a(n,m)=1;
    end
end
end
for n=1:1:row
    for m=1:1:col
        t=a(n,m);          %% Takes the value of the Pixel
        h(t)=h(t)+1;       %% Incrementing each counter
    end
end
figure(1);
imshow(uint8(a));
figure(2);
bar(h)

⌨️ 快捷键说明

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