Items with no label
3335 Discussions

Transforming coordinates between depth image and color image

MAbdo2
New Contributor I
1,462 Views

I wish to draw some graphics on the color image at a certain location where a 3D structure has been located within the depth image. For example, consider that the 3D scene contains several objects, and that the location of these objects in the depth image are known. We would like to draw an indicator, such as a circle, over the same objects in the color image.

I am looking for a "simple" way of transforming the 3D position from the depth image to the color image. Is there an API to do this for me? If so, please point me toward the relevant section. Otherwise, If I have to the math myself, is there any example showing how one retrieves the relevant extrinsic matrix/matrices from the D435?

Thanks,

MoA

0 Kudos
1 Solution
idata
Employee
420 Views

Hi MoA,

 

 

Thank you for your interest in the RealSense camera.

 

You can find some examples on how to retrieve the depth of a pixel in meters in the Depth Image Formats section:

 

https://github.com/IntelRealSense/librealsense/wiki/Projection-in-RealSense-SDK-2.0# depth-image-formats

 

 

Regards,

 

Alexandra

View solution in original post

0 Kudos
2 Replies
jb455
Valued Contributor II
420 Views

Check out https://github.com/IntelRealSense/librealsense/wiki/Projection-in-RealSense-SDK-2.0# frame-alignment Projection in RealSense SDK 2.0 · IntelRealSense/librealsense Wiki · GitHub and the 'align' samples provided with the SDK.

If you align the depth frame before generating the point cloud, the point cloud will be aligned to the colour image so there is a 1:1 relationship between them.

0 Kudos
idata
Employee
421 Views

Hi MoA,

 

 

Thank you for your interest in the RealSense camera.

 

You can find some examples on how to retrieve the depth of a pixel in meters in the Depth Image Formats section:

 

https://github.com/IntelRealSense/librealsense/wiki/Projection-in-RealSense-SDK-2.0# depth-image-formats

 

 

Regards,

 

Alexandra
0 Kudos
Reply