0

I just had my theory of wavelets complete and decided to test using matlab. However, I am not able to interpret the result of dwt2 and idwt2. When I used imshow to display my results, I did not get any image.

    [ca,ch,cv,cd] = dwt2(I_gray,'haar');
    I_regray = idwt2(ca,ch,cv,cd,'haar');
    figure(1);
    imshow(I_regray);
    figure(2);
    imshow(ca);

Both the figures are blank. I am not able to view my downscaled image as well. Could you please tell me the right way to view it? The matlab help speaks about some way of plotting. Am not getting it clear though. Please help me. My apologies if the question is rudimentary. Thanks in advance.

Lakshmi Narayanan
  • 5,220
  • 13
  • 50
  • 92
  • 2
    The problem is most likely with the type of your data variable. If it's type double you may have a problem with the range of values. imshow expects double values to have 0-1 range – Buck Thorn Sep 24 '13 at 21:54

1 Answers1

0

You should read your image and convert it to double. Then call the dwt2.

The results of dwt2 will be in double, so check the range of those results. If you have something outside of [0,1] range then you'll need to convert it to uint8.

Helder
  • 482
  • 5
  • 18