Table of Contents

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

point1 Point2f
point2 Point2f
point3 Point2f

RotatedRect(Point2f, Size2f, float)

Constructor

public RotatedRect(Point2f center, Size2f size, float angle)

Parameters

center Point2f
size Size2f
angle float

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

float

Center

the rectangle mass center

public Point2f Center

Field Value

Point2f

Size

width and height of the rectangle

public Size2f Size

Field Value

Size2f

Methods

BoundingRect()

returns the minimal up-right rectangle containing the rotated rectangle

public readonly Rect BoundingRect()

Returns

Rect

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

point1 Point2f
point2 Point2f
point3 Point2f

Returns

RotatedRect

Points()

returns 4 vertices of the rectangle

public readonly Point2f[] Points()

Returns

Point2f[]