数字图像处理上机实验程序.docVIP

  • 14
  • 0
  • 约3.14千字
  • 约 3页
  • 2017-08-17 发布于重庆
  • 举报
数字图像处理上机实验程序.doc

利用MATLAB实现图像的频域变换 I1=imread(cameraman.tif); J1=fftshift(fft2(I1)); K1=dct2(I1); I2=imread(pout.tif); J2=fftshift(fft2(I2)); K2=dct2(I2); subplot(2,3,1),imshow(I1);title(原图像1); subplot(2,3,4),imshow(I2);title(原图像2); subplot(2,3,2),imshow(log(abs(J1)),[]),title(fft1); subplot(2,3,5),imshow(log(abs(J2)),[]),title(fft2); subplot(2,3,3),imshow(log(abs(K1)),[]),title(dct1); subplot(2,3,6),imshow(log(abs(k2)),[]),title(dct2); 利用MATLAB实现图像的点运算 I=imread(cameraman.tif); I1=double(I); J1=I1*1.5+20; J=uint8(J1); K1=I1*0.5-30; K=uint8(K1); L1=I1*1.5-30; L=uint8(L1); subplot(2,2,1),imshow(I);title(原图); subplot(2,2,2),imshow(J);title(对比度大 变亮); subplot(2,2,3),imshow(K);title(对比度小 变暗); subplot(2,2,4),imshow(L);title(对比度大 变暗); 利用MATLAB实现图像的直方图均衡 I=imread(pout.tif); J=histeq(I); K=imadjust(I,[0.3 0.7],[0.1 0.9]); L=imadjust(I,[0.3 0.7],[0 1]); subplot(2,4,1),imshow(I);title(原图像); subplot(2,4,5),imhist(I);title(原图直方图); subplot(2,4,2),imshow(J);title(均衡图像); subplot(2,4,6),imhist(J);title(均衡图直方图); subplot(2,4,3),imshow(K);title(展宽图像); subplot(2,4,7),imhist(K);title(展宽图直方图); subplot(2,4,4),imshow(L);title(灰级窗图像); subplot(2,4,8),imhist(L);title(灰级窗直方图); 均值和中值滤波,维纳滤波 I=imread(cameraman.tif); J1=imnoise(I,salt pepper,0.02); J2=imnoise(I,gaussian,0,0.01); J3=imnoise(I,speckle,0.02); K1=medfilt2(J1,[3 3]); K2=medfilt2(J1,[3 3]); K3=medfilt2(J1,[3 3]); L1=filter2(fspecial(average,3),J1)/255; L2=filter2(fspecial(average,3),J2)/255; L3=filter2(fspecial(average,3),J3)/255; subplot(3,3,1),imshow(J1);title(s-p noise); subplot(3,3,2),imshow(J2);title(g noise ); subplot(3,3,3),imshow(J3);title(s noise); subplot(3,3,4),imshow(K1);title(s-p noise by med); subplot(3,3,5),imshow(K2);title(g noise by med); subplot(3,3,6),imshow(K3);title(s noise by med); subplot(3,3,7),imshow(L1);title(s-p noise by ave); subplot(3,3,8),imshow(L2);title(g noise by ave); subplot(3,3,9),imshow(L3);title(s noise by ave); Sobel算子、Prewitt算子以及高斯-拉普拉斯算子实现图像锐化 I=imread(cameraman.tif); h1=[0 -1 0;-1 4 -1;0 -1 0]; h2=[-1 -1 -1;-1 8

文档评论(0)

1亿VIP精品文档

相关文档