Giter VIP home page Giter VIP logo

danieltobon43 / pointcloudtomesh Goto Github PK

View Code? Open in Web Editor NEW
156.0 9.0 35.0 329 KB

C++ application to convert pcd file, ply file, txt file or xyz point cloud to MESH representation (Gp3).

Home Page: https://raw.githubusercontent.com/danielTobon43/pointcloudToMesh/master/example/mss1.png

License: GNU General Public License v3.0

CMake 27.43% C++ 68.75% Dockerfile 3.82%
pcl pcl-library point-cloud mesh ply poisson-reconstruction pcd

pointcloudtomesh's Introduction

pointcloudToMesh

C++ application to convert a pcd, ply, txt or xyz point cloud data file into a MESH representation (Gp3/poisson). This projects is based in the Point Cloud Library 1.12.1 as backend.


Input file structure support

Format Description
.pcd Point Cloud Data file format
.ply Polygon file format
.txt Text file format
.xyz X Y Z Text file format

Output file structure

Mesh Cloud Description
.ply Polygon mesh file

Example


Compile

You can either build the project from source or download a docker image.

Compiling from source code

  1. Download source code:
git clone https://github.com/danielTobon43/pointcloudToMesh
  1. Create a "build" folder
  2. Run CMake
cd build/ && cmake ../src && make
  1. Run project
./pointcloudToMESH <input cloud> <surface method estimation> <normal method estimation> <output dir>
    
    surface method estimation:
        1 --> for poisson
        2 --> for gp3
        
    normal method estimation.
        1 --> for normal estimation
        2 --> for mls normal estimation
        
     example:
     ./pointcloudToMESH /home/xXx/PCD-PLY_Files/cloud.txt 2 1 /home/xXx/Desktop 

Docker image

  1. Download the docker image
docker pull ghcr.io/danieltobon43/pcdtomesh:latest
  1. Run a docker container
docker run --rm -it \
           --volume=/tmp/.X11-unix:/tmp/.X11-unix:rw \
           --volume=/tmp/.docker.xauth:/tmp/.docker.xauth:rw \
           --env="XAUTHORITY=/tmp/.docker.xauth" \
           --env="DISPLAY" \
           --name="mesh" \
           --volume=[PATH TO YOUR PCD FOLDER]:/tmp \
           -t ghcr.io/danieltobon43/pcdtomesh:latest /tmp/[YOUR PCD FILENAME] [surface method] [normal method] /tmp

The previous command will run a docker container with the ghcr.io/danieltobon43/pcdtomesh:latest image and will share a .pcd file from the host machine ([PATH TO YOUR PCD FOLDER]) to the tmp folder in the container.

If you get something like this after setting --display flag it might be related to this:

No protocol specified

Try running with the following command belowe or use the provided .sh script:

sudo -sE docker run --rm -it \
           --env="DISPLAY" \
           --volume=/tmp/.X11-unix:/tmp/.X11-unix:rw \
           --volume=/tmp/.docker.xauth:/tmp/.docker.xauth:rw \
           --name="dbscan" \
           --volume=[PATH TO YOUR PCD FOLDER]:/tmp \
           -t ghcr.io/danieltobon43/dbscan-octrees:latest --cloudfile /tmp/[YOUR PCD FILENAME] --display

If this still does not work to display, run: xhost +local:docker and then run the option 1 command.

Note

These parameters can be modify in "create_mesh" method to get better results!

for GP3:

setKSearch(100);                         //It was 20
gp3.setSearchRadius(10);                 //It was 0.025
gp3.setMu(5);                            //It was 2.5
gp3.setMaximumNearestNeighbors(100);     //It was 100
gp3.setMaximumSurfaceAngle(M_PI/4);      //45 degrees   
gp3.setMinimumAngle(M_PI/18);            //10 degrees 
gp3.setMaximumAngle(M_PI/1.5);           //120 degrees     
gp3.setNormalConsistency(false); 

for POISSON:

poisson.setDepth(depth);//7
poisson.setInputCloud(cloud_with_normals);
poisson.setPointWeight(pointWeight);//2
poisson.setDegree(2);
poisson.setSamplesPerNode(samplePNode);//1.5
poisson.setScale(scale);//1.1
poisson.setIsoDivide(isoDivide);//8
poisson.setConfidence(confidence);
poisson.setOutputPolygons(outputPolygons);
poisson.setManifold(manifold);
poisson.setSolverDivide(solverDivide);//8
poisson.reconstruct(triangles);

pointcloudtomesh's People

Contributors

danieltobon43 avatar dtcmlops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pointcloudtomesh's Issues

The result can't be supported by third_program?

@danielTobon43
Hi! Thanks for your grate work. I use your code get one mesh, when I put it into the CloudCompare meeting warning "some faces are not triangular", moreover I use rply library to read the result, meeting wrong "Read PLY failed: A polygon in the mesh could not be decomposed into triangles.RPly: Aborted by user"
Here is my experiment data.
parasaurolophus2.zip

Make problem

Hello, I have successfully build and make the project. but after making it, there is no executable file, as follows:
2019-04-11 09-47-23屏幕截图
2019-04-11 09-50-07屏幕截图
What's the matter? as I am in need of it, could you please give me a help? Thank you very much

Command line

Would it be possible to create command line interface for people with little coding knowledge?

Building, OpenNI issue

Hi,

I finally managed to install PCL on windows.

Through CMake I compile the VS project.
Build is successful.

But when I run the app in debug mode, I have error regarding OpenNI.
How can I solve it ?

image

C:\libs\PCL\pointcloudToMesh-master\src\bin\Debug\pointcloudToMESH.exe (process 24840) exited with code -1073741515.
Press any key to close this window . . .

I also tried this by copying stl file to debug folder:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.