HiroIshida / detic_ros

ROS wrapper for pretrained Detic instance segmentation and detection (and some utils to work with point cloud)
MIT License
28 stars 14 forks source link

Specify CvBridge encoding bgr8 #40

Closed Kanazawanaoaki closed 1 year ago

Kanazawanaoaki commented 1 year ago

The colors of the debug_image are inverted when the input image topic is not encoded in bgr8. I apologize for the lack of confirmation, but I suspect that the input to the Detic model is also inverted.

This problem can be solved by specifying the encoding of the CvBridge conversion. This is also done in jsk_recognition, which I used as a reference.

image topic not in bgr8 encoding

$ rostopic echo /hsrb/head_rgbd_sensor/rgb/image_rect_color --noarr
header: 
  seq: 25135
  stamp: 
    secs: 1668335381
    nsecs: 431184046
  frame_id: "head_rgbd_sensor_rgb_frame"
height: 480
width: 640
encoding: "rgb8"
is_bigendian: 0
step: 1920
data: "<array type: uint8, length: 921600>"
---
before after
Screenshot from 2022-11-13 19-09-23_crop Screenshot from 2022-11-13 19-10-40_crop

Comparison before and after change, the upper image is input image topic and the lower image is debug_image.

image topic in bgr8 encoding

$ rostopic echo /kinect_head/rgb/image_color --noarr
header: 
  seq: 39033
  stamp: 
    secs: 1668335714
    nsecs: 387932439
  frame_id: "head_mount_kinect_rgb_optical_frame"
height: 480
width: 640
encoding: "bgr8"
is_bigendian: 0
step: 1920
data: "<array type: uint8, length: 921600>"
---
before after
Screenshot from 2022-11-13 19-14-24 Screenshot from 2022-11-13 19-13-29

Comparison before and after change, the upper image is debug_image and the lower image is input image topic.

HiroIshida commented 1 year ago

Thanks!