Problem with multiplying labeled images in for loop.
Show older comments

Hello, I have problem with displying one image of several objects that was earlier labeled. Here's a code:
close all
clear all
Orginal_img=imread('Orginal_img.png');
Label_img = bwlabel((Orginal_img),8);
disp(' ')
disp(['Number of objects in picture: ' int2str(max(max(Label_img)))]);
%it's 27 objects
disp(' ')
figure
imshow(Label_img);
title('Obraz ety');
i=1;
a=1:i:27;
for object_nr=a
Object_img = Label_img == object_nr;
FD=imFeretDiameter(Object_img);
disp(['Feret Diameter: ' num2str(FD)]);
if FD>120
All_objects_img=immultiply(imcomplement(Object_img),imcomplement(Object_img+1));
figure
imshow(All_objects_img,'InitialMagnification','fit')
title('All objects imgage')
else
end
end
After labeling I callculated Feret Diameter to remove objects that are not thick and long enough. My problem is that i want to display now all other objects (that were not removed) in one image. I know that I have to multiply all pictures that are consistent with condition (FD>120) but it doesn't work. Please help and thank you in advance. Here's a picture (Orginal_img)
Accepted Answer
More Answers (0)
Categories
Find more on Region and Image Properties in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!