top of page

Project :

Object tracking in point cloud

​

​

Skills Involved:

C++, PCL, ROS2

​

Solo Project

​

​

​

github(1).png
Code

Description

Aim:

To cluster and detect objects in point clouds generated by lidar or depth cameras and tracking them using bounding boxes.

​

Methodology:

  1. Conversion of ROS Point Cloud Message to PCL Point Cloud:

    1. Receive a point cloud message (sensor_msgs::msg::PointCloud2) from a topic named "/kitti/point_cloud".

    2. Convert this ROS point cloud message to a format that PCL can use (pcl::PointCloud<PointT>).














       

  2. Cropping of Point Cloud Along X and Y Axes:

    1. Define a filtering object (pcl::PassThrough) and set up filter parameters for filtering along the X and Y axes to remove points that are not within a predefined range (defined by radius).

    2. Apply the passthrough filter along the X-axis, and then the Y-axis, thereby cropping the point cloud data to retain only points within a "cuboid" centered around the origin (X=0, Y=0).

  3. Voxel Grid Downsampling:

    1. Create a voxel grid filter and define a leaf size for downsampling.

    2. Apply this filter to the cropped point cloud, reducing its size by averaging nearby points into voxels (small cubes of a fixed size), which also reduces computational complexity in the subsequent steps.














       

  4. Estimation of Surface Normals:

    1. Estimate the normals of the point cloud using k-Nearest Neighbors (where k is set to 30).

    2. This is likely done to facilitate the subsequent step which involves identifying a road plane using surface normals.

  5. Road Surface Segmentation:

    1. Define a model for segmenting the planar road surface using the previously calculated normals, utilizing the RANSAC algorithm for robust model estimation.

    2. Extract the inliers and coefficients of the plane model and subtract these inliers from the original point cloud, resulting in a point cloud (road_cloud) presumably containing only objects/obstacles above the road surface.















       

  6. Euclidean Clustering for Traffic Object Segmentation:

    1. Perform Euclidean clustering to group together points that are close to each other in the road_cloud.

    2. For each cluster identified, check if its size falls within a reasonable range (defined by min_reasonable_size and max_reasonable_size), and if so, identify it as an object/obstacle of interest.

  7. Bounding Box Computation:

    1. Compute a 3D axis-aligned bounding box around each identified cluster.

    2. Store the minimum and maximum coordinates of each bounding box along with potential RGB color values in a structured manner.

  8. Visualization of Results:

    1. Create and visualize bounding boxes around detected objects.

    2. Employ several markers (top and bottom squares, connecting lines, corner spheres) to represent each bounding box in 3D space using ROS visualization messages.

    3. Publish the markers to a ROS topic named "visualization_marker_array" for visualization in a ROS visualization tool (e.g., RViz).
















       

kitti_voxel.png
kitti_pcd.png
segmented_road.png
Bounding_boxes.png

Figure 1. Orignal Kitti dataset

Figure 2. Downsampled Kitti dataset

Figure 3. Segmented road

Figure 4. Visualized bounding boxes

bottom of page