图形图像处理(第三讲).ppt

上传人:max****ui 文档编号:11616027 上传时间:2020-04-30 格式:PPT 页数:32 大小:1.01MB
返回 下载 相关 举报
图形图像处理(第三讲).ppt_第1页
第1页 / 共32页
图形图像处理(第三讲).ppt_第2页
第2页 / 共32页
图形图像处理(第三讲).ppt_第3页
第3页 / 共32页
点击查看更多>>
资源描述
图形图像处理,信息与计算科学系张宝雷,主要内容,二、数字图像处理的数学基础,卷积和滤波关联函数二维系统,卷积与滤波,x=132;y=1234;conv(x,y)ans=151117188,CONVConvolutionandpolynomialmultiplication.C=CONV(A,B)convolvesvectorsAandB.TheresultingvectorislengthMAX(LENGTH(A)+LENGTH(B)-1,LENGTH(A),LENGTH(B).IfAandBarevectorsofpolynomialcoefficients,convolvingthemisequivalenttomultiplyingthetwopolynomials.,卷积,卷积,C=CONV(A,B,SHAPE)returnsasubsectionoftheconvolutionwithsizespecifiedbySHAPE:full-(default)returnsthefullconvolution,same-returnsthecentralpartoftheconvolutionthatisthesamesizeasA.valid-returnsonlythosepartsoftheconvolutionthatarecomputedwithoutthezero-paddededges.LENGTH(C)isMAX(LENGTH(A)-MAX(0,LENGTH(B)-1),0).,二维卷积,二维卷积,A=12;32;B=103;452;315;conv2(A,B)ans=1236715211015302314991710,二维卷积,CONV2Twodimensionalconvolution.C=CONV2(A,B)performsthe2-DconvolutionofmatricesAandB.Ifma,na=size(A),mb,nb=size(B),andmc,nc=size(C),thenmc=max(ma+mb-1,ma,mb)andnc=max(na+nb-1,na,nb).,二维卷积,C=CONV2(H1,H2,A)convolvesAfirstwiththevectorH1alongtherowsandthenwiththevectorH2alongthecolumns.Ifn1=length(H1)andn2=length(H2),thenmc=max(ma+n1-1,ma,n1)andnc=max(na+n2-1,na,n2).,C=CONV2(.,SHAPE)returnsasubsectionofthe2-DconvolutionwithsizespecifiedbySHAPE:full-(default)returnsthefull2-Dconvolution,same-returnsthecentralpartoftheconvolutionthatisthesamesizeasA.valid-returnsonlythosepartsoftheconvolutionthatarecomputedwithoutthezero-paddededges.size(C)=max(ma-max(0,mb-1),na-max(0,nb-1),0).Seealsoconv,convn,filter2and,inthesignalProcessingToolbox,xcorr2.,二维卷积,234132,2468,36912,1234,151117188,卷积的性质,?,一致收敛,问题,二维卷积示例,二维卷积示例,a=imread(cai.jpg);imshow(a)aa=rgb2gray(a);subplot(221);imshow(a);holdon;subplot(222);imshow(aa);holdon;B=10;01;c=conv2(A,B);subplot(223);imshow(c);holdon;b1=010;101;010;c=conv2(A,b1);subplot(224);imshow(c),二维卷积示例,二维卷积示例,imshow(uint8(c);subplot(223);imshow(aa);holdon;c=conv2(aa,b1);Warning:CONV2onvaluesofclassUINT8isobsolete.UseCONV2(DOUBLE(A),DOUBLE(B)orCONV2(SINGLE(A),SINGLE(B)instead.Inuint8.conv2at11subplot(224);imshow(c);holdon;imshow(uint8(c);,线性运算,subplot(221);imshow(uint8(c);holdon;subplot(222);imshow(uint8(0.5*c);holdon;subplot(223);imshow(uint8(0.25*c);holdon;subplot(224);imshow(uint8(0.05*c);holdon;,线性运算,直方图,直方图,IMHISTDisplayhistogramofimagedata.IMHIST(I)displaysahistogramfortheintensityimageIwhosenumberofbinsarespecifiedbytheimagetype.IfIisagrayscaleimage,IMHISTuses256binsasadefaultvalue.IfIisabinaryimage,IMHISTusesonly2bins.,IMHIST(I,N)displaysahistogramwithNbinsfortheintensityimageIaboveagrayscalecolorbaroflengthN.IfIisabinaryimagethenNcanonlybe2.,直方图,IMHIST(X,MAP)displaysahistogramfortheindexedimageX.ThishistogramshowsthedistributionofpixelvaluesaboveacolorbarofthecolormapMAP.ThecolormapmustbeatleastaslongasthelargestindexinX.Thehistogramhasonebinforeachentryinthecolormap.,直方图,COUNTS,X=imhist(.)returnsthehistogramcountsinCOUNTSandthebinlocationsinXsothatstem(X,COUNTS)showsthehistogram.Forindexedimages,itreturnsthehistogramcountsforeachcolormapentry;thelengthofCOUNTSisthesameasthelengthofthecolormap.,直方图,Forintensityimages,theNbinsofthehistogramareeachhalf-openintervalsofwidthA/(N-1).Inparticular,forintensityimagesthatarenotint16,thep-thbinisthehalf-openinterval:A*(p-1.5)/(N-1)=xA*(p-0.5)/(N-1)Forint16intensityimages,thep-thbinisthehalf-openinterval:A*(p-1.5)/(N-1)-32768suplot(131);subplot(131);imshow(aa);holdon;subplot(132);imshow(j);holdon;subplot(133);imhist(j);holdon;,均衡化处理,HISTEQEnhancecontrastusinghistogramequalization.HISTEQenhancesthecontrastofimagesbytransformingthevaluesinanintensityimage,orthevaluesinthecolormapofanindexedimage,sothatthehistogramoftheoutputimageapproximatelymatchesaspecifiedhistogram.,均衡化处理,J=HISTEQ(I,HGRAM)transformstheintensityimageIsothatthehistogramoftheoutputimageJwithlength(HGRAM)binsapproximatelymatchesHGRAM.ThevectorHGRAMshouldcontainintegercountsforequallyspacedbinswithintensityvaluesintheappropriaterange:0,1forimagesofclassdoubleorsingle,0,255forimagesofclassuint8,0,65535forimagesofclassuint16,and-32768,32767forimagesofclassint16.HISTEQautomaticallyscalesHGRAMsothatsum(HGRAM)=NUMEL(I).ThehistogramofJwillbettermatchHGRAMwhenlength(HGRAM)ismuchsmallerthanthenumberofdiscretelevelsinI.,均衡化处理,J=HISTEQ(I,N)transformstheintensityimageI,returninginJanintensityimagewithNdiscretelevels.AroughlyequalnumberofpixelsismappedtoeachoftheNlevelsinJ,sothatthehistogramofJisapproximatelyflat.(ThehistogramofJisflatterwhenNismuchsmallerthanthenumberofdiscretelevelsinI.)ThedefaultvalueforNis64.,均衡化处理,J,T=HISTEQ(I)returnsthegrayscaletransformationthatmapsgraylevelsintheintensityimageItograylevelsinJ.,均衡化处理,ClassSupport-ForsyntaxesthatincludeanintensityimageIasinput,Icanbeuint8,uint16,int16,doubleorsingle.TheoutputimageJhasthesameclassasI.ForsyntaxesthatincludeanindexedimageXasinput,Xcanbeuint8,double,orsingle.Theoutputcolormapisalwaysdouble.Also,theoptionaloutputT(thegrayleveltransform)isalwaysofclassdouble.,均衡化处理,
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 课件教案


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!