@@ -191,38 +191,39 @@ void RoiClusterFusionNode::fuseOnSingleImage(
191
191
max_iou = iou + iou_x + iou_y;
192
192
}
193
193
}
194
- bool is_roi_label_known = feature_obj.object .classification .front ().label !=
195
- autoware_auto_perception_msgs::msg::ObjectClassification::UNKNOWN;
196
- bool is_roi_existence_prob_higher =
197
- output_cluster_msg.feature_objects .at (index ).object .existence_probability <=
198
- feature_obj.object .existence_probability ;
199
- if (iou_threshold_ < max_iou && is_roi_existence_prob_higher && is_roi_label_known) {
200
- output_cluster_msg.feature_objects .at (index ).object .classification =
201
- feature_obj.object .classification ;
202
-
203
- // Update existence_probability for fused objects
204
- if (
205
- output_cluster_msg.feature_objects .at (index ).object .existence_probability <
206
- min_roi_existence_prob_) {
207
- output_cluster_msg.feature_objects .at (index ).object .existence_probability =
208
- min_roi_existence_prob_;
194
+ if (!output_cluster_msg.feature_objects .empty ()) {
195
+ bool is_roi_label_known = feature_obj.object .classification .front ().label !=
196
+ autoware_auto_perception_msgs::msg::ObjectClassification::UNKNOWN;
197
+ bool is_roi_existence_prob_higher =
198
+ output_cluster_msg.feature_objects .at (index ).object .existence_probability <=
199
+ feature_obj.object .existence_probability ;
200
+ if (iou_threshold_ < max_iou && is_roi_existence_prob_higher && is_roi_label_known) {
201
+ output_cluster_msg.feature_objects .at (index ).object .classification =
202
+ feature_obj.object .classification ;
203
+
204
+ // Update existence_probability for fused objects
205
+ if (
206
+ output_cluster_msg.feature_objects .at (index ).object .existence_probability <
207
+ min_roi_existence_prob_) {
208
+ output_cluster_msg.feature_objects .at (index ).object .existence_probability =
209
+ min_roi_existence_prob_;
210
+ }
209
211
}
210
- }
211
212
212
- // fuse with unknown roi
213
-
214
- if (unknown_iou_threshold_ < max_iou && is_roi_existence_prob_higher && !is_roi_label_known) {
215
- output_cluster_msg.feature_objects .at (index ).object .classification =
216
- feature_obj.object .classification ;
217
- // Update existence_probability for fused objects
218
- if (
219
- output_cluster_msg.feature_objects .at (index ).object .existence_probability <
220
- min_roi_existence_prob_) {
221
- output_cluster_msg.feature_objects .at (index ).object .existence_probability =
222
- min_roi_existence_prob_;
213
+ // fuse with unknown roi
214
+
215
+ if (unknown_iou_threshold_ < max_iou && is_roi_existence_prob_higher && !is_roi_label_known) {
216
+ output_cluster_msg.feature_objects .at (index ).object .classification =
217
+ feature_obj.object .classification ;
218
+ // Update existence_probability for fused objects
219
+ if (
220
+ output_cluster_msg.feature_objects .at (index ).object .existence_probability <
221
+ min_roi_existence_prob_) {
222
+ output_cluster_msg.feature_objects .at (index ).object .existence_probability =
223
+ min_roi_existence_prob_;
224
+ }
223
225
}
224
226
}
225
-
226
227
debug_image_rois.push_back (feature_obj.feature .roi );
227
228
}
228
229
0 commit comments