diff --git a/modules/calib3d/src/calibinit.cpp b/modules/calib3d/src/calibinit.cpp index de956abe36..ede68c6b71 100644 --- a/modules/calib3d/src/calibinit.cpp +++ b/modules/calib3d/src/calibinit.cpp @@ -298,7 +298,7 @@ static void icvSmoothHistogram256(const ArrayContainer& piHist, ArrayContainer& CV_DbgAssert(iIdx >= 0 && iIdx < 256); iSmooth += piHist[iIdx]; } - piHistSmooth[i] = iSmooth/(2*iWidth+1); + piHistSmooth[i] = iSmooth/(iIdx_max-iIdx_min+1); } } /***************************************************************************************************/