projects
/
trackerpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
finish tracker
[trackerpp.git]
/
src
/
MultiTracker.cpp
diff --git
a/src/MultiTracker.cpp
b/src/MultiTracker.cpp
index
aef5e2e
..
547a195
100644
(file)
--- a/
src/MultiTracker.cpp
+++ b/
src/MultiTracker.cpp
@@
-14,6
+14,7
@@
static const cv::Size PREFERRED_SIZE = Size(64, 128);
static const double MaxCost = 100000;
static const int MaxPatch = 5;
static const double MaxCost = 100000;
static const int MaxPatch = 5;
+static const double ProbThreshold = 0.05;
MultiTracker::MultiTracker(EngineWPtr e)
: engine(e)
MultiTracker::MultiTracker(EngineWPtr e)
: engine(e)
@@
-74,8
+75,11
@@
double MultiTracker::distance(TrackerPtr tracker, const cv::Mat& image, const De
ss = similarity(i, patch);
features.insert(features.end(), ss.begin(), ss.end());
}
ss = similarity(i, patch);
features.insert(features.end(), ss.begin(), ss.end());
}
- double prob = predictor->predict(4, features);
- return prob;
+ double prob = predictor->predict(MaxPatch - 1, features); // TODO ???
+ if (prob > ProbThreshold)
+ return -log(prob);
+ else
+ return MaxCost;
}
static float calc_iou_ratio(const Detection& d1, const Detection& d2)
}
static float calc_iou_ratio(const Detection& d1, const Detection& d2)
@@
-85,6
+89,12
@@
static float calc_iou_ratio(const Detection& d1, const Detection& d2)
void MultiTracker::update(unsigned int total, const Detection* detections, const Mat& image)
{
void MultiTracker::update(unsigned int total, const Detection* detections, const Mat& image)
{
+ // predict trackers, update trackers using kalman filter
+ for (auto t : trackers){
+ t->predict();
+ }
+
+ // match the trackers with the detections
int row = trackers.size();
int col = total;
Eigen::MatrixXi cost_matrix = Eigen::MatrixXi::Zero(row, col);
int row = trackers.size();
int col = total;
Eigen::MatrixXi cost_matrix = Eigen::MatrixXi::Zero(row, col);