How do I align color and depth in a.bag file?
How do I align the color sequence image with the depth sequence image?Is it frame by frame?
-
There is an Intel tutorial for the Python language called 'distance_to_object' that shows how to align color and depth in a bag file.
https://github.com/IntelRealSense/librealsense/blob/jupyter/notebooks/distance_to_object.ipynb
-
Hi MartyG,
I don't know if I can put the aligned frameset of color and depth back in the.bag file for later processing.
-
As the example provides a readout of the distance to a detected object once color and depth has been aligned, I would think that it does it for all frames (though when capturing frames from the bag, it skips the first 5 frames to give auto-exposure time to adjust).
The subject of aligning depth to color in MATLAB using align.m is discussed in the link below. Please read downwards in the comments from the point in the conversation that is linked to.
https://github.com/IntelRealSense/librealsense/issues/2455#issuecomment-439939852
-
Hi MartyG,
I have two more questions.
The first one, is the aligned color and depth aligned in the.bag?
The second ond,Whether this ‘rs2_deproject_pixel_to_point’ function has matlab code?
Thanks!
-
Once a bag file has had its color and depth frames aligned,you could save it as a .ply point cloud data file. I think trying to re-save aligned data back into a bag file would be like trying to insert a round peg into a square hole.
-
MATLAB has a downloadable Function that can convert a depth image to a point cloud. Scroll down the page at the link below to the heading titled 'Depth Image to Point Cloud (MATLAB)' and click on the 'depthToCloud.m' link to launch its download in your browser.
-
As I said above, you should be able to save the aligned depth and color frames as a .ply format point cloud file. I don't think you can write them back to the bag once they have been aligned and retain that alignment data in the bag.
-
Hi MartyG,
Can these aligned color and depth frames be saved?Because I also need color and depth frames.
-
If you are asking about saving aligned color and depth frames back to the bag, the previous answer applies
https://support.intelrealsense.com/hc/en-us/community/posts/360033038054/comments/360007844274
Please sign in to leave a comment.
Comments
14 comments