From 1d3ec99102b456fbff4866c4fd8c9ce6f146f35d Mon Sep 17 00:00:00 2001 From: Daniil Osokin Date: Fri, 12 Oct 2012 12:31:05 +0400 Subject: [PATCH] fixed batchDistance minimum finding #2292 --- modules/core/src/stat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index 09f1d48..ac6c043 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; } } -- 2.7.4