필터 지우기
필터 지우기

hello iam getting these type of error for my code iam appl dddt dwt algorithm to get decomposition image please help me to goet output....

조회 수: 1 (최근 30일)
clc;
clear;
close all;
R=imread('img_00155.bmp');
K=rgb2gray(R);
K(K > 255*0.62) = 255;
figure,imshow(K);
K(K < 255*0.30) = 0;
figure,imshow(K);
J = 3;
L = 8*2^(J+1);
[Faf, Fsf] = FSdoubledualfilt;
[af, sf] = doubledualfilt;
w = cplxdoubledual_f2D(double(K), J, Faf, af);
y = cplxdoubledual_i2D(w, J, Fsf, sf);
y = [y; sqrt(y(1:L,:).^2+y(L+[1:L],:).^2)];
figure,
clf
imagesc(y);
title('Complex 2-D Double-Density Dual-Tree Wavelets')
axis image
axis off
colormap(gray(128))
error is
Index in position 1 exceeds array bounds (must not exceed 240).
Error in te1 (line 21)
y = [y; sqrt(y(1:L,:).^2+y(L+[1:L],:).^2)];
>>

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 3월 17일
편집: KALYAN ACHARJYA 2019년 3월 17일
I have tried with different image, hope you facing the same issue. If not, let me know the size of y?
In the code so many nesting custom functions are there. In the following statement
y = [y; sqrt(y(1:L,:).^2+y(L+[1:L],:).^2)];
From the workspace L=128, but the size of the y is
>> size(y)
ans =
96 200
Then if the indexing is y(1:L,:) that means y(1 to 128, all colm element), where no 128 row in the y, definitely it shows error.
Note and Hints: Debug the code in simmilar way by breaking the above y statement in smaller parts, problem will be resolved.
Say
y1= sqrt(y(1:L,:).^2+y(L+[1:L],:).^2); % Break this line also in y1=y11+y12, do the debug one by one
y=[y;y1]
Hope it Helps!

추가 답변 (1개)

krishna kotha
krishna kotha 2019년 3월 17일
clc;
clear;
close all;
R=imread('img_00155.bmp');
K=rgb2gray(R);
K(K > 255*0.62) = 255;
figure,imshow(K);
K(K < 255*0.30) = 0;
figure,imshow(K);
J = 3;
L = 4*2^(J+1);
[Faf, Fsf] = FSdoubledualfilt;
[af, sf] = doubledualfilt;
w = cplxdoubledual_f2D(double(K), J, Faf, af);
y = cplxdoubledual_i2D(w, J, Fsf, sf);
y11 = y(1:L,:).^2;
y12 = y(L+[1:L],:).^2;
y1 = sqrt(y11+y12);
y = [y;y1];
figure,
clf
imagesc(y);
title('Complex 2-D Double-Density Dual-Tree Wavelets')
axis image
axis off
colormap(gray(128))
got it but output is showing like this how i get proper output
ggg.jpg

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by