资源描述:
《福建农林大学数字图像实验三》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、福建农林大学计算机与信息学院实验报告课程名称:数字图像处理(双语)(DigitalImageProcessing)姓名:王智勇系:计算机科学与技术专业:计算机科学与技术年级:2012级学号:3126010032指导教师:王长缨职称:副教授2014~2015学年下学期福建农林大学计算机与信息学院实验报告系:计算机科学与技术专业:计算机科学与技术年级:2012级姓名:王智勇学号:3126010032实验室号田家炳510计算机号33实验时间:2015年5月20日指导教师签字:成绩:ExperimentIIIImplementcon
2、volutionfiltertoobtainimagesmoothingaswellasedgeenhancement(validated)(2periods)ObjectiveGetfullyunderstandofthenotionoftheconvolutionanditsapplicationsonimagesmoothingandenhancementMethodologyConvoluteanimagewithdifferentdedicateddesignedfunctiontogetimagesmoothin
3、gandimageedgeenhancementbymeansofMATLAB.EnvironmentHardware:GeneralPCOperatingsystem:WindowsXPCalculatingplatform:MATLAB6.5orhigherversionExperimentindetail:1.ImagesmoothingwithdifferentsizeofspatialmasksA.Imagesmoothingwitharithmeticaveragingfilter(spatialconvolut
4、ion).function[r]=avgfilter(gray,n)a(1:n,1:n)=1;[row,col]=size(gray);gray1=double(gray);gray2=gray1;fori=1:row-n+1forj=1:col-n+1c=gray1(i:i+(n-1),j:j+(n-1)).*a;s=sum(sum(c));gray2(i+(n-1)/2,j+(n-1)/2)=s/(n*n);endendr=uint8(gray2);B.Makeacomparisonofnoisereductionbyb
5、othmedianfilterandaveragingfilter.function[r]=midfilter(gray,n)[row,col]=size(gray);gray1=double(gray);gray2=gray1;fori=1:row-n+1forj=1:col-n+1c=gray1(i:i+(n-1),j:j+(n-1));e=c(1,:);foru=2:ne=[e,c(u,:)];endmm=median(e);gray2(i+(n-1)/2,j+(n-1)/2)=mm;endendr=uint8(gra
6、y2);2.Edgeenhancementbymeansofspatialfiltering.A.DevelopaprogramtoimplementaGradientMasktoobtainedgeofanobject(incomparewiththefunctionprovidedbyMatlab)>>subplot(231);imshow(xx);title('原图');>>eSoble=edge(xx,'sobel');>>subplot(232);imshow(eSoble);title('Soble图');>>e
7、Prewitt=edge(xx,'prewitt');>>subplot(233);imshow(ePrewitt);title('Prewitt图');>>eRobert=edge(xx,'roberts');>>subplot(234);imshow(eRobert);title('Robert图');>>eLog=edge(xx,'log');>>subplot(235);imshow(eLog);title('Log图');>>eCanny=edge(xx,'canny');>>subplot(236);imshow
8、(eCanny);title('Canny图');B.ImageenhancementwithHigh-BoostFilteringMaskandcomparewiththeresultoftheoperationdefinedbyequation>>subplot(131);imshow