Build Poisson Surface Reconstruction from source in Ubuntu

aswath govind
Technology Hits
Published in
2 min readSep 8, 2023

--

Poisson surface reconstruction is an algorithm widely used to reconstruct surfaces in the form of meshes from a set of point data or point cloud data. This finds a very wide application in many areas across domains namely augmented reality, virtual reality, robotics navigation, etc. The working of the algorithm is very interesting but this blog does not cover that in detail. But I hope this blog helps people get their hands on this interesting piece of science.

First things First, clone the Poisson surface reconstruction source code from repo in GitHub using the following command

git clone https://github.com/mkazhdan/PoissonRecon.git

Once the repo is downloaded successfully, run the following commands just to make sure that all the dependencies are installed appropriately.

apt-get install libjpeg-dev
apt-get install libboost-dev
apt install libboost-system-dev

After installing these dependencies,

cd PoissonRecon // To get into the source folder
make

This will take quite some time to finish. In case you want to quickly finish the build process, then navigate to the preprocessor.h file inside Src/ and uncomment the following line of code. This will make sure that the build finishes soon.

//#define FAST_COMPILE // If enabled, only a single version of the code is compiled

Once the build is finished successfully, you can try out various examples as mentioned in the README.md file. You can download the bunny.points.ply from the repo’s example section and run the following command in your terminal.

cd Bin/Linux
./PoissonRecon --in ../Sample_Data/bunny.points.ply --out bunny.ply --depth 10 --pointWeight 0

If the program has executed successfully, you will get an output file in the name bunny.ply in the current directory. You can visualize it using the Python code given below:-

from open3d import *    

def main():
cloud = io.read_point_cloud("bunny.ply") # Read point cloud
open3d.visualization.draw_geometries([cloud]) # Visualize point cloud

if __name__ == "__main__":
main()

You might get an output similar to the one shown here,

The output of the Poisson reconstruction

Hope this was helpful. Happy learning and Engineering.

References:-

  1. Kazdhan’s GitHub repo:- https://github.com/mkazhdan/PoissonRecon.git

--

--