diff --git a/src/ORBextractor.cc b/src/ORBextractor.cc index 970b7cc7bf..4a0d1d7258 100644 --- a/src/ORBextractor.cc +++ b/src/ORBextractor.cc @@ -556,7 +556,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;