Matlab wavedec2:低通图像不会出现

时间:2015-11-16 12:14:22

标签: matlab image-processing pgm wavelet-transform

显示小波变换时,不会出现低通图像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 wavelet transformed: wave = 'db1', level = 2

0 个答案:

没有答案