1、数字图像处理作业2数字图像处理作业2空间滤波器比较袁潘宸Contents 生成原图 算术均值滤波 几何均值滤波 谐波均值滤波 逆谐波均值滤波 中值滤波 中点滤波 最大值滤波 最小值滤波生成原图tk = 1 : 17+7 : (17+7)*10;I = zeros(210+10*2, (17+7)*10);for i = 1 : length(tk)-1 I(10:10+210, tk(i+1):tk(i+1)+6) = 1;endI = logical(I);figure,imshow(I),title(原图);算术均值滤波a=spfilt(I,amean,3,3);figure;subplo
2、t(1,2,1),imshow(I),title(原图);subplot(1,2,2),imshow(a),title(算术均值滤波);几何均值滤波b= spfilt(I,gmean,3,3); %33几何均值滤波figure;subplot(1,2,1),imshow(I),title(原图);subplot(1,2,2),imshow(b),title(几何均值滤波);谐波均值滤波c =spfilt(I,hmean,3,3); %33谐波均值滤波figure;subplot(1,2,1),imshow(I),title(原图);subplot(1,2,2),imshow(c),title(
3、谐波均值滤波);逆谐波均值滤波d =spfilt(I,chmean,3,3); %33逆谐波均值滤波figure;subplot(1,2,1),imshow(I),title(原图);subplot(1,2,2),imshow(d),title(逆谐波均值滤波);中值滤波e =spfilt(I,median,3,3); %33中值滤波figure;subplot(1,2,1),imshow(I),title(原图);subplot(1,2,2),imshow(2),title(中值滤波);中点滤波f=spfilt(I,midpoint,3,3); %33中点滤波figure;subplot(1
4、,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(最小值滤波);Published with MATLAB R2012b