Create a rotated rectangle from 3 points
rrect = cv.RotatedRect.from3points(pt1, pt2, pt3)
Input
- pt1, pt2, pt3 Any 3 end points
[x,y]
of the
rotated rectangle. They must be given in order (either
clockwise or anticlockwise). By definition, the two sides
formed by these three points must be perpendicular.
Output
- rrect output rotated rectangle. A structure with the
following fields:
- center The rectangle mass center
[x,y]
.
- size Width and height of the rectangle
[w,h]
.
- angle The rotation angle in a clockwise direction. When
the angle is 0, 90, 180, 270 etc., the rectangle becomes an
up-right rectangle.