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);
道。查资料寻找还有哪些去雾的方法