Index in position 3 exceeds array bounds (must not exceed 3) in horizontal (i,ma,j)=c​onsistency​(i+1,ma,j)​*consisten​cy(i,ma,j)​; what is mean this error ?

1 view (last 30 days)
local=rangefilt(cb_component,true(3));%local range of pixel intensity
reshape(local,[512,3]);
mean=mean2(double(local));%mean
sdImage = stdfilt(local, true(3));%standard devieation
Variance_final = mean2(var(double(local)));%varience
%sdImage = stdfilt(cb_component, true(3));% Now sdImage is the std dev within a 3-by-3 window around each pixel.
variace=var(double(local)) ;
[mr,ma,mc]= size(local);
consistency=zeros(mr,ma,mc);
for i=1:1:mr
for j=1:1:mc
consistency(i,ma,j)= (local(i,ma,j)-mean )/(Variance_final+1);
end
end
%horizontial direction feature
horiz=zeros(mr,ma,mc);
for i=1:1:mc
for j=1:1:mr
horiz(i,ma,j)=consistency(i+1,ma,j)*consistency(i,ma,j);
end
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!