Struct RotatedRect
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
The class represents rotated (i.e. not up-right) rectangles on a plane.
[SuppressMessage("Design", "CA1051: Do not declare visible instance fields")]
public record struct RotatedRect : IEquatable<RotatedRect>
- Implements
- Inherited Members
Constructors
RotatedRect(Point2f, Point2f, Point2f)
Any 3 end points of the RotatedRect. They must be given in order (either clockwise or anticlockwise).
public RotatedRect(Point2f point1, Point2f point2, Point2f point3)
Parameters
RotatedRect(Point2f, Size2f, float)
Constructor
public RotatedRect(Point2f center, Size2f size, float angle)
Parameters
Fields
Angle
the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
public float Angle
Field Value
Center
the rectangle mass center
public Point2f Center
Field Value
Size
width and height of the rectangle
public Size2f Size
Field Value
Methods
BoundingRect()
returns the minimal up-right rectangle containing the rotated rectangle
public readonly Rect BoundingRect()
Returns
FromThreeVertexPoints(Point2f, Point2f, Point2f)
Any 3 end points of the RotatedRect. They must be given in order (either clockwise or anticlockwise).
public static RotatedRect FromThreeVertexPoints(Point2f point1, Point2f point2, Point2f point3)
Parameters
Returns
Points()
returns 4 vertices of the rectangle
public readonly Point2f[] Points()
Returns
- Point2f[]