Skip to content

Commit c8053da

Browse files
committed
Merge pull request #426 from wangyan42164:opencl_building_macro
2 parents 06b03a7 + 5eb03d2 commit c8053da

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

modules/tracking/src/multiTracker.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ namespace cv
119119
//Detect all
120120
for (int k = 0; k < targetNum; k++)
121121
tmpCandidates[k] = boundingBoxes[k];
122+
#ifdef HAVE_OPENCL
122123
if (ocl::haveOpenCL())
123124
ocl_detect_all(imageForDetector, image_blurred, tmpCandidates, detectorResults, detect_flgs, trackers);
124125
else
126+
#endif
125127
detect_all(imageForDetector, image_blurred, tmpCandidates, detectorResults, detect_flgs, trackers);
126128

127129
for (int k = 0; k < targetNum; k++)
@@ -215,16 +217,20 @@ namespace cv
215217
}
216218
tldModel->integrateRelabeled(imageForDetector, image_blurred, detectorResults[k]);
217219
pExpert.additionalExamples(examplesForModel, examplesForEnsemble);
220+
#ifdef HAVE_OPENCL
218221
if (ocl::haveOpenCL())
219222
tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, true);
220223
else
224+
#endif
221225
tldModel->integrateAdditional(examplesForModel, examplesForEnsemble, true);
222226
examplesForModel.clear(); examplesForEnsemble.clear();
223227
nExpert.additionalExamples(examplesForModel, examplesForEnsemble);
224228

229+
#ifdef HAVE_OPENCL
225230
if (ocl::haveOpenCL())
226231
tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, false);
227232
else
233+
#endif
228234
tldModel->integrateAdditional(examplesForModel, examplesForEnsemble, false);
229235
}
230236
else
@@ -434,6 +440,7 @@ namespace cv
434440
}
435441
}
436442

443+
#ifdef HAVE_OPENCL
437444
void ocl_detect_all(const Mat& img, const Mat& imgBlurred, std::vector<Rect2d>& res, std::vector < std::vector < tld::TLDDetector::LabeledPatch > > &patches, std::vector<bool> &detect_flgs,
438445
std::vector<Ptr<Tracker> > &trackers)
439446
{
@@ -644,5 +651,6 @@ namespace cv
644651
}
645652
}
646653
}
654+
#endif
647655

648656
}

modules/tracking/src/multiTracker.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ namespace cv
5151
{
5252
void detect_all(const Mat& img, const Mat& imgBlurred, std::vector<Rect2d>& res, std::vector < std::vector < tld::TLDDetector::LabeledPatch > > &patches,
5353
std::vector<bool>& detect_flgs, std::vector<Ptr<Tracker> >& trackers);
54+
#ifdef HAVE_OPENCL
5455
void ocl_detect_all(const Mat& img, const Mat& imgBlurred, std::vector<Rect2d>& res, std::vector < std::vector < tld::TLDDetector::LabeledPatch > > &patches,
5556
std::vector<bool>& detect_flgs, std::vector<Ptr<Tracker> >& trackers);
57+
#endif
5658
}
5759
#endif

0 commit comments

Comments
 (0)