fhwedel-hoe / pylon_instant_camera

ROS2 node for access to Basler camera via Pylon CBaslerUniversalInstantCamera API. Supports high-performance, arbitrary framerate, free-running mode.
MIT License
11 stars 4 forks source link

Color compressed image #7

Open ciniminis1 opened 2 months ago

ciniminis1 commented 2 months ago

Hi there,

I wish to log the output image in compressed form, I see that the package directly outputs the compressed image on /pylon_camera/image_compressed topic, although the image is monochrome. Is there any workaround on how to solve this within the package? I guess it might be related to the encoding format. I currently use BayerRG8. Thank you.

fhwedel-hoe commented 2 months ago

Hi @ciniminis1 (yum),

Thank you for your interest. This project only provides access to the image data as provided by the camera. No further enhancements are done.

In ROS2, it is possible to compress image data for transport (from one node to another). This is offered by the package https://github.com/ros-perception/image_transport_plugins, which is totally independent from this project. As far as I know, compression is done in a transparent fashion: The data is compressed, transmitted and decompressed. The compressed data-stream is not directly available to the subscribing node (though I might be wrong). Maybe you can ask the question at https://robotics.stackexchange.com/.

Also – at least as far as I know – this kind of transport compression can only work on RGB data (and maybe YUV), but not on Bayer. This is also indicated by the fact that in RGB mode, image data is available via /pylon_camera/image, but in Bayer mode, it is published via /pylon_camera/image_raw. This project does not include de-bayering. For software de-bayering, you may use the official driver from https://github.com/basler/pylon-ros-camera/.

Kind Regards,
Hermann