Class OpenCVRotatedRectangleWrapper

  • All Implemented Interfaces:
    RectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>, RotatedRectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>

    public class OpenCVRotatedRectangleWrapper
    extends Object
    implements RotatedRectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>

    Wraps RotatedRect

    Since:
    1.0
    Author:
    Andreas Pointner
    • Constructor Detail

      • OpenCVRotatedRectangleWrapper

        public OpenCVRotatedRectangleWrapper​(org.opencv.core.RotatedRect rotatedRect)
        Parameters:
        rotatedRect - the wrapped rotated rectangle
    • Method Detail

      • create

        public static RotatedRectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point> create​(Point2Wrapper<org.opencv.core.Point> center,
                                                                                                              double width,
                                                                                                              double height,
                                                                                                              double angle)
        Create a rotated rectangle and wraps it using this wrapper.
        Parameters:
        center - the center point of the rectangle
        width - the width
        height - the height
        angle - the getRotation or angle in radians
        Returns:
        the resulting rectangle wrapped in the wrapper
      • getPoints

        public List<Point2Wrapper<org.opencv.core.Point>> getPoints()
        Specified by:
        getPoints in interface RotatedRectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>
        Returns:
        Receive the corner points in order bottomLeft, topLeft, topRight, bottomRight
      • getRotation

        public double getRotation()
        Specified by:
        getRotation in interface RotatedRectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>
        Returns:
        the angle / getRotation of the rectangle in radians
      • getRectangle

        public org.opencv.core.RotatedRect getRectangle()
        Specified by:
        getRectangle in interface RectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>
        Returns:
        Wrapped Rectangle
      • setRectangle

        public void setRectangle​(org.opencv.core.RotatedRect rectangle)
        Specified by:
        setRectangle in interface RectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>
        Parameters:
        rectangle - The Rectangle to wrap
      • getTopLeftPoint

        public Point2Wrapper<org.opencv.core.Point> getTopLeftPoint()
        Specified by:
        getTopLeftPoint in interface RectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>
        Returns:
        The top left corner point of the rectangle
      • getBottomRightPoint

        public Point2Wrapper<org.opencv.core.Point> getBottomRightPoint()
        Specified by:
        getBottomRightPoint in interface RectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>
        Returns:
        The bottom right corner point of the rectangle
      • getCenterPoint

        public Point2Wrapper<org.opencv.core.Point> getCenterPoint()
        Specified by:
        getCenterPoint in interface RectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>
        Returns:
        The center corner point of the rectangle
      • getWidth

        public double getWidth()
        Specified by:
        getWidth in interface RectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>
        Returns:
        The width of the rectangle
      • getHeight

        public double getHeight()
        Specified by:
        getHeight in interface RectangleWrapper<org.opencv.core.RotatedRect,​org.opencv.core.Point>
        Returns:
        The height of the rectangle