I am a novice to wavelet transform. I am trying to use wavelet transform to decompose the images and then modify the co-efficients,such that only the first 15 co-efficients are retained in the final image,say for image compression( never mind the quality for now).
I need help to proceed further on this. My code so far looks like this -
% gray_image is my inout image%
[C,S] = wavedec2(gray_image,2,'haar');
A1 = appcoef2(C,S,'haar',1);
A2 = appcoef2(C,S,'haar',2);
[H1,V1,D1] = detcoef2('all',C,S,1);
[H2,V2,D2] = detcoef2('all',C,S,2);
I have the approx image for level 1 and 2, and the detail components of levels 1 and 2. If i need to retain the first 15 co-efficients of both approx and detail and then recombine them using waverec2(), how do I go about it?
Any help is appreciated.
Thanks in advance.