From 255de8777b754a5385a326f761f2057060c4a9f6 Mon Sep 17 00:00:00 2001 From: Vladislav Sovrasov Date: Fri, 18 Aug 2017 14:01:45 +0300 Subject: [PATCH] tracking: fix wrong conditions of OCL run --- modules/tracking/src/tldTracker.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/tracking/src/tldTracker.cpp b/modules/tracking/src/tldTracker.cpp index d83b7057a..4d7596891 100644 --- a/modules/tracking/src/tldTracker.cpp +++ b/modules/tracking/src/tldTracker.cpp @@ -149,8 +149,10 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox) if (i == 1) { #ifdef HAVE_OPENCL - if (ocl::haveOpenCL()) + if (ocl::useOpenCL()) + { DETECT_FLG = tldModel->detector->ocl_detect(imageForDetector, image_blurred, tmpCandid, detectorResults, tldModel->getMinSize()); + } else #endif DETECT_FLG = tldModel->detector->detect(imageForDetector, image_blurred, tmpCandid, detectorResults, tldModel->getMinSize()); @@ -221,7 +223,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox) tldModel->integrateRelabeled(imageForDetector, image_blurred, detectorResults); pExpert.additionalExamples(examplesForModel, examplesForEnsemble); #ifdef HAVE_OPENCL - if (ocl::haveOpenCL()) + if (ocl::useOpenCL()) tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, true); else #endif @@ -230,7 +232,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox) nExpert.additionalExamples(examplesForModel, examplesForEnsemble); #ifdef HAVE_OPENCL - if (ocl::haveOpenCL()) + if (ocl::useOpenCL()) tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, false); else #endif