jkk-research / lidar_cluster_ros2

LIDAR pointcloud clustering
https://jkk-research.github.io/workshops/clustering_a/
GNU General Public License v3.0
13 stars 2 forks source link

Add euclidean voxel grid implementation #4

Closed Zahuczky closed 2 months ago

Zahuczky commented 2 months ago

Adding voxel grid base euclidean clusterint

Overview

This pull request provides a new method of clustering, specifically voxel grid based euclidean clustering. On my computer (R5 5600H) compared to the previous best performer(DBSCAN Spatial with 10Hz) this method reaches upwards of 300Hz with a similar(somewhat better) quality of clustering.

This implementation is somewhat based on https://autowarefoundation.github.io/autoware.universe/main/perception/euclidean_cluster/ (Apache 2.0 licensed)

The process:

  1. Voxel Grid Creation:

    • A voxel grid is created from the input point cloud
    • This reduces the number of points, thereby speeding up subsequent operations.
  2. Projection to 2D:

    • The z-coordinate of the points in the voxel grid is zeroed out to project the point cloud to a 2D plane.
  3. Clustering:

    • A KD-Tree is used to do nearest-neighbor search.
    • Euclidean clustering is performed on the 2D projected point cloud.
  4. Mapping Cluster Indices:

    • The cluster indices from the 2D clustering are mapped back to the original(cropped) 3D point cloud.
    • This ensures that the z-coordinate information is retained, and the original point cloud can be reconstructed with cluster labels.