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

Bayer support #68

Open
Lashhev opened this issue Dec 15, 2020 · 1 comment
Open

Bayer support #68

Lashhev opened this issue Dec 15, 2020 · 1 comment

Comments

@Lashhev
Copy link

Lashhev commented Dec 15, 2020

Does the compressed image plugin support bayer image format?

@andrei-ng
Copy link

andrei-ng commented Aug 18, 2023

No, but recently there is a PR related to this: #98

@Lashhev, I am correcting my previous answer as after an experiment I would say it is supported but not documented.

I perfomed the following experiment with ROS Noetic:

  • recorded in a rosbag a compressed topic where the uncompressed raw image is in Bayer format
    The recording has only a single topic recorded of type
types:       sensor_msgs/CompressedImage [8f7a12909da2c9d3332d540a0977563f]
topics:      /pylon_camera_node/image_raw/compressed   125 msgs    : sensor_msgs/CompressedImage

By echoing the topic, the header states the original image was in bayer format

rostopic echo /pylon_camera_node/image_raw/compressed
header: 
  seq: 77
  stamp: 
    secs: 1692615289
    nsecs: 610064228
  frame_id: "pylon_camera"
format: "bayer_rggb8; jpeg compressed "
.....
.....
[topic values]
...
...
  • I replayed the rosbag and launched an image view node
rosrun image_view image_view image:=/pylon_camera_node/image_raw/compressed

the image_view node complains with the following output

[image_transport] It looks like you are trying to subscribe directly to a transport-specific image topic '/pylon_camera_node/image_raw/compressed', in which case you will likely get a connection error. Try subscribing to the base topic '/pylon_camera_node/image_raw' instead with parameter ~image_transport set to 'compressed' (on the command line, _image_transport:=compressed). See http://ros.org/wiki/image_transport for details.

By adding the argument as shown in the hint of the warning,

rosrun image_view image_view image:=/pylon_camera_node/image_raw _image_transport:=compressed

I get back a color image with the header:

rostopic echo /image_view/output
header: 
  seq: 0
  stamp: 
    secs: 1692615291
    nsecs: 312088400
  frame_id: "pylon_camera"
height: 1200
width: 1600
encoding: "bgr8"
is_bigendian: 0
step: 4800

One would have to study the code for the publisher and subscriber in the noetic-devel here and here to check what if/else branches are taken.

If anyone has other experience or knowledge about this, please share, IMO it seems that compression and uncompression is working for Bayer formats as well but it is not documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants