Skip to content

Commit 6558a72

Browse files
committed
feat(traffic_light_multi_camera_fusion): take confidence into consideration (autowarefoundation#6267)
* fix: highest confidence Signed-off-by: tzhong518 <sworgun@gmail.com> * fix: use the confidence of the first element Signed-off-by: tzhong518 <sworgun@gmail.com> --------- Signed-off-by: tzhong518 <sworgun@gmail.com>
1 parent beeaba3 commit 6558a72

File tree

1 file changed

+3
-7
lines changed
  • perception/traffic_light_multi_camera_fusion/src

1 file changed

+3
-7
lines changed

perception/traffic_light_multi_camera_fusion/src/node.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,9 @@ int compareRecord(const traffic_light::FusionRecord & r1, const traffic_light::F
8282
int visible_score_1 = calVisibleScore(r1);
8383
int visible_score_2 = calVisibleScore(r2);
8484
if (visible_score_1 == visible_score_2) {
85-
int area_1 = r1.roi.roi.width * r1.roi.roi.height;
86-
int area_2 = r2.roi.roi.width * r2.roi.roi.height;
87-
if (area_1 < area_2) {
88-
return -1;
89-
} else {
90-
return static_cast<int>(area_1 > area_2);
91-
}
85+
double confidence_1 = r1.signal.elements[0].confidence;
86+
double confidence_2 = r2.signal.elements[0].confidence;
87+
return confidence_1 < confidence_2 ? -1 : 1;
9288
} else {
9389
return visible_score_1 < visible_score_2 ? -1 : 1;
9490
}

0 commit comments

Comments
 (0)