output image format: 'bgr' to 'rgb'

This commit is contained in:
shalenikol 2025-03-12 12:43:25 +03:00
parent fe7d966dcc
commit d6976281e3

View file

@ -231,7 +231,7 @@ class ObjectDetection(Node):
if len(self.image_det) == 0:
return
# The 'cv2_to_imgmsg' method converts an OpenCV image to a ROS 2 image message
msg = self.br.cv2_to_imgmsg(self.image_det, encoding="bgr8")
msg = self.br.cv2_to_imgmsg(self.image_det, encoding="rgb8")
# Publish the message.
self._pubI.publish(msg)