Unless you really need to use Python scripting to do the alignment, there is a simple method for creating a color and depth alignment in the 3D point cloud mode of the RealSense Viewer, so you can then export a ply from the Viewer.
MartyG Thank you for the reply.
I am aware of that functionality in the RealSense Viewer, but I need do it in code, but it doesn't have to be in Python.
I am guessing there is some API for doing it since RealSense Viewer can do it, but I am not sure where to find that information.
I searched extensively but unfortunately could not find a solution that I would be totally confident in.
You could take a look at the export_ply_example Python program.
Otherwise, I would recommend posting a request for code for an aligned point cloud on the RealSense GitHub, where the RealSense engineers and developers reside. You can do so by going to the link below and clicking on the 'New Issue' button.
This message was posted on behalf of Intel Corporation
The export_ply_example.py already aligns the color and depth streams. You shouldn't have to align separately.
You can also try this example:
Can you also tell me what makes you think you are not getting an aligned poincloud from export_ply_example.py? Can you send some screenshots?