Skip to content

Commit

Permalink
Merge pull request #1155 from tier4/cherry-pick/beta/v0.20.1.1+tlr_fu…
Browse files Browse the repository at this point in the history
…sion

feat(traffic_light_multi_camera_fusion): take confidence into consideration(autowarefoundation#6267)
  • Loading branch information
shmpwk authored Mar 4, 2024
2 parents e662b10 + 6558a72 commit d9c5e3d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions perception/traffic_light_multi_camera_fusion/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,9 @@ int compareRecord(const traffic_light::FusionRecord & r1, const traffic_light::F
int visible_score_1 = calVisibleScore(r1);
int visible_score_2 = calVisibleScore(r2);
if (visible_score_1 == visible_score_2) {
int area_1 = r1.roi.roi.width * r1.roi.roi.height;
int area_2 = r2.roi.roi.width * r2.roi.roi.height;
if (area_1 < area_2) {
return -1;
} else {
return static_cast<int>(area_1 > area_2);
}
double confidence_1 = r1.signal.elements[0].confidence;
double confidence_2 = r2.signal.elements[0].confidence;
return confidence_1 < confidence_2 ? -1 : 1;
} else {
return visible_score_1 < visible_score_2 ? -1 : 1;
}
Expand Down

0 comments on commit d9c5e3d

Please sign in to comment.