数字图像处理-图像的直方图计算方法

1 实验题目

       给出多幅图像的直方图并计算该图像信息熵、标准差和平均梯度,并进行分析(注 意图像的选择和设计)。

2 程序源代码

clc;
A1=imread('b.jpg');
subplot(4,4,1);imshow(A1);title('原图');
Ar=A1(:,:,1);%R 通道
Ag=A1(:,:,2);%G 通道
Ab=A1(:,:,3);%B 通道
subplot(4,4,4),imshow(A1(:,:,1));title('红色分量图'); %R 通道
subplot(4,4,7),imshow(A1(:,:,2));title('绿色分量图'); %G 通道
subplot(4,4,10),imshow(A1(:,:,3));title('蓝色分量图'); %B 通道
subplot(4,4,5),imhist(Ar);title('红色分量直方图');
subplot(4,4,8),imhist(Ag);title('绿色分量直方图');
subplot(4,4,11),imhist(Ab);title('蓝色分量直方图');
subplot(4,4,6),imhist(Ar,10);title('红色指定灰度级');
subplot(4,4,9),imhist(Ag,25);title('绿色指定灰度级');
subplot(4,4,12),imhist(Ab,50);title('蓝色指定灰度级');
if length(size(A1))>2%size 获得矩阵的大小,length 获得矩阵最大维度
A1=rgb2gray(A1);
end
subplot(4,4,2);imshow(A1);title('原图灰度化');
subplot(4,4,3);imhist(A1);title('原直方图');
ima=imadjust(A1);%按默认参数进行对比度调整
his=histeq(A1);%按默认参数对直方图进行均衡化
subplot(4,4,13);imshow(ima);title('对比度默认拉伸图');
subplot(4,4,14);i
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

这个西瓜明明超甜却过分低调

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值