필터 지우기
필터 지우기

What is the comments given in this IWT code?

조회 수: 2 (최근 30일)
Pooja
Pooja 2013년 3월 4일
댓글: Walter Roberson 2021년 3월 2일
Hello,
I am not able to read and understand the comments given in the following code.I got this from net and also not able to understand steps followed in this code.Please help me in this regard.
function y=IWT(x)
x=imread('lenna.gif');
subplot(2,3,1);imshow(x);title('ԭͼÏñ');
x=double(x);
y=x;
[hp,lp]=size(x);
hc=hp/2; lc=lp/2;
%----------------ÆæżÁÐÖØÅÅ
for n=1:lc
j=n*2-1;
y(:,n)=x(:,j);
y(:,lc+n)=x(:,j+1);
end
subplot(2,3,2);imshow(uint8(y)); title('ÆæżÁÐÖØÅÅ');
%-----------------ÐÐÖØÅÅ
for n=1:lc
y(:,lc+n)=y(:,lc+n)-y(:,n);
end
for n=1:lc
k=y(:,lc+n)/2-mod(y(:,lc+n)/2,1);
y(:,n)=y(:,n)+k;
end
subplot(2,3,3);imshow(uint8(y));title('ÐÐÖØÅÅ');
%---------------ÆæżÐÐÖØÅÅ
x=y;
for n=1:hc
j=n*2-1;
y(n,:)=x(j,:);
y(hc+n,:)=x(j+1,:);
end
subplot(2,3,4);imshow(uint8(y));title('ÆæżÐÐÖØÅÅ');
%---------------ÁÐÖØÅÅ
for n=1:hc
y(hc+n,:)=y(hc+n,:)-y(n,:);
end
for n=1:hc
k=y(hc+n,:)/2-mod(y(hc+n,:)/2,1);
y(n,:)=y(n,:)+k;
end
subplot(2,3,5);imshow(uint8(y));title('ÁÐÖØÅÅ');
%----------------Öظ´ÉÏÊö²½Ö裬½øÐжþ´ÎѹËõ
for n=1:lc
j=n*2-1;
y(:,n)=x(:,j);
y(:,lc+n)=x(:,j+1);
end
for n=1:lc
y(:,lc+n)=y(:,lc+n)-y(:,n);
end
for n=1:lc
k=y(:,lc+n)/2-mod(y(:,lc+n)/2,1);
y(:,n)=y(:,n)+k;
end
x=y;
for n=1:hc
j=n*2-1;
y(n,:)=x(j,:);
y(hc+n,:)=x(j+1,:);
end
for n=1:hc
y(hc+n,:)=y(hc+n,:)-y(n,:);
end
for n=1:hc
k=y(hc+n,:)/2-mod(y(hc+n,:)/2,1);
y(n,:)=y(n,:)+k;
end
%----------------ÔÙ½øÐÐÆæżÐÐÖØÅźÍÁÐÖØÅÅ
x=y;
for n=1:hc
j=n*2-1;
y(n,:)=x(j,:);
y(hc+n,:)=x(j+1,:);
end
for n=1:hc
y(hc+n,:)=y(hc+n,:)-y(n,:);
end
for n=1:hc
k=y(hc+n,:)/2-mod(y(hc+n,:)/2,1);
y(n,:)=y(n,:)+k;
end
subplot(2,3,6);imshow(uint8(y));title('¶þ´ÎѹËõ ');
  댓글 수: 5
rizky alvarez
rizky alvarez 2021년 2월 26일
hi sara and nur, so do i, i m still not understand waht the meaning on this code, have find the solution what is the meaning on this code ?
Walter Roberson
Walter Roberson 2021년 3월 2일
Have you managed to find an original source for the code? (Something other than this post) ?

댓글을 달려면 로그인하십시오.

답변 (2개)

Wayne King
Wayne King 2013년 3월 4일
편집: Wayne King 2013년 3월 4일
I think you have to inquire with the individuals that provided this code.
Do you have the MathWorks Wavelet Toolbox? If so you can implement both the 2-D DWT and the inverse DWT using that Toolbox.
  댓글 수: 1
Pooja
Pooja 2013년 3월 4일
편집: Walter Roberson 2017년 8월 12일
Hello,
There is no identity of the author.`when i gave code like this i got o/p in this form
x=imread('lena.bmp');
y=dwt2(x)
o/p -Error in ==> Untitled5 at 2
y=dwt2(x)
??? Error using ==> dwt2 at 55
Not enough input arguments.
What is the problem?

댓글을 달려면 로그인하십시오.


Wayne King
Wayne King 2013년 3월 4일
Have you read the help for dwt2? You need to specify a wavelet name (or the filters) to use.
It's better to use wavedec2 because you can specify the level that you want.
wavedec2 uses dwt2.m internally but handles the iteration for you.
imdata = imread('ngc6543a.jpg');
[C,S] = wavedec2(imdata,3,'bior3.5');
  댓글 수: 4
Pooja
Pooja 2013년 5월 6일
how to show the image after this step [C,S] = wavedec2(imdata,3,'bior3.5');
I wanted to show the image with three level decompostion.
Deepika
Deepika 2013년 10월 20일
Hello Pooja, Mr. Wayne King is right. After that you should write imshow(). Then, you will get the what you want.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Signal Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by