From 9b46ee1da48e2c41a19c6700cd1f5459e1724cd7 Mon Sep 17 00:00:00 2001 From: Atsushi Kuwagata Date: Thu, 11 Jan 2024 20:09:49 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sciurus17_examples/src/color_detection.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sciurus17_examples/src/color_detection.cpp b/sciurus17_examples/src/color_detection.cpp index f0178e0..a5386b9 100644 --- a/sciurus17_examples/src/color_detection.cpp +++ b/sciurus17_examples/src/color_detection.cpp @@ -109,9 +109,11 @@ void ColorDetection::image_callback(const sensor_msgs::msg::Image::SharedPtr msg RCLCPP_DEBUG_STREAM(this->get_logger(), "Detect at" << object_point << "."); // 検出領域と検出位置を描画 - cv::Scalar color(256, 0, 256); - cv::drawContours(img_annotated, contours, max_area_i, color, 2); - cv::circle(img_annotated, object_point, 10, color, -1); + const cv::Scalar ANNOTATE_COLOR(256, 0, 256); + const int ANNOTATE_THICKNESS = 4; + const int ANNOTATE_RADIUS = 10; + cv::drawContours(img_annotated, contours, max_area_i, ANNOTATE_COLOR, ANNOTATE_THICKNESS); + cv::circle(img_annotated, object_point, ANNOTATE_RADIUS, ANNOTATE_COLOR, -1); // 画像の中心を原点とした検出位置に変換 cv::Point2d translated_object_point;