mgh
mgh

Reputation: 1021

apply wavelet with haar filter and reconstruction image with approximation coefficients

I want apply wavelet with haar filter on an image and then reconstruction the image with approximation coefficients. I run this code in matlab:

f = imread('pic.tif');
sX = size(f);
[cA,cH,cV,cD] = dwt2(f,'haar');
x = idwt2(cA,[],[],[],'haar',sX);
imshow(x);

This is the pic.tif:

enter image description here

but the output picture is a white screen,

why the reason?!

Upvotes: 0

Views: 2178

Answers (1)

user958933
user958933

Reputation: 21

Apparently, your image 'x' is computed correctly but not scaled when shown. Try this example, works fine.

load woman;
f = X;
sX = size(f);
figure,imagesc(f); colormap(gray);
wname = 'haar';
[cA,~,~,~] = dwt2(f,wname);
x = idwt2(cA,[],[],[],wname, sX);
figure,imagesc(x); colormap(gray);

Upvotes: 0

Related Questions