83 {
84 bool is_background = object->is_background;
86 std::string key = latest_object->sensor_info.name + object->sensor_info.name;
87 const std::vector<float>* weights = nullptr;
88 if (is_background) {
92 } else {
93 weights = &iter->second;
94 }
95 } else {
99 } else {
100 weights = &iter->second;
101 }
102 }
103 if (weights == nullptr || weights->size() < 7) {
104 AERROR <<
"Invalid weights";
105 return 1e+10f;
106 }
107 float distance = 0.f;
108 float delta = 1e-10f;
109
110 double current_time = object->object_ptr->latest_tracked_time;
111 track->PredictState(current_time);
112
113 double time_diff =
114 track->age_ ? current_time - track->latest_visible_time_ : 0;
115 if (weights->at(0) > delta) {
116 distance +=
118 object, time_diff);
119 }
120 if (weights->at(1) > delta) {
121 distance +=
123 object, time_diff);
124 }
125 if (weights->at(2) > delta) {
126 distance +=
128 object, time_diff);
129 }
130 if (weights->at(3) > delta) {
131 distance +=
133 object, time_diff);
134 }
135 if (weights->at(4) > delta) {
136 distance +=
138 object, time_diff);
139 }
140 if (weights->at(5) > delta) {
142 track->predict_.state,
143 object, time_diff);
144 }
145 if (weights->at(6) > delta) {
146 distance += weights->at(6) *
149 }
150
151
152
153
154
155 return distance;
156}
std::map< std::string, std::vector< float > > foreground_weight_table_
static const std::vector< float > kForegroundDefaultWeight
double background_object_match_threshold_
std::map< std::string, std::vector< float > > background_weight_table_
static const std::vector< float > kBackgroundDefaultWeight
float BboxSizeDistance(const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
Compute bbox size distance for given track & object
float PointNumDistance(const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
Compute point num distance for given track & object
std::shared_ptr< const TrackedObject > TrackedObjectConstPtr
float LocationDistance(const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
Compute location distance for given track & object
float CentroidShiftDistance(const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
Compute centroid shift distance for object and background match
float BboxIouDistance(const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff, double match_threshold)
Compute bbox iou distance for object and background match
float DirectionDistance(const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
Compute direction distance for given track & object
float HistogramDistance(const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
Compute histogram distance for given track & object