find the error in the code.

code: % input is a gray image y=imread('c:\working\lena.jpg');
%x=rgb2gray(y); [Lo_D,Hi_D,Lo_R,Hi_R] = wfilters('haar'); [LL,LH,HL,HH]=dwt2(y,Lo_D,Hi_D);
figure(1),imshow(uint8(LL));title(' LL Image'); figure(2),imshow(y);title('INput Image');
dec=[... LL,LH HL,HH ... ]; LLI = imresize(LL,2,'bicubic'); LHI = imresize(LH,2,'bicubic'); HLI = imresize(HL,2,'bicubic'); HHI = imresize(HH,2,'bicubic'); image=double(y);
figure(3),imagesc(image); colormap gray;title('doubled input image');
figure(4),imagesc(LLI); colormap gray;title('iterpolated LL Image');
figure(5),imagesc(LHI); colormap gray;title('iterpolated LH Image');
figure(6),imagesc(HLI); colormap gray;title('iterpolated HL Image');
figure(7),imagesc(HHI); colormap gray;title('iterpolated HH Image');
Diff_Img=imsubtract(image,LLI);
figure(8),imagesc(Diff_Img);colormap gray;title('Difference Image');
[m,n]=size(Diff_Img);
for i=1:m
for j=1:n
ELH(i,j)=(Diff_Img(i,j)+LHI(i,j))/2;
end
end
figure(9),imagesc(ELH);colormap gray;title('Added LH Image');
for i=1:m
for j=1:n
EHL(i,j)=(Diff_Img(i,j)+HLI(i,j))/2;
end
end
figure(10),imagesc(EHL);colormap gray;title('Added HL Image');
for i=1:m
for j=1:n
EHH(i,j)=(Diff_Img(i,j)+HHI(i,j))/2;
end
end
figure(11),imagesc(EHH);colormap gray;title('Added HH Image');
%scale the image by factor of two
scale=2;
LLI2 = imresize(image,scale/2,'bicubic');
figure(12),imagesc(LLI2);colormap gray;title('Resized for IDWT input image');
LHI2 = imresize(ELH,scale/2,'bicubic');
figure(13),imagesc(LHI2);colormap gray;title('Resized LH Image');
HLI2 = imresize(EHL,scale/2,'bicubic');
figure(14),imagesc(HLI2);colormap gray;title('Resized HL Image');
HHI2 = imresize(EHH,scale/2,'bicubic');
figure(15),imagesc(HHI2);colormap gray;title('Resized HH Image');
% image=im2double(image);
out=idwt2(LLI2,LHI2,HLI2,HHI2,'haar');
figure(16),imagesc(out); colormap gray;title('output enhanced image');
%imshow(unit8(out));

 採用された回答

Walter Roberson
Walter Roberson 2013 年 5 月 4 日

0 投票

"code:" is invalid MATLAB syntax.

3 件のコメント

jiju
jiju 2013 年 5 月 5 日
can u please get me the correct code. i am doing a project on satellite image enhancement using dwt. i am new to matlab
Walter Roberson
Walter Roberson 2013 年 5 月 5 日
%code:
Question: where is your "y" value going to come from for your statement
[LL,LH,HL,HH]=dwt2(y,Lo_D,Hi_D);
??
Image Analyst
Image Analyst 2013 年 5 月 5 日
Where you get y (from imread) is commented out. Was that the problem? If not, please post your error message and read this: http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by