From 1a7c1ff6c942eb49c6290d8c123620fff053f2e1 Mon Sep 17 00:00:00 2001 From: Bey Hao Yun Date: Thu, 7 Mar 2024 12:29:37 +0800 Subject: [PATCH] Defined starting position of OpenCV window display in showimage under image_tools. Signed-off-by: Bey Hao Yun --- image_tools/src/showimage.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/image_tools/src/showimage.cpp b/image_tools/src/showimage.cpp index c221b1f5b..0481b6f50 100644 --- a/image_tools/src/showimage.cpp +++ b/image_tools/src/showimage.cpp @@ -186,7 +186,12 @@ class ShowImage : public rclcpp::Node cv::cvtColor(frame, frame, cv::COLOR_YUV2BGR_YUYV); } - // Show the image in a window + // Define starting position of OpenCV window. + int x_position = 0; + int y_position = 0; + cv::moveWindow(window_name_, x_position, y_position); + + // Show the image in OpenCV window cv::imshow(window_name_, frame); // Draw the screen and wait for 1 millisecond. cv::waitKey(1);