fix mot id not displaying
This commit is contained in:
parent
151acbe2e3
commit
b23ee6d509
|
@ -189,6 +189,7 @@ void SORT::update(TargetsInFrame& tgts)
|
|||
tracklet.id = ++ this->_next_tracklet_id;
|
||||
// cout << tracklet.id << endl;
|
||||
tgts.targets[i].tracked_id = this->_next_tracklet_id;
|
||||
tgts.targets[i].has_tid = true;
|
||||
|
||||
tracklet.bbox << box.x1, box.y1, box.x2-box.x1, box.y2-box.y1; // x,y,w,h
|
||||
tracklet.age = 0;
|
||||
|
@ -207,6 +208,7 @@ void SORT::update(TargetsInFrame& tgts)
|
|||
for (int i=0; i<tgts.targets.size(); i++)
|
||||
{
|
||||
tgts.targets[i].tracked_id = 0;
|
||||
tgts.targets[i].has_tid = true;
|
||||
}
|
||||
|
||||
array<int, 100> match_det;
|
||||
|
@ -278,6 +280,7 @@ void SORT::update(TargetsInFrame& tgts)
|
|||
tracklet.covariance = new_covariance;
|
||||
|
||||
tgts.targets[i].tracked_id = this->_next_tracklet_id;
|
||||
tgts.targets[i].has_tid = true;
|
||||
this->_tracklets.push_back(tracklet);
|
||||
}
|
||||
}
|
||||
|
@ -371,7 +374,7 @@ vector<pair<int, int> > SORT::_hungarian(vector<vector<double> > costMatrix)
|
|||
for (int i=0; i<numRows; i++)
|
||||
{
|
||||
vector<bool> visited(numCols, false);
|
||||
_augment(costMatrix, i, rowMatch, colMatch, visited);
|
||||
this->_augment(costMatrix, i, rowMatch, colMatch, visited);
|
||||
}
|
||||
// step4: calculate the matches
|
||||
matches.clear();
|
||||
|
@ -397,7 +400,7 @@ bool SORT::_augment(const vector<vector<double> >& costMatrix, int row, vector<i
|
|||
if (costMatrix[row][j] == 0 && !visited[j])
|
||||
{
|
||||
visited[j] = true;
|
||||
if (colMatch[j] == -1 || _augment(costMatrix, colMatch[j], rowMatch, colMatch, visited))
|
||||
if (colMatch[j] == -1 || this->_augment(costMatrix, colMatch[j], rowMatch, colMatch, visited))
|
||||
{
|
||||
rowMatch[row] = j;
|
||||
colMatch[j] = row;
|
||||
|
|
Loading…
Reference in New Issue