title: Generating a bounding box around a fragmented silhouette in matlab
body: <p>Hello I am working with matlab. I am trying to generate a bounding box around a silhouette. The problem here is that the silhouette is fragmented
  as shown here</p>
  
  <p><img src="https://i.stack.imgur.com/zE5SY.png" alt="enter image description here"></p>
  
  <p>The code i tried is</p>
  
  <pre><code>BW=bwconncomp(image);
  STATS = regionprops(BW, 'FilledArea','BoundingBox');
  </code></pre>
  
  <p>which gives me a bounding box around a part of the silhouette. I cannot use <code>dilate</code> which is the preferred morphological operation in this case as it connects the silhouette with neighboring fragments. </p>
  
  <p>Thanks in advance for the help.</p>