Skip to content

Commit a7782a2

Browse files
keep the same encoding as the input image (#4)
1 parent 0a8b245 commit a7782a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

detection_visualizer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def on_detections(self, image_msg, detections_msg):
8080
font = cv2.FONT_HERSHEY_SIMPLEX
8181
cv2.putText(cv_image, label, pos, font, 0.75, color, 1, cv2.LINE_AA)
8282

83-
detection_image_msg = self._bridge.cv2_to_imgmsg(cv_image, encoding="bgr8")
83+
detection_image_msg = self._bridge.cv2_to_imgmsg(cv_image, encoding=image_msg.encoding)
8484
detection_image_msg.header = image_msg.header
8585

8686
self._image_pub.publish(detection_image_msg)

0 commit comments

Comments
 (0)