1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 23:03:03 +04:00

Test for Rect2f in Python.

This commit is contained in:
Alexander Smorkalov
2024-01-24 18:32:44 +03:00
parent fefc7e3749
commit cb92974914
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -608,6 +608,14 @@ class Arguments(NewOpenCVTests):
_, inter_pts = cv.rotatedRectangleIntersection(rect1, rect2)
self.assertLess(np.max(np.abs(inter_pts.reshape(-1, 2) - pts)), 1e-4)
def test_result_rotated_rect_boundingRect2f(self):
center = (0, 0)
size = (10, 10)
angle = 0
gold_box = (-5.0, -5.0, 10.0, 10.0)
rect1 = cv.RotatedRect(center, size, angle)
bbox = rect1.boundingRect2f()
self.assertEqual(gold_box, bbox)
def test_parse_to_rotated_rect_not_convertible(self):
for not_convertible in ([], (), np.array([]), (123, (45, 34), 1), {1: 2, 3: 4}, 123,