Clear Filters
Clear Filters

Getting Error in code

1 view (last 30 days)
Poonam
Poonam on 14 Mar 2013
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

Answers (1)

Walter Roberson
Walter Roberson on 14 Mar 2013
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.

Products

Community Treasure Hunt

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

Start Hunting!