版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
一、题目:双树复小波变换二、目的:双树复小波和实小波变换的比较算法及其实现:提取阶梯型边界点1.算法。二、—.(,)=*匕(,)+J(,)〈/>,.)=)幅值:I<•(/,〃)1=】[%(,,〃)]'+叵(/,〃)『相位:Zd(j,n)=arctail'、"'〃)UhU»J2.代码实现。加3),扁(〃),方1(〃)虚部:。«)=^Xg。(〃处(2,一〃)
加3),扁(〃),方1(〃)虚部:。«)=^Xg。(〃处(2,一〃)
fl%(0=&(〃成(2—〃)n初《)=《£务(〃威(2-〃)fl气(0=巾£务(〃域.(2"n)'电-h,&扑Wh,Vh分别是双正交对偶尺度函数与对偶小波,和&(/?)是相应的低通滤波器和高通滤波器,即它们满足—实部:仓。)=心£瓦(〃灿,(2f—〃)/IWh(0=4(〃Wh(2f一〃)n场(0=72^4(〃域(2r-n)nWh(0=5/2^4(〃域(2f-〃)〃n双树复小波变换可以通过离散小波变换DWT实现:一个DWT产生实部,另一个产生虚部。四、实现工具:Matlab五、程序代码:shift_test_2D.m:%shift_test_2D.m%%M-flletopeiibrma4-levelwavelettransformonacircleusingQ-shift%dualwavelettreeandDWT,andtocompaiesliiftiiivaiianceproperties.%%NickKingsbury,CambridgeUniversity.May2002.clearallcloseall%Drawaciiculardisc.x=round((drawcirc(64,1,0,0,256)-0.5)*200);setfig(l);colorniap(gray(256))iniage(niHi(niax(x+128』),256));set(gca,'position',[5.5]);axis(,off);axis(,miage,);%draw(xx);title(Tnput(256x256)\*FontSize\14);diawnow%Do4levelsofCWT.[YLYh]=dtwavexfiii2(x,4/neai_sym_b\,qsluft_b,);%Looptoleconstiuctoutputfromcoefsateachlevelinturn.%Startswithtliefinestlevel.titl=口sf;'2nd;3rd';'4th';'Low];yy=zeros(size(x)・*[23]);ytl=l:size(x,l);yt2=l:size(x,2);fornilev=1:5,mask=zeros(6,5);mask(:anlev)=1;z=dtwaveifhi2(Yl*mask(l,5),Yh,'near_sym_b','qshift_b',mask);figure;draw(z);drawnowyy(yti,yt2)=z;yt2=yt2+size(x,2)/2;end%dispfPressakey%pause%NowdosamewithDWT.%Do4levelsofRealDWTusingfantomni,(9,7)-tapfilters.[YLYh]=wavexfiii2(x,4;antonuir);ytl=[l:size(x,l)]+size(x.l);yt2=l:size(x,2);fornilev=1:5,mask=zeros(3,5);mask(:anlev)=1;z=waveifiii2(Yl*niask(1,5).Yli/antonini\mask);figure;draw(z);drawnowyy(yti,yt2)=z;yt2=yt2+size(x,2)/2;endfigure;setfig(gcf);colorniap(gray(256))iniage(niHi(niax(yy+128,1),256));set(gca,'position\[.8]);axisfoff);axis(,iinage,);holdonplot(128*[[l;l]*[l:4][0;6]]+l,128*[[0;4]*[l111][2;2]]+l;-k*);holdofftitle('Componentsofreconstmcted"disc”iniages\*FontSize\14);text(・0.01*size(yy,2),0.25*size(yy,l),'DTCWT,'horiz',T);text(0.02*size(yy,2)4.02*size(yyj),^avelets:7horiz\,r7vert,/t,);text(-0.01*size(yy,2),0.75*size(yyJ),'DWT7horiz7rl);fork=l:4,text(k*128-63,size(yy,1)*1.02,sprintf(*level%d\k)/FontSize\14/honz,/c,/vertVf);endtext(5*128+1,size(yy,1)*1.02,level4scalmgfh*'FontSize',14,'horiz','c',"verf,'t');diawnow%print-depscucrecq.epsdisp(,Piessakeytoseeperfectreconstructionpropeity…')pause%Accumulatetheimagesfromlowbandupwardstoshowperfectreconstmction.sy=size(x,2)/2;fbrnilev=4>l:l,yt2=[l:sy]+(nilev-l)*sy;yy(:,yt2)=yy(:,yt2)+yy(:,yt2+sy);endfigure;setfig(gcf);colorniap(gray(256))iniage(niHi(niax(yy+128,1),256));set(gca,'position\[.8]);axisfoff);axis(,iinage,);title('AccumulatedreconstmctionsfiomeachlevelofDTCWT\TontSize\14);text(size(yy,2)*0.5,size(yy,l)*1.02,'AccumulatedreconstmctionsfiomeachlevelofDWTdrawnowreturnfunctionp=drawcirc(r,w.dx,dy,N)%functionp=drawcirc(r,w,dx,dy;N)%GenerateanimageofsizeN*Npels,contauungacircle%radiusrpelsandcentredatdx.dyrelative%totliecentreoftlieimage.Theedgeoftheciicleisacosineshaped%edgeofwidthw(from10to90%pomts).x=ones(NJ)*(([1:N]・(N+l)/2-dx)/r);y=(([1:N]'・(N+l)/2.dy)/i)*ones(l,N);p=0.5+0.5*sin(iniii(inax((exp(-0.5*(x+y))・exp(-O.5))*Q*3/w),-pi/2),pi/2));returnfunctionZ=dnvaveifiii2(YLYh.biort,qshift,gain_mask);%Functiontoperformailn-leveldual-treecomplexwavelet(DTCWT)%2-Dreconstmction.%%Z=dnvaveifiii2(YLYh,bioit,qshift,gain_mask);%%Y1->Thereallowpassimagefromthefiliallevel%Yh->Acellarraycontauiiiigthe6complexhighpasssubiinagesforeachlevel.%%bion->'antonini'=>Aiitonini9,7tapfilters.%legal!1=>LeGall5,3tapfilters.%,neai_sym_a,=>Near-Synunetric5,7tapfilters.%,neai_sym_b,=>Near-Synunetric13,19tapfilters.%%qshift->'qshifL06'=>QuarterSampleSluftOnhogonal(Q-Sluft)10.10tapfilters,%(only6,6non-zerotaps).%'qshift_a'=>Q-sliift10,10tapfilters,%(with10,10non-zerotaps,unlikeqshift_06).%'qshift_b'=>Q-Sliift14,14tapfilters.%'qshift_c'=>Q-Sliift16,16tapfilters.%'qshift_d'=>Q-Sliift18,18tapfilters.%gam_mask->Gaintobeappliedtoeachsubbaiid.%gain_mask(d,l)isgainfbrsubbandwithdiiectiondatlevel1.%Ifgain_mask(d,l)==0,nocomputationisperformedfbrband(d,l)・%Defaultgain_mask=ones(6Jength(Yh)).%%Z->Reconstmctedrealimagematrix%%%Foiexample:Z=dtwaveifhi2(Yl,Yh,'near_sym_b'.'qshift_b');%performsa3-levelreconstructionfiomYLYhusingthe13,19-tapfilters%forlevel1andtheQ-shift14-tapfiltersforlevels>=2.%%NickKingsburyandCiaiiShaffieyJJ%CainbiidgeUniversity,May2002a=length(Yh);%Nooflevels.ifnargin<5,gaiiwnask=ones(6,a);end%Defaultgaiiwiiask.ifisstr(biort)&issti(qshift)%Checkifthemputsarestringsbiort_exist=exist([biort'.mat']);qshift_exist=exist([qshift'.mat']);ifbiort_exist=2&qsliift_exist==2;%Checktoseeifthemputsexistas.matfilesload(biort);load(qshift);elseeiTOiXPleaseenterthecorrectnamesoftheBioithogonalorQ-SluftFilters,seehelpDTWAVEIFM2fbrdetails?);endelseeiro^PleaseentertlienamesoftheBioithogonalorQ-ShiftFiltersasshowninhelpDTWAVEIFM2.);endcunent_level=a;Z=Y1;wliilecunent_level>=2;;ensuresthatfbrlevel-1weneverdothefollowingHi=c2q(Yh(cuiTentJevel}(:/,[!6]),gain_mask([l6],current_level));hl=c2q(Yh(cuiTent_level)(:,:,[34]),gain_mask([34],current_level));lili=c2q(Yli(current_level}(:/,[25]),gain_mask([25],cunent_level));%DoevenQshiftfiltersoncolumns.yl=colifilt(Z,gOb,gOa)+colifilt(lh,g1b,g1a);y2=colifilt(hl,gOb,gOa)+colifilt(hh,g1b,g1a);%DoevenQshiftfiltersonrows.Z=(colifilt(y1/5gOb,gOa)+colifilt(y2.\g1b,g1a)).\%ChecksizeofZandcropasrequued[row_sizecoLsize]=size(Z);S=2*size(Yh{cunent_level-l});ifiow_sizeyS(l)%checktoseeiftliisresultneedstobecroppedfbrtherowsZ=Z(2:iow_size-1,:);endifcoLsize~=S(2)%checktoseeiftliisresultneedstobecroppedfbrthecolsZ=Z(:,2:col_size-1);endifany(size(Z)S(l:2)),enoi^SizesofsubbandsarenotvalidforDTXVtWEIFM2r);endcunentlevel=currentlevel-1;endifcunenOevel==1;Hi=c2q(Yh(cuirenclevel}(:,:,[!6]),gaiii_mask([l6],current_level));hl=c2q(Yh(cuirenclevel}(:,:,[34]),gaiii_mask([34],current_level));lili=c2q(Yli(current_level}(:,:,[25]),gain_mask([25],cunent_level));%Dooddtop-levelfiltersoncolunms.yl=colfilter(Z,gOo)+colfilter(lh,glo);y2=colfiltei(lil.gOo)+colfilter(hli,glo);%Dooddtop-levelfiltersonrows.Z=(colfilter(yl.\gOo)+colfilter(y2.\g1o)).1;endreturn%=====—==========================—=======%**********INTERNALFUNCTION**********%=====—=================—=================fiinctionx=c2q(w,gain)%functionz=c2q(w,gain)%Scalebygainandconvertfromcomplexw(:,:,l:2)torealquad-numbersin乙%%Arrangepixelsfromtlierealandiiiiagpansofthe2subbands%into4separatesubiniages.%A——BRe%II%II%C——DReImofw(:,:,2)sw=size(w);x=zeros(2*sw(l:2));ifany(w(:))&any(gaiii)sc=sqrt(O.5)*gain;P=w(:,:,l)*sc(l)+w(:,:,2)*sc(2);Q=w(:,:,l)*sc(1)-w(:,:,2)*sc⑵;tl=l:2:size(x,l);t2=l:2:size(x,2);%Recovereachofthe4corneisofthequads.x(tl,t2)=real(P);%a=(A+C)*sc;x(tl,t2+l)=iinag(P);%b=(B+D)*sc;x(tl+l,t2)=iinag(Q);%c=(B-D)*sc;x(tl+l,t2+l)=-real(Q);%d=(C-A)*sc;endreturnfunction[YLYh.Yscale]=dt\vavexfiii2(X,nlevels,biort,qsluft);%Functiontopeiibrman-levelDTCWT-2Ddecompostionona2DmatrixX%%[YLYh^Yscale]=dhvavexfiii2(X,iilevels,bion.qshift);%%X->2Drealmatrix-linage%%iilevels->No.oflevelsofwaveletdecomposition%%bion->'antoninr=>Aiitonini9,7tapfilters.%legall1=>LeGall5,3tapfilters.%,neai_sym_a,=>Near-Symmetric5,7tapfilters.,neai_sym_b,=>Near-Synunetric13,19tapfilters.%qshift->'qshiH_06'=>QuarterSampleSluftOnhogonal(Q-Sluft)10.10tapfilters,%(only6,6non-zerotaps).%'qshift_a'=>Q-sliift10,10tapfilters,%(with10,10non-zerotaps,unlikeqshift_06)・%'qshift_b'=>Q-Sliift14,14tapfilters.%'qshift_c'=>Q-Sliift16,16tapfilters.%'qshift_d'=>Q-Sliift18,18tapfilters.%%%Y1->Thereallowpassimagefromthefiliallevel%Yh->Acellarraycontammgthe6complexhighpasssubiniagesfbreachlevel.%Yscale->TliisisanOPTIONALoutputaigument,thatisacellarraycontaniing%reallowpasscoefficientsforeveiyscale.%%%Example:[YLYh]=dtwavexfhi2(X,3,'neai_sym_b'.'qshift_b');%performsa3-leveltransformontherealimageXusingthe13.19-tapfilters%forlevel1andtheQ-shift14-tapfiltersforlevels>=2.%%NickKingsburyandCiaiiShaffieyJJ%CainbiidgeUniversity,Sept2001ifisstr(biort)&issti(qshift)%Checkifthemputsarestringsbiort_exist=exist([biort'.mat']);qshift_exist=exist([qshift'.mat']);ifbiort_exist=2&qsliift_exist==2;%Checktoseeiftheinputsexistas.niatfilesload(bioit);load(qshift);elseenoiXPleaseenterthecorrectnamesoftheBioithogonalorQ-SluftFilters,seehelpDTWAVEXFM2fordetails/);endelseeuo^PleaseentertlienamesoftheBioithogonalorQ-ShiftFiltersasshowninhelpDTWAVEXFM2.)endorginaLsize=size(X);ifnduns(X)>=3;enor(spnntRTheenteredimageis%dx%dx%d.pleaseentereachimageslice
sepaiately\orginal_size(l),orgmal_size(2),orgiiial_size(3)));end%Thenextfewlinesofcodechecktoseeiftlieimageisoddmsize,ifsoanextra...%low/colunmwillbeaddedtothebottonVrightoftheimageinitialrowextend=0;%iiiitialiseinitialcolextend=0;ifaiiy(rem(orgiiiaLsize(1),2)),%ifsx(l)isnotdivisableby2thenweneedtoextendXbyaddingarowattliebottomX=[X;X(end,:)];%Anyfiirtherextensionwillbedoneinduecourse.initialrowextend=1:—endifany(rem(orgmaLsize(2),2)),%ifsx(2)isnotdivisableby2thenweneedtoextendXbyaddmgacoltotheleftX=[XX(:,end)];%Anyfinthei-extensionwillbedoneinduecourse.initialcolextend=1;endextended_size=size(X);ifiilevels=0,return;end%initialiseYh=cell(iilevels,1);ifnargout==3Yscale=cell(nlevels,1);isonlyrequiiediftlieuserspecifiesathiidoutputcomponent,endS=[];sx=size(X);ifiilevels>=1,%Dooddtop-levelfiltersoncols.Lo=colfilter(X,hOo).r;Hi=colfilter(X,hlo).r;%Dooddtop-levelfiltersonrows.LoLo=colfiltei(Lo.hOo).f;%LoLoYh{1}=zeios([size(LoLo)/26]);%Horizontalpair%Verticalpair%Horizontalpair%Verticalpair%DiagonalpairYh{l[34])=q2c(colfilter(Lo,hlo)「);Yh{l[25])=q2c(colfiltei(HLhlo)/);S=[size(LoLo);S];ifnaigout=3Yscale{l}=LoLo;endendifiilevels>=2;forlevel=2:nlevels;[row_sizecoLsize]=size(LoLo);ifany(rem(row_size,4)).%Extendby2rowsifno.ofrowsofLoLoaiedivisableLoLo=[LoLo(l,:);LoLo:LoLo(end,:)];endifany(rem(col_size,4)),%Extendby2colsifno.ofcolsofLoLoaredivisableby4;LoLo=[LoLo(:,l)LoLoLoLo(:,end)];end%DoevenQshiftfiltersonrows.Lo=coldfilt(LoLo.hOb.hOa).‘;Hi=coldfilt(LoLo,h1b,hla).1;%DoevenQshiftfiltersoncolumns.LoLo=coldfilt(Lo.hOb,hOa).';%LoLoYh(level}=zeros([size(LoLo)/26]);Yh(level}(:,:,[!6])=q2c(coldfilt(Hi,h0b,h0a).);%HorizontalYh(level}(:,:,[34])=q2c(coldfilt(Lo.hlb,hla).');%VerticalYh(level}(:,:,[25])=q2c(coldfilt(Hi,hlb,h1a)/);%DiagonalS=[size(LoLo);S];ifnaigout==3Yscale(level}=LoLo;endendendY1=LoLo;ifiiiitiaLrow_extend==1&initial_col_extend=1;wainmg(sprintf(,\r\rTheimageenteredisnowa%dx%dNOTa%dx%d\rThebottomrowandrightmostcolumnhavebeenduplicated,priortodecomposition.\1V',…extended_size(l),extended_size(2),orgmaLsize(l),orginaLsize(2)));endifmitialrowextend=1;wainmg(sprintf(,\r\rTheimageenteredisnowa%dx%dNOTa%dx%d\rRownumber%dhasbeenduplicated,andaddedtothebottomoftheimage,piiortodecomposition.extended_size(l),extended_size(2),orgiiial_size(1),orginal_size(2),orginal_size(1)));endifinitialcolextend==1;warnmg(spiintf(,\r\rThemiageenteredisnowa%dx%dNOTa%dx%d\rColnumber%dhasbeenduplicated,andaddedtotherightoftheimage,priortodecomposition.…extended_size(l),extended-size(2).orgmaLsize(l),orgmal_size(2),orgmaLsize(2)));endreturn%=====—==========================—=======%**********INTERNALFUNCTION**********fiinctionz=q2c(y)%functionz=q2c(y)%Convertfromquadsinytocomplexnumbersinz.sy=size(y);tl=l:2:sy(l);t2=l:2:sy(2);j2=sqrt([0.5-0.5]);%Arrangepixelsfromtliecornersofthequadsinto%2subiinagesofalternaterealandiiiiagpixels.%a—b%II%II%c・---d%Combine(a,b)and(d,c)toformtwocomplexsubiinages.p=y(tl,t2)*j2(l)+y(tl,t2+l)*j2(2);%p=(a+jb)/sqrt(2)q=y(tl+l,t2+l)*j2(l)・y(tl+l,t2)*j2(2);%q=(d-jc)/sqrt(2)%Formthe2subbandsinz.z=cat(3,p-q,p+q);leturnfunctionZ=dnvaveifiii2(YLYh.biort,qshift.gain_mask);%Functiontoperformailn-leveldual-treecomplexwavelet(DTCWT)%2-Dreconstmction.%%Z=dtwaveifiii2(YLYh,bioit,qshift,gain_mask);%%Y1->Thereallowpassimagefromthefiliallevel%Yh->Acellarraycontainingthe6complexhighpasssubiinagesforeachlevel.%%bion->'antonini*=>Aiitonini9,7tapfilters.%legal!1=>LeGall5,3tapfilters.%,neai_sym_a,=>Near-Symmetric5,7tapfilters.%,neai_sym_b,=>Near-Synunetiic13,19tapfilters.%%qshift->'qshift_06'=>QuarterSampleSluftOnhogonal(Q-Sluft)10,10tapfilters,%(only6,6non-zerotaps).%'qshift_a'=>Q-sliift10,10tapfilters,%(with10,10non-zerotaps,unlikeqshift_06)・%'qshift_b'=>Q-Sliift14,14tapfilters.%'qshift_c'=>Q-Sliift16,16tapfilters.%'qshift_d'=>Q-Sliift18,18tapfilters.%%gaiiwnask->Gaintobeappliedtoeachsubbaiid.%gain_mask(d,l)isgainforsubbandwithduectiondatlevel1.%Ifgain_mask(d,l)==0,nocomputationisperformedfbrband(d.l).%Defaultgain_mask=ones(6Jength(Yh)).%%Z->Reconstmctedrealimagematrix%%%Foiexample:Z=dtwaveifhi2(Yl,Yh,'near_sym_b','qshift_b');%performsa3-levelreconstmctionfiomYLYhusingthe13,19-tapfilters%forlevel1andtheQ-shift14-tapfiltersforlevels>=2.%%NickKingsburyandCiaiiShaffieyJJ%CainbiidgeUniversity,May2002a=length(Yh);%Nooflevels.ifnargin<5,gaiiwnask=ones(6,a);end%Defaultgaiiwiiask.ifisstr(biort)&issti(qshift)%Checkifthemputsarestringsbiort_exist=exist([biort'.mat1]);qshift_exist=exist([qshift'.mat']);ifbiort_exist=2&qsliift_exist==2;%Checktoseeifthemputsexistas.matfilesload(bioit);load(qshift);elseenoiXPleaseenterthecorrectnamesoftheBioithogonalorQ-SluftFilters,seehelpDTWAVEIFM2fbrdetails?);endelseeuo^PleaseentertlienamesoftheBioithogonalorQ-ShiftFiltersasshowninhelpDTWAVEIFM2.);endcunenOevel=a;Z=Y1;wliilecurrent_level>=2;;%tliisensuresthatfbrlevel-1weneverdothefollowingHi=c2q(Yh(cuiTentJevel}(:,:,[!6]),gaiii_mask([l6],current_level));hl=c2q(Yh(cuiTentJevel}(:,:,[34]),gain_mask([34],current_level));lili=c2q(Yli(current_level}(:,:,[25]),gain_niask([25],cunent_level));%DoevenQshiftfiltersoncolumns.yl=colifilt(Z,gOb,gOa)+colifilt(lh,g1b,g1a);y2=colifilt(hl,gOb,gOa)+colifilt(hli,g1b,g1a);%DoevenQshiftfiltersonrows.Z=(colifilt(yl.\gOb,gOa)+coiifilt(y2.,5glb,gla)).,j%ChecksizeofZandcropasrequued[row_sizecoLsize]=size(Z);S=2*size(Yh{cunent_level-l});ifiow_sizeyS(l)%checktoseeiftliisresultneedstobecroppedfbrtherowsZ=Z(2:row_size-1,:);endifcoLsize~=S(2)%checktoseeiftliisresultneedstobecroppedfbrthecolsZ=Z(:,2:col_size・l);endifany(size(Z)S(l:2)),eiTor(fSizesofsubbandsarenotvalidforDTXVtWEIFM2f);endcunentlevel=currentlevel-1;endifcunent_level==1;Hi=c2q(Yh(cuirenUevel}(:,:,[!6]),gain_mask([l6],current_level));hl=c2q(Yh(cuirenUevel}(:,:,[34]),gain_mask([34],current_level));lili=c2q(Yli(current_level}(:,:,[25]),gain_niask([25],cunent_level));%Dooddtop-levelfiltersoncolunms.yl=colfiltei(Z,gOo)+colfilter(lh,glo);y2=colfiltei(lil,gOo)+colfilter(hli,glo);%Dooddtop-levelfiltersonrows.Z=(colfilter(y1.\g0o)+colfilter(y2.\g1o)).";endreturn%=====—==========================—=======%**********INTERNALFUNCTION**********%=====—==========================—=======fiinctionx=c2q(w.gam)%functionz=c2q(w,gain)%Scalebygainandconvertfromcomplexw(:,:,l:2)torealquad-numbersin乙%%Arrangepixelsfromtlierealandmiagpansofthe2subbands%into4separatesubiniages.%A——BReImofw(:,:,l)%II%II%C——DReImofw(:,:,2)sw=size(w);x=zeros(2*sw(l:2));ifany(w(:))&any(gaiii)sc=sqrt(O.5)*gain;P=w(:,:,l)*sc(l)+w(:,:,2)*sc(2);Q=w(:,:,l)*sc(1)-w(:,:,2)*sc⑵;tl=12size(x,l);t2=l:2:size(x,2);%Recovereachofthe4cornersofthequads.x(tl,t2)=real(P);%a=(A+C)*sc;x(tl,t2+l)=iinag(P);%b=(B+D)*sc;x(tl+l,t2)=iinag(Q);%c=(B-D)*sc;x(tl+l,t2+l)=-ieal(Q);%d=(C-A)*sc;endreturnfiinction[YLYh^Yscale]=wavexfiii2(Xjilevels,biort);%Functiontoperforman-levelDWT-2Ddecompostionona2-DmatrixX.%%[YLYh^Yscale]=dhvavexfiii2(Xailevels,biort);%%X->real1-Dsignalcolumnvector(ormatrixofvectors)%%iilevels->No.oflevelsofwaveletdecomposition%%bion->'antonini*=>Aiitonini9,7tapfilters.%legalF=>LeGall5,3tapfilters.%,neai_sym_a,=>Near-Synmietric5,7tapfilters.%,neai_sym_b,=>Near-Synmietric13,19tapfilters.%%Y1->Thelowpasssubbandfromtliefinallevel.%Yh->Acellarraycontammgthehighpasssubbandforeachlevel.%Yscale->TinsisanOPTIONALoutputaigument,thatisacellairaycontammg%thelowpasscoefficientsateveiyscale.%%%Example:[YLYli]=wavexfiii2(X.4/near_sym_b,);%performsa4-level2-DDWTontherealimageXusingthe13,19-tapfilters.%%NickKingsbury,CambridgeUniversity,May2002ifisstr(biort)%Checkiftliebioitinputisastringbiort_exist=exist([biort'.mat']);ifbiort_exist=2,%Checktoseeifthefilterexistsasa.matfileload(bioit);elseenoiXPleaseenterthecorrectnameoftheBioithogonalFilter,seehelpWAVEXFM2fordetails/);endelseenor(*PleaseenterthenameoftheBioithogonalFilterasshownmhelpWAVEXFM2.');endL=size(X);ifany(rem(L,2)),%ensuietliatXisanevenlength,thusenablingittobeextendedifneedsbe.error(*SizeofXmustbeamultipleof2');end%initialiseYh=cell(iilevels,1);ifnargout==3Yscale=cell(nlevels,1);%Tillsisonlyrequiiediftheuserspecifiesathudoutputcomponent.endLoLo=X;forlevel=1:iilevels;ifiem(size(LoLo,1)4),%ChecktoseeifheightofLoLoisdivisableby4,ifnotextend.LoLo=[LoLo(l.:);LoLo;LoLo(end/)];endifiem(size(LoLo,2),4),%ChecktoseeifheightofLoLoisdivisableby4,ifnotextend.LoLo=[LoLo(:,1)LoLoLoLo(:,end)];end%Dofiltersonrows.Lo=coldwtfilt(LoLo,h0o,0)MHi=coldwtfilt(LoLo,hloJ)「;%Dofiltersoncolumns.LoLo=coldwtfilt(LoJi0o,0).r;%LoLoYh(level)=zeros([size(LoLo)3]);Yh{level}(:,:,l)=coldwtfilt(Hi,h0o,0).';%HorizontalYh(level}(:,:,3)=coldwtfilt(Lo,hlo,l)・';%VerticalYh(level)(:,:,2)=coldwtfilt(Hi,hlo,l).';%Diagonalifnaigout=3Yscale{level}=LoLo;endendY1=LoLo;returnfijnctionZ=waveifiii2(Yl,Yh,bioit,gain_inask);%Functiontopeiibrmailn-levelDWT2-Dreconstmction.%%Z=waveifiii2(YLYh,biort,gam_inask);%%Y1->Thereallowpasssubbandfromthefiliallevel%Yh->Acellarraycontainingthecomplexhighpasssubbandforeachlevel.%%bion->'antonini'=>Aiitonini9,7tapfilters.%legal!1=>LeGall5,3tapfilters.%,neai_sym_a,=>Near-Synunetric5,7tapfilters.%,neai_sym_b,=>Near-Synmietiic13,19tapfilters.%%
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 职业技术学校迁建工程初步设计
- 城乡市政及城市更新改造项目立项报告
- 2026春小学统编版语文一年级下册第一单元测试卷含答案(三套)
- 儿童皮肤日常护理技巧
- 高中主题班会 学反诈知识筑安全防线守青春底线护家庭平安教案 高一上学期反诈教育主题班会
- 2025-2026学年外研版(2024)七年级英语下册Unit 1 The secrets of happiness Understanding ideas 教学设计
- 头颈外科三基三严考试题库及答案
- 低血压症状的预防性护理措施
- 中职生饮食营养需求
- 新能源企业安全生产法律法规岗前培训试题及答案
- 材料课题立项申报书范文
- 经胃镜鼻空肠管置入术的护理配合
- 检验科职业暴露应急处置演练脚本
- 上海辅助生殖管理办法
- 应用化工技术毕业论文
- 巡察底稿制作培训课件
- 中科大火灾调查B讲义
- 军事训练热身运动课件
- 2025国家药品监督管理局药品审评中心考试真题(附答案)
- GA/T 2182-2024信息安全技术关键信息基础设施安全测评要求
- 2026年中考英语专题复习:话题作文 10类常考练习题汇编(含答案+范文)
评论
0/150
提交评论