好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

数字图像处理指令及效果.docx

23页
  • 卖家[上传人]:ss****gk
  • 文档编号:236502433
  • 上传时间:2022-01-07
  • 文档格式:DOCX
  • 文档大小:658.97KB
  • / 23 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 数字图象处理1图象读取及彩色图象转化为灰度图彖原图灰度变换指令:clearclose allI=imread('C:\Documents and Settings\Administrator\桌面\图片\l.jpg1); subplot(l 21 ),imshow(I);titleC 原图');L=rgb2gray(I);subplot(l 22),imshow(L);titleC灰度变换,)2直方图 104 原图直方图4.54原图3.532.521.510.500 100 200指令:clearclose allI=imread(C\Documents and Settings\Administrator\桌面\图片\2.jpg); subplot(l 2 l)Jmshow(I);title原图 J;L=rgb2gray(I)subplot(l 22) jmhist(L);title(源图直方图J3图象旋转指令:clear close allI=imread(,C:\Documents and Sett i ngs\ Ad mini strator\桌面\图片 \2.jpg1); subplot( 121) jmshow(I);title(源图J;theta = 30;K = imrotate(I,theta);subplot( 122)Jmshow(K);titleC旋转后图J 原图旋转后图4、边缘检测clear close allI二imread('C:\Documents and Settings\Administrator\桌面\图片\l.jpg1); subplot( 121) jmshow(I);bwl=im2bw(I);bw2=double(bwl);Jl=cdgc(I,'sobcl');J2=edge(I/prewitt,);J3=edge(I;log,);subplot(l 41 ),imshow(I);subplot( 1 A2),imshow(J 1);subplot( 143) jmshow(J2);subplot(l ,4,4),imshow(J3);5图像反转close allI=imread('C:\Documents and Settings\Administrator\桌面\图片A2.jpg1); J=double(I);J=-J+(256-l);H=uint8(J);subplot( 12 l)Jmshow(I);subplot( 122),imshow(H);6灰度线性变换原始图彖灰度图像线性变换图像[0.1, 0.5]2004006008001000500 1000 1500线性变换图像[0.3 0.7]close allI=imread(,C:\Documents and Settings\Administrator\桌面\图片\2.jpg1) subplot(2,2,1) jmshow(I);titleC原始图像*);axis on;Il=rgb2gray(I);subplot(222),imshow(11);titled灰度图像);axis on;J=imadjust(Il,lO .1 0.5],[]);subplot(2,2,3),imshow(J);title(线性变换图像[0.1 0.5]*);grid onaxis onK=imadjust(Il,[0.3 0.7],[]);subplot(2,2,4),imshow(K);title(线性变换图像[0.3 0.7门;grid on;axis on7非线性变换原始图彖2004006008001000-500 1000 1500灰度图像対数变换图像500 1000 1500close allI=imread(fC:\Documents and Settings\Administrator\桌面\图片\2.jpg); subplot(221 )Jmshow(I);titl*原始图像)Il =rgb2gray(I);clearsubplot(2,2,2),imshow(11);titleC灰度图像');grid on;axis on;J=doublc(ll);j=40*(log(J+l));H=uint8(J);subplot(2,2,3),imshow(H);titled对数变换图像grid on;axis on;8直方图均衡化灰度图像4x 104x 10close allI=imread(C\Documents and Settings\Administrator\桌面\图片\2.jpg1); subplot(2,2,1 ),imshow(I);titleC灰度图像');I=rgb2gray(I);subplot(2,2,l);imshow(I);subplot(2,2,2);imhist(I);Il=histeq(I);subplot(2,2,3);imshow(Il);subplot(2,2,4);imhist(ll);9线性平滑滤波原始图像加入躁声图像3七摸板5*5摸板7*7摸板9*9摸板1 p厂P 一f Jrclearclose allI=imread('C:\Documents and Settings\Administrator\桌面\图片\2.jpg'); subplo((2,3,1 ),imshow(I);titled原始图像)I=rgb2gray(I);Il=imnoise(I,'salt & pepper*,0.02);subplot(2,3,2),imshow(11);title(•加入躁声图像Jk 1 =filtcr2(fspccial('avcragc',3),Il )/255;k2=filter2(fspecialCaverage',5),11)/255; k3=filter2(fspecial('average',7),Il )/255; k4=filter2(fspecial('average',9),11 )/255;subplol(2,3,3),imshow(kl);title('3*3 摸板*) subplot(2,3»4),imshow(k2);title('5*5 摸板) subplot(2,3,5),imshow(k3);title('7*7 摸板') subplot(2,3,6),imshow(k4);titlc('9*9 摸板')10中值滤波3七模板中值滤波原图像添加椒盐噪声图像5*5模板中值滤波7*7模板中值滤波9*9模板中值滤波clearclose allI=imreadCC:\Documents and Settings\Administrator\桌面\图片\2.jpg'); I=rgb2gray(I);J=imnoise(I,'salt & pepper',0.02);subplot(2,3,l ),imshow(I);titleC 原图像'); subplot(2,3,2),imshow(J);title(添加椒盐噪声图像'); kl=mcdfilt2(J);k2=medfilt2(J,[5,5]);k3=medfilt2(J,[7,7]);模板中值滤波 模板中值滤波*);模板中值滤波'); 模板中值滤波);k4=medfilt2(J,[9,9]);subplol(2,3,3),imshow(k l);title('3*3subplot(2,3,4),imshow(k2);title('5*5subplot(2,3>5),imshow(k3);titleC7*7subplot(2,3,6),imshow(k4);title('9*911用sobel算子和拉普拉丝对图象锐化2004006008001000500 1000 1500二值图像sobel算子锐化图像5010015020050 100 150 200 250拉普拉斯算子锐化图像2004006008001000500 1000 1500clearclose allI=imread(C\Documents and Settings\Administrator\桌面\图片\2.jpg1); subplot(2,2,1 ),imshow(I);行啦原始图像');grid on;axis on;Il=im2bw(I);subplot(2,2,2),imshow(11);title(二值图像匕grid on;axis on;H=fspecial('sober);J=filter2(H,Il);subplot(2,2,3),imshow(J);titleCsobel算子锐化图像');axis([50,250,50,200]);grid on; axis on;h=[0 1 0,1 ・4 1,0 1 0J; ll=double(Il);% 缺少转化Jl=conv2(Il ,h,'same'); subplot(2,2,4),imshow(J 1); titl*拉普拉斯算子锐化图像); grid on;axis on;12真彩色分解原始真彩色图像真彩色图像的红色分暈真彩色图像的绿色分量真彩色图像的蓝色分量RGB=imread('C:\Documents and Settings\Administrator\桌面\图片 \2.jpg'); subplot(221 ),imshow(RGB) titled原始真彩色图像)subplot(222),imshow(RGB(:,:,l))titleCM彩色图像的红色分量) subplot(223),imshow(RGB(:,:,2)) titleCM彩色图像的绿色分量') subplot(224),imshow(RGB(:,:,3)) titleC真彩色图像的蓝色分量?13伪彩色增强举例clearclose all1=imread(fC:\Documents and Settings\Adininistrator\桌而\图 Ji \2jpg1); subplot(121), imshow(I);X=。

      点击阅读更多内容
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.