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

pointcloud.calculate and points.export_to_ply in C# #3557

Closed
jacobusp opened this issue Mar 21, 2019 · 8 comments
Closed

pointcloud.calculate and points.export_to_ply in C# #3557

jacobusp opened this issue Mar 21, 2019 · 8 comments
Labels

Comments

@jacobusp
Copy link

jacobusp commented Mar 21, 2019

Required Info
Camera Model D415
Firmware Version 05.11.01.100
Operating System & Version Win 10
Platform PC
SDK Version 2.0
Language C#

Issue Description

I am trying to do two things with the C# wrapper:

  • Retrieving a Points object from a DepthFrame.
  • Saving this data (Points) to a pointcloud file (.ply for example).

In C++ that would look like:

// Retrieve the data.
auto frames = pipe.wait_for_frames();
auto depthFrame = frames.get_depth_frame();
auto colorFrame = frames.get_color_frame();    
pointcloud pc = pointcloud();
pc.map_to(colorFrame);
points points= pc.calculate(depthFrame);

// Save to pointcloud file.
points.export_to_ply("1.ply", colorFrame);

However, the PointCloud.Calculate method is obsolete ("This method is obsolete. Use Process method instead") and the export_to_ply does not seem to be included in the C# wrapper.

What exactly is meant by "Use Process method instead"?
How can I create the above code in C#?

@dorodnic dorodnic added the .NET label Mar 21, 2019
@ogoshen
Copy link
Contributor

ogoshen commented Mar 27, 2019

The obsolete warning in this case is harmless, just means you should use the common Process interface method instead.

Sorry about missing PLY export, will be handled in the next PR.

@jacobusp
Copy link
Author

jacobusp commented Apr 4, 2019

@ogoshen The problem is that is not clear what is meant by "Use Process method instead". How would this be implemented in C#? Are there (or could someone provide) code examples of how to use this process method in order to retrieve a pointcloud?

@ogoshen
Copy link
Contributor

ogoshen commented Apr 4, 2019

Here's a sample for running the PointCloud processing block, getting the Points frame as well as getting the raw point cloud data.

Also, Points.ExportPLY is now merged to development branch.

@jacobusp
Copy link
Author

jacobusp commented Apr 4, 2019

@ogoshen
Thanks for the quick answer 👍 !
I always get a stable release from https://github.com/IntelRealSense/librealsense/releases/latest.
When can I (approximately) expect the changes to be in the latest release?

@RealSenseCustomerSupport
Copy link
Collaborator


@jacobusp The latest stable release v2.20.0 has included the changes. Please have a check. Thanks! https://github.com/IntelRealSense/librealsense/blob/v2.20.0/wrappers/csharp/Intel.RealSense/Frames/Points.cs#L116

@RealSenseCustomerSupport
Copy link
Collaborator


@jacobusp Did you get the chance to have a try with v2.20.0? Any other questions about this ticket? Looking forward to your update. Thanks!

@jacobusp
Copy link
Author

jacobusp commented May 7, 2019

I have added the new version to my project and I can confirm the export to ply functionality was added. Thanks for helping me out.

@jacobusp jacobusp closed this as completed May 7, 2019
@Lowpassfilter
Copy link

Lowpassfilter commented Aug 13, 2019

How to interprete the vertices converted from the points? For a 640 * 480 depth image, I got 640 * 480 * 3 float numbers, which is reasonable. However, I found that there are 40k non-zero values at position i * 3, 70k non-zero values at positions i * 3+2 and only one 24 value at i * 3+1, where i in range 0 to 640*480 -1. This realy confused me. Can anyone explain?

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

No branches or pull requests

5 participants