title: how to select the object with the largest area?
body: <p>I have used <code>bwconvhull</code> to detect a certain part of the image, as you can see in the image, 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. </p>
  
  <p>Which method should I follow?</p>
  
  <p>I will be very thankful for your help. The following is the code (it's very roughly written as I am still working on it. Sorry for any inconvenience in advance)</p>
  
  <pre><code>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
  </code></pre>
  
  <p><a href="https://www.imageshack.com/i/n6qfzbj" rel="nofollow noreferrer">Here</a> is the image.</p>