From 08f1f5769a8b92b6953e4e177bdd1733adf2833e Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 14 Jul 2011 12:11:18 +0000 Subject: [PATCH] ok. enabled TBB in LatentSVM, but need to check if it works --- modules/objdetect/src/_lsvm_matching.h | 4 ---- modules/objdetect/src/latentsvm.cpp | 2 -- modules/objdetect/src/lsvmtbbversion.cpp | 4 +--- modules/objdetect/src/matching.cpp | 7 ++----- modules/objdetect/test/test_latentsvmdetector.cpp | 2 -- 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/modules/objdetect/src/_lsvm_matching.h b/modules/objdetect/src/_lsvm_matching.h index 64bc2f650d..5c8bb43e20 100644 --- a/modules/objdetect/src/_lsvm_matching.h +++ b/modules/objdetect/src/_lsvm_matching.h @@ -11,8 +11,6 @@ #include "_lsvm_fft.h" #include "_lsvm_routine.h" -#undef HAVE_TBB - #ifdef HAVE_TBB #include "_lsvm_tbbversion.h" #endif @@ -358,8 +356,6 @@ int thresholdFunctionalScore(const CvLSVMFilterObject **all_F, int n, CvPoint **points, int **levels, int *kPoints, CvPoint ***partsDisplacement); -#undef HAVE_TBB - #ifdef HAVE_TBB /* // int tbbThresholdFunctionalScore(const CvLSVMFilterObject **all_F, int n, diff --git a/modules/objdetect/src/latentsvm.cpp b/modules/objdetect/src/latentsvm.cpp index cac271fabb..339c936db9 100644 --- a/modules/objdetect/src/latentsvm.cpp +++ b/modules/objdetect/src/latentsvm.cpp @@ -2,8 +2,6 @@ #include "_latentsvm.h" #include "_lsvm_matching.h" -#undef HAVE_TBB - /* // Transformation filter displacement from the block space // to the space of pixels at the initial image diff --git a/modules/objdetect/src/lsvmtbbversion.cpp b/modules/objdetect/src/lsvmtbbversion.cpp index 99a880b363..3c87930d31 100644 --- a/modules/objdetect/src/lsvmtbbversion.cpp +++ b/modules/objdetect/src/lsvmtbbversion.cpp @@ -1,7 +1,5 @@ #include "precomp.hpp" -#undef HAVE_TBB - #ifdef HAVE_TBB #include "_lsvm_tbbversion.h" @@ -48,7 +46,7 @@ public: for (i = 0; i < kLevels; i++) { level = procLevels[i]; - partsLevel = level - H->lambda; + partsLevel = level - LAMBDA;//H->lambda; res = thresholdFunctionalScoreFixedLevel( filters, n, H, level, b, maxXBorder, maxYBorder, scoreThreshold, &(score[partsLevel]), diff --git a/modules/objdetect/src/matching.cpp b/modules/objdetect/src/matching.cpp index bb27002b8d..df0c944423 100644 --- a/modules/objdetect/src/matching.cpp +++ b/modules/objdetect/src/matching.cpp @@ -2,8 +2,6 @@ #include "_lsvm_matching.h" #include -#undef HAVE_TBB - #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif @@ -1577,8 +1575,7 @@ int tbbThresholdFunctionalScore(const CvLSVMFilterObject **all_F, int n, // Computation the number of levels for seaching object, // first lambda-levels are used for computation values // of score function for each position of root filter - numLevels = H->countLevel - H->lambda; - + numLevels = H->numLevels; kLevels = (int *)malloc(sizeof(int) * threadsNum); procLevels = (int **)malloc(sizeof(int*) * threadsNum); computeBorderSize(maxXBorder, maxYBorder, &bx, &by); @@ -1648,7 +1645,7 @@ int tbbThresholdFunctionalScore(const CvLSVMFilterObject **all_F, int n, for (i = 0; i < numLevels; i++) { // Computation the number of level - level = i + H->lambda; + level = i + LAMBDA;//H->lambda; // Addition a set of points f += tmpKPoints[i]; diff --git a/modules/objdetect/test/test_latentsvmdetector.cpp b/modules/objdetect/test/test_latentsvmdetector.cpp index 2933e8cce1..1dfe756599 100644 --- a/modules/objdetect/test/test_latentsvmdetector.cpp +++ b/modules/objdetect/test/test_latentsvmdetector.cpp @@ -42,8 +42,6 @@ #include "test_precomp.hpp" -#undef HAVE_TBB - #include #ifdef HAVE_CVCONFIG_H -- GitLab