title: Crop and Select Only the Detected Region from an Image in Python
body: <p>I have used Tensorflow Object Detection API to detect hands from images. By using the provided sample code (object_detection_tutorial.ipynb) I have been able to draw bounding boxes on images. Is there any way to select only the detected region (which is inside a bounding box) and get it as an image?</p>
  <p>For example,</p>
  <h3>Sample Input Image</h3>
  <p><a href="https://i.stack.imgur.com/nOUKK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nOUKK.jpg" alt="enter image description here" /></a></p>
  <h3>Tensorflow Output</h3>
  <p><a href="https://i.stack.imgur.com/EpMqu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EpMqu.png" alt="enter image description here" /></a></p>
  <h3>What I Want</h3>
  <p><a href="https://i.stack.imgur.com/Bfogk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bfogk.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/0PfbE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0PfbE.png" alt="enter image description here" /></a></p>
  <p>Object detection API sample code can be found here. <a href="https://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb" rel="nofollow noreferrer">https://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb</a></p>
  <p>Any help would be highly appreciated!</p>