- c++ generic dbscan library on CPU & GPU. header-only codes for cpu dbscan.
- cpu dbscan uses kd-tree for radius search.
- gpu dbscan or G-DBSCAN uses BFS on nodes of point.
- Implement generic kd-tree
- Implement generic dbscan
- Create unittest & examples
- GPU DBSCAN
- base dependencies
sudo apt-get install \
libpcl-dev \
tested with pcl 1.10
- gpu dbscan
CUDA toolkits (tested on cuda 11)
lower pcl version (that uses older eigen version) might not be compatible with cuda
# build lib
make default -j`nproc`
# build examples
# build only cpu dbscan
make apps -j`nproc`
# build both cpu and gpu dbscan
make gpu_apps -j`nproc`
- This library provides an example with clustering point cloud from livox horizon lidar
# after make apps or make gpu_apps
# cpu
./build/examples/test_pointcloud_clustering [path/to/pcl/file] [eps] [min/points]
# gpu
./build/examples/test_pointcloud_clustering_gpu [path/to/pcl/file] [eps] [min/points]
# eps and min points are parameters of dbscan algorithm
# for example
./build/examples/test_pointcloud_clustering ./data/street_no_ground.pcd 0.7 3 1
# or
./build/examples/test_pointcloud_clustering_gpu ./data/street_no_ground.pcd 0.7 3 1
# change final parameters to 0 to disable visualization
- processing time (average of 10 tests):
# number of points: 11619
# processing time (cpu): 80[ms]
# processing time (gpu): 38[ms]
# difference in speed will get more obvious with point cloud of more points
- Here is the sample result:
- cpu
# build
docker build -f ./dockerfiles/ubuntu2004_gpu.dockerfile -t dbscan .
# run
docker run -it --rm -v `pwd`:/workspace dbscan
- gpu: change the cuda version here to match your local cuda version before build.
# build
docker build -f ./dockerfiles/ubuntu2004_gpu.dockerfile -t dbscan_gpu .
# run
docker run -it --rm --gpus all -v `pwd`:/workspace dbscan_gpu