how to select the object with the largest area ?
Show older comments
hi...i have i used bwconvhull to detect a certain part of the image, as you can see in the image that there are number of objects with certain centroids. what i want to do is to detect the object with the largest area(1st big one from the left) and neglect the others.
which method should i follow?
i will will be very thankful for your help.
following is the code(its very roughly written as i am still working on it. Sorry for any inconvenience in advance)
CH_objects = bwconvhull(c,'objects');
imshow(CH_objects);
title('Objects Convex Hull');
bwarea(CH_objects)
Ilabel =bwlabel(CH_objects,8);
stat = regionprops(Ilabel,'centroid');
imshow(CH_objects); hold on;
for x = 1: numel(stat)
plot(stat(x).Centroid(1),stat(x).Centroid(2),'ro');
end

Accepted Answer
More Answers (0)
Categories
Find more on ROI-Based Processing 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!