数字图像处理作业2.docx
《数字图像处理作业2.docx》由会员分享,可在线阅读,更多相关《数字图像处理作业2.docx(9页珍藏版)》请在冰豆网上搜索。
![数字图像处理作业2.docx](https://file1.bdocx.com/fileroot1/2022-11/17/a88b2892-e3c3-45c5-b69f-670936f880b7/a88b2892-e3c3-45c5-b69f-670936f880b71.gif)
数字图像处理作业2
数字图像处理作业2
空间滤波器比较——袁潘宸
Contents
▪生成原图
▪算术均值滤波
▪几何均值滤波
▪谐波均值滤波
▪逆谐波均值滤波
▪中值滤波
▪中点滤波
▪最大值滤波
▪最小值滤波
生成原图
tk=1:
17+7:
(17+7)*10;
I=zeros(210+10*2,(17+7)*10);
fori=1:
length(tk)-1
I(10:
10+210,tk(i+1):
tk(i+1)+6)=1;
end
I=logical(I);
figure,imshow(I),title('原图');
算术均值滤波
a=spfilt(I,'amean',3,3);
figure;
subplot(1,2,1),imshow(I),title('原图');
subplot(1,2,2),imshow(a),title('算术均值滤波');
几何均值滤波
b=spfilt(I,'gmean',3,3);%3×3几何均值滤波
figure;
subplot(1,2,1),imshow(I),title('原图');
subplot(1,2,2),imshow(b),title('几何均值滤波');
谐波均值滤波
c=spfilt(I,'hmean',3,3);%3×3谐波均值滤波
figure;
subplot(1,2,1),imshow(I),title('原图');
subplot(1,2,2),imshow(c),title('谐波均值滤波');
逆谐波均值滤波
d=spfilt(I,'chmean',3,3);%3×3逆谐波均值滤波
figure;
subplot(1,2,1),imshow(I),title('原图');
subplot(1,2,2),imshow(d),title('逆谐波均值滤波');
中值滤波
e=spfilt(I,'median',3,3);%3×3中值滤波
figure;
subplot(1,2,1),imshow(I),title('原图');
subplot(1,2,2),imshow
(2),title('中值滤波');
中点滤波
f=spfilt(I,'midpoint',3,3);%3×3中点滤波
figure;
subplot(1,2,1),imshow(I),title('原图');
subplot(1,2,2),imshow(f),title('中点滤波');
最大值滤波
g=spfilt(I,'max',3,3);
figure;
subplot(1,2,1),imshow(I),title('原图');
subplot(1,2,2),imshow(g),title('最大值滤波');
最小值滤波
h=spfilt(I,'min',3,3);
figure;
subplot(1,2,1),imshow(I),title('原图');
subplot(1,2,2),imshow(h),title('最小值滤波');
PublishedwithMATLAB®R2012b