|
19 | 19 |
|
20 | 20 | #include "sensor_msgs/msg/region_of_interest.hpp"
|
21 | 21 |
|
| 22 | +#include <algorithm> |
22 | 23 | #include <map>
|
23 | 24 | #include <memory>
|
24 | 25 | #include <string>
|
@@ -65,47 +66,6 @@ float calIou(
|
65 | 66 | return static_cast<float>(area1) / static_cast<float>(area2);
|
66 | 67 | }
|
67 | 68 |
|
68 |
| -// double getGenIoU( |
69 |
| -// const sensor_msgs::msg::RegionOfInterest & roi1, const sensor_msgs::msg::RegionOfInterest & |
70 |
| -// roi2) |
71 |
| -// { |
72 |
| -// int rect1_x_min = static_cast<int>(roi1.x_offset); |
73 |
| -// int rect1_x_max = static_cast<int>(roi1.x_offset + roi1.width); |
74 |
| -// int rect1_y_min = static_cast<int>(roi1.y_offset); |
75 |
| -// int rect1_y_max = static_cast<int>(roi1.y_offset + roi1.height); |
76 |
| -// int rect2_x_min = static_cast<int>(roi2.x_offset); |
77 |
| -// int rect2_x_max = static_cast<int>(roi2.x_offset + roi2.width); |
78 |
| -// int rect2_y_min = static_cast<int>(roi2.y_offset); |
79 |
| -// int rect2_y_max = static_cast<int>(roi2.y_offset + roi2.height); |
80 |
| -// int rect1_area = roi1.width * roi1.height; |
81 |
| -// int rect2_area = roi2.width * roi2.height; |
82 |
| -// int x_min = std::max(rect1_x_min, rect2_x_min); |
83 |
| -// int y_min = std::max(rect1_y_min, rect2_y_min); |
84 |
| -// int x_max = std::min(rect1_x_max, rect2_x_max); |
85 |
| -// int y_max = std::min(rect1_y_max, rect2_y_max); |
86 |
| - |
87 |
| -// auto w = std::max(0, x_max - x_min); |
88 |
| -// auto h = std::max(0, y_max - y_min); |
89 |
| -// auto intersect = w * h; |
90 |
| - |
91 |
| -// auto union_area = rect1_area + rect2_area - intersect; |
92 |
| - |
93 |
| -// double iou = static_cast<double>(intersect) / static_cast<double>(union_area); |
94 |
| - |
95 |
| -// // convex shape area |
96 |
| - |
97 |
| -// auto con_x_min = std::min(rect1_x_min, rect2_x_min); |
98 |
| -// auto con_y_min = std::min(rect1_y_min, rect2_y_min); |
99 |
| -// auto con_x_max = std::max(rect1_x_max, rect2_x_max); |
100 |
| -// auto con_y_max = std::max(rect1_y_max, rect2_y_max); |
101 |
| - |
102 |
| -// auto con_area = (con_x_max - con_x_min + 1) * (con_y_max - con_y_min + 1); |
103 |
| - |
104 |
| -// // GIoU calc |
105 |
| -// double giou = iou - static_cast<double>(con_area - union_area) / static_cast<double>(con_area); |
106 |
| - |
107 |
| -// return giou; |
108 |
| -// } |
109 | 69 | // create and function of 2 binary image
|
110 | 70 | int andOf2Images(cv::Mat & img1, cv::Mat & img2)
|
111 | 71 | {
|
@@ -174,7 +134,6 @@ TrafficLightSelectorNode::TrafficLightSelectorNode(const rclcpp::NodeOptions & n
|
174 | 134 | {
|
175 | 135 | max_iou_threshold_ = declare_parameter<double>("max_iou_threshold", 0.0);
|
176 | 136 | RCLCPP_INFO(get_logger(), "max_iou_threshold: %f", max_iou_threshold_);
|
177 |
| - debug_ = declare_parameter<bool>("debug"); |
178 | 137 | using std::placeholders::_1;
|
179 | 138 | using std::placeholders::_2;
|
180 | 139 | using std::placeholders::_3;
|
@@ -282,8 +241,6 @@ void TrafficLightSelectorNode::objectsCallback(
|
282 | 241 | }
|
283 | 242 | }
|
284 | 243 | pub_traffic_light_rois_->publish(output);
|
285 |
| - if (debug_) { |
286 |
| - } |
287 | 244 | return;
|
288 | 245 | }
|
289 | 246 | } // namespace autoware::traffic_light
|
|
0 commit comments