数字图像处理-点运算实验

1、能够利用线性变换方法将一幅图像分别进行增加对比度、减少对比度、增加亮度和减少亮度操作,从而生成四幅新图像,显示这五幅图像及其各自的直方图;

2、利用直方图均衡化方法调整上述五幅图像的质量,显示这五幅新图像及其各自的直方图;

3、对一幅灰度图像利用自动阈值方法和手工设置阈值方法进行处理,并对比其效果;

4、利用直方图对图像进行去雾,首先将彩色图像分成三个通道,依次对每个通道进行直方图均衡化,然后合并这三个通

I=imread('lena512.bmp');
I=im2double(I);
[M,N]=size(I);
figure(1);
imshow(I);
title('yuan tu xiang');
figure(2);
[H,x]=imhist(I,64);
stem(x,(H/M/N),'.');
title('yuantuxiang');
 
%zengjiaduibidu
Fa=2;Fb=-55;
O=Fa.*I+Fb/255;
figure(3);
subplot(2,2,1);
imshow(O);
title('zengjiaduibidu');
figure(4);
subplot(2,2,1);
[H,x]=imhist(O,64);
stem(x,(H/M/N),'.');
title('zengjiaduibidu');
 
%jianxiaoduibidu
Fa=0.5;Fb=-55;
O=Fa.*I+Fb/255;
figure(3);
subplot(2,2,2);
imshow(O);
title('jianxiaoduibidu');
figure(4);
subplot(2,2,2);
[H,x]=imhist(O,64);
stem(x,(H/M/N),'.');
title('jianxiaoduibidu');
%zengjialiangdu
Fa=1;Fb=55;
O=Fa.*I+Fb/255;
figure(3);
subplot(2,2,3);
imshow(O);
title('zengjialiangduu');
figure(4);
subplot(2,2,3);
[H,x]=imhist(O,64);
stem(x,(H/M/N),'.');
title('zengjialiangdu');
%jianxiaoliangdu
Fa=1;Fb=-55;
O=Fa.*I+Fb/255;
figure(3);
subplot(2,2,4);
imshow(O);
title('jianxiaoliangduu');
figure(4);
subplot(2,2,4);
[H,x]=imhist(O,64);
stem(x,(H/M/N),'.');
title('jianxiaoliangdu');

(2)利用直方图均衡化方法调整上述五幅图像的质量,显示这五幅新图像及其各自的直方图;
I=imread('lena512.bmp');
I=im2double(I);
 
 
%1
I1=2*I-55/255;
 
subplot(4,4,1);
imshow(I1);
 
subplot(4,4,2);
imhist(I1);
subplot(4,4,3);
imshow(histeq(I1));
subplot(4,4,4);
imhist(histeq(I1));
 
 
%2
I2=0.5*I+55/255;
 
subplot(4,4,5);
imshow(I2);
 
subplot(4,4,6);
imhist(I2);
subplot(4,4,7);
imshow(histeq(I2));
subplot(4,4,8);
imhist(histeq(I2));
 
 
%3
I3=I+55/255;
 
subplot(4,4,9);
imshow(I3);
 
subplot(4,4,10);
imhist(I3);
subplot(4,4,11);
imshow(histeq(I3));
subplot(4,4,12);
imhist(histeq(I3));
 
 
%4
I4=I-55/255;
 
subplot(4,4,13);
imshow(I4);
 
subplot(4,4,14);
imhist(I4);
subplot(4,4,15);
imshow(histeq(I4));
subplot(4,4,16);
imhist(histeq(I4));

(3)对一幅灰度图像利用自动阈值方法和手工设置阈值方法进行处理,并对比其效果
I=imread('lena512.bmp');
thresh=graythresh(I)
thresh=0.5137;
 
bw1=im2bw(I,thresh);
bw2=im2bw(I,100/255);
subplot(1,3,1);imshow(I);title('yuantuxiang');
subplot(1,3,2);imshow(bw1);title('b1');
subplot(1,3,3);imshow(bw2);title('b2');



(4)利用直方图对图像进行去雾,首先将彩色图像分成三个通道,依次对每个通道进行直方图均衡化,然后合并这三个通道。查资料寻找还有哪些去雾的方法,并简洁介绍
%全局直方图
I=imread('c4.jpg');
R=I(:,:,1);
G=I(:,:,2);
B=I(:,:,3);
M=histeq(R);
N=histeq(G);
L=histeq(B);
E=cat(3,M,N,L);
subplot(1,2,1),imshow(I);subplot(1,2,2),imshow(E);

道。查资料寻找还有哪些去雾的方法

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值