@@ -146,6 +146,37 @@ void DataAssociation::assign(
146
146
}
147
147
}
148
148
149
+ void DataAssociation::objectFilter (
150
+ autoware_auto_perception_msgs::msg::DetectedObjects & measurements) const
151
+ {
152
+ using Label = autoware_auto_perception_msgs::msg::ObjectClassification;
153
+
154
+ for (auto & measurement_object : measurements.objects ) {
155
+ auto & obj_class_list = measurement_object.classification ;
156
+ const std::uint8_t measurement_label =
157
+ object_recognition_utils::getHighestProbLabel (obj_class_list);
158
+ bool passed_gate = true ;
159
+ const double max_area = max_area_matrix_ (measurement_label, measurement_label);
160
+ const double min_area = min_area_matrix_ (measurement_label, measurement_label);
161
+ const double area = tier4_autoware_utils::getArea (measurement_object.shape );
162
+ if (area < min_area || max_area < area) passed_gate = false ;
163
+
164
+ //
165
+ if (!passed_gate) {
166
+ // change top-rate label to unknown, step back the existing labels
167
+ constexpr float RATE_REDUCED = 0 .3f ;
168
+ constexpr float RATE_OVERWRITE = 0 .7f ;
169
+ for (auto & obj_class : obj_class_list) {
170
+ obj_class.probability *= RATE_REDUCED;
171
+ }
172
+ Label new_obj_class;
173
+ new_obj_class.label = Label::UNKNOWN;
174
+ new_obj_class.probability = RATE_OVERWRITE;
175
+ obj_class_list.emplace_back (new_obj_class);
176
+ }
177
+ }
178
+ }
179
+
149
180
Eigen::MatrixXd DataAssociation::calcScoreMatrix (
150
181
const autoware_auto_perception_msgs::msg::DetectedObjects & measurements,
151
182
const std::list<std::shared_ptr<Tracker>> & trackers)
@@ -179,13 +210,6 @@ Eigen::MatrixXd DataAssociation::calcScoreMatrix(
179
210
if (passed_gate) {
180
211
if (max_dist < dist) passed_gate = false ;
181
212
}
182
- // area gate
183
- if (passed_gate) {
184
- const double max_area = max_area_matrix_ (tracker_label, measurement_label);
185
- const double min_area = min_area_matrix_ (tracker_label, measurement_label);
186
- const double area = tier4_autoware_utils::getArea (measurement_object.shape );
187
- if (area < min_area || max_area < area) passed_gate = false ;
188
- }
189
213
// angle gate
190
214
if (passed_gate) {
191
215
const double max_rad = max_rad_matrix_ (tracker_label, measurement_label);
0 commit comments