Skip to content

Commit 0a8b245

Browse files
authored
added header from subscribed image to detection image (#3)
1 parent 4f39e9d commit 0a8b245

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

detection_visualizer/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ def on_detections(self, image_msg, detections_msg):
7979
pos = (min_pt[0], max_pt[1])
8080
font = cv2.FONT_HERSHEY_SIMPLEX
8181
cv2.putText(cv_image, label, pos, font, 0.75, color, 1, cv2.LINE_AA)
82+
83+
detection_image_msg = self._bridge.cv2_to_imgmsg(cv_image, encoding="bgr8")
84+
detection_image_msg.header = image_msg.header
8285

83-
self._image_pub.publish(self._bridge.cv2_to_imgmsg(cv_image, encoding="bgr8"))
86+
self._image_pub.publish(detection_image_msg)
8487

8588

8689
def main():

0 commit comments

Comments
 (0)