《数字图像处理》实验指导书201403

《数字图像处理》实验指导书201403

ID:38584413

大小:76.50 KB

页数:8页

时间:2019-06-15

《数字图像处理》实验指导书201403_第1页
《数字图像处理》实验指导书201403_第2页
《数字图像处理》实验指导书201403_第3页
《数字图像处理》实验指导书201403_第4页
《数字图像处理》实验指导书201403_第5页
资源描述:

《《数字图像处理》实验指导书201403》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、1.直方图均衡化clearall;closeall%CleartheMATLABworkspaceofanyvariables%andcloseopenfigurewindows.I=imread('pout.tif');%Readsthesampleimages‘pout.tif’,andstoresitinimshow(I)%anarraynamedI.displaytheimagefigure,imhist(I)%Createahistogramoftheimageanddisplayitin%anewfigurewindow.[I2,T]=h

2、isteq(I);%Histogramequalization.figure,imshow(I2)%Displaythenewequalizedimage,I2,inanewfigurewindow.figure,imhist(I2)%CreateahistogramoftheequalizedimageI2.figure,plot((0:255)/255,T);%plotthetransformationcurve.imwrite(I2,'pout2.png');%WritethenewlyadjustedimageI2toadiskfilenam

3、ed%‘pout2.png’.imfinfo('pout2.png')%Checkthecontentsofthenewlywrittenfile2.直接灰度变换clearall;closeallI=imread('cameraman.tif');J=imadjust(I,[00.2],[0.51]);imshow(I)figure,imshow(J)[X,map]=imread('forest.tif');figure,imshow(X,map)I2=ind2gray(X,map);J2=imadjust(I2,[],[],0.5);figure,

4、imshow(I2)figure,imshow(J2)J3=imadjust(I2,[],[],1.5);figure,imshow(J3)helpimadjust%Displaytheimadjust()functioninformation.3.空域平滑滤波(模糊、去噪)clearall;closeallI=imread('eight.tif');h1=ones(3,3)/9;h2=ones(5,5)/25;8I1=imfilter(I,h1);I2=imfilter(I,h2);figure(1),imshow(I),title('Origin

5、alImage');figure(2),imshow(I1),title('FilteredImageWith3*3')figure(3),imshow(I2),title('FilteredImageWith5*5')%加入Gaussian噪声J1=imnoise(I,'gaussian',0,0.005);%加入椒盐噪声J2=imnoise(I,'salt&pepper',0.02);%对J1、J2进行平均值平滑滤波K1=imfilter(J1,fspecial('average',3));K2=imfilter(J2,fspecial('ave

6、rage',3));figure(4);subplot(2,2,1),imshow(J1),title('gaussian');subplot(2,2,2),imshow(J2),title('salt&pepper');subplot(2,2,3),imshow(K1),title('average');subplot(2,2,4),imshow(K2);%对J1、J2进行中值滤波K3=medfilt2(J1,[33]);K4=medfilt2(J2,[33]);figure(5);subplot(2,2,1),imshow(J1),title('

7、gaussian');subplot(2,2,2),imshow(J2),title('salt&pepper');subplot(2,2,3),imshow(K3),title('Medianfiltering');subplot(2,2,4),imshow(K4)4.空域锐化滤波clearall;closeallI=imread('moon.tif');w=fspecial('laplacian',0)w8=[1,1,1;1,-8,1;1,1,1]I1=imfilter(I,w,'replicate');figure(1);imshow(I),t

8、itle('OriginalImage');figure(2),imshow(I1),title('Lapl

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。