title: largest inscribed rectangle in arbitrary polygon
body: <p>I've worked with OpenCV Stitching for a while. Now I want to do the last step of stitching: crop image. This leads to find the largest inscribed axis-parallel rectangle in general polygon. </p>
  
  <p>I've already googled it and found some answers (<a href="https://stackoverflow.com/questions/21410449/how-do-i-crop-to-largest-interior-bounding-box-in-opencv/21479072#21479072">How do I crop to largest interior bounding box in OpenCV?</a>). The quality of output image is good despite the program run slowly (it takes 15 sec to crop image quite takes only 47 sec to stitch 36 1600x1200 pictures into 1 panorama) since the used algorithm have bad time complexity (for each point in the contour, it scan all point in same row/column). </p>
  
  <p>Any way to improve this? Thanks.</p>
  
  <p>P/S: I also found this book: </p>
  
  <blockquote>
    <p>Finding the Largest Area Axis-Parallel Rectangle in a Polygon</p>
    
    <p>Karen Daniels y Victor Milenkovicz Dan Rothx Harvard University,</p>
    
    <p>Division of Applied Sciences,</p>
    
    <p>Center for Research in Computing Technology,</p>
    
    <p>Cambridge, MA 02138.</p>
    
    <p>June 1995</p>
  </blockquote>
  
  <p>but I didn't have any idea to implement the theory into code :v </p>