Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vertex normal information is not present in ply file generated from bag file #4813

Closed
rupeshchandgude opened this issue Sep 6, 2019 · 6 comments

Comments

@rupeshchandgude
Copy link

|---------------------------------|------------------------------------------- |
| Camera Model | D435 |
| Firmware Version | RealSense Viewer |
| Operating System & Version | Ubuntu 16 |
| Platform | PC |
| Language | python |

Issue Description

I have generated bag file using Realsense Viewer. After I convert it into ply file using following code:

pc = rs.pointcloud()
points = rs.points()
pipeline = rs.pipeline()
config = rs.config()
rs.config.enable_device_from_file(config,bag_file,repeat_playback=False)
pipeline.start(config)
colorizer = rs.colorizer()
align_to = rs.stream.color
align = rs.align(align_to)
frames = pipeline.wait_for_frames()
frames = align.process(frames)
depth_frame = frames.get_depth_frame()
color = frames.get_color_frame()
depth_color_frame = colorizer.colorize(depth_frame)
depth_color_image = np.asanyarray(depth_color_frame.get_data())
pc.map_to(depth_color_frame)
points = pc.calculate(depth_frame)
points.export_to_ply('temp.ply',color)

Generated ply file does not have vertex normal information in it. Is there any way to add vertex normal information while generating ply file or after generating ply file?

@lramati
Copy link
Contributor

lramati commented Sep 8, 2019

You would have to turn the pointcloud into a mesh and then calculate vertex normals based on that mesh. I think PCL gets recommended frequently by people here for doing these kinds of things, although that appears to be a C++ project

@rupeshchandgude
Copy link
Author

thanks @lramati I will try that out.

@dorodnic
Copy link
Contributor

@rupeshchandgude - latest viewer includes options to export with normals. Thank you for the feedback

@rupeshchandgude
Copy link
Author

@dorodnic Thanks for update.

@AlexSeongJu-sr
Copy link

@dorodnic
Hi there. I have the same issue, but in my case, I should do it in python code, not realsense-viewer. Is there a way to get .ply file with both rgb color & vertex normals with python code?
my issue is in #6194. I guess u know how to do it maybe..
thanks in advance.

@lramati
Copy link
Contributor

lramati commented Apr 12, 2020

check out the save_to_ply object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants