diff --git a/modules/calib3d/src/stereobm.cpp b/modules/calib3d/src/stereobm.cpp index f01c41e0bf..d84d875306 100644 --- a/modules/calib3d/src/stereobm.cpp +++ b/modules/calib3d/src/stereobm.cpp @@ -496,7 +496,7 @@ static void findStereoCorrespondenceBM_SSE2( const Mat& left, const Mat& right, dptr[y*dstep] = (short)(((ndisp - mind - 1 + mindisp)*256 + (d != 0 ? (p-n)*256/d : 0) + 15) >> 4); } else - dptr[y*dstep] = (short)((ndisp - mind - 1)*16); + dptr[y*dstep] = (short)((ndisp - mind - 1 + mindisp)*16); costptr[y*coststep] = sad[mind]; } }