I detected a rectangle by:
- finding contours
- approximating polygon
then I tried to find the corners of the rectangle as:
imgPoints[0]=contours_poly[i][0];
imgPoints[1]=contours_poly[i][1];
imgPoints[3]=contours_poly[i][3];
imgPoints[2]=contours_poly[i][2];
I want to order these points in a predefined order due to a reference point. Let's say I want to start at point 0, how can I order the previous points?