0

显示小波变换时,不出现低通图像 cA2。尽管使用了double ,但在使用im2double时没有显着差异。下面是我的代码:

% 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 小波变换:wave = 'db1', level = 2

4

0 回答 0