diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index 09f1d4833..ac6c043fa 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -1845,7 +1845,7 @@ void cv::batchDistance( InputArray _src1, InputArray _src2, int d = tdist.at(i), d0 = dist.at(idx); if( d < d0 ) { - dist.at(idx) = d0; + dist.at(idx) = d; nidx.at(idx) = i + update; } } @@ -1858,7 +1858,7 @@ void cv::batchDistance( InputArray _src1, InputArray _src2, float d = tdist.at(i), d0 = dist.at(idx); if( d < d0 ) { - dist.at(idx) = d0; + dist.at(idx) = d; nidx.at(idx) = i + update; } }