Sign inSign up

danieltobon43/dbscan-octrees

By danieltobon43

•Updated over 4 years ago

DBScan algorithm using Octrees to cluster 3D points in a space with PCL Library 1.9.1 - Ubuntu 20.04

Image
0

289

danieltobon43/dbscan-octrees repository overview

⁠DBScan-Octrees-PCL-1.12.1

This project is based on pcl-docker-1.12.1⁠ and uses dbscan octrees from here⁠.

Docker multi-stage graph generated with: dockerfilegraph⁠

In order to pass a pcd file to the docker container, you must mount a folder between the host machine and the pcd location folder in the container.

⁠Docker image

You can either choose to build the image by yourself or pull it from the docker hub

⁠Pull from docker-hub
docker pull danieltobon43/dbscan-octrees:1.1-alpine3.15
⁠build from Dockerfile⁠
docker build -f Dockerfile -t dbscan:1.1 .

⁠How to run dbscan docker image

To run this image, you can execute the command below or create a .sh file⁠

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="dbscan" \
           --cap-add sys_ptrace \
           -p 127.0.0.1:2222:22 \
           --user=pcl \
           --volume=[PATH TO YOUR PCD FOLDER]:/home/pcl/project/pcd \
           -t danieltobon43/dbscan-octrees:1.1-alpine3.15 --cloudfile pcd/[YOUR PCD FILENAME]
⁠example
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="dbscan" \
           --cap-add sys_ptrace \
           -p 127.0.0.1:2222:22 \
           --user=pcl \
           --volume=`pwd`/pcd:/home/pcl/project/pcd \
           -t danieltobon43/dbscan-octrees:1.1-alpine3.15 --cloudfile pcd/Tree2.pcd
⁠Parameters

These parameters are passed to the docker container.

-h --help       	shows help message and exits [default: false]
-v --version    	prints version information and exits [default: false]
--cloudfile     	input cloud file [required]
--octree-res    	octree resolution [default: 120]
--eps           	epsilon value [default: 40]
--minPtsAux     	minimum auxiliar points [default: 5]
--minPts        	minimum points [default: 5]
-o --output-dir 	output dir to save clusters [default: "-"]
--ext           	cluster output extension [pcd, ply, txt, xyz] [default: "pcd"]
-d --display    	display clusters in the pcl visualizer [default: false]
--cal-eps       	calculate the value of epsilon with the distance to the nearest n points [default: false]

⁠Dockerfile

# vtk 9.0 
# error: vtkContextDevice2D.cxx:32 WARN| Error: no override found for 'vtkContextDevice2D
# https://discourse.vtk.org/t/two-questions-about-new-module-system/2864/16

# Build stage
FROM danieltobon43/pcl-docker:1.12.1-alpine3.15-All as build_dbscan

# ======== Compile dbscan project ========
RUN apk --no-cache add cmake make g++

COPY . /tmp

WORKDIR /tmp

RUN cmake -DCMAKE_INSTALL_PREFIX=/tmp/install \
	-S . -Bbuild && make -C build/ -j$(nproc) --no-print-directory && \
	make -C build/ install --no-print-directory

# Runtime
FROM danieltobon43/pcl-docker:1.12.1-alpine3.15-All as runtime
ENV MESA_LOADER_DRIVER_OVERRIDE i965

COPY --from=build_dbscan /tmp/install /usr

# ======== Run binary file ========
ENTRYPOINT ["app"]

Tag summary

Content type

Image

Digest

Size

429.3 MB

Last updated

over 4 years ago

docker pull danieltobon43/dbscan-octrees:1.1-alpine3.15