From c3e9d0dd7e2a09fbc3605f6c5376280621c95d13 Mon Sep 17 00:00:00 2001 From: Evgeniy Kozinov Date: Fri, 15 Jul 2011 06:35:12 +0000 Subject: [PATCH] fixed parser bug. fixed TBB version in LatentSVM. example works ok. --- modules/objdetect/src/lsvmparser.cpp | 6 +++--- modules/objdetect/src/matching.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/objdetect/src/lsvmparser.cpp b/modules/objdetect/src/lsvmparser.cpp index 69a192f8e3..49724a59d4 100644 --- a/modules/objdetect/src/lsvmparser.cpp +++ b/modules/objdetect/src/lsvmparser.cpp @@ -671,11 +671,11 @@ void parserModel(FILE * xmlf, CvLSVMFilterObject *** model, int *last, int *max, * b = bb; * count = N_comp + 1; } else { - cmp = (int *)malloc(sizeof(int) * (N_comp + 1)); + cmp = (int *)malloc(sizeof(int) * (N_comp + 1)); bb = (float *)malloc(sizeof(float) * (N_comp + 1)); for(ii = 0; ii < N_comp; ii++){ - cmp[i] = (* comp)[ii]; - bb [i] = (* b )[ii]; + cmp[ii] = (* comp)[ii]; + bb [ii] = (* b )[ii]; } free(* comp); free(* b ); diff --git a/modules/objdetect/src/matching.cpp b/modules/objdetect/src/matching.cpp index df0c944423..4ad4b8523d 100644 --- a/modules/objdetect/src/matching.cpp +++ b/modules/objdetect/src/matching.cpp @@ -1575,7 +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->numLevels; + numLevels = H->numLevels - LAMBDA; kLevels = (int *)malloc(sizeof(int) * threadsNum); procLevels = (int **)malloc(sizeof(int*) * threadsNum); computeBorderSize(maxXBorder, maxYBorder, &bx, &by);