数字图像处理实验报告 下载本文

内容发布更新时间 : 2024/6/29 17:07:19星期一 下面是文章的全部内容请认真阅读。

.

subplot(1,2,2); imhist(G);

title('test2均衡化后的直方图'); 实验二

1.图像的平滑滤波处理

①图像加高斯噪声以及均值滤波处理 I=imread('d:\\test3.gif','gif'); subplot(2,2,1); imshow(I);

title('test3原始图像'); G=imnoise(I,'gaussian',0.02); subplot(2,2,2); imshow(G);

title('test3加高斯噪声'); h1=fspecial('average',[3,3]); G1=filter2(h1,G); subplot(2,2,3); imshow(G1,[]);

title('高斯噪声3*3均值滤波'); h2=fspecial('average',[5,5]); G2=filter2(h2,G); subplot(2,2,4);

Word 资料

.

imshow(G2,[]);

title('高斯噪声5*5均值滤波'); ②图像加高斯噪声以及中值滤波处理 I=imread('d:\\test3.gif','gif'); subplot(2,2,1); imshow(I);

title('test3原始图像'); G=imnoise(I,'gaussian',0.02); subplot(2,2,2); imshow(G);

title('test3加高斯噪声'); G1=medfilt2(G,[3,3]); subplot(2,2,3); imshow(G1,[]);

title('高斯噪声3*3中值滤波'); h2=fspecial('average',[5,5]); G2=filter2(h2,G); subplot(2,2,4); imshow(G2,[]);

title('高斯噪声5*5中值滤波'); ③图像加椒盐噪声以及均值滤波处理 I=imread('d:\\test3.gif','gif');

Word 资料

.

subplot(2,2,1); imshow(I);

title('test3原始图像');

G=Imnoise(I,'salt & pepper',0.02); subplot(2,2,2); imshow(G);

title('test3加椒盐噪声'); h1=fspecial('average',[3,3]); G1=filter2(h1,G); subplot(2,2,3); imshow(G1,[]);

title('椒盐噪声3*3均值滤波处理'); h2=fspecial('average',[5,5]); G2=filter2(h2,G); subplot(2,2,4); imshow(G2,[]);

title('椒盐噪声5*5均值滤波处理'); ④图像加椒盐噪声以及中值滤波处理 I=imread('d:\\test3.gif','gif'); subplot(2,2,1); imshow(I);

title('test3原始图像');

Word 资料

.

G=Imnoise(I,'salt & pepper',0.02); subplot(2,2,2); imshow(G);

title('test3加椒盐噪声'); G1=medfilt2(G,[3,3]); subplot(2,2,3); imshow(G1,[]);

title('椒盐噪声3*3中值滤波处理'); G1=medfilt2(G,[5,5]); subplot(2,2,4); imshow(G2,[]);

title('椒盐噪声5*5中值滤波处理'); 2.图像的锐化处理

①Laplacian 锐化算子(α=-1)锐化处理 I=imread('d:\\test4.gif','gif'); subplot(1,2,1); imshow(I);

title('test4原始图像'); w=[0,-1,0;-1,5,-1;0,-1,0]; I=double(I); G=conv2(I,w); subplot(1,2,2);

Word 资料

.

G=uint8(G); imshow(G,[]);

title('test4拉普拉斯算子锐化');

②Roberts、Prewitt 和Sobel 边缘检测 I=imread('d:\\test4.gif','gif'); subplot(2,2,1); imshow(I);

title('test4原始图像'); G1=edge(I,'Roberts'); subplot(2,2,2); imshow(G1,[]);

title('test4Roberts边缘检测'); G2=edge(I,'Prewitt'); subplot(2,2,3); imshow(G2,[]);

title('test4Prewitt边缘检测'); G3=edge(I,'Sobel'); subplot(2,2,4); imshow(G3,[]);

title('test4Sobel边缘检测'); 实验三

Word 资料