基于MATLAB图像去噪处理

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

第三幅
figure%线性变换进行图像增强%
A=imread('SPGIRL~1.BMP'); %读入图像
subplot(2,2,1);imshow(A);title('原始图像')
%imshow(A);
%显示图像
%figure,
subplot(2,2,3);imhist(A);title('原始图像的直方图');
end end subplot(2,2,3); imshow(uint8(y))
title('均值滤波后的图像'); x=f; for i=1:h-n+1
for j=1:w-n+1 c=f(i:i+(n-1),j:j+(n-1)); e=c(1,:); for u=2:n e=[e,c(u,:)]; end mm=median(e); x (i+(n-1)/2,j+(n-1)/2)=mm;
%sobel%边缘检测 I=uint8(y)%imread('NGIRL001.BMP'); %读灰度图均值滤波处理后的图像 %sobel edge detector E=edge(I,'sobel',0.08); E=uint8(255*(1-double(E))); figure('name','均值滤波后sobel检测'),imshow(uint8(E),'truesize');
%imhist(A);
%显示图像的直方图
J1=imadjust(A,[0.2 , 0.8],[]);
%函数将图像在0.3*255~0.7*255灰度之间的值通过线性变换映射到0~255 之间
%figure,
subplot(2,2,2);imshow(J1);title('处理后图像'); %输出图像效果图
subplot(2,2,1);imshow(A);title('原始图像')
%imshow(A);
%显示图像
%figure,
subplot(2,2,3);imhist(A);title('原始图像的直方图');
%imhist(A);
%显示图像的直方图
J1=imadjust(A,[0.2 , 0.8],[]);
图像的去噪处理
电信1103班 周传磊 顾林熙 高亚斌 张建平 郑超峰
分工: 周传磊 郑超峰 调试程序 高亚斌 张建平 顾林熙 查找资料 PPT
实验要求
(1)对指定含噪图片NGIRL001,SGIRL002, SPGIRL~1分别进行去噪处理。方法不限于课本所 讲方法。
(2)找出适合各类含噪声图片处理的方法。 (3)可以设计界面,能灵活选择输入图像的文件名,
%figure,
subplot(2,2,3);imhist(A);title('原始图像的直方图');
%imhist(A);
%显示图像的直方图
J1=imadjust(A,[0.2 , 0.8],[]);
%函数将图像在0.3*255~0.7*255灰度之间的值通过线性变换映射0~255 之间
%figure,
Байду номын сангаас
E=edge(I,'canny',th);
E=uint8(255*(1-double(E)));
figure('name','中值滤波后canny检测'),imshow(uint8(E),'truesize')
%canny%边缘检测 I=uint8(y)%imread('NGIRL001.BMP'); %读灰度图均值滤波处理后图像 %Canny edge detector th=[0.05 0.2]; E=edge(I,'canny',th); E=uint8(255*(1-double(E))); figure('name','均值滤波后canny检测'),imshow(uint8(E),'truesize');
end end subplot(2,2,4); imshow(uint8(x)) title('中值滤波后的图像');
%canny%边缘检测
I=uint8(x)%imread('NGIRL001.BMP'); 中值滤波处理后图像
%读灰度图
%Canny edge detector
th=[0.05 0.2];
%figure,
subplot(2,2,4);imhist(J1);title('处理后图像的直方图'); %输出图像的直方图
图像加入椒盐噪声后进行均值和中值滤波
g=imread('NGIRL001.BMP'); %读入图像的具体位置, v=imnoise(g,'salt & pepper',0.1); subplot(2,2,1); imshow(g) title('原始图像');
%sobel%边缘检测 I=uint8(y)%imread('NGIRL001.BMP'); %读灰度图均值滤波处理后的图像 %sobel edge detector E=edge(I,'sobel',0.08); E=uint8(255*(1-double(E))); figure('name','均值滤波后sobel检测'),imshow(uint8(E),'truesize');
实验分工: 组长:周传磊 分析讨论:全组人员 编写程序:周传磊 资料收集:张建平 顾林熙 高亚斌 PPT制作:郑超峰
subplot(2,2,2); imshow(v) title('噪声图像'); [h,w]=size(v); n=9; f=double(v); a=ones(n,n); y=f; for i=1:h-n+1
for j=1:w-n+1 a=f(i:i+(n-1),j:j+(n-1)); s=sum(sum(a)); y(i+(n-1)/2,j+(n-1)/2)=s/(n*n);
能自行设置输出文件名,将输出图片能保存起来。 (4)分别用主客观指标对处理效果进行评价。
处理程序及截图
第一幅
%线性变换进行图像增强%
A=imread('SGIRL002.BMP'); %读入图像
subplot(2,2,1);imshow(A);title('原始图像')
%imshow(A);
%显示图像
subplot(2,2,2);imshow(J1);title('处理后图像'); %输出图像效果图
%figure,
subplot(2,2,4);imhist(J1);title('处理后图像的直方图')%输出图像的直方图
第二幅
figure%线性变换进行图像增强%
A=imread('NGIRL001.BMP'); %读入图像
%函数将图像在0.3*255~0.7*255灰度之间的值通过线性变换映射到 0~255之间
%figure,
subplot(2,2,2);imshow(J1);title('处理后图像'); %输出图像效果图
%figure,
subplot(2,2,4);imhist(J1);title('处理后图像的直方图');%输出图像的直方图
相关文档
最新文档