ros-perception / vision_opencv

Apache License 2.0
536 stars 599 forks source link

decode images in mode IMREAD_UNCHANGED #520

Closed christian-rauch closed 4 months ago

christian-rauch commented 5 months ago

This is a backport of https://github.com/ros-perception/vision_opencv/pull/228 to ROS 2.

You can use the same conversion script in that PR to test that without this PR the data that is converted from the original 16bit image becomes an 8bit image where the values do not match anymore:

original: 2500 uint16
converted: 9 uint8
match? False

and with this PR, the conversion is done correctly and the values match:

original: 2500 uint16
converted: 2500 uint16
match? True