StevenWang30 / R-PCC

R-PCC: A Baseline for Range Image-based Point Cloud Compression
31 stars 2 forks source link
compression point-cloud

R-PCC

R-PCC: A Baseline for Range Image-based Point Cloud Compression

This repository contains the python implementation for our full paper submitted to ICRA 2022 "R-PCC: A Baseline for Range Image-based Point Cloud Compression". If you find our paper or code useful, please cite:

@misc{wang2021rpcc,
      title={R-PCC: A Baseline for Range Image-based Point Cloud Compression}, 
      author={Sukai Wang and Jianhao Jiao and Peide Cai and Ming Liu},
      year={2021},
      eprint={2109.07717},
      archivePrefix={arXiv},
      primaryClass={cs.RO}
}

Overview

Introduction

The framework architecture of R-PCC:

Qualitative results:

From left to right: Ours-uniform, Ours-Nonuniform, Draco, G-PCC, and JPEG-Range, respectively. The color in the point cloud and the colorbar are based on the mean symmetric chamfer distance between the reconstructed and original point cloud.

First row, from left to right: Ours-Uniform, Ours-Uniform(birds-eye-view), Ours-Nonuniform; Second row, from left to right: Draco, G-PCC, and JPEG-Range.

Dataset:

We evaluated our compression framework on three datasets: KITTI (64E), Oxford (32E), and HKUSTCampus (VLP16).

You can download and test from the dataset websites or directly download the tested point clouds in the paper from here. The detailed dataset file path can be found in data/*.txt.

Installation

1. Clone the github repository.

git clone --recursive https://github.com/StevenWang30/R-PCC.git

2. Install CUDA and C++ extensions.

python setup.py develop

CUDA is used in FPS implementation and segmentation module, and some modules are implemented in C++ using pybind11.

3. Uninstall (if needed):

python setup.py develop --uninstall --user 

Usage

Config File

Set the parameters in the compression framework in cfg/compressor.yaml.

Compress

Compress single frame point cloud:

python tools/compress.py --input assets/example_data/example.bin --output example.rpcc --lidar Velodyne64E --eval

Currently supported LiDAR types: Velodyne64E / Velodyne32E / VelodyneVLP16

Currently supported data type: .bin / .pcd / .ply / .npy / .npz / .txt

The uniform and non-uniform compression framework can be switched by adding --nonuniform, and most of the parameters in the compressor.yaml can be manually set in the command line. But it is strongly recommanded to set the parameters in the yaml file to make sure they are matching while compression and decompression.

Decompress

python tools/decompress.py --input example.rpcc --output reconstructed.pcd --lidar Velodyne64E

Add original point cloud file to evaluate the reconstruction quality.

python tools/decompress.py --input example.rpcc --output reconstructed.pcd --lidar Velodyne64E --eval --original_point_cloud assets/example_data/example.bin

Compress datalist

Use datalist.txt to compress batch of point cloud.

python tools/compress_datalist.py --datalist data/test_64E_KITTI_city.txt --output_dir /output/R-PCC/test/compressed --lidar Velodyne64E 

The output compressed bitstream will be saved in --output_dir + original_file_path with suffix '.rpcc'.

Add --output to show the compression time and results on screen.

Add --workers 4 to set number of workers for parallel compression.

Example datalist files are in data.

Decompress datalist

python tools/decompress_datalist.py --datalist decompress_datalist.txt --output_dir /data/R-PCC/test/decompressed --lidar Velodyne64E --workers 4

The file path in the datalist must have .rpcc suffix.

The output reconstructed point clouds are .bin files. The intensity information will be dropped and replaced with all-zeros.

Acknowledgement

Part of "FPS" related code is borrowed from OpenPCDet.