point cloud to mesh issues

classic Classic list List threaded Threaded
1 message Options
ThT
Reply | Threaded
Open this post in threaded view
|

point cloud to mesh issues

ThT
Hi guys,

I am facing an issue when I am creating a mesh using the greedy
triangulation solution given a point cloud and the point normals. The point
cloud is created from a CAD model and in different areas the point density
is different, see figure below:

<http://www.pcl-users.org/file/t499303/pt.png>  

The point cloud can be also found in the attached .ply file ( test_pcd.ply
<http://www.pcl-users.org/file/t499303/test_pcd.ply>  ) together with each
point normals.

Now I am trying to create a mesh out of it by using the greedy triangulation
approach. Code snippet can be seen below:

// Create search tree*
    pcl::search::KdTree<pcl::PointNormal>::Ptr tree2 (new
pcl::search::KdTree<pcl::PointNormal>);
    tree2->setInputCloud (cloud_with_normals);

    // Initialize objects
    pcl::GreedyProjectionTriangulation<pcl::PointNormal> gp3;
    // Create mesh
    pcl::PolygonMesh triangles;

    // Set the maximum distance between connected points (maximum edge
length)
    gp3.setSearchRadius (1000);
   
    // Set typical values for the parameters
    gp3.setMu (2.5);
    gp3.setMaximumNearestNeighbors (100);
    gp3.setMaximumSurfaceAngle(M_PI/4); // 45 degrees
    gp3.setMinimumAngle(M_PI/18); // 10 degrees
    gp3.setMaximumAngle(2*M_PI/3); // 120 degrees
    gp3.setNormalConsistency(true);
    gp3.setConsistentVertexOrdering(true);

    // Get result
    gp3.setInputCloud (cloud_with_normals);
    gp3.setSearchMethod (tree2);
    gp3.reconstruct (triangles);

the above code give me the following result:

<http://www.pcl-users.org/file/t499303/mesh.png>

which is quite nice, however you will notice that the left side wall as well
as some some parts on the top area of the floor were not reconstructed. Then
I tried to play a bit with used parameters and the only one that made a
difference was the setMu() which I changed from 2.5 to 5.5 or even 10.5.
This now gives me the side left wall as well the top area of the floor

<http://www.pcl-users.org/file/t499303/mesh1.png>  

but as you can notices it is kind of messes up with the rest of the mesh by
creating holes and unwanted mergings. The output in the first case is more
preferable but I cannot understand why it is not working for the left side
of the wall and some part of the floor. Does anyone have any idea or hint
how to solve this one.

Thanks.



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users