From 8f108b4e7e55e2de47b822df62d6431506f78e71 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 12 Oct 2011 11:01:11 +0000 Subject: [PATCH] bug fix --- modules/gpu/src/brute_force_matcher.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/gpu/src/brute_force_matcher.cpp b/modules/gpu/src/brute_force_matcher.cpp index b601521..c109d7f 100644 --- a/modules/gpu/src/brute_force_matcher.cpp +++ b/modules/gpu/src/brute_force_matcher.cpp @@ -801,6 +801,11 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatchSingle(const GpuMat& query, ensureSizeIsEnough(nQuery, std::max((nTrain / 100), 10), CV_32SC1, trainIdx); ensureSizeIsEnough(nQuery, std::max((nTrain / 100), 10), CV_32FC1, distance); } + + if (stream) + stream.enqueueMemSet(nMatches, Scalar::all(0)); + else + nMatches.setTo(Scalar::all(0)); caller_t func = callers[distType][query.depth()]; CV_Assert(func != 0); @@ -926,6 +931,11 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatchCollection(const GpuMat& qu ensureSizeIsEnough(nQuery, std::max((nQuery / 100), 10), CV_32SC1, imgIdx); ensureSizeIsEnough(nQuery, std::max((nQuery / 100), 10), CV_32FC1, distance); } + + if (stream) + stream.enqueueMemSet(nMatches, Scalar::all(0)); + else + nMatches.setTo(Scalar::all(0)); caller_t func = callers[distType][query.depth()]; CV_Assert(func != 0); -- 2.7.4