Skip to content

add support for RVL depth image compression#1409

Merged
matlabbe merged 8 commits intointrolab:masterfrom
borongyuan:depth_rvl_compression
Dec 16, 2024
Merged

add support for RVL depth image compression#1409
matlabbe merged 8 commits intointrolab:masterfrom
borongyuan:depth_rvl_compression

Conversation

@borongyuan
Copy link
Copy Markdown
Contributor

addressing #1362

@borongyuan
Copy link
Copy Markdown
Contributor Author

Compared with ROS's compressed_depth_image_transport, we add an additional signature, but there is no compressionConfig part. Therefore, additional processing is required to convert from compressedDepth message to RTAB-Map.

https://github.com/ros-perception/image_transport_plugins/blob/ccb2e9bf447c16c1857afc0d935413dcc2969cea/compressed_depth_image_transport/src/codec.cpp#L383-L392

If someone uses rtabmap_util/rgbd_relay for data compression and then rtabmap_util/rgbd_split for splitting, they will not get a valid compressedDepth message.

@matlabbe
Copy link
Copy Markdown
Member

matlabbe commented Dec 15, 2024

That PR looks great! I'll check tomorrow how it could work with ROS. As you said, we may have to strip the header "DEPTHRVL" from the byte array when converting back to sensor_msgs/Image. I guess for the input compressed depth images, image_transport would already convert it.

@borongyuan borongyuan changed the title add support for RVL deep image compression add support for RVL depth image compression Dec 15, 2024
@matlabbe matlabbe changed the base branch from master to noetic-devel December 15, 2024 21:18
@matlabbe matlabbe changed the base branch from noetic-devel to master December 15, 2024 21:19
@matlabbe
Copy link
Copy Markdown
Member

matlabbe commented Dec 16, 2024

On rtabmap_ros, we don't actually convert back from rtabmap's internal compressed depth format to the outside. For rgbd_split, rgbd_relay and rgbd_sync nodes, they already explicitly use PNG by default when compress option is enabled (I created this follow-up issue on rtabmap_ros). So we should not break anything merging this PR.

I did a small comparison of the compression time using ZED 2K depth images:

  • RVL ~12 ms
  • PNG 16bits: ~24 ms
  • PNG 32 bits: ~50 ms

My main changes are:

  • In DBViewer, there is an action to edit the depth image. I added a function to read the compression format so we can re-save the edited depth to database with same format.
  • Because default of Mem/SaveDepth16Format=false and Mem/DepthCompressionFormat=".rvl", I removed the warning about setting Mem/SaveDepth16Format to true if Mem/DepthCompressionFormat=".rvl" (as it would appear every time). If the input depth images are already 16bits, no warning will be shown and RVL is used. If the input images are 32bits, there will be a warning if RVL is used that depth images are incompatible and they will be saved in PNG instead. This will make sure that stereo depth images, that have often values over 65 meters, are not clipped by default.

@matlabbe matlabbe merged commit 89849ae into introlab:master Dec 16, 2024
@borongyuan borongyuan deleted the depth_rvl_compression branch December 16, 2024 07:55
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

Successfully merging this pull request may close these issues.

2 participants