@Namespace(value="cv") @NoOffset public static class opencv_core.RotatedRect extends FloatPointer
Each rectangle is specified by the center point (mass center), length of each side (represented by cv::Size2f structure) and the rotation angle in degrees.
The sample below demonstrates how to use RotatedRect:
Mat image(200, 200, CV_8UC3, Scalar(0));
RotatedRect rRect = RotatedRect(Point2f(100,100), Size2f(100,50), 30);
Point2f vertices[4];
rRect.points(vertices);
for (int i = 0; i < 4; i++)
line(image, vertices[i], vertices[(i+1)%4], Scalar(0,255,0));
Rect brect = rRect.boundingRect();
rectangle(image, brect, Scalar(255,0,0));
imshow("rectangles", image);
waitKey(0);

\sa CamShift, fitEllipse, minAreaRect, CvBox2D
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Constructor and Description |
|---|
opencv_core.RotatedRect()
various constructors
|
opencv_core.RotatedRect(long size)
Native array allocator.
|
opencv_core.RotatedRect(opencv_core.Point2f point1,
opencv_core.Point2f point2,
opencv_core.Point2f point3)
Any 3 end points of the RotatedRect.
|
opencv_core.RotatedRect(opencv_core.Point2f center,
opencv_core.Size2f size,
float angle) |
opencv_core.RotatedRect(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
float |
angle() |
opencv_core.RotatedRect |
angle(float angle) |
opencv_core.Rect |
boundingRect()
returns the minimal up-right rectangle containing the rotated rectangle
|
opencv_core.Point2f |
center() |
opencv_core.RotatedRect |
center(opencv_core.Point2f center) |
void |
points(opencv_core.Point2f pts)
returns 4 vertices of the rectangle
|
opencv_core.RotatedRect |
position(long position) |
opencv_core.Size2f |
size() |
opencv_core.RotatedRect |
size(opencv_core.Size2f size) |
asBuffer, capacity, get, get, get, get, limit, put, put, put, putaddress, asByteBuffer, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, hashCode, isNull, limit, maxBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, position, put, setNull, sizeof, toString, totalBytes, withDeallocator, zeropublic opencv_core.RotatedRect(Pointer p)
Pointer.Pointer(Pointer).public opencv_core.RotatedRect(long size)
Pointer.position(long).public opencv_core.RotatedRect()
public opencv_core.RotatedRect(@Const@ByRef opencv_core.Point2f center, @Const@ByRef opencv_core.Size2f size, float angle)
center - The rectangle mass center.size - Width and height of the rectangle.angle - The rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc.,
the rectangle becomes an up-right rectangle.public opencv_core.RotatedRect(@Const@ByRef opencv_core.Point2f point1, @Const@ByRef opencv_core.Point2f point2, @Const@ByRef opencv_core.Point2f point3)
public opencv_core.RotatedRect position(long position)
position in class FloatPointerpublic void points(opencv_core.Point2f pts)
pts - The points array for storing rectangle vertices.@ByVal public opencv_core.Rect boundingRect()
@ByRef public opencv_core.Point2f center()
public opencv_core.RotatedRect center(opencv_core.Point2f center)
@ByRef public opencv_core.Size2f size()
public opencv_core.RotatedRect size(opencv_core.Size2f size)
public float angle()
public opencv_core.RotatedRect angle(float angle)
Copyright © 2016. All rights reserved.