Reputation: 1021
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:
but the output picture is a white screen,
why the reason?!
Upvotes: 0
Views: 2178
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