tld_utils.cpp 13.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
/*///////////////////////////////////////////////////////////////////////////////////////
 //
 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
 //
 //  By downloading, copying, installing or using the software you agree to this license.
 //  If you do not agree to this license, do not download, install,
 //  copy or use the software.
 //
 //
 //                           License Agreement
 //                For Open Source Computer Vision Library
 //
 // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
 // Third party copyrights are property of their respective owners.
 //
 // Redistribution and use in source and binary forms, with or without modification,
 // are permitted provided that the following conditions are met:
 //
 //   * Redistribution's of source code must retain the above copyright notice,
 //     this list of conditions and the following disclaimer.
 //
 //   * Redistribution's in binary form must reproduce the above copyright notice,
 //     this list of conditions and the following disclaimer in the documentation
 //     and/or other materials provided with the distribution.
 //
 //   * The name of the copyright holders may not be used to endorse or promote products
 //     derived from this software without specific prior written permission.
 //
 // This software is provided by the copyright holders and contributors "as is" and
 // any express or implied warranties, including, but not limited to, the implied
 // warranties of merchantability and fitness for a particular purpose are disclaimed.
 // In no event shall the Intel Corporation or contributors be liable for any direct,
 // indirect, incidental, special, exemplary, or consequential damages
 // (including, but not limited to, procurement of substitute goods or services;
 // loss of use, data, or profits; or business interruption) however caused
 // and on any theory of liability, whether in contract, strict liability,
 // or tort (including negligence or otherwise) arising in any way out of
 // the use of this software, even if advised of the possibility of such damage.
 //
 //M*/

#include "precomp.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc.hpp"
#include "time.h"
Alex Leontiev's avatar
Alex Leontiev committed
46 47 48 49
#include<algorithm>
#include<limits.h>
#include<math.h>
#include<opencv2/highgui.hpp>
Alex Leontiev's avatar
Alex Leontiev committed
50
#include "tld_tracker.hpp"
51

Alex Leontiev's avatar
Alex Leontiev committed
52
namespace cv {namespace tld
53 54 55
{

//debug functions and variables
Alex Leontiev's avatar
Alex Leontiev committed
56 57 58
Rect2d etalon(14.0, 110.0, 20.0, 20.0);
void drawWithRects(const Mat& img, std::vector<Rect2d>& blackOnes, Rect2d whiteOne)
{
59 60
    Mat image;
    img.copyTo(image);
Alex Leontiev's avatar
Alex Leontiev committed
61 62 63 64 65
    if( whiteOne.width >= 0 )
        rectangle( image, whiteOne, 255, 1, 1 );
    for( int i = 0; i < (int)blackOnes.size(); i++ )
        rectangle( image, blackOnes[i], 0, 1, 1 );
    imshow("img", image);
66
}
Alex Leontiev's avatar
Alex Leontiev committed
67 68
void drawWithRects(const Mat& img, std::vector<Rect2d>& blackOnes, std::vector<Rect2d>& whiteOnes, String filename)
{
69
    Mat image;
Alex Leontiev's avatar
Alex Leontiev committed
70
    static int frameCounter = 1;
71
    img.copyTo(image);
Alex Leontiev's avatar
Alex Leontiev committed
72 73 74 75 76 77 78
    for( int i = 0; i < (int)whiteOnes.size(); i++ )
        rectangle( image, whiteOnes[i], 255, 1, 1 );
    for( int i = 0; i < (int)blackOnes.size(); i++ )
        rectangle( image, blackOnes[i], 0, 1, 1 );
    imshow("img", image);
    if( filename.length() > 0 )
    {
Alex Leontiev's avatar
Alex Leontiev committed
79
        char inbuf[100];
Alex Leontiev's avatar
Alex Leontiev committed
80 81
        sprintf(inbuf, "%s%d.jpg", filename.c_str(), frameCounter);
        imwrite(inbuf, image);
Alex Leontiev's avatar
Alex Leontiev committed
82 83
        frameCounter++;
    }
84
}
Alex Leontiev's avatar
Alex Leontiev committed
85 86
void myassert(const Mat& img)
{
Alex Leontiev's avatar
Alex Leontiev committed
87
    int count = 0;
Alex Leontiev's avatar
Alex Leontiev committed
88 89 90 91 92
    for( int i = 0; i < img.rows; i++ )
    {
        for( int j = 0; j < img.cols; j++ )
        {
            if( img.at<uchar>(i, j) == 0 )
93 94 95
                count++;
        }
    }
Alex Leontiev's avatar
Alex Leontiev committed
96
    dprintf(("black: %d out of %d (%f)\n", count, img.rows * img.cols, 1.0 * count / img.rows / img.cols));
97 98
}

Alex Leontiev's avatar
Alex Leontiev committed
99 100 101 102 103 104
void printPatch(const Mat_<uchar>& standardPatch)
{
    for( int i = 0; i < standardPatch.rows; i++ )
    {
        for( int j = 0; j < standardPatch.cols; j++ )
            dprintf(("%5.2f, ", (double)standardPatch(i, j)));
Alex Leontiev's avatar
Alex Leontiev committed
105
        dprintf(("\n"));
106 107 108
    }
}

Alex Leontiev's avatar
Alex Leontiev committed
109 110
std::string type2str(const Mat& mat)
{
Alex Leontiev's avatar
Alex Leontiev committed
111
  int type = mat.type();
112 113 114
  std::string r;

  uchar depth = type & CV_MAT_DEPTH_MASK;
Alex Leontiev's avatar
Alex Leontiev committed
115
  uchar chans = (uchar)(1 + (type >> CV_CN_SHIFT));
116 117 118 119 120 121 122 123 124 125 126 127 128

  switch ( depth ) {
    case CV_8U:  r = "8U"; break;
    case CV_8S:  r = "8S"; break;
    case CV_16U: r = "16U"; break;
    case CV_16S: r = "16S"; break;
    case CV_32S: r = "32S"; break;
    case CV_32F: r = "32F"; break;
    case CV_64F: r = "64F"; break;
    default:     r = "User"; break;
  }

  r += "C";
Alex Leontiev's avatar
Alex Leontiev committed
129
  r += (chans + '0');
130 131 132 133 134

  return r;
}

//generic functions
Alex Leontiev's avatar
Alex Leontiev committed
135 136
double scaleAndBlur(const Mat& originalImg, int scale, Mat& scaledImg, Mat& blurredImg, Size GaussBlurKernelSize, double scaleStep)
{
Alex Leontiev's avatar
Alex Leontiev committed
137
    double dScale = 1.0;
Alex Leontiev's avatar
Alex Leontiev committed
138
    for( int i = 0; i < scale; i++, dScale *= scaleStep );
Alex Leontiev's avatar
Alex Leontiev committed
139 140
    Size2d size = originalImg.size();
    size.height /= dScale; size.width /= dScale;
Alex Leontiev's avatar
Alex Leontiev committed
141 142
    resize(originalImg, scaledImg, size);
    GaussianBlur(scaledImg, blurredImg, GaussBlurKernelSize, 0.0);
143 144
    return dScale;
}
Alex Leontiev's avatar
Alex Leontiev committed
145 146 147 148 149
void getClosestN(std::vector<Rect2d>& scanGrid, Rect2d bBox, int n, std::vector<Rect2d>& res)
{
    if( n >= (int)scanGrid.size() )
    {
        res.assign(scanGrid.begin(), scanGrid.end());
150 151
        return;
    }
Alex Leontiev's avatar
Alex Leontiev committed
152
    std::vector<double> overlaps;
Alex Leontiev's avatar
Alex Leontiev committed
153 154 155 156
    overlaps.assign(n, 0.0);
    res.assign(scanGrid.begin(), scanGrid.begin() + n);
    for( int i = 0; i < n; i++ )
        overlaps[i] = overlap(res[i], bBox);
157 158
    double otmp;
    Rect2d rtmp;
Alex Leontiev's avatar
Alex Leontiev committed
159 160
    for (int i = 1; i < n; i++)
    {
161 162
        int j = i;
        while (j > 0 && overlaps[j - 1] > overlaps[j]) {
Alex Leontiev's avatar
Alex Leontiev committed
163 164
            otmp = overlaps[j]; overlaps[j] = overlaps[j - 1]; overlaps[j - 1] = otmp;
            rtmp = res[j]; res[j] = res[j - 1]; res[j - 1] = rtmp;
165 166 167 168
            j--;
        }
    }

Alex Leontiev's avatar
Alex Leontiev committed
169 170
    for( int i = n; i < (int)scanGrid.size(); i++ )
    {
Alex Leontiev's avatar
Alex Leontiev committed
171
        double o = 0.0;
Alex Leontiev's avatar
Alex Leontiev committed
172
        if( (o = overlap(scanGrid[i], bBox)) <= overlaps[0] )
173
            continue;
Alex Leontiev's avatar
Alex Leontiev committed
174
        int j = 0;
Alex Leontiev's avatar
Alex Leontiev committed
175 176
        while( j < n && overlaps[j] < o )
            j++;
177
        j--;
Alex Leontiev's avatar
Alex Leontiev committed
178 179
        for( int k = 0; k < j; overlaps[k] = overlaps[k + 1], res[k] = res[k + 1], k++ );
        overlaps[j] = o; res[j] = scanGrid[i];
180 181 182
    }
}

Alex Leontiev's avatar
Alex Leontiev committed
183 184 185 186 187 188 189 190 191
double variance(const Mat& img)
{
    double p = 0, p2 = 0;
    for( int i = 0; i < img.rows; i++ )
    {
        for( int j = 0; j < img.cols; j++ )
        {
            p += img.at<uchar>(i, j);
            p2 += img.at<uchar>(i, j) * img.at<uchar>(i, j);
192 193
        }
    }
Alex Leontiev's avatar
Alex Leontiev committed
194 195 196
    p /= (img.cols * img.rows);
    p2 /= (img.cols * img.rows);
    return p2 - p * p;
197 198
}

Alex Leontiev's avatar
Alex Leontiev committed
199 200 201 202
double NCC(const Mat_<uchar>& patch1, const Mat_<uchar>& patch2)
{
    CV_Assert( patch1.rows == patch2.rows );
    CV_Assert( patch1.cols == patch2.cols );
203

Alex Leontiev's avatar
Alex Leontiev committed
204
    int N = patch1.rows * patch1.cols;
Alex Leontiev's avatar
Alex Leontiev committed
205 206 207 208 209 210
    int s1 = 0, s2 = 0, n1 = 0, n2 = 0, prod = 0;
    for( int i = 0; i < patch1.rows; i++ )
    {
        for( int j = 0; j < patch1.cols; j++ )
        {
            int p1 = patch1(i, j), p2 = patch2(i, j);
Alex Leontiev's avatar
Alex Leontiev committed
211 212 213
            s1 += p1; s2 += p2;
            n1 += (p1 * p1); n2 += (p2 * p2);
            prod += (p1 * p2);
Alex Leontiev's avatar
Alex Leontiev committed
214 215
        }
    }
Alex Leontiev's avatar
Alex Leontiev committed
216
    double sq1 = sqrt(std::max(0.0, n1 - 1.0 * s1 * s1 / N)), sq2 = sqrt(std::max(0.0, n2 - 1.0 * s2 * s2 / N));
Alex Leontiev's avatar
Alex Leontiev committed
217
    double ares = (sq2 == 0) ? sq1 / abs(sq1) : (prod - s1 * s2 / N) / sq1 / sq2;
218 219
    return ares;
}
Alex Leontiev's avatar
Alex Leontiev committed
220 221 222
int getMedian(const std::vector<int>& values, int size)
{
    if( size == -1 )
Alex Leontiev's avatar
Alex Leontiev committed
223
        size = (int)values.size();
Alex Leontiev's avatar
Alex Leontiev committed
224 225 226
    std::vector<int> copy(values.begin(), values.begin() + size);
    std::sort(copy.begin(), copy.end());
    if( size % 2 == 0 )
Alex Leontiev's avatar
Alex Leontiev committed
227
        return (copy[size / 2 - 1] + copy[size / 2]) / 2;
Alex Leontiev's avatar
Alex Leontiev committed
228
    else
Alex Leontiev's avatar
Alex Leontiev committed
229
        return copy[(size - 1) / 2];
230 231
}

Alex Leontiev's avatar
Alex Leontiev committed
232 233
double overlap(const Rect2d& r1, const Rect2d& r2)
{
Alex Leontiev's avatar
Alex Leontiev committed
234 235
    double a1 = r1.area(), a2 = r2.area(), a0 = (r1&r2).area();
    return a0 / (a1 + a2 - a0);
236 237
}

Alex Leontiev's avatar
Alex Leontiev committed
238 239 240 241 242 243 244 245 246 247
void resample(const Mat& img, const RotatedRect& r2, Mat_<uchar>& samples)
{
    Mat_<float> M(2, 3), R(2, 2), Si(2, 2), s(2, 1), o(2, 1);
    R(0, 0) = (float)cos(r2.angle * CV_PI / 180); R(0, 1) = (float)(-sin(r2.angle * CV_PI / 180));
    R(1, 0) = (float)sin(r2.angle * CV_PI / 180); R(1, 1) = (float)cos(r2.angle * CV_PI / 180);
    Si(0, 0) = (float)(samples.cols / r2.size.width); Si(0, 1) = 0.0f;
    Si(1, 0) = 0.0f; Si(1, 1) = (float)(samples.rows / r2.size.height);
    s(0, 0) = (float)samples.cols; s(1, 0) = (float)samples.rows;
    o(0, 0) = r2.center.x; o(1, 0) = r2.center.y;
    Mat_<float> A(2, 2), b(2, 1);
Alex Leontiev's avatar
Alex Leontiev committed
248 249
    A = Si * R;
    b = s / 2.0 - Si * R * o;
Alex Leontiev's avatar
Alex Leontiev committed
250 251 252
    A.copyTo(M.colRange(Range(0, 2)));
    b.copyTo(M.colRange(Range(2, 3)));
    warpAffine(img, samples, M, samples.size());
253
}
Alex Leontiev's avatar
Alex Leontiev committed
254 255 256 257 258 259
void resample(const Mat& img, const Rect2d& r2, Mat_<uchar>& samples)
{
    Mat_<float> M(2, 3);
    M(0, 0) = (float)(samples.cols / r2.width); M(0, 1) = 0.0f; M(0, 2) = (float)(-r2.x * samples.cols / r2.width);
    M(1, 0) = 0.0f; M(1, 1) = (float)(samples.rows / r2.height); M(1, 2) = (float)(-r2.y * samples.rows / r2.height);
    warpAffine(img, samples, M, samples.size());
260 261 262
}

//other stuff
Alex Leontiev's avatar
Alex Leontiev committed
263 264
void TLDEnsembleClassifier::stepPrefSuff(std::vector<Vec4b>& arr, int pos, int len, int gridSize)
{
Alex Leontiev's avatar
Alex Leontiev committed
265
#if 0
Alex Leontiev's avatar
Alex Leontiev committed
266
        int step = len / (gridSize - 1), pref = (len - step * (gridSize - 1)) / 2;
Alex Leontiev's avatar
Alex Leontiev committed
267
        for( int i = 0; i < (int)(sizeof(x1) / sizeof(x1[0])); i++ )
Alex Leontiev's avatar
Alex Leontiev committed
268
            arr[i] = pref + arr[i] * step;
Alex Leontiev's avatar
Alex Leontiev committed
269
#else
Alex Leontiev's avatar
Alex Leontiev committed
270
        int total = len - gridSize;
Alex Leontiev's avatar
Alex Leontiev committed
271 272 273
        int quo = total / (gridSize - 1), rem = total % (gridSize - 1);
        int smallStep = quo, bigStep = quo + 1;
        int bigOnes = rem, smallOnes = gridSize - bigOnes - 1;
Alex Leontiev's avatar
Alex Leontiev committed
274
        int bigOnes_front = bigOnes / 2, bigOnes_back = bigOnes - bigOnes_front;
Alex Leontiev's avatar
Alex Leontiev committed
275 276 277 278
        for( int i = 0; i < (int)arr.size(); i++ )
        {
            if( arr[i].val[pos] < bigOnes_back )
            {
Alex Leontiev's avatar
Alex Leontiev committed
279
                arr[i].val[pos] = (uchar)(arr[i].val[pos] * bigStep + arr[i].val[pos]);
280 281
                continue;
            }
Alex Leontiev's avatar
Alex Leontiev committed
282 283
            if( arr[i].val[pos] < (bigOnes_front + smallOnes) )
            {
Alex Leontiev's avatar
Alex Leontiev committed
284
                arr[i].val[pos] = (uchar)(bigOnes_front * bigStep + (arr[i].val[pos] - bigOnes_front) * smallStep + arr[i].val[pos]);
285 286
                continue;
            }
Alex Leontiev's avatar
Alex Leontiev committed
287 288
            if( arr[i].val[pos] < (bigOnes_front + smallOnes + bigOnes_back) )
            {
Alex Leontiev's avatar
Alex Leontiev committed
289 290 291
                arr[i].val[pos] =
                    (uchar)(bigOnes_front * bigStep + smallOnes * smallStep + 
                            (arr[i].val[pos] - (bigOnes_front + smallOnes)) * bigStep + arr[i].val[pos]);
292 293
                continue;
            }
Alex Leontiev's avatar
Alex Leontiev committed
294
            arr[i].val[pos] = (uchar)(len - 1);
295
        }
Alex Leontiev's avatar
Alex Leontiev committed
296
#endif
297
}
Alex Leontiev's avatar
Alex Leontiev committed
298 299 300 301
void TLDEnsembleClassifier::prepareClassifier(int rowstep)
{
    if( lastStep_ != rowstep )
    {
Alex Leontiev's avatar
Alex Leontiev committed
302
        lastStep_ = rowstep;
Alex Leontiev's avatar
Alex Leontiev committed
303 304
        for( int i = 0; i < (int)offset.size(); i++ )
        {
Alex Leontiev's avatar
Alex Leontiev committed
305 306
            offset[i].x = rowstep * measurements[i].val[0] + measurements[i].val[1];
            offset[i].y = rowstep * measurements[i].val[2] + measurements[i].val[3];
Alex Leontiev's avatar
Alex Leontiev committed
307 308 309
        }
    }
}
Alex Leontiev's avatar
Alex Leontiev committed
310 311
TLDEnsembleClassifier::TLDEnsembleClassifier(const std::vector<Vec4b>& meas, int beg, int end):lastStep_(-1)
{
Alex Leontiev's avatar
Alex Leontiev committed
312 313 314
    int posSize = 1, mpc = end - beg;
    for( int i = 0; i < mpc; i++ )
        posSize *= 2;
Alex Leontiev's avatar
Alex Leontiev committed
315 316 317
    posAndNeg.assign(posSize, Point2i(0, 0));
    measurements.assign(meas.begin() + beg, meas.begin() + end);
    offset.assign(mpc, Point2i(0, 0));
318
}
Alex Leontiev's avatar
Alex Leontiev committed
319 320 321 322
void TLDEnsembleClassifier::integrate(const Mat_<uchar>& patch, bool isPositive)
{
    int position = code(patch.data, (int)patch.step[0]);
    if( isPositive )
Alex Leontiev's avatar
Alex Leontiev committed
323
        posAndNeg[position].x++;
Alex Leontiev's avatar
Alex Leontiev committed
324
    else
Alex Leontiev's avatar
Alex Leontiev committed
325
        posAndNeg[position].y++;
326
}
Alex Leontiev's avatar
Alex Leontiev committed
327 328 329
double TLDEnsembleClassifier::posteriorProbability(const uchar* data, int rowstep) const
{
    int position = code(data, rowstep);
Alex Leontiev's avatar
Alex Leontiev committed
330
    double posNum = (double)posAndNeg[position].x, negNum = (double)posAndNeg[position].y;
Alex Leontiev's avatar
Alex Leontiev committed
331
    if( posNum == 0.0 && negNum == 0.0 )
332
        return 0.0;
Alex Leontiev's avatar
Alex Leontiev committed
333
    else
Alex Leontiev's avatar
Alex Leontiev committed
334
        return posNum / (posNum + negNum);
335
}
Alex Leontiev's avatar
Alex Leontiev committed
336 337
double TLDEnsembleClassifier::posteriorProbabilityFast(const uchar* data) const
{
Alex Leontiev's avatar
Alex Leontiev committed
338 339
    int position = codeFast(data);
    double posNum = (double)posAndNeg[position].x, negNum = (double)posAndNeg[position].y;
Alex Leontiev's avatar
Alex Leontiev committed
340
    if( posNum == 0.0 && negNum == 0.0 )
Alex Leontiev's avatar
Alex Leontiev committed
341
        return 0.0;
Alex Leontiev's avatar
Alex Leontiev committed
342
    else
Alex Leontiev's avatar
Alex Leontiev committed
343
        return posNum / (posNum + negNum);
Alex Leontiev's avatar
Alex Leontiev committed
344
}
Alex Leontiev's avatar
Alex Leontiev committed
345 346
int TLDEnsembleClassifier::codeFast(const uchar* data) const
{
Alex Leontiev's avatar
Alex Leontiev committed
347
    int position = 0;
Alex Leontiev's avatar
Alex Leontiev committed
348 349
    for( int i = 0; i < (int)measurements.size(); i++ )
    {
Alex Leontiev's avatar
Alex Leontiev committed
350
        position = position << 1;
Alex Leontiev's avatar
Alex Leontiev committed
351
        if( data[offset[i].x] < data[offset[i].y] )
Alex Leontiev's avatar
Alex Leontiev committed
352 353 354 355
            position++;
    }
    return position;
}
Alex Leontiev's avatar
Alex Leontiev committed
356 357
int TLDEnsembleClassifier::code(const uchar* data, int rowstep) const
{
Alex Leontiev's avatar
Alex Leontiev committed
358
    int position = 0;
Alex Leontiev's avatar
Alex Leontiev committed
359 360
    for( int i = 0; i < (int)measurements.size(); i++ )
    {
Alex Leontiev's avatar
Alex Leontiev committed
361 362 363 364
        position = position << 1;
        if( *(data + rowstep * measurements[i].val[0] + measurements[i].val[1]) <
                *(data + rowstep * measurements[i].val[2] + measurements[i].val[3]) )
        {
365 366 367 368 369
            position++;
        }
    }
    return position;
}
Alex Leontiev's avatar
Alex Leontiev committed
370 371 372
int TLDEnsembleClassifier::makeClassifiers(Size size, int measurePerClassifier, int gridSize,
        std::vector<TLDEnsembleClassifier>& classifiers)
{
Alex Leontiev's avatar
Alex Leontiev committed
373 374 375

    std::vector<Vec4b> measurements;

Alex Leontiev's avatar
Alex Leontiev committed
376 377 378 379 380 381
    for( int i = 0; i < gridSize; i++ )
    {
        for( int j = 0; j < gridSize; j++ )
        {
            for( int k = 0; k < j; k++ )
            {
Alex Leontiev's avatar
Alex Leontiev committed
382
                Vec4b m;
Alex Leontiev's avatar
Alex Leontiev committed
383
                m.val[0] = m.val[2] = (uchar)i;
Alex Leontiev's avatar
Alex Leontiev committed
384
                m.val[1] = (uchar)j; m.val[3] = (uchar)k;
Alex Leontiev's avatar
Alex Leontiev committed
385
                measurements.push_back(m);
Alex Leontiev's avatar
Alex Leontiev committed
386
                m.val[1] = m.val[3] = (uchar)i;
Alex Leontiev's avatar
Alex Leontiev committed
387
                m.val[0] = (uchar)j; m.val[2] = (uchar)k;
Alex Leontiev's avatar
Alex Leontiev committed
388 389 390 391
                measurements.push_back(m);
            }
        }
    }
Alex Leontiev's avatar
Alex Leontiev committed
392
    random_shuffle(measurements.begin(), measurements.end());
Alex Leontiev's avatar
Alex Leontiev committed
393

Alex Leontiev's avatar
Alex Leontiev committed
394 395 396 397
    stepPrefSuff(measurements, 0, size.width, gridSize);
    stepPrefSuff(measurements, 1, size.width, gridSize);
    stepPrefSuff(measurements, 2, size.height, gridSize);
    stepPrefSuff(measurements, 3, size.height, gridSize);
Alex Leontiev's avatar
Alex Leontiev committed
398

Alex Leontiev's avatar
Alex Leontiev committed
399
    for( int i = 0, howMany = (int)measurements.size() / measurePerClassifier; i < howMany; i++ )
Alex Leontiev's avatar
Alex Leontiev committed
400
        classifiers.push_back(TLDEnsembleClassifier(measurements, i * measurePerClassifier, (i + 1) * measurePerClassifier));
Alex Leontiev's avatar
Alex Leontiev committed
401 402
    return (int)classifiers.size();
}
403

Alex Leontiev's avatar
Alex Leontiev committed
404
}}