• DepthAI-v2
  • Aligned Depth & RGB frames for resolutions lower than 1920x1080?

Hi,

I just bought OAK-D S2 device and ran some tests. I need to have spatially aligned depth & rgb frames. And it is trivial when the frame resolution is equal to minimal supported RGB sensor resolution (1080_P).

However, when I try to work with lower resolutions, there is a problem (by the way, why 480_P on my OAK-D S2 is not supported?) - setPreviewSize method crops the frame and setIspScale as far as I understand is not able to scale the 1920x1080 frame into something compatible with 640x400 resolution.

Any ideas how to proceed? It is not good when Depth camera doesn't support such basic procedure as getting two (rgb, depth) frames of indentical size...

  • erik replied to this.

    Hello agicortex ,
    480P is not supported as the mono camera resolution is 1280x800. So only 800P, 720P, and 400P are supported. On OAK-D Lite the mono camera resolution is 640x480, so only the 480P is supported.

    You can set do camRgb.setIspScale(1,3) to downscale color frames from 1920x1080 to 640x360, which would be the closest to 400P. StereoDepth node would then also downscale its results to the 640x360.

    When setting stereoDepth.setDepthAlign(dai.CameraBoardSocket.RGB) (example here), depthai will also scale depth to have identical size as the rgb (in this case) frame - so that's already supported.

    Thoughts?

    Thanks, Erik

    Thank you for your help. Indeed, the solution is to use setDepthAlign method in combination with setIspScale to scale depth frame to identical size as the color frame.