matlab有关图像的程序代码

来源:百度知道 编辑:UC知道 时间:2024/09/03 03:02:27
理想低通、高通滤波器
巴特沃思低通、高通滤波器的设计
编程将一个图像放大4倍
编写可以进行哈夫曼编码和算术编码的函数
是图像滤波哦,初学者,不知道如何下手,给些思路也可以啊!
谢谢!急用!!!

M=imread('dl011.jpg') %读取MATLAB中的名为cameraman的图像
subplot(3,3,1)
imshow(M) %显示原始图像
title('original')
P1=imnoise(M,'gaussian',0.02) %加入高斯躁声
subplot(3,3,2)
imshow(P1) %加入高斯躁声后显示图像
title('gaussian noise');
P2=imnoise(M,'salt & pepper',0.02) %加入椒盐躁声
subplot(3,3,3)
imshow(P2) %%加入椒盐躁声后显示图像
title('salt & pepper noise');
g=medfilt2(P1) %对高斯躁声中值滤波
subplot(3,3,5)
imshow(g)
title('medfilter gaussian')
h=medfilt2(P2) %对椒盐躁声中值滤波
subplot(3,3,6)
imshow(h)
title('medfilter salt & pepper noise')
l=[1 1 1 %对高斯躁声算术均值滤波
1 1 1
1 1 1];
l=l/9;
k=conv2(P1,l)
subplot(3,3,8)
imshow(k,[])
title(