Items with no label
3335 Discussions

D415 Depth frame misalign color frame

HChua3
Beginner
2,206 Views

how can i map the color frame(640*480) to the depth frame (1280*720)

I want to use depth frame transfer to camera 3D coordinate (u,v,depth)->(X,Y,Z)

But I have the problem that color frame can't match the depth frame

In the realsense2 SDK example pointcloud, color frame is 640*480 and depth frame is 1280*720

using map_to(color) to map color frame to depth frame

H@ow does the map_to() function work ?

Is there a function can map the color frame to depth frame ?

0 Kudos
1 Solution
MartyG
Honored Contributor III
610 Views

You can align color and depth in a point cloud using the RealSense Viewer, in a method described in the link below.

If you prefer to do a color and depth alignment with scripting though, the documentation section linked below may be useful.

https://github.com/IntelRealSense/librealsense/wiki/Projection-in-RealSense-SDK-2.0# frame-alignment Projection in RealSense SDK 2.0 · IntelRealSense/librealsense Wiki · GitHub

View solution in original post

4 Replies
MartyG
Honored Contributor III
611 Views

You can align color and depth in a point cloud using the RealSense Viewer, in a method described in the link below.

If you prefer to do a color and depth alignment with scripting though, the documentation section linked below may be useful.

https://github.com/IntelRealSense/librealsense/wiki/Projection-in-RealSense-SDK-2.0# frame-alignment Projection in RealSense SDK 2.0 · IntelRealSense/librealsense Wiki · GitHub

HChua3
Beginner
610 Views

thank you MartyG

I try the method of RealSense Viewer

But the way of RealSense Viewer just map the color frame with depth directly

It will cause the misalignment

And using the aligned_frames function make the depth frame (1280*720->640*480)

I want the frame pixel can be 1280*720

By using the API pointCloud example

don't have misalignment problem

I want to know the detail of the function " pc.map_to(color) "

how does it map the 640*480 color frame to 1280*720 depth frame

0 Kudos
MartyG
Honored Contributor III
610 Views

I researched your request for information on pc.map_to(color) but unfortunately there is no explanatory documentation for it.

My recollection of cases involving misalignment of the streams when generating point clouds is that the camera's intrinsics should be used to obtain the correct alignment. The past case linked to below may help you.

https://github.com/IntelRealSense/librealsense/issues/2002 Aligned Point Cloud using wrong intrinsics? · Issue # 2002 · IntelRealSense/librealsense · GitHub

0 Kudos
HChua3
Beginner
610 Views

thanks for your help MartyG

0 Kudos
Reply