Skip to content

timothy-a13/SC2-SVC

Repository files navigation

[Paper Implementation] SC2-SVC

English | 中文

SC2-SVC is a PyTorch implementation of the Sight View Constraint (SVC) model-selection idea for robust point cloud registration. This repository is built by modifying the SC2-PCR codebase and adding SVC-based transformation selection on top of the original second-order spatial compatibility pipeline.

Paper

Base Project

This implementation is derived from SC2-PCR: A Second Order Spatial Compatibility for Efficient and Robust Point Cloud Registration, which is released under the MIT License.

The main added component is svc.py. The matcher in SC2_PCR.py keeps the SC2-PCR candidate generation flow, sorts candidate transformations by fitness, and uses SVC checks to select a final transformation from the top candidates.

What This Code Does

The project evaluates a registration pipeline on standard point cloud registration benchmarks. The main steps are:

  1. Load source and target point clouds with pre-computed local descriptors.
  2. Match descriptors and construct correspondences.
  3. Generate transformation candidates using the SC2-PCR compatibility pipeline.
  4. Apply SVC-based bidirectional visibility checks to select the final transformation.
  5. Evaluate registration recall, rotation error, translation error, inlier precision, inlier recall, and F1 score.

Requirements

  • Python 3.7
  • CUDA-capable GPU
  • PyTorch 1.6.0 with CUDA 10.1
  • Open3D 0.9.0
  • NumPy, SciPy, scikit-learn, tqdm, easydict

The code calls .cuda() directly in the dataset loaders and matcher, so a CUDA environment is expected.

If you are using conda, configure the environment with:

conda env create -f environment.yml
conda activate SC2_PCR

The environment name is inherited from the SC2-PCR base project.

3DMatch

Data Preparation

Prepare the 3DMatch test set with downsampled fragments and pre-computed FPFH or FCGF descriptors. The path is configured in config_json/config_3DMatch.json.

Expected layout:

<data-root>/3DMatch/
  fragments/
    7-scenes-redkitchen/
      cloud_bin_0.ply
      cloud_bin_0_fcgf.npz
      cloud_bin_0_fpfh.npz
      ...
    sun3d-home_at-home_at_scan1_2013_jan_1/
    ...
  gt_result/
    7-scenes-redkitchen-evaluation/
      gt.info
      gt.log
      ...
    sun3d-home_at-home_at_scan1_2013_jan_1-evaluation/
    ...

Testing

python ./test_3DMatch.py --config_path config_json/config_3DMatch.json

The CUDA device, descriptor type, dataset path, and evaluation thresholds can be changed in the JSON config file.

3DLoMatch

Data Preparation

For FPFH or FCGF descriptors, use the same fragment layout as 3DMatch. For Predator descriptors, follow the OverlapPredator preprocessing instructions and organize the exported .pth files as configured by config_json/config_3DLoMatch.json.

Expected Predator descriptor layout:

<data-root>/3DLoMatch/
  0.pth
  1.pth
  ...
  1780.pth

Testing

python ./test_3DLoMatch.py --config_path config_json/config_3DLoMatch.json

KITTI Odometry

Data Preparation

Prepare pre-computed FPFH or FCGF descriptor pairs for the KITTI odometry benchmark. The raw point clouds can be downloaded from the KITTI Odometry website. The path is configured in config_json/config_KITTI.json.

Expected layout:

<data-root>/KITTI/
  fpfh_test/
    pair_0.npz
    pair_1.npz
    ...
    pair_554.npz
  fcgf_test/
    pair_0.npz
    pair_1.npz
    ...
    pair_554.npz

Testing

python ./test_KITTI.py --config_path config_json/config_KITTI.json

Project Structure

  • SC2_PCR.py: SC2-PCR matcher and candidate transformation generation, modified to call SVC selection.
  • svc.py: Sight View Constraint checks and final transformation selection.
  • dataset.py: 3DMatch, 3DLoMatch, and KITTI data loaders.
  • test_3DMatch.py: 3DMatch evaluation entry point.
  • test_3DLoMatch.py: 3DLoMatch evaluation entry point.
  • test_KITTI.py: KITTI odometry evaluation entry point.
  • config_json/: dataset paths, descriptors, thresholds, and runtime parameters.
  • utils/: SE(3), point cloud, timer, Sinkhorn, and maximum-clique utilities inherited from the base project.
  • benchmarks/: benchmark metadata used by the evaluation scripts.

Logs and Outputs

Evaluation logs are written under:

logs/

Each test script writes a dataset-specific log file, for example logs/3DMatch-fpfh.log or logs/KITTI-fpfh.log.

References

This project is an unofficial implementation based on the following paper and codebase.

SVC paper:

@article{Zhang2024SVC,
  title   = {SVC: Sight view constraint for robust point cloud registration},
  author  = {Zhang, Yaojie and Wang, Weijun and Huang, Tianlun and Wang, Zhiyong and Feng, Wei},
  journal = {Image and Vision Computing},
  volume  = {152},
  pages   = {105315},
  year    = {2024},
  doi     = {10.1016/j.imavis.2024.105315},
  url     = {https://www.sciencedirect.com/science/article/pii/S0262885624004207}
}

SC2-PCR paper, whose MIT-licensed implementation is used as the base code:

@InProceedings{Chen_2022_CVPR,
  author    = {Chen, Zhi and Sun, Kun and Yang, Fan and Tao, Wenbing},
  title     = {SC2-PCR: A Second Order Spatial Compatibility for Efficient and Robust Point Cloud Registration},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  month     = {June},
  year      = {2022},
  pages     = {13221-13231}
}

Copyright Notes

This repository contains a modified version of the MIT-licensed ZhiChen902/SC2-PCR codebase. The MIT License requires preserving the original copyright and permission notice, so this repository includes a LICENSE file that keeps the SC2-PCR notice and adds a modification copyright notice for this project.

This repository should not redistribute the ScienceDirect paper PDF, extracted paper figures, tables, screenshots, or long verbatim passages from the paper unless permission is granted by the rights holder. The README only provides bibliographic information and links to the paper page/DOI.

Before uploading datasets, pre-computed descriptors, generated results, or evaluation files, also verify the redistribution terms of the corresponding benchmark datasets and third-party projects.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages