Table of Contents

Struct RotatedRect

Namespace
Emgu.CV.Structure
Assembly
Emgu.CV.dll

The class represents rotated (i.e. not up-right) rectangles on a plane.

public struct RotatedRect : IConvexPolygonF, IEquatable<RotatedRect>
Implements
Inherited Members

Constructors

RotatedRect(PointF, SizeF, float)

Create a RotatedRect structure with the specific parameters

public RotatedRect(PointF center, SizeF size, float angle)

Parameters

center PointF

The rectangle mass center

size SizeF

Width and height of the rectangle

angle float

The rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.

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 PointF Center

Field Value

PointF

Size

Width and height of the rectangle

public SizeF Size

Field Value

SizeF

Properties

Empty

Represent an uninitialized RotatedRect

public static RotatedRect Empty { get; }

Property Value

RotatedRect

Methods

Equals(RotatedRect)

Returns true if the two box are equal

public bool Equals(RotatedRect other)

Parameters

other RotatedRect

The other box to compare with

Returns

bool

True if two boxes are equal

GetVertices()

Get the 4 vertices of this Box.

public PointF[] GetVertices()

Returns

PointF[]

The vertices of this RotatedRect

MinAreaRect()

Get the minimum enclosing rectangle for this Box

public Rectangle MinAreaRect()

Returns

Rectangle

The minimum enclosing rectangle for this Box

Offset(int, int)

Shift the box by the specific amount

public void Offset(int x, int y)

Parameters

x int

The x value to be offset

y int

The y value to be offset

Operators

implicit operator RotatedRect(RectangleF)

Convert a RectangleF to RotatedRect

public static implicit operator RotatedRect(RectangleF rectangle)

Parameters

rectangle RectangleF

The rectangle

Returns

RotatedRect

The equivalent RotatedRect