Class OpenCVRotatedRectangleWrapper
- java.lang.Object
-
- science.aist.imaging.opencv.imageprocessing.wrapper.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 Summary
Constructors Constructor Description OpenCVRotatedRectangleWrapper(org.opencv.core.RotatedRect rotatedRect)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.Point2Wrapper<org.opencv.core.Point>
getBottomLeftPoint()
Point2Wrapper<org.opencv.core.Point>
getBottomRightPoint()
Point2Wrapper<org.opencv.core.Point>
getCenterPoint()
double
getHeight()
List<Point2Wrapper<org.opencv.core.Point>>
getPoints()
org.opencv.core.RotatedRect
getRectangle()
double
getRotation()
Point2Wrapper<org.opencv.core.Point>
getTopLeftPoint()
Point2Wrapper<org.opencv.core.Point>
getTopRightPoint()
double
getWidth()
void
setRectangle(org.opencv.core.RotatedRect 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 rectanglewidth
- the widthheight
- the heightangle
- the getRotation or angle in radians- Returns:
- the resulting rectangle wrapped in the wrapper
-
getTopRightPoint
public Point2Wrapper<org.opencv.core.Point> getTopRightPoint()
- Specified by:
getTopRightPoint
in interfaceRotatedRectangleWrapper<org.opencv.core.RotatedRect,org.opencv.core.Point>
- Returns:
- the top right point of the rectangle
-
getBottomLeftPoint
public Point2Wrapper<org.opencv.core.Point> getBottomLeftPoint()
- Specified by:
getBottomLeftPoint
in interfaceRotatedRectangleWrapper<org.opencv.core.RotatedRect,org.opencv.core.Point>
- Returns:
- the bottom left point of the rectangle
-
getPoints
public List<Point2Wrapper<org.opencv.core.Point>> getPoints()
- Specified by:
getPoints
in interfaceRotatedRectangleWrapper<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 interfaceRotatedRectangleWrapper<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 interfaceRectangleWrapper<org.opencv.core.RotatedRect,org.opencv.core.Point>
- Returns:
- Wrapped Rectangle
-
setRectangle
public void setRectangle(org.opencv.core.RotatedRect rectangle)
- Specified by:
setRectangle
in interfaceRectangleWrapper<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 interfaceRectangleWrapper<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 interfaceRectangleWrapper<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 interfaceRectangleWrapper<org.opencv.core.RotatedRect,org.opencv.core.Point>
- Returns:
- The center corner point of the rectangle
-
getWidth
public double getWidth()
- Specified by:
getWidth
in interfaceRectangleWrapper<org.opencv.core.RotatedRect,org.opencv.core.Point>
- Returns:
- The width of the rectangle
-
getHeight
public double getHeight()
- Specified by:
getHeight
in interfaceRectangleWrapper<org.opencv.core.RotatedRect,org.opencv.core.Point>
- Returns:
- The height of the rectangle
-
-