This is a basic segmentation of plane fitting in point cloud data using (RAN)dom (SA)mple (C)onsensus.
ransac.cu
is the CUDA C++ implementation which uses the Open3D C++ API to vusualize.ransac.py
is the Python (NumPy) implementation, using Open3D Python API to visualize.This setup assumes you’ve installed Anaconda already. If not, please install anaconda from here or from your package manager.
The following packages are required to run this code.
To set up a conda environment and install all dependencies, do the following.
conda create -n open3d
conda activate open3d
conda install -c open3d-admin -c open3d
conda install -c conda-forge python-kaleido plotly numpy matplotlib
To test it on custom data, change the source code to represent the path of your data.
Run python3 ransac.py
to obtain a plot of the data along with the best fit plane.
The points in green are the points of the data, and the grey part is the best fit plane.