1 | initial version |

The maths should be the following.

Given the color `K_c`

and depth `K_d`

intrinsic parameters:

Given the homogeneous transformation between the color and depth frames:

The previous matrix allows transforming a 3D point expressed in one frame to another frame:

To get the corresponding RGB color for a given 3D point:

(*Skip this as you already have the [X,Y,Z] coordinates. Sometimes, you only have the depth map.*)

Get the full 3D coordinate from the depth value `Z_d`

(using the depth intrinsic parameters) for a given `[u,v]`

coordinate in the depth map (here without taking into account the distortion):

Transform the 3D point expressed in the depth frame to the color frame:

Project the 3D point expressed in the color frame into the image plane to get the corresponding `[u_c, v_c]`

coordinate:

Practically, you should be able to achieve this using `projectPoints()`

. More details about the camera frame here.

Copyright OpenCV foundation, 2012-2018. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.