This project implements a complete pipeline for aligning two 3D point clouds using a combination of Global Coarse Registration (RANSAC) and Local Fine Alignment (ICP). It also includes a custom implementation of the Chamfer Distance metric to evaluate the quality of the registration.
- Two-Stage Alignment: Combines RANSAC-based global registration for rough alignment and ICP for high-precision refinement.
- Feature Extraction: Uses Fast Point Feature Histograms (FPFH) to identify correspondences between point clouds.
- Custom Evaluation: Measures geometric similarity using a manually implemented Chamfer Distance algorithm optimized with KD-Trees.
- Visualization Ready: Generates
.plyfiles compatible with CloudCompare and Open3D.
- Python 3.8+
- Open3D
- NumPy
- SciPy
git clone https://github.com/yourusername/pointcloud_registration.git
cd pointcloud_registration
pip install open3d numpy scipy
The align.py script takes a source and target cloud, performs registration, and saves the transformed source cloud.
python3 align.py --source input/bunny_source.ply --target input/bunny_target.ply --output result/bunny_aligned.ply
The evaluate.py script computes the Chamfer Distance between the candidate (aligned) cloud and the reference (ground truth) cloud.
python3 evaluate.py --candidate result/bunny_aligned.ply --reference input/bunny_target.ply
- Voxel Downsampling: Reduces point density to speed up feature computation.
- Normal Estimation: Computes surface normals for both clouds.
- FPFH Features: Generates local geometric descriptors.
- RANSAC: Performs global registration to find an initial transformation matrix.
- Point-to-Plane ICP: Refines the transformation for maximum precision.
The similarity is calculated using the following mathematical approach:

