?? hvsynthesis.m
字號:
% wavelet synthesis of a image region% f0: synthesis lowpass f1: synthesis highpass% Ain: input image [M x N]% [sr, sc] and [er, ec] specify the rect region of Ain% to be decomposed. % diret: horizontal =1 , vertical=-1; % A: output images, only the region is changed% function [A]=synthesis(f0, f1, Ain, sr, sc, er, ec, diret)% 07/08/99function [A]=synthesis(f0, f1, Ain, sr, sc, er, ec, diret)RRM=(sr+er-1)/2;CCM=(sc+ec-1)/2;if (diret < 0), disp(' vertical synthesis....'); clen=(er-sr)+1; w1=zeros(clen,1); w2=zeros(clen,1); for cn=sc:ec, w1(2:2:clen)=0; w1(1:2:clen)=Ain(sr:RRM, cn); w2(1:2:clen)=0; w2(2:2:clen)=Ain((RRM+1):er, cn); Ain(sr:er, cn)=(mfilter(f0,w1)+mfilter(f1,w2)); endelse disp(' horizontal synthesis....'); rlen=ec-sc+1; w1=zeros(1, rlen); w2=zeros(1, rlen); for rn=sr:er, w1(2:2:rlen)=0; w1(1:2:rlen)=Ain(rn, sc:CCM); w2(1:2:rlen)=0; w2(2:2:rlen)=Ain(rn, (CCM+1):ec); Ain(rn, sc:ec)=(mfilter(f0,w1)+mfilter(f1,w2)); endendA=Ain;return;%*---------------------------------function [y]=mfilter(B, x)len=length(x);y=zeros(1, len);[RN CN]=size(x);if CN==1, x=x';endflen=length(B);xe=[ fliplr(x(2:len)), x, fliplr( x(1:(len-1)))];dd=(flen-1)/2;yt=filter(B,1, xe);y=yt( (len+dd):(len+len-1+dd));if CN==1, y=y';endreturn;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -