title: Obtain rectangle ROI from object/mask opencv
body: <p>I aim to obtain a ROI from a <code>Mat</code>. This Mat <strong>is expected to have a expected convex silhouette inside</strong> it. As example:</p>
  
  <p><img src="https://i.stack.imgur.com/KEVqZ.png" alt="enter image description here"></p>
  
  <p>Being the red rectangle the ROI I want to obtain, in order <em>to cut this part of the image</em> and work only with it.</p>
  
  <p>I've tried using a mask from this silhouette; create a new Mat, and then copy it using the mask, but this doesn't work since I want to reduce my image size, not only to have the data of this ROI:</p>
  
  <p><img src="https://i.stack.imgur.com/WNH6Z.png" alt="enter image description here"></p>
  
  <p>It also has the another problem: found another little areas in the mask. This would be avoided if I could have only the ROI I want.</p>
  
  <p>Any ideas about how to do it? I wonder if I can get the ROI from the mask I've used here, and calculate the ROI around the biggest area or something like that, but don't know if that's possible or how to face to code it.</p>
  
  <p>Thank you in advance</p>