Skip to content

Commit

Permalink
Using 64 bit integers to count
Browse files Browse the repository at this point in the history
  • Loading branch information
sklum committed Oct 7, 2015
1 parent 8b767b4 commit 661c722
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions openbr/plugins/classification/cascade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ class CascadeClassifier : public Classifier
return negative;
}

int mine()
uint64 mine()
{
int passedNegatives = 0;
uint64 passedNegatives = 0;
forever {
Mat negative;
Point offset;
Expand Down Expand Up @@ -294,13 +294,13 @@ class CascadeClassifier : public Classifier

qDebug() << "POS count : consumed " << posSamples.size() << ":" << posIndex;

QFutureSynchronizer<int> futures;
QFutureSynchronizer<uint64> futures;
for (int i=0; i<QThread::idealThreadCount(); i++)
futures.addFuture(QtConcurrent::run(this, &CascadeClassifier::mine));
futures.waitForFinished();

int passedNegs = 0;
QList<QFuture<int> > results = futures.futures();
uint64 passedNegs = 0;
QList<QFuture<uint64> > results = futures.futures();
for (int i=0; i<results.size(); i++)
passedNegs += results[i].result();

Expand Down

0 comments on commit 661c722

Please sign in to comment.