Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
s = regionprops(BW5, I, {'Area','Centroid','PixelValues','BoundingBox'});
figure, imshow(BW5);
title('Standard Deviation of Regions');
hold on
for k = 1 : numObj
    s(k).StandardDeviation = std(double(s(k).PixelValues));
    text(s(k).Centroid(1),s(k).Centroid(2), ...
        sprintf('%2.1f', s(k).StandardDeviation), ...
        'EdgeColor','b','Color','r');
end
for k = 1 : numObj
    S(k)=s(k).Area;

   text(S(1),S(2), ...
       sprintf('%d', S(k)), ...
       'EdgeColor','b','Color','r');


end
hold off


when I run the code, it shows error in
VB
text(S(1),S(2), ...
      sprintf('%d', S(k)), ...
      'EdgeColor','b','Color','r');


I think most probably I type it in a wrong way.
Can anyone help me correct it?
Thanks.

This code is basically find the area of each objects that had been detected.
Posted
Comments
Legor 5-May-14 4:22am    
Whats the error exactly. Please allways provide the error message.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900