-
Notifications
You must be signed in to change notification settings - Fork 222
Enable to publish JPEG images without image decompression on the host #77
Conversation
I don't have a device here at the moment, but did you check if everything works with jpeg color format and rgb point cloud?
This check will fail with color format jpeg I think. Later on at the point cloud generation you need distinct values for Red, Green, Blue. Thats difficult with jpeg color format I guess. Because of that I turned on conversion to BGRA when using recording files. |
@RoseFlunder Nice catch! Please take a look at the updated PR. I confirmed that the following topics work as expected with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another questions is how to handle the parameter when opening a recording file?
Whats the expected behaviour?
At the moment we always enable conversion to bgra.
We could use this setting to decide wether to enable color conversion to bgra or not.
If set to bgra we enable color conversion.
If set to jpeg and the recordings color Format is jpeg, we do not enable color conversion.
This is the logic that needs to be changed:
https://github.com/shuntaraw/Azure_Kinect_ROS_Driver/blob/f7f1cf98adb4c1168615b6c1a4ea02742fd487ba/src/k4a_ros_device.cpp
@RoseFlunder Thanks for pointing this out. I will address this issue shortly. |
Apparently, the color format in a recorded file is either MJPG, NV12, or YUV2. Since the SDK does not support the conversion to MJPG, the logic implemented here is as follows:
I've tested this PR with the files recorded in MJPG, NV12, and YUV2. |
Looks fine to me. |
@RoseFlunder As mentioned in the "description of the changes", |
@skalldri will you merge this? |
@shuntaraw I'm doing a quick local validation and will merge. |
Confirmed on Windows |
Enable to publish JPEG image at
rgb/image_raw/compressed
so that clients can subscribe to the compressed image atrgb/image_raw
viacompressed_image_transport
. This feature is useful when the images are received/consumed by remote clients and the local host is not powerful enough to decompress the JPEG images.Fixes #20
Description of the changes:
This PR implements the technique described in the following site. http://wiki.ros.org/compressed_image_transport#Publishing_compressed_images_directly
color_format
ROS param to enable publishing JPEG images without image decompression on the host computer.color_format
isjpeg
,/rgb/image_raw/compressed
/rgb/image_raw
is not advertised (to avoid confusion)./rgb_to_depth/image_raw
does not publish.rgb_point_cloud
ROS param must befalse
.Before submitting a Pull Request:
I tested changes on:
manual/ad-hoc testing