title: Bounding box using MATLAB for the image
body: <p>I am trying to draw a bounding box around the white blob in the image below:  </p>
  
  <p><img src="https://i.stack.imgur.com/XBpOf.jpg" alt="enter image description here"></p>
  
  <p>I did like this: </p>
  
  <pre><code>bw = imread('box.jpg');
  bw=im2bw(bw);
  imshow(bw)
  L = bwlabel(bw);
  s = regionprops(L, 'Area', 'BoundingBox');
  s(1);
  area_values = [s.Area];
  idx = find((100 &lt;= area_values) &amp; (area_values &lt;= 1000)); % list of all the objects   
  
  %whose area is between 100 and 1000
  
  bw2 = ismember(L, idx); %construct a binary image containing all the objects whose 
  
  %area is between 100 and 1000 by passing L and idx to ismember. 
  
  imshow(bw2)
  </code></pre>
  
  <p>The output bw2, so far is: 
  <img src="https://i.stack.imgur.com/1if3w.jpg" alt="enter image description here"> </p>
  
  <p>Can someone one tell me how to draw a bounding box around this blob(white)?</p>
  
  <p><strong>Update</strong>
  Wajih's answer actually accurately solved the issue. </p>