2017-12-16 8 views
1

私はMatlab R2017aを使って画像に整数Haarウェーブレット変換を実装しています。 Haar変換は正常に実行されます。画像の逆変換は再構成画像を示さず、代わりに白色画像を示す。コードをご覧ください。私もスクリーンショットをつけています。Matlabウェーブレット逆白img

おかげenter image description here

% Load the image of a cameraman. 
im = imread('cameraman.tif'); 
figure,imshow(im); 
title('Image'); 
%% 
% Obtain the 2-D Haar transform using the |'integer'| flag. 
[a,h,v,d]=haart2(im,1,'integer'); 
ff = uint8([a,h;v,d]); 
figure,imshow(ff); 
title('Image2'); 
%% 
% Reconstruct the image using the inverse 2-D Haar transform and view the 
% image. 
xrec = ihaart2(a,h,v,d,'integer'); 
figure,imshow(xrec); 
title('Decrypted Image'); 
%imagesc(xrec) 
%% 

答えて

1
xrec = uint8(ihaart2(a,h,v,d,'integer')); 
figure,imshow(xrec); 
title('Decrypted Image'); 

か、あるいは:

xrec = ihaart2(a,h,v,d,'integer'); 
figure,imshow(xrec,[]); 
title('Decrypted Image'); 

あなたxrec変数はuint8値の形式ではなく根本的なタイプとしてdoubleしていました。これが問題の原因でした。

+0

ありがとうございました。 – user3819984

関連する問題