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

Merge pull request #27910 from MaximSmolskiy:add_corner_cases_tests_for_minEnclosingCircle

Add corner cases tests for minEnclosingCircle
This commit is contained in:
Alexander Smorkalov
2025-10-16 10:36:42 +03:00
committed by GitHub
+16
View File
@@ -56,6 +56,22 @@ TEST(minEnclosingCircle, basic_test)
Point2f center;
float radius;
{
const vector<Point2f> pts = { {5, 10} };
minEnclosingCircle(pts, center, radius);
EXPECT_NEAR(center.x, 5, EPS);
EXPECT_NEAR(center.y, 10, EPS);
EXPECT_NEAR(radius, 0, EPS);
}
{
const vector<Point2f> pts = { {5, 10}, {11, 18} };
minEnclosingCircle(pts, center, radius);
EXPECT_NEAR(center.x, 8, EPS);
EXPECT_NEAR(center.y, 14, EPS);
EXPECT_NEAR(radius, 5, EPS);
}
// pts[2] is within the circle with diameter pts[0] - pts[1].
// 2
// 0 1