0

When displaying wavelet transform, low pass image cA2 doesn't appear. No significant difference when using im2double in spite of double.Here below is my code:

% Read pgm file and normalize it by hitogram equalization
    J = imread('C:\baboon.pgm');
    J = histeq(J);
    figure;imshow(J);

    % Decompose and display wavelet transform result
    dwtmode('per', 'nodisp');

    I1 = double(J); % I1 = im2double(J);
    [C,S] = wavedec2(I1, 2, 'db1');

    ii = 1; jj = prod(S(1,:));
    cA2 = reshape(C(ii:jj),S(1,:));

    ii = jj+1; jj = ii + prod(S(2,:)) - 1;
    cH2 = reshape(C(ii:jj),S(2,:));

    ii = jj+1; jj = ii + prod(S(2,:)) - 1;
    cV2 = reshape(C(ii:jj),S(2,:));

    ii = jj+1; jj = ii + prod(S(2,:)) - 1;
    cD2 = reshape(C(ii:jj),S(2,:));

    ii = jj+1; jj = ii + prod(S(3,:)) - 1;
    cH1 = reshape(C(ii:jj),S(3,:));

    ii = jj+1; jj = ii + prod(S(3,:)) - 1;
    cV1 = reshape(C(ii:jj),S(3,:));

    ii = jj+1; jj = ii + prod(S(3,:)) - 1;
    cD1 = reshape(C(ii:jj),S(3,:));

    figure;imshow([[cA2,cH2; cV2,cD2],cH1;cV1,cD1]); 

baboon.pgm wavelet transformed: wave = 'db1', level = 2

PingPong
  • 11
  • 3

0 Answers0