title: How to find and draw largest rectangle inside contour area?
body: <p>i want to compare an image with specific pixel using </p>
  
  <pre><code>(score, diff) = compare_ssim(grayA[y:y+h, x:x+w], grayB[y:y+h, x:x+w], full=True)
  </code></pre>
  
  <p>But that function only support rectangle ROI. And my ROI is a contour. 
  To compare that i need largest rectangle inside the contour. How to find largest rectangle inside contour area ?</p>
  
  <p>Sample image 
  <a href="https://i.stack.imgur.com/zhv1C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zhv1C.png" alt="enter image description here"></a></p>