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

Fix minEnclosingCircle

This commit is contained in:
MaximSmolskiy
2025-10-15 01:34:14 +03:00
parent 0a25225b76
commit 1b09d7390f
2 changed files with 40 additions and 19 deletions
+38
View File
@@ -127,6 +127,44 @@ TEST(Imgproc_minEnclosingCircle, regression_16051) {
EXPECT_NEAR(2.1024551f, radius, 1e-3);
}
TEST(Imgproc_minEnclosingCircle, regression_27891) {
{
const vector<Point2f> pts = { {219, 301}, {639, 635}, {740, 569}, {740, 569}, {309, 123}, {349, 88} };
Point2f center;
float radius;
minEnclosingCircle(pts, center, radius);
EXPECT_NEAR(center.x, 522.476f, 1e-3f);
EXPECT_NEAR(center.y, 346.4029f, 1e-3f);
EXPECT_NEAR(radius, 311.2331f, 1e-3f);
}
{
const vector<Point2f> pts = { {219, 301}, {639, 635}, {740, 569}, {740, 569}, {349, 88} };
Point2f center;
float radius;
minEnclosingCircle(pts, center, radius);
EXPECT_NEAR(center.x, 522.476f, 1e-3f);
EXPECT_NEAR(center.y, 346.4029f, 1e-3f);
EXPECT_NEAR(radius, 311.2331f, 1e-3f);
}
{
const vector<Point2f> pts = { {639, 635}, {740, 569}, {740, 569}, {349, 88} };
Point2f center;
float radius;
minEnclosingCircle(pts, center, radius);
EXPECT_NEAR(center.x, 522.476f, 1e-3f);
EXPECT_NEAR(center.y, 346.4029f, 1e-3f);
EXPECT_NEAR(radius, 311.2331f, 1e-3f);
}
}
PARAM_TEST_CASE(ConvexityDefects_regression_5908, bool, int)
{
public: