plz help me sorting the error...
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
the code i wrote is:
S(y,x)=0.125*f(y,mod(x-p-2,N)+1)+...
0.375*f(y,x)+...
0.375*f(y,mod(x+p,N)+1)+...
0.125*f(y,mod(x+p*2+1,N)+...
0.125*f(mod(y-p-2,N)+1,x)+...
0.375*f(y,x)+...
0.375*f(mod(y+p,N)+1,x)+...
0.125*f(mod(y+p*2+1,N)+1,x));
here f() corresponds to my input image
error shown is:
Attempted to access f(1,169.125); index must be a positive integer or logical.
Error in dyadicAnalysis (line 29)
S(y,x)=0.125*f(y,mod(x-p-2,N)+1)+...
here p=2^j-1; where j is a loop variable starts from 1 and end at log(N)/log(2)
N=sizef(1), sizef=size(f);
can anybody tell me what is the problem in it? i've tried floor but the error remains the same
채택된 답변
Image Analyst
2013년 4월 13일
0 개 추천
There is no 169.125'th element of a matrix. You can access element # 169 or 170, but if you want to get 169.125 then you'll have to do interpolation.
댓글 수: 13
angel
2013년 4월 13일
sir hoew can i get the 169 or 170 value?
i used floor but it didnt work shows the same error....
what changes should i do in the above code corresponding to s(y,x)?
S(y,x)=0.125*f(y,mod(x-p-2,N)+1)+...
0.375*f(y,x)+...
0.375*f(y,mod(x+p,N)+1)+...
0.125*f(y,mod(x+p*2+1,N)+...
0.125*f(mod(y-p-2,N)+1,x)+...
0.375*f(y,x)+...
0.375*f(mod(y+p,N)+1,x)+...
0.125*f(mod(y+p*2+1,N)+1,x));
Image Analyst
2013년 4월 13일
Explain in words what you're attempting to do with this code. Right now it just looks like alphabet soup to me.
angel
2013년 4월 13일
function [wx wy]=dwt2(f)
clc;
close all;
f=rgb2gray(imread('tank.jpg'));
sizeF=size(f);
N=sizeF(1);
J=log(N)/log(2);
wx=zeros(N,N,J+1);
wy=zeros(N,N,J+1);
lambdaTable=[0.15 1.12 1.03 1.01];
figure;
imshow(f);
title('original signal');
S=zeros(N,N);
figure;
j=0;
while j<J
p=2^j-1;
lambda=1;
if j<4
lambda=lambdaTable(j+1);
end
for y=1:N
for x=1:N
wx(y,x,j+1)=(-2*f(y,x)+...
2*f(y,mod(x+p,N)+1))/lambda;
wx(y,x,j+1)=(-2*f(y,x)+...
2*f(mod(y+p,N)+1,x))/lambda;
S(y,x)=0.125*f(y,mod(x-p-2,N)+1)+...
0.375*f(y,x)+...
0.375*f(y,mod(x+p,N)+1)+...
0.125*f(y,mod(x+p*2+1,N)+...
0.125*f(mod(y-p-2,N)+1,x)+...
0.375*f(y,x)+...
0.375*f(mod(y+p,N)+1,x)+...
0.125*f(mod(y+p*2+1,N)+1,x));
end
end
subplot(J,2,j*2+1);
imshow(wx(:,:,j+1),[min(min(wx(:,:,j+1))) max(max(wx(:,:,j+1)))]);
subplot(J,2,j*2+2);
imshow(wy(:,:,j+1),[min(min(wy(:,:,j+1))) max(max(wy(:,:,j+1)))]);
f=S;
j=j+1;
end
%w(:,:,J+1)=S; figure; imshow(S,256);
this is my code sir for dyadic wavelet transform for 2D image...
pammy
2013년 4월 13일
sir where should i adjust the function floor so that it can work properly. the problem is in s(y,x)
reply soon
Image Analyst
2013년 4월 13일
angel, I don't have the wavelet toolbox so I can't help with wavelets. Plus you didn't put in an explanation like I requested. Do you know how to use the debugger to step through your code and examine variables? Please see : http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/ if you aren't using debugging skills right now.
pammy, I don't know. Are you talking about the same code as angel? If so, you'll have to follow up with angel. Are you and angel working together, or have the same assignment in the same class? It's not tagged as homework, so probably not. Do you work for the same company then?
sir i've used the dubugger the above error i sorted it out but the error given below i didnt
Error using imshow>preParseInputs (line 385)
The syntax IMSHOW(I,N) has been removed.
Error in imshow (line 194)
varargin_translated = preParseInputs(varargin{:});
Error in dyadicAnalysis (line 56)
imshow(S,256);
385 error(message('images:removed:syntaxNoReplacement','IMSHOW(I,N)'))
K>>
the following is my code
function [wx wy]=dwt2(f)
clc;
close all;
f=rgb2gray(imread('tank.jpg'));
sizeF=size(f);
N=sizeF(1);
J=ceil(log(N)/log(2));
wx=zeros(N,N,J+1);
wy=zeros(N,N,J+1);
lambdaTable=[0.15 1.12 1.03 1.01];
figure;
imshow(f);
title('original signal');
S=zeros(N,N);
figure;
j=0;
while j<J
p=2^j-1;
lambda=1;
if j<4
lambda=lambdaTable(j+1);
end
for y=1:N
for x=1:N
wx(y,x,j+1)=(-2*f(y,x)+...
2*f(y,mod(x+p,N)+1))/lambda;
wx(y,x,j+1)=(-2*f(y,x)+...
2*f(mod(y+p,N)+1,x))/lambda;
S(y,x)=0.125*f(y,mod(x-p-2,N)+1)+...
0.375*f(y,x)+...
0.375*f(y,mod(x+p,N)+1)+...
0.125*f(y,mod(x+p*2+1,N)+1)+...
0.125*f(mod(y-p-2,N)+1,x)+...
0.375*f(y,x)+...
0.375*f(mod(y+p,N)+1,x)+...
0.125*f(mod(y+p*2+1,N)+1,x);
end
end
dbstop if error
subplot(J,2,j*2+1);
imshow(wx(:,:,j+1),[min(min(wx(:,:,j+1))) max(max(wx(:,:,j+1)))]);
subplot(J,2,j*2+2); % showing error
imshow(wy(:,:,j+1),[min(min(wy(:,:,j+1))) max(max(wy(:,:,j+1)))]);
f=S;
j=j+1;
end
%w(:,:,J+1)=S; figure; imshow(S,256);
problem in the imshow function plz tell me what should i modify in the code so that my code can work fine
reply soon
Why not just use
imshow(wy(:,:,j+1), []);
You don't need to calculate the min and max - it will do it for you.
angel
2013년 4월 15일
the problem is in the last line sir
imshow(S,256)
Error using imshow>preParseInputs (line 385)
The syntax IMSHOW(I,N) has been removed.
Error in imshow (line 194)
varargin_translated = preParseInputs(varargin{:});
Error in dyadicAnalysis (line 56)
imshow(S,256);
385 error(message('images:removed:syntaxNoReplacement','IMSHOW(I,N)'))
K>>
Modify your code to
imshow(S, [])
angel
2013년 4월 15일
thank u so much sir.......
Aqsa Ali
2017년 5월 8일
Error using imshow>preParseInputs (line 425) IMSHOW expected at least 1 input argument but was called instead with 0 input arguments.
Error in imshow (line 214) varargin_translated = preParseInputs(varargin{:}); while running the code i am facing this error please help me in sorting out this error
Walter Roberson
2017년 5월 8일
Aqsa Ali: which code are you using? Please post it.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Install Products에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
