Finds out if there is any intersection between two rotated rectangles.
[intersectingRegion,result] = cv.rotatedRectangleIntersection(rect1, rect2)
Input
- rect1 First rectangle. Structure with the following fields:
- center The rectangle mass center
[x,y]
.
- size Width and height of the rectangle
[w,h]
.
- angle The rotation angle in a clockwise direction.
When the angle is 0, 90, 180, 270 etc., the
rectangle becomes an up-right rectangle.
- rect2 Second rectangle. Similar struct to first.
Output
- intersectingRegion The output array of the verticies of the
intersecting region. It returns at most 8 vertices. A cell array of
2D points
{[x,y], ...}
- result types of intersection between rectangles. One of:
- None No intersection.
- Partial There is a partial intersection.
- Full One of the rectangle is fully enclosed in the other.
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.