From 58f4460fc61384a0c920c23088a5ecfc25d2a327 Mon Sep 17 00:00:00 2001 From: Ronald Rogers Date: Thu, 20 Jan 2022 19:17:50 -0500 Subject: [PATCH] Fixed divide by zero --- src/ORBextractor.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ORBextractor.cc b/src/ORBextractor.cc index 8dcbdba0bd..dac71835b0 100644 --- a/src/ORBextractor.cc +++ b/src/ORBextractor.cc @@ -538,7 +538,10 @@ namespace ORB_SLAM3 const int &maxX, const int &minY, const int &maxY, const int &N, const int &level) { // Compute how many initial nodes - const int nIni = round(static_cast(maxX-minX)/(maxY-minY)); + int nIni = round(static_cast(maxX-minX)/(maxY-minY)); + + if (nIni == 0) + nIni = 1; const float hX = static_cast(maxX-minX)/nIni;