85 {
86 bool is_background = object->is_background;
88 std::string key = latest_object->sensor_info.name + object->sensor_info.name;
89 const std::vector<float>* weights = nullptr;
90 if (is_background) {
94 } else {
95 weights = &iter->second;
96 }
97 } else {
101 } else {
102 weights = &iter->second;
103 }
104 }
105 if (weights == nullptr || weights->size() < 7) {
106 AERROR <<
"Invalid weights";
107 return 1e+10f;
108 }
109 float distance = 0.f;
110 float delta = 1e-10f;
111
112 double current_time = object->object_ptr->latest_tracked_time;
113 track->PredictState(current_time);
114
115 double time_diff =
116 track->age_ ? current_time - track->latest_visible_time_ : 0;
117
118
119 float euclidean_distance =
123 }
124
125 if (weights->at(0) > delta) {
126 distance +=
128 object, time_diff);
129 }
130 if (weights->at(1) > delta) {
131 distance +=
133 object, time_diff);
134 }
135 if (weights->at(2) > delta) {
136 distance +=
138 object, time_diff);
139 }
140 if (weights->at(3) > delta) {
141 distance +=
143 object, time_diff);
144 }
145 if (weights->at(4) > delta) {
146 distance +=
148 object, time_diff);
149 }
150 if (weights->at(5) > delta) {
152 track->predict_.state,
153 object, time_diff);
154 }
155 if (weights->at(6) > delta) {
156 distance += weights->at(6) *
159 }
160
161 return distance;
162}
static const std::vector< float > kBackgroundDefaultWeight
std::map< std::string, std::vector< float > > background_weight_table_
std::map< std::string, std::vector< float > > foreground_weight_table_
float euclidean_distance_threshold_
double background_object_match_threshold_
static const std::vector< float > kForegroundDefaultWeight
float out_gate_match_cost_
std::shared_ptr< const TrackedObject > TrackedObjectConstPtr
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 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
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 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 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 EuclideanDistance(const TrackedObjectConstPtr &last_object, const Eigen::VectorXf &track_predict, const TrackedObjectConstPtr &new_object, const double time_diff)
: compute euclidean 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
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