Getting Error in code

2 次查看(过去 30 天)
Poonam
Poonam 2013-3-14
function[g,nr,si,ti]=regiongrow(f,s,t)
f=double(f);
if numel(s)==1
si=f==s;
s1=s;
else
si=bwmorph(s,'shrink',inf);
j=find(si);
s1=f(j); % Logical indexing is better than find
end
ti=false(size(f));
for k=1:length(s1)
seedvalue=s1(k);
s=abs(f-seedvalue)<=t;
ti=ti|s;
end
[g,nr]=bwlabel(imreconstruct(si,ti));
Getting Error
j=find(si);
s1=f(j); % Logical indexing is better than find
Please Help

回答(1 个)

Walter Roberson
Walter Roberson 2013-3-14
That is not an error, it is advice. You can improve your code speed by using
s1 = f(si);
Note: I suspect that your code is not correct for this case, but I do not understand it well enough to be sure.

产品

Community Treasure Hunt

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

Start Hunting!

Translated by