|
Hi I use this for a dwt decomp
[C,S]=wavedec2(X,3,'db4');
cA3=appcoef2(C,S,'db4',3);
cA2=appcoef2(C,S,'db4',2);
cA1=appcoef2(C,S,'db4',1);
[cH3,cV3,cD3] = detcoef2('all',C,S,3);
[cH2,cV2,cD2] = detcoef2('all',C,S,2);
[cH1,cV1,cD1] = detcoef2('all',C,S,1);
I perform some process onthe detail coefficients in the 3 levels then i need to recover my original image back yousing this equation
img= waverec2(C,S,'db4');
so i reshape every coeff matrix like
cH3 = (cH3, 1, m*n)
then i form a vector for every level decomposition
V1 = [cA1, cH1, cV1, cD1]
V2 =
V3 =
then i restore it back into the C at its copistion
C(1:len3) = V3;
C(len3+1 : len3+len2) = V2;
C(len3+len2+1:end) = V1;
but i performed a little test before doing the above step i found that when i add the length of those 3 vecotrs it's bigger than the size of C ? what's logicially wrong in here wrong in here?
isn't
C = [ A(N) | H(N) | V(N) | D(N) | ... H(N-1) | V(N-1) | D(N-1) | ... | H(1) | V(1) | D(1) ].
|