17 void CTracker::Update(
const std::vector<Point_t>& detectedCentroid,
const std::vector< std::vector<cv::Point> >& contours)
20 assert(detectedCentroid.size() == contours.size());
28 for (
size_t i = 0; i < detectedCentroid.size(); ++i)
36 size_t M = detectedCentroid.size();
46 for (
size_t i = 0; i <
tracks.size(); i++)
48 for (
size_t j = 0; j < detectedCentroid.size(); j++)
50 Cost[i + j * N] =
tracks[i]->CalcDist(detectedCentroid[j]);
63 for (
size_t i = 0; i < assignment.size(); i++)
65 if (assignment[i] != -1)
70 tracks[i]->skipped_frames = 1;
76 tracks[i]->skipped_frames++;
83 for (
int i = 0; i < static_cast<int>(
tracks.size()); i++)
88 assignment.erase(assignment.begin() + i);
97 for (
size_t i = 0; i < detectedCentroid.size(); ++i)
99 if (
find(assignment.begin(), assignment.end(), i) == assignment.end())
107 for (
size_t i = 0; i < assignment.size(); i++)
111 if (assignment[i] != -1)
113 tracks[i]->skipped_frames = 0;
std::vector< std::unique_ptr< CTrack > > tracks
CTracker(const Params ¶meters)
int max_allowed_skipped_frames
cv::Point3_< track_t > Point_t
void updateParameters(const Params ¶meters)
std::vector< track_t > distMatrix_t
std::vector< int > assignments_t
bool find(const std::vector< unsigned int > &l, unsigned int n)
track_t Solve(const distMatrix_t &distMatrixIn, size_t nOfRows, size_t nOfColumns, assignments_t &assignment, TMethod Method=optimal)
void Update(const std::vector< Point_t > &detectedCentroid, const std::vector< std::vector< cv::Point > > &contour)