Class OpenCVRectangleWrapper

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

    public class OpenCVRectangleWrapper
    extends AbstractRectangleWrapper<org.opencv.core.Rect,​org.opencv.core.Point>

    OpenCV Implementation of the RectangleWrapper

    Since:
    1.0
    Author:
    Christoph Praschl
    • Constructor Detail

      • OpenCVRectangleWrapper

        public OpenCVRectangleWrapper​(org.opencv.core.Rect rectangle)
      • OpenCVRectangleWrapper

        public OpenCVRectangleWrapper​(org.opencv.core.Point topLeftPoint,
                                      org.opencv.core.Point bottomRightPoint)
      • OpenCVRectangleWrapper

        public OpenCVRectangleWrapper​(double topLeftPointX,
                                      double topLeftPointY,
                                      double bottomRightPointX,
                                      double bottomRightPointY)
    • Method Detail

      • buildRectangle

        protected org.opencv.core.Rect buildRectangle​(org.opencv.core.Point topLeftPoint,
                                                      org.opencv.core.Point bottomRightPoint)
        Method to create a new rectangle from to given points
        Overrides:
        buildRectangle in class AbstractRectangleWrapper<org.opencv.core.Rect,​org.opencv.core.Point>
        Parameters:
        topLeftPoint - Top left point of the rectangle
        bottomRightPoint - Bottom right point of the rectangle
        Returns:
        The created rectangle
      • buildRectangle

        protected org.opencv.core.Rect buildRectangle​(double topLeftPointX,
                                                      double topLeftPointY,
                                                      double bottomRightPointX,
                                                      double bottomRightPointY)
        Method to create a new rectangle from to given points (defined by the x and y coordinates)
        Overrides:
        buildRectangle in class AbstractRectangleWrapper<org.opencv.core.Rect,​org.opencv.core.Point>
        Parameters:
        topLeftPointX - x-Coordinate of the Top left point of the rectangle
        topLeftPointY - y-Coordinate of the Top left point of the rectangle
        bottomRightPointX - x-Coordinate of the Bottom Right point of the rectangle
        bottomRightPointY - y-Coordinate of the Bottom Right point of the rectangle
        Returns:
        The created rectangle
      • getTopLeftPoint

        public Point2Wrapper<org.opencv.core.Point> getTopLeftPoint()
        Returns:
        The top left corner point of the rectangle
      • getBottomRightPoint

        public Point2Wrapper<org.opencv.core.Point> getBottomRightPoint()
        Returns:
        The bottom right corner point of the rectangle
      • getCenterPoint

        public Point2Wrapper<org.opencv.core.Point> getCenterPoint()
        Returns:
        The center corner point of the rectangle
      • getWidth

        public double getWidth()
        Returns:
        The width of the rectangle
      • getHeight

        public double getHeight()
        Returns:
        The height of the rectangle