From 89833853fa8991261c0d4415a4c91a0af0130e28 Mon Sep 17 00:00:00 2001 From: E Braun Date: Tue, 2 Sep 2014 13:56:13 +0200 Subject: [PATCH] Revert "fix for bug 3172" This reverts commit ed2cdb71e5821db85b57cf60d88689c2bf32aeeb. --- modules/core/src/stat.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index cafdf0fd3b..8ad2aabb8b 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -2463,7 +2463,7 @@ struct BatchDistInvoker : public ParallelLoopBody } void cv::batchDistance( InputArray _src1, InputArray _src2, - InputOutputArray _dist, int dtype, InputOutputArray _nidx, + OutputArray _dist, int dtype, OutputArray _nidx, int normType, int K, InputArray _mask, int update, bool crosscheck ) { @@ -2479,6 +2479,8 @@ void cv::batchDistance( InputArray _src1, InputArray _src2, } CV_Assert( (type == CV_8U && dtype == CV_32S) || dtype == CV_32F); + K = std::min(K, src2.rows); + _dist.create(src1.rows, (K > 0 ? K : src2.rows), dtype); Mat dist = _dist.getMat(), nidx; if( _nidx.needed() )