MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / DrawCircles

Method DrawCircles

pose_graph/src/utils/UtilsOpenCV.cpp:154–177  ·  view source on GitHub ↗

-------------------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

152
153/* -------------------------------------------------------------------------- */
154cv::Mat UtilsOpenCV::DrawCircles(const cv::Mat img,
155 const KeypointsCV& image_points,
156 const std::vector<cv::Scalar>& circle_colors,
157 const std::vector<double>& circle_sizes) {
158 cv::Mat img_color = img.clone();
159 if (img_color.channels() < 3u) {
160 cv::cvtColor(img_color, img_color, cv::COLOR_GRAY2BGR);
161 }
162
163 for (size_t i = 0u; i < image_points.size(); i++) {
164 double circle_size = 3.0;
165 cv::Scalar circle_color(0u, 0u, 255u);
166 if (circle_sizes.size() == image_points.size()) {
167 circle_size = 5.0 * std::max(circle_sizes[i], 0.5);
168 }
169
170 if (circle_colors.size() == image_points.size()) {
171 circle_color = circle_colors[i];
172 }
173
174 cv::circle(img_color, image_points[i], circle_size, circle_color, 2u);
175 }
176 return img_color;
177}
178
179/* -------------------------------------------------------------------------- */
180cv::Mat UtilsOpenCV::DrawCircles(const cv::Mat img,

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected