From 0b7fce63ad68686a534f94155fae68343c3ad150 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Fri, 21 Nov 2025 12:09:23 -0800 Subject: [PATCH 1/4] increase resolution and text size (in these modern times) Signed-off-by: William Woodall --- intra_process_demo/include/image_pipeline/camera_node.hpp | 2 +- intra_process_demo/include/image_pipeline/common.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/intra_process_demo/include/image_pipeline/camera_node.hpp b/intra_process_demo/include/image_pipeline/camera_node.hpp index c5e0109c5..1f6c5b6c4 100644 --- a/intra_process_demo/include/image_pipeline/camera_node.hpp +++ b/intra_process_demo/include/image_pipeline/camera_node.hpp @@ -41,7 +41,7 @@ class CameraNode final : public rclcpp::Node /// \param height What video height to capture at explicit CameraNode( const std::string & output, const std::string & node_name = "camera_node", - bool watermark = true, int device = 0, int width = 320, int height = 240) + bool watermark = true, int device = 0, int width = 640, int height = 480) : Node(node_name, rclcpp::NodeOptions().use_intra_process_comms(true)), canceled_(false), watermark_(watermark) { diff --git a/intra_process_demo/include/image_pipeline/common.hpp b/intra_process_demo/include/image_pipeline/common.hpp index f81e6e535..a2876f20e 100644 --- a/intra_process_demo/include/image_pipeline/common.hpp +++ b/intra_process_demo/include/image_pipeline/common.hpp @@ -81,7 +81,7 @@ draw_on_image(cv::Mat & image, const std::string & text, int height) text.c_str(), cv::Point(10, height), cv::FONT_HERSHEY_SIMPLEX, - 0.3, + 0.5, cv::Scalar(0, 255, 0)); } From f0b1924e19ffccee9d743dcc26546991425d5aa9 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Fri, 21 Nov 2025 12:09:58 -0800 Subject: [PATCH 2/4] improve window titles in image viewers Signed-off-by: William Woodall --- .../src/image_pipeline/image_pipeline_all_in_one.cpp | 2 +- .../image_pipeline/image_pipeline_with_two_image_view.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/intra_process_demo/src/image_pipeline/image_pipeline_all_in_one.cpp b/intra_process_demo/src/image_pipeline/image_pipeline_all_in_one.cpp index f93ee0f94..1624fbd28 100644 --- a/intra_process_demo/src/image_pipeline/image_pipeline_all_in_one.cpp +++ b/intra_process_demo/src/image_pipeline/image_pipeline_all_in_one.cpp @@ -35,7 +35,7 @@ int main(int argc, char * argv[]) } auto watermark_node = std::make_shared("image", "watermarked_image", "Hello world!"); - auto image_view_node = std::make_shared("watermarked_image"); + auto image_view_node = std::make_shared("watermarked_image", "image_pipeline_all_in_one"); executor.add_node(camera_node); executor.add_node(watermark_node); diff --git a/intra_process_demo/src/image_pipeline/image_pipeline_with_two_image_view.cpp b/intra_process_demo/src/image_pipeline/image_pipeline_with_two_image_view.cpp index 19aeeb14c..2ad2b50b9 100644 --- a/intra_process_demo/src/image_pipeline/image_pipeline_with_two_image_view.cpp +++ b/intra_process_demo/src/image_pipeline/image_pipeline_with_two_image_view.cpp @@ -36,8 +36,10 @@ int main(int argc, char * argv[]) } auto watermark_node = std::make_shared("image", "watermarked_image", "Hello world!"); - auto image_view_node = std::make_shared("watermarked_image"); - auto image_view_node2 = std::make_shared("watermarked_image", "image_view_node2"); + auto image_view_node = + std::make_shared("watermarked_image", "image_pipeline_with_two_image_view"); + auto image_view_node2 = + std::make_shared("watermarked_image", "image_pipeline_with_two_image_view2"); executor.add_node(camera_node); executor.add_node(watermark_node); From 7d100af9392916398463c6aef921bdb0711f9d96 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Fri, 21 Nov 2025 12:10:28 -0800 Subject: [PATCH 3/4] revert back to unique_ptr in image view to fix demo purpose Signed-off-by: William Woodall --- intra_process_demo/include/image_pipeline/image_view_node.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intra_process_demo/include/image_pipeline/image_view_node.hpp b/intra_process_demo/include/image_pipeline/image_view_node.hpp index 217fee503..12c523677 100644 --- a/intra_process_demo/include/image_pipeline/image_view_node.hpp +++ b/intra_process_demo/include/image_pipeline/image_view_node.hpp @@ -41,12 +41,12 @@ class ImageViewNode final : public rclcpp::Node sub_ = this->create_subscription( input, rclcpp::SensorDataQoS(), - [node_name, watermark](sensor_msgs::msg::Image::ConstSharedPtr msg) { + [node_name, watermark](sensor_msgs::msg::Image::UniquePtr msg) { // Create a cv::Mat from the image message (without copying). cv::Mat cv_mat( msg->height, msg->width, encoding2mat_type(msg->encoding), - const_cast(msg->data.data())); + msg->data.data()); if (watermark) { // Annotate with the pid and pointer address. std::stringstream ss; From a425b0e03a92638bdc9c0a9c6c10ca703fda7ee6 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Fri, 21 Nov 2025 12:59:51 -0800 Subject: [PATCH 4/4] fixup lint error, line length Signed-off-by: William Woodall --- .../src/image_pipeline/image_pipeline_all_in_one.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/intra_process_demo/src/image_pipeline/image_pipeline_all_in_one.cpp b/intra_process_demo/src/image_pipeline/image_pipeline_all_in_one.cpp index 1624fbd28..6d3534023 100644 --- a/intra_process_demo/src/image_pipeline/image_pipeline_all_in_one.cpp +++ b/intra_process_demo/src/image_pipeline/image_pipeline_all_in_one.cpp @@ -35,7 +35,8 @@ int main(int argc, char * argv[]) } auto watermark_node = std::make_shared("image", "watermarked_image", "Hello world!"); - auto image_view_node = std::make_shared("watermarked_image", "image_pipeline_all_in_one"); + auto image_view_node = + std::make_shared("watermarked_image", "image_pipeline_all_in_one"); executor.add_node(camera_node); executor.add_node(watermark_node);