0

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?!

mgh
  • 921
  • 3
  • 9
  • 37
  • Thanks for providing a picture for the white screen though I like to think most could've used there imagination. :) – T I Mar 21 '14 at 16:24

1 Answers1

0

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);
user958933
  • 21
  • 2