title: Java OpenCV deskewing a contour
body: <p>I have made some progress detecting a specific kind of object. Actually a card, just like any other in your wallet. </p>
  
  <p>Now I'm stuck with deskewing the photo. See:</p>
  
  <p><img src="https://i.stack.imgur.com/eUIfT.png" alt="enter image description here"></p>
  
  <p>The blue (rounded) rectangle represents the detected contour.
  The purple rotate rectangle represents a <code>RotatedRect</code> extracted from the detected contour.
  The green line is just the bounding box.</p>
  
  <p>Well I need neither of those rectangles. The rectangles both have 90 degree corners. Which won't get me the perspective.</p>
  
  <p><strong>My question:</strong></p>
  
  <p>How can I get as accurate as possible all <strong>quadrangle</strong> corners from a contour?</p>