46201412INTELLIGENTCOMPUTERANDAPPLICATIONSVol.4No.6Dec.20142014-11-101980-、。MATLAB211135。MATLAB。MATLABTP301A2095-2163201406-0087-03TheMedianFilteringAlgorithmofImageEnhancementbasedonMATLABWANGSainanJiangsuProvinceNanjingEngineeringVocationalCollegeNanjing211135ChinaAbstractImageenhancementtechnologyistoimprovetheimageofthemostcommonlyusedtechniquesthepurposeistoimprovetheimagevisualeffectmaketheimagemoreclear.Thispapermainlyexpoundsthenonlinearmedianfilteringal-gorithmofspatialfilteringprincipleandtheoreticalbasis.AndintheMATLABplatformthroughthedifferentfiltertemplateandaddingdifferentnoisemedianfilteringsimulationexperimentandtheexperimentalresultsanalysisaregivenout.KeywordsMedianFilteringImageEnhancementMATLAB01。。、。、、MATLAB。1。。。2。1.13。fxy、、AGxy=Medxy∈AGxy11。1.2。X1X2…XnX'1<X'2<…<X'n2y=MedX1X2…Xn=X'nnisodd12X'n2+X'n2+[]1nis{even22。3×355×5137×7259×941。1015202020202025100“20”。1.3medfilt2MATLABmedfilt21K=medfilt2BmnBm×n。2K=medfilt2Bmn3B。2MATLAB7.6。MATLAB4。2.10.083×3、5×5、7×7、9×9。MATLABimnoisemedfilt2。I=imread’saturn.png’%I=rgb2grayIJ=imnoiseI’salt&pepper’0.08%subplot231imshowItitle’’subplot232imshowJtitle’0.08’k1=medfilt2J%3×3k2=medfilt2J55%5×5k3=medfilt2J77%7×7k4=medfilt2J99%9×9subplot233imshowk1title’3x3’subplot234imshowk2title’5x5’subplot235imshowk3title’7x7’subplot236imshowk4title’9x9’1。1Fig.1Medianfilteringwithsaltandpeppernoisefilter2.20.0800.040.069×9。I=imread’saturn.png’%M=rgb2grayIN1=imnoiseM’salt&pepper’0.08%0.08N2=imnoiseM’gaussian’00.04%00.04N3=imnoiseM’speckle’0.06%00.06G1=medfilt2N199%N19×9G2=medfilt2N299G3=medfilt2N399subplot241imshowMtitle’’subplot242imshowN1title’’subplot243·88·4imshowN2title’’subplot244imshowN3title’’subplot246imshowG1title’’subplot247imshowG2title’’subplot248imshowG3title’’2。2Fig.2Medianfiltertoremoveavarietyofdifferentnoisecontrastimages3。10.083×3、5×5、7×7、9×9。。2。。、。4。5MATLAB。。1.MATLAB7.6M.2009.2.MATLABM.2014.3.D.2013.4.MATLABM.2014.5.J.20133364-367407.·98·6MATLAB