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

[Feature-Request] Depth image compression by colorization #875

Open
borongyuan opened this issue Jul 16, 2023 · 5 comments
Open

[Feature-Request] Depth image compression by colorization #875

borongyuan opened this issue Jul 16, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@borongyuan
Copy link

Start with the why:

VideoEncoder only supports NV12 or GRAY8 format. It cannot be used to encode depth images, only disparity images with subpixel disabled. This creates a big headache for us with PoE models. We hope to be able to transmit depth images with high resolution, high precision and high frame rate. The approach presented in this RealSense white paper seems promising. Hope it works for OAK cameras.

Move to the what:

Add depth image compression by colorization feature.

Move to the how:

The basic idea is to colorize the 16-bit depth image or disparity image according to the method mentioned in the white paper. Then use VideoEncoder for compressed transport. The recovery part on the Host side should be relatively easy to implement. The main feature that needs to be added is colorization on the camera. Currently ImageManip does not support color conversion of 16-bit images. Perhaps this particular color conversion method should be added to ImageManip, or implemented elsewhere.

@borongyuan borongyuan added the enhancement New feature or request label Jul 16, 2023
@themarpe
Copy link
Collaborator

This is a great idea!

We already added Colormap feature a while ago and could be easily extended to cover 16bit to RGB/NV12 as well.

@borongyuan
Copy link
Author

Any plan for this? It should be possible to create a custom blob and use the new Cast node. But if you can add this to ImageManip node, I'll now waste time on this.

@themarpe
Copy link
Collaborator

CC: @moratom on whats the applicability on RVC2

@borongyuan
Copy link
Author

If we use disparityWidth of 96 and subpixelFractionalBits of 4, the max disparity should be 1520. This colorization method provides 1529 discrete levels. So there should be no quantization error, and normalization step might be skipped.

@borongyuan
Copy link
Author

Another solution is to use the RVL depth image compression algorithm. RVL codec has been added to ROS since Noetic/Jazzy. We are also considering adding it to RTAB-Map.

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

No branches or pull requests

2 participants