- 25
- 0
- 约1.6千字
- 约 6页
- 2017-01-09 发布于贵州
- 举报
(1)直方图均衡
I=imread(D:\ProgramFiles\MATLAB\R2010b\toolbox\images\imdemos\trees.tif) %载入图像
J=histeq(I); %直方图均衡
subplot(2,2,1),imshow(I),title(原图);
subplot(2,2,2),imhist(I),title(原图灰度直方图);
subplot(2,2,3),imshow(J),title(均衡处理图);
subplot(2,2,4),imhist(J),title(图均衡处理灰度直方图);
(2)平滑滤波
I=imread(D:\Program Files\MATLAB\R2010b\toolbox\images\imdemos\tire.tif);%读入图像
subplot(231),imshow(I);%显示原始图像
title(原始图像);?
J=imnoise(I,salt??pepper,0.01);%加均值为0,方差为0.01的椒盐噪声
?subplot(232),imshow(J);?title(添加椒盐噪声图片);?
K=medfilt2(J,[7,7]);%7X7的滤波窗口
subplot(233),imshow(K,[]);%显示处理后的图像
title(中值滤波图像);?
I2=imread(D:\Program Files\MATLAB\R2010b\toolbox\images\imdemos\tire.tif);
subplot(234),imshow(I2);?
title(原始图像);?
J2=imnoise(I2,gaussian,0.01);%加均值为0,方差为0.01的高斯噪声
subplot(235),imshow(J2);?title(添加高斯噪声图像);?
K2=medfilt2(J2,[7,7]);?
subplot(236),imshow(K2,[]);?title(中值滤波图像);
(3)锐化滤波
I=imread(D:\Program Files\MATLAB\R2010b\toolbox\images\imdemos\tire.tif);
%A=rgb2gray(I);
%figure;
subplot(221),imshow(I);title(原图);
hs=fspecial(sobel);?
S=imfilter(I,hs);
hp=fspecial(prewitt);
P=imfilter(I,hs);
I=double(I);%双精度型
H=[0?1?0,1?-4?1,0?1?0];%拉普拉斯算子
J=conv2(I,H,same);
K=I-J;
subplot(222),imshow(K);
title(拉普拉斯锐化图像);
subplot(223),imshow(S);
title(sobel算子锐化图像);
subplot(224),imshow(P);?
title(prewitt算子锐化图像);
I=imread(D:\Program Files\MATLAB\R2010b\toolbox\images\imdemos\tire.tif);
subplot(221),imshow(I);title(原图);
I=double(I);%双精度型
H=[0?1?0,1?-4?1,0?1?0];%拉普拉斯算子
J=conv2(I,H,same);
K=I-J;
subplot(222),imshow(K);
title(拉普拉斯锐化图像);
您可能关注的文档
最近下载
- 《岭外代答》的人类学解读实验——兼论宋代华夷之辨的弱化.pdf VIP
- QSH 0081-2007 探井(直井)钻井工程设计.docx VIP
- 《岭表录异》青少年读物.pdf VIP
- 资产处置委托协议书模板5篇.docx VIP
- mipi_CSI-2_specification_v1.3._高清版电子文档.pdf VIP
- QSH 0042-2007 钻井液用磺甲基酚醛树脂技术要求.docx VIP
- 《QSH0047-2007-钻井液用抗高温抗盐降滤失剂通用技术要求》.pdf VIP
- 股市主力操盘盘 口摩斯密码(原创内容,侵权必究).pptx
- 指数基金投资指南(银行螺丝钉).pdf VIP
- 《QSH0082-2007-水平井钻井工程设计要求》.pdf VIP
原创力文档

文档评论(0)