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

Method DrawCirclesInPlace

pose_graph/src/utils/UtilsOpenCV.cpp:19–40  ·  view source on GitHub ↗

-------------------------------------------------------------------------- */ add circles in the image at desired position/size/color

Source from the content-addressed store, hash-verified

17/* -------------------------------------------------------------------------- */
18// add circles in the image at desired position/size/color
19void UtilsOpenCV::DrawCirclesInPlace(cv::Mat& img,
20 const KeypointsCV& image_points,
21 const cv::Scalar& color,
22 const double& msize,
23 const std::vector<int>& point_ids,
24 const int& rem_id) {
25 // text offset
26 cv::Point2f text_offset(-10, -5);
27 if (img.channels() < 3) cv::cvtColor(img, img, cv::COLOR_GRAY2BGR);
28 for (size_t i = 0u; i < image_points.size(); i++) {
29 cv::circle(img, image_points[i], msize, color, 2);
30 if (point_ids.size() == image_points.size()) {
31 // We also have text
32 cv::putText(img,
33 std::to_string(point_ids[i] % rem_id),
34 image_points[i] + text_offset,
35 cv::FONT_HERSHEY_COMPLEX,
36 0.5,
37 color);
38 }
39 }
40}
41/* -------------------------------------------------------------------------- */
42// add squares in the image at desired position/size/color
43void UtilsOpenCV::DrawSquaresInPlace(cv::Mat& img,

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected