Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(traffic_light_multi_camera_fusion): take confidence into consideration(#6267) #1155

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading