Struct RotatedRect

Struct Documentation

struct RotatedRect

RotatedRect structure.

Public Functions

RotatedRect() = default
inline RotatedRect(const Point2f &center, const Size2f &size, float angle)
inline RotatedRect(const Rect &rect, float angle = 0.f)
inline operator Rect() const
inline bool isNormalized() const
inline RotatedRect normalize(unsigned int width, unsigned int height) const

Normalize the rotated rectangle. The normalized rectangle will have center and size coordinates in range [0,1]

Returns:

Normalized rotated rectangle

inline RotatedRect denormalize(unsigned int width, unsigned int height, bool force = false) const

Denormalize the rotated rectangle. The denormalized rectangle will have center and size coordinates in range [0, width] and [0, height]

Returns:

Denormalized rotated rectangle

inline std::array<dai::Point2f, 4> getPoints() const

Get the 4 corner points of the rotated rectangle

Returns:

4 corner points

inline std::array<float, 4> getOuterRect() const

Returns the outer non-rotated rectangle

Returns:

[minx, miny, maxx, maxy]

Public Members

Point2f center
Size2f size
float angle = 0.f

degrees, increasing clockwise