Table of Contents

Method RotatedRectangleIntersection

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

RotatedRectangleIntersection(RotatedRect, RotatedRect, OutputArray)

Finds out if there is any intersection between two rotated rectangles. If there is then the vertices of the interesecting region are returned as well. Below are some examples of intersection configurations. The hatched pattern indicates the intersecting region and the red vertices are returned by the function.

public static RectanglesIntersectTypes RotatedRectangleIntersection(RotatedRect rect1, RotatedRect rect2, OutputArray intersectingRegion)

Parameters

rect1 RotatedRect

First rectangle

rect2 RotatedRect

Second rectangle

intersectingRegion OutputArray

The output array of the verticies of the intersecting region. It returns at most 8 vertices. Stored as std::vector<cv::Point2f> or cv::Mat as Mx1 of type CV_32FC2.

Returns

RectanglesIntersectTypes

RotatedRectangleIntersection(RotatedRect, RotatedRect, out Point2f[])

Finds out if there is any intersection between two rotated rectangles. If there is then the vertices of the interesecting region are returned as well. Below are some examples of intersection configurations. The hatched pattern indicates the intersecting region and the red vertices are returned by the function.

public static RectanglesIntersectTypes RotatedRectangleIntersection(RotatedRect rect1, RotatedRect rect2, out Point2f[] intersectingRegion)

Parameters

rect1 RotatedRect

First rectangle

rect2 RotatedRect

Second rectangle

intersectingRegion Point2f[]

The output array of the verticies of the intersecting region. It returns at most 8 vertices.

Returns

RectanglesIntersectTypes