title: How to find coordinates of largest rectangle in OpenCV?
body: <p>I have the following code:</p>
  
  <pre><code>    findContours( src, contours, hierarchy, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE );
  
      Mat drawing = Mat::zeros( src.size(), CV_8UC3 );
  
      double largest_area = 0;
  
      for( int i = 0; i &lt; contours.size(); i++) {  // get the largest contour
          area = fabs( contourArea( contours[i] ) );
          if( area &gt;= largest_area ){
              largest_area = area;
              largest_contours.clear(); 
              largest_contours.push_back( contours[i] );
          }
      }
  
      if( largest_area &gt;= 3000 ){   // draw the largest contour if exceeded minimum largest area 
          drawContours( drawing, largest_contours, -1, Scalar(0,0,255), 2 );
      }
  </code></pre>
  
  <p>... which produces the following output image:</p>
  
  <p><img src="https://i.stack.imgur.com/Evoxk.png" alt="enter image description here"></p>
  
  <p>I want to get coordinates of four points (marked with green), is that possible?</p>