title: Detect corner point from rectangle with rounded corners
body: <p>I need to solve a problem when I am detecting rectangles with rounded corners using opencv. Basically I'm using the same code sample squares.c:</p>
  
  <pre><code>cvFindContours( gray, storage, &amp;contours, sizeof(CvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE );
  while( contours )
  {
      double area=fabs(cvContourArea(contours, CV_WHOLE_SEQ));
      if(area &lt; minimum_area || area &gt; maximum_area) {
          contours = contours-&gt;h_next;
          continue;
      }               
      result = cvApproxPoly( contours, sizeof(CvContour), storage,
          CV_POLY_APPROX_DP, cvContourPerimeter(contours)*0.05, 0 );
      if( result-&gt;total == 4 &amp;&amp;
          fabs(cvContourArea(result,CV_WHOLE_SEQ)) &gt; 1000 &amp;&amp;
          cvCheckContourConvexity(result) )
          {
  </code></pre>
  
  <p>With this code I can usually detect the image, but I need to adjust the image's perspective and for that I need to detect the corners of the image, how to do this and the image has rounded corners? The problem happens because the point I need not detected between points, as an example, I created the following image, where the black lines represent the points detected by the existing code and the blue dots are the ones I need?</p>
  
  <p><img src="https://i.stack.imgur.com/nxHFt.png" alt="enter image description here"></p>
  
  <p>Thank's for any help.</p>