orbbec / OrbbecSDK

Orbbec SDK v1&v2 Pre-Compiled Repo
https://www.orbbec3d.com/
Other
124 stars 16 forks source link

when saving RGBD D2C-aligned data to disk, the data size is huge #131

Closed bowieshi closed 3 weeks ago

bowieshi commented 2 months ago

Hi. I am using D2C alignment to save RGB color image and depth image to my disk. However, after alignment, the depth image will have the same size as the color image (grow from 640x576 to 1280x960). Further the depth is stored with float32, which takes up space much larger than uint8. So for single depth image it may takes up over 2.5MB while the same size color image only takes up around 300kb. This means a 1 mins video may takes up over 5GB storage. I have 2 idea to alleviate this problem:

  1. save the depth image in original 640x576. Do D2C alignment when post-processing it. I wonder that is there any D2C alignment code we can use to do the post-processing?
  2. save them in more compacted form like video; I looked through SDK manual book and examples. It seems no video forms storage is supported.

Can I ask for some advice from you how can I storage the RGBD data in a efficient format? Thank you very much.

zhonghong322 commented 2 months ago

First, you can call this interface. Its function is to set whether the depth after D2C (depth-to-color alignment) should be scaled to the resolution of the color image. If set to false, it will not be scaled to the color resolution. When set to false, the resolution of the depth after D2C needs to be scaled to match the color resolution for proper alignment.

   /**
 * @brief Set whether the depth needs to be scaled after setting D2C
 *
 * @param enable Whether scaling is required
 */
void setDepthScaleRequire(bool enable);

config->setDepthScaleRequire(false);