How to save point cloud with RGB information using Python?
My camera is L515. I used to generate the point cloud from the Intel Realscense viewer. It works fine which I can get the point cloud *.ply file. Also, in the *.ply file contains the location X,Y,Z and RGB information corresponding to each point. Well, I tried the manual coding in Python below to generate *.ply to achieve as the intel RS viewer does. However, I cannot get the RGB information in *.ply file. I get color as the depth. Therefore, how can I modify the coding to get the RGB information corresponding to each point ? Thank you very much.
Noted : the code below only summary the statement code for generate the point cloud.
pc = rs.pointcloud()
points = rs.points()
align_to = rs.stream.color
align = rs.align(align_to)
color_frame = aligned_frames.get_color_frame()
pc.map_to(color_frame)
ply = rs.save_to_ply("test1.ply")
ply.set_option(rs.save_to_ply.option_ply_binary, True)
ply.set_option(rs.save_to_ply.option_ply_normals, False)
ply.process(color_frame)
-
Hello Lyhour,
Thank you for contacting us.
There is similar issue has been discussed in this thread #6194. I hope it will help you to resolve the issue.
Regards,
Zulkifli Halim
Intel Customer Support
Please sign in to leave a comment.
Comments
1 comment