I need to solve the problem when I detect rounded rectangles using opencv. I mainly use the same squares.c code example:
cvFindContours( gray, storage, &contours, sizeof(CvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE ); while( contours ) { double area=fabs(cvContourArea(contours, CV_WHOLE_SEQ)); if(area < minimum_area || area > maximum_area) { contours = contours->h_next; continue; } result = cvApproxPoly( contours, sizeof(CvContour), storage, CV_POLY_APPROX_DP, cvContourPerimeter(contours)*0.05, 0 ); if( result->total == 4 && fabs(cvContourArea(result,CV_WHOLE_SEQ)) > 1000 && cvCheckContourConvexity(result) ) {
With this code, I can usually determine the image, but I need to adjust the perspective of the image, and for this I need to determine the angles of the image, how to do it, and the image has rounded corners? The problem arises due to the fact that a point that I did not find between the points, as an example, I created the following image, where the black lines represent the points detected by the existing code, and the blue points are the ones I need?

Thanks for any help.
Ricardo
source share