How to reconstruct image from a percentage of largest DWT coefficients in Matlab

Viewed 379

I want to reconstruct an image from a multi-level DWT transform from only 5% of the largest coefficients while setting the rest to zero. I'm not sure which coefficients I need to choose the largest 5% from? A, H, V, or D?

Here is what I've done so far:

% Read image
x = imread('app.bmp'); 

% Define wavelet name
wavelet = 'haar';
% Define wavelet decomposition level
level = 4;
% Define colormap
map = gray;
% Compute multilevel 2D wavelet decomposition
[C, S] = wavedec2(x,level,wavelet);
for i = 1:levle
    % Approximation coefficients
    A = appcoef2(C,S,'haar',i);
    % Detailed coefficients
    [H,V,D] = detcoef2('all',C,S,i);
 end

Any help would be appreciated!

1 Answers
Related