From 68c8cf83b7d8e1841b5340cb2bf2b8f27f1c4fe8 Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Tue, 20 May 2025 23:06:22 +0200 Subject: [PATCH] Properly fix inf/inf issue in MCC Properly fix https://github.com/opencv/opencv_contrib/issues/3316 Without this fix, we could end up with 4 corners, which might seem valid, while some of those are (0,0). --- modules/mcc/src/bound_min.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mcc/src/bound_min.cpp b/modules/mcc/src/bound_min.cpp index c2bc6e6c82c..bb2d8b428b7 100644 --- a/modules/mcc/src/bound_min.cpp +++ b/modules/mcc/src/bound_min.cpp @@ -167,7 +167,7 @@ void CBoundMin::calculate() j = (i + 1) % 4; Vcart = lines[i].cross(lines[j]); if (fabs(Vcart.z) <= 1e-6){ - continue; + return; } Vhom.x = Vcart.x / Vcart.z; Vhom.y = Vcart.y / Vcart.z;