Detailed cv2.minAreaRect function

1. Function of cv2.minAreaRect function: return the smallest circumscribed rectangle of a trapezoid

Two, opencv4.2 version:

        1. Input: Polygon contour points

        2. Output: coordinates x, y of the center point of the smallest circumscribed rectangle, width and height w, h, angle anlge

3. Angle explanation:

        The side that first coincides with the counterclockwise rotation of the x-axis is w. At this time, the angle of the counterclockwise rotation of the x-axis is -angle, Θ: the angle between the counterclockwise rotation of the x-axis and width. Since the origin is located in the upper left corner of the image, counterclockwise The rotation angle is negative, Θ∈[-90, 0)

-----------------------------------------------------------------------------------------------------------------------

In addition, the rotated rectangle has another long side notation as follows:

 

추천

출처blog.csdn.net/pangxing6491/article/details/127905953