bug fix
authorVladislav Vinogradov <no@email>
Wed, 12 Oct 2011 11:01:11 +0000 (11:01 +0000)
committerVladislav Vinogradov <no@email>
Wed, 12 Oct 2011 11:01:11 +0000 (11:01 +0000)
modules/gpu/src/brute_force_matcher.cpp

index b601521..c109d7f 100644 (file)
@@ -801,6 +801,11 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatchSingle(const GpuMat& query,
         ensureSizeIsEnough(nQuery, std::max((nTrain / 100), 10), CV_32SC1, trainIdx);\r
         ensureSizeIsEnough(nQuery, std::max((nTrain / 100), 10), CV_32FC1, distance);\r
     }\r
+    \r
+    if (stream)\r
+        stream.enqueueMemSet(nMatches, Scalar::all(0));\r
+    else\r
+        nMatches.setTo(Scalar::all(0));\r
 \r
     caller_t func = callers[distType][query.depth()];\r
     CV_Assert(func != 0);    \r
@@ -926,6 +931,11 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatchCollection(const GpuMat& qu
         ensureSizeIsEnough(nQuery, std::max((nQuery / 100), 10), CV_32SC1, imgIdx);\r
         ensureSizeIsEnough(nQuery, std::max((nQuery / 100), 10), CV_32FC1, distance);\r
     }\r
+    \r
+    if (stream)\r
+        stream.enqueueMemSet(nMatches, Scalar::all(0));\r
+    else\r
+        nMatches.setTo(Scalar::all(0));\r
 \r
     caller_t func = callers[distType][query.depth()];\r
     CV_Assert(func != 0);\r