• wahaha八宝粥
    了解作者
  • matlab
    开发工具
  • 45KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 1
    下载次数
  • 2019-04-12 18:25
    上传日期
数学形态学的基本运算单元是腐蚀和膨胀,很多高级的形态学算法均是以这两种原始运算单元作为基础的。
滤波.zip
  • 滤波
  • 滤波.docx
    51KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/627d5a97ebb030486ddf1c4b/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/627d5a97ebb030486ddf1c4b/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">&#9332;<span class="sc1">&#24179;&#28369;&#28388;&#27874;&#65288;&#27169;&#31946;&#12289;&#21435;&#22122;&#65289;</span></div><div class="t m0 x1 h4 y3 ff2 fs1 fc0 sc0 ls0 ws0">clear all; close all;</div><div class="t m0 x1 h4 y4 ff2 fs1 fc0 sc0 ls0 ws0">I = imread('eight.tif');</div><div class="t m0 x1 h4 y5 ff2 fs1 fc0 sc0 ls0 ws0">h1 = ones(3,3) / 9;</div><div class="t m0 x1 h4 y6 ff2 fs1 fc0 sc0 ls0 ws0">h2 = ones(5,5) / 25;</div><div class="t m0 x1 h4 y7 ff2 fs1 fc0 sc0 ls0 ws0">I1 = imfilter(I,h1);</div><div class="t m0 x1 h4 y8 ff2 fs1 fc0 sc0 ls0 ws0">I2 = imfilter(I,h2);</div><div class="t m0 x1 h4 y9 ff2 fs1 fc0 sc0 ls0 ws0">figure(1), imshow(I), title('Original Image');</div><div class="t m0 x1 h4 ya ff2 fs1 fc0 sc0 ls0 ws0">figure(2), imshow(I1), title('Filtered Image With 3*3 ')</div><div class="t m0 x1 h4 yb ff2 fs1 fc0 sc0 ls0 ws0">figure(3), imshow(I2), title('Filtered Image With 5*5 ')</div><div class="t m0 x1 h5 yc ff2 fs1 fc0 sc0 ls0 ws0">% <span class="ff1">&#21152;&#20837;<span class="_ _0"> </span></span>Gaussian <span class="ff1">&#22122;&#22768;</span></div><div class="t m0 x1 h4 yd ff2 fs1 fc0 sc0 ls0 ws0">J1 = imnoise(I,'gaussian',0,0.005);</div><div class="t m0 x1 h5 ye ff2 fs1 fc0 sc0 ls0 ws0">% <span class="ff1">&#21152;&#20837;&#26898;&#30416;&#22122;&#22768;</span></div><div class="t m0 x1 h4 yf ff2 fs1 fc0 sc0 ls0 ws0">J2 = imnoise(I,'salt &amp; pepper',0.02);</div><div class="t m0 x1 h5 y10 ff2 fs1 fc0 sc0 ls0 ws0">% <span class="ff1">&#23545;<span class="_ _0"> </span></span>J1<span class="ff1">&#12289;</span>J2<span class="_ _0"> </span><span class="ff1">&#36827;&#34892;&#24179;&#22343;&#20540;&#24179;&#28369;&#28388;&#27874;</span></div><div class="t m0 x1 h4 y11 ff2 fs1 fc0 sc0 ls0 ws0">K1 = imfilter(J1,fspecial('average',3));</div><div class="t m0 x1 h4 y12 ff2 fs1 fc0 sc0 ls0 ws0">K2 = imfilter(J2,fspecial('average',3));</div><div class="t m0 x1 h4 y13 ff2 fs1 fc0 sc0 ls0 ws0">figure(4);</div><div class="t m0 x1 h4 y14 ff2 fs1 fc0 sc0 ls0 ws0">subplot(2,2,1), imshow(J1) , title('gaussian');</div><div class="t m0 x1 h4 y15 ff2 fs1 fc0 sc0 ls0 ws0">subplot(2,2,2), imshow(J2), title('salt &amp; pepper ');</div><div class="t m0 x1 h4 y16 ff2 fs1 fc0 sc0 ls0 ws0">subplot(2,2,3), imshow(K1), title('average ');</div><div class="t m0 x1 h4 y17 ff2 fs1 fc0 sc0 ls0 ws0">subplot(2,2,4), imshow(K2);</div><div class="t m0 x1 h5 y18 ff2 fs1 fc0 sc0 ls0 ws0">% <span class="ff1">&#23545;<span class="_ _0"> </span></span>J1<span class="ff1">&#12289;</span>J2<span class="_ _0"> </span><span class="ff1">&#36827;&#34892;&#20013;&#20540;&#28388;&#27874;</span></div><div class="t m0 x1 h4 y19 ff2 fs1 fc0 sc0 ls0 ws0">K3 = medfilt2(J1,[3 3]);</div><div class="t m0 x1 h4 y1a ff2 fs1 fc0 sc0 ls0 ws0">K4 = medfilt2(J2,[3 3]);</div><div class="t m0 x1 h4 y1b ff2 fs1 fc0 sc0 ls0 ws0">figure(5);</div><div class="t m0 x1 h4 y1c ff2 fs1 fc0 sc0 ls0 ws0">subplot(2,2,1), imshow(J1) , title('gaussian');</div><div class="t m0 x1 h4 y1d ff2 fs1 fc0 sc0 ls0 ws0">subplot(2,2,2), imshow(J2), title('salt &amp; pepper ');</div><div class="t m0 x1 h4 y1e ff2 fs1 fc0 sc0 ls0 ws0">subplot(2,2,3), imshow(K3), title(' Median filtering ');</div><div class="t m0 x1 h4 y1f ff2 fs1 fc0 sc0 ls0 ws0">subplot(2,2,4), imshow(K4)</div><div class="t m0 x1 h4 y20 ff2 fs1 fc0 sc0 ls0 ws0">%------------------------------------------------------------</div><div class="t m0 x1 h3 y21 ff1 fs0 fc0 sc0 ls0 ws0">&#9333;<span class="sc1">&#38160;&#21270;&#28388;&#27874;</span></div><div class="t m0 x1 h4 y22 ff2 fs1 fc0 sc0 ls0 ws0">clear <span class="fc1">all</span>; close <span class="fc1">all</span></div><div class="t m0 x1 h4 y23 ff2 fs1 fc0 sc0 ls0 ws0">f = imread(<span class="fc1">'Fig0338(a)(blurry_moon).tif'</span>);</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐