MATLAB: Image type? dwt2 problem? I don’t know! the size is incorrect!

dwt2

I perform a dwt2 on bmp image with in 5 levels and with filter bior4.4 but always doesn't have the same image size? since the original image size 512*512 =262144 but I get more than this number for the image …the image is greyscale (black& white) why this happening…. the steps:
X=imread('baboon.bmp'); [C,S] = wavedec2(X,5,'bior4.4'); len=length(C);
and thank you in advance…

Best Answer

Hi Nizar, You are likely using the default extension mode for the DWT. Use the periodization mode.
dwtmode('per');
[C,S] = wavedec2(X,5,'bior4.4');
len=length(C);
Hope that helps,
Wayne