Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Fix debug window color #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion openpose_ros2/openpose_ros2/openpose_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from builtin_interfaces.msg import Time
from cv_bridge import CvBridge
from rclpy.node import Node
import cv2
from rcl_interfaces.msg import ParameterDescriptor, ParameterType
from sensor_msgs.msg import Image, CompressedImage
from std_msgs.msg import Header
Expand Down Expand Up @@ -61,7 +62,7 @@ def __init__(self):
def publish_from_img(self, img: np.ndarray, timestamp: Time, frame_id: str =""):
result = self.openpose_wrapper.body_from_image(img)
if self.is_debug_mode:
result_image: Image = self.bridge.cv2_to_imgmsg(result.cvOutputData, "rgb8")
result_image: Image = self.bridge.cv2_to_imgmsg(cv2.cvtColor(result.cvOutputData,cv2.COLOR_BGR2RGB), "rgb8")
result_image_compressed: CompressedImage = self.bridge.cv2_to_compressed_imgmsg(result.cvOutputData)
result_image.header.stamp = timestamp
result_image.header.frame_id = frame_id
Expand Down