Display point cloud continuous c# Intel Realsense

715 views Asked by At

This maybe a continuation of my previous question about displaying ply file with Helix toolkit in c#. The problem I have with that solution is that it is not continuous and if a ply file is made it slows down the program a lot. My code for making the point cloud looks like:

// CopyVertices is extensible, any of these will do:
                            var vertices = new float[points.Count * 3];
                            // var vertices = new Intel.RealSense.Math.Vertex[points.Count];
                            // var vertices = new UnityEngine.Vector3[points.Count];
                            // var vertices = new System.Numerics.Vector3[points.Count]; // SIMD
                            // var vertices = new GlmSharp.vec3[points.Count];
                            //  var vertices = new byte[points.Count * 3 * sizeof(float)];
                            points.CopyVertices(vertices);

And the ply file is made with the line:

points.ExportToPLY("pointcloud.ply", colorFrame);

The helix toolkit is used like this:

                Model3DGroup model1 = import.Load("pointcloud.ply");
                model.Content = model1;

the rest of the code is like the C# wrapper of librealsense: https://github.com/IntelRealSense/librealsense/tree/master/wrappers/csharp Does anyone have an idea on how to make this pointcloud display continuous?

1

There are 1 answers

1
Lance H On

Are you using HelixToolkit.Wpf or HelixToolkit.SharpDX.Wpf?

Try to use HelixToolkit.SharpDX version if your point cloud is big.

Also try to avoid export and import while doing continuous update. You can convert your point cloud directly into helixtoolkit supported points format and update the point model.