record3d icon indicating copy to clipboard operation
record3d copied to clipboard

Can I just resize depth images to align with rgb images?

Open haonanhe opened this issue 10 months ago • 1 comments

The depth images shot in Lidar mode are of shape (256, 192), which is different from the RGB images' shape (960, 720). Can I just resize the depth images using cv2.resize(depth_array, (720, 960)) and scale the intrinsics by 3.75 (960/256)? Is such scaling accurate? Looking for help.

haonanhe avatar Feb 24 '25 14:02 haonanhe

The intrinsic parameters provided by Record3D are the intrinsic parameters of the RGB image, so if you will resize the depth image to the same resolution as that of the RGB image, then you should not scale the 4 intrinsic coefficients.

It should be enough to just scale the depth image to the same resolution as the RGB image and do not scale the intrinsic coefficients.

You would need to scale each of the 4 coefficients by 256/960 (i.e. approx. 0.2667) only if you would want to downsize the high-resolution RGB image to the size of the small depth image.

(Resizing the depth image while using the same intrinsic parameters for it as those of the RGB images is valid because the RGB and the depth images are aligned. That is also why scaling the intrinsic coefficients of the RGB image and using them for both the newly downsized RGB image and for the depth image in my second example is valid.)

marek-simonik avatar Feb 24 '25 16:02 marek-simonik