BSD 2-Clause "Simplified" License

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

3DMatch-Toolbox 技术深度分析

项目背景与痛点

3DMatch-Toolbox 是由 Andy Zeng 开发的一款基于 3D 卷积网络的局部几何描述子。它专为配准 3D 网格和点云服务。在现有的许多3D处理工具集中,3DMatch ToolBox 为解决三维数据之间的精准配准提供了一种新颖且高效的解决方案。在现代计算机视觉与机器学习领域中,3D 数据的精确配准是一个核心问题,这一问题广泛应用于自动驾驶、增强现实、机器人视觉等诸多场景。而在许多现有的解决方案中,3D Match 的创新在于其使用的卷积神经网络能够学习到更复杂的局部几何特征,以实现更准确的配准。

核心技术揭秘

作为一款先进的3D 描述子,3DMatch ToolBox 的技术实现提供了多项技术亮点。该工具的核心技术栈主要基于深度学习,特有的 3D 卷积神经网络用于提取点云和网格的局部几何特征。具体实施方案遵循卷积神经网络的原理解,通过神经网络对局部几何特征进行表征和匹配。在模型训练过程中,该工具实现了仔细的几何特征匹配,使得在卷积过程中能够捕捉到更具鲁棒性的局部特征,促进更精确的3D配准。

以下是对核心技术栈和数据流架构的一个简要分析:

graph TD A[输入点云] --> B[预处理] B --> C[批处理] C --> D{"卷积层"} D -->|"局部特征提取"| E[特征匹配] D -->|"全局特征提取"| F[特征融合] E --> G[局部配准] F --> H[全局配准] G --> I[输出局部配准结果] H --> J[输出全局配准结果]

上图描述了从输入点云开始的整个数据流过程。首先,对点云进行预处理,接着通过批处理减少冗余。随后进入卷积层提取局部和全局的几何特征。这点也是3DMatch ToolBox创新性的体现。通过局部特征匹配实现快速精确的局部配准,而全局特征融合则促进了整体一致性的提高。

功能亮点与差异

3DMatch ToolBox 的最大亮点在于其通过局部几何特征的提取大大提升了3D 数据配准的精度与鲁棒性。与传统的3D 描述子相比,3DMatch ToolBox 在几何与拓扑信息提取上更精准,突出表现在细节管理和一致匹配。这使得3DMatch ToolBox 能够在更多复杂环境下使用,而传统的点云处理方法在复杂的变化场景下容易出现错误。

除了以上优势,3DMatch ToolBox 还提供了开源的便利。这意味着开发者们可以在其基础上进行二次开发,允许充分自定义和优化。

应用场景与落地建议

在生产环境中使用3DMatch ToolBox 需要考虑的关键因素包括稳定的硬件设备以及大量的高质量训练数据。对于点云和网格数据而言,高质量的数据是获得良好配准结果的基础。另外,在使用该工具的过程中,需要关注其速度和内存资源的消耗。3DMatch ToolBox适用的场景广泛,其中包括但不限于三维重建,自动驾驶,机器视觉等重要领域,尤其适合那些需要高精度和鲁棒性3D配准的场景。

综合评价

3DMatch ToolBox 的设计思想和技术实现体现出了针对3D几何特征理解和配准需求的深度解析与优化,这不仅提升了工具的实际应用效果,也显示了在未来,深度学习在基于局部几何描述子的3D配准中所具有的潜在价值。但是在实际使用过程中,尤其是对于大数据集的处理需要使用者具备更先进的服务器和更加优化的数据集,如不具备则会在使用中遇到计算性能和数据精确度之间的权衡问题。

关于

GitHub 原始描述(英文)

3DMatch - a 3D ConvNet-based local geometric descriptor for aligning 3D meshes and point clouds.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

Awk
C
C++
Cuda
HTML
MATLAB
Makefile
SWIG
Shell

README

3DMatch Toolbox

3DMatch is a ConvNet-based local geometric feature descriptor that operates on 3D data (i.e. point clouds, depth maps, meshes, etc.). This toolbox provides code to use 3DMatch for geometric registration and keypoint matching, as well as code to train 3DMatch from existing RGB-D reconstructions. This is the reference implementation of our paper:

3DMatch: Learning Local Geometric Descriptors from RGB-D Reconstructions

PDF | Webpage & Benchmarks & Datasets | Video

Andy Zeng, Shuran Song, Matthias Nießner, Matthew Fisher, Jianxiong Xiao, and Thomas Funkhouser

IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2017 Oral Presentation

Matching local geometric features on real-world depth images is a challenging task due to the noisy, low-resolution, and incomplete nature of 3D scan data. These difficulties limit the performance of current state-of-art methods, which are typically based on histograms over geometric properties. In this paper, we present 3DMatch, a data-driven model that learns a local volumetric patch descriptor for establishing correspondences between partial 3D data. To amass training data for our model, we propose an unsupervised feature learning method that leverages the millions of correspondence labels found in existing RGB-D reconstructions. Experiments show that our descriptor is not only able to match local geometry in new scenes for reconstruction, but also generalize to different tasks and spatial scales (e.g. instance-level object model alignment for the Amazon Picking Challenge, and mesh surface correspondence). Results show that 3DMatch consistently outperforms other state-of-the-art approaches by a significant margin.

Overview

Citing

If you find this code useful in your work, please consider citing:

@inproceedings{zeng20163dmatch, 
	title={3DMatch: Learning Local Geometric Descriptors from RGB-D Reconstructions}, 
	author={Zeng, Andy and Song, Shuran and Nie{\ss}ner, Matthias and Fisher, Matthew and Xiao, Jianxiong and Funkhouser, Thomas}, 
	booktitle={CVPR}, 
	year={2017} 
}
License

This code is released under the Simplified BSD License (refer to the LICENSE file for details).

Benchmarks and Datasets

All relevant information and downloads can be found here.

Contact

If you have any questions or find any bugs, please let me know: Andy Zeng andyz[at]princeton[dot]edu

Change Log

  • Mar. 20, 2018. Update: added labels for test-set of keypoint matching benchmark (for convenience).
  • Nov. 02, 2017. Bug fix: added #include <random> to utils.hpp in demo code.
  • Oct. 30, 2017. Bug fix: included Quoc-Huy’s fix for NaN errors that occasionally occur during training.
  • Oct. 28, 2017. Notice: demo code only reads 3D point clouds saved in a simple binary format. If you would like to run the 3DMatch demo code on your own point cloud format, please modify demo.cu accordingly.
  • Apr. 06, 2017. Notice: 3DMatch uses cuDNN 5.1. Revised install instructions.

Dependencies

Our reference implementation of 3DMatch, as well as other components in this toolbox, require the following dependencies. Tested on Ubuntu 14.04.

  1. CUDA 7.5 and cuDNN 5.1. You may need to register with NVIDIA. Below are some additional steps to set up cuDNN 5.1. NOTE We highly recommend that you install different versions of cuDNN to different directories (e.g., /usr/local/cudnn/vXX) because different software packages may require different versions.

    LIB_DIR=lib$([[ $(uname) == "Linux" ]] && echo 64)
    CUDNN_LIB_DIR=/usr/local/cudnn/v5.1/$LIB_DIR
    echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDNN_LIB_DIR >> ~/.profile && ~/.profile
    
    tar zxvf cudnn*.tgz
    sudo cp cuda/$LIB_DIR/* $CUDNN_LIB_DIR/
    sudo cp cuda/include/* /usr/local/cudnn/v5.1/include/
    
  2. OpenCV (tested with OpenCV 2.4.11)

  • Used for reading image files
  1. Matlab 2015b or higher (tested with Matlab 2016a)

Table of Contents

Demo: Align Two Point Clouds with 3DMatch

Demo-Teaser

This demo aligns two 3D point clouds (projected from single-view depth maps) using our pre-trained 3DMatch descriptor (with Marvin) and standard RANSAC.

Instructions

  1. Checkout 3DMatch toolbox, compile C++/CUDA demo code and Marvin

    git clone https://github.com/andyzeng/3dmatch-toolbox.git 3dmatch-toolbox
    cd 3dmatch-toolbox/core
    ./compile.sh
    
  2. Download our 3DMatch pre-trained weights

    ./download-weights.sh # 3dmatch-weights-snapshot-137000.marvin
    
  3. Load the two example 3D point clouds, compute their TDF voxel grid volumes, and compute random surface keypoints and their 3DMatch descriptors (saved to binary files on disk). Warning: this demo only reads 3D point clouds saved in a simple binary format. If you would like to run the 3DMatch demo code on your own point cloud format, please modify demo.cu accordingly.

    # Generate fragment-1.desc.3dmatch.bin and fragment-1.keypts.bin
    ./demo ../data/sample/3dmatch-demo/single-depth-1.ply fragment-1
    
    # Generate fragment-2.desc.3dmatch.bin and fragment-2.keypts.bin
    ./demo ../data/sample/3dmatch-demo/single-depth-2.ply fragment-2 
    
  4. Run the following script in Matlab:

    % Load keypoints and 3DMatch descriptors and use RANSAC to register the two
    % point clouds. A visualization of the aligned point clouds is saved into
    % the file `result.ply` which can be viewed with Meshlab or any other 3D
    % viewer. Note: there is a chance that alignment may fail on the first try
    % of this demo due to bad keypoints, which are selected randomly by default.
    demo;
    

Converting 3D Data to TDF Voxel Grids

Instructions on how to convert from various 3D data representations into a voxel grid of Truncated Distance Function (TDF) values.

  1. Point cloud to TDF voxel grid (using nearest neighbor point distances)
  • See C++/CUDA demo code (ComputeTDF) which approximates TDF values (fast) using an occupancy voxel grid.
  • Alternative: See Matlab/CUDA code which computes accurate TDF values but is very slow.
  • Alternative: See Matlab code which also computes accurate TDF values, but works standalone on Matlab. Usually runs without memory problems if your point cloud is small.
  1. Mesh to TDF voxel grid (using distance transform of mesh surface with GAPS). Note that a version of GAPS is already included in this repository.
  • Instructions on installing GAPS and converting a sample mesh (.off file) into a voxel grid (binary .raw file of floats):

    cd 3dmatch-toolbox/gaps
    
    # Install GAPS
    make
    
    # Run msh2df on example mesh file (see comments in msh2df.cpp for more instructions)
    cd bin/x86_64
    wget http://3dvision.princeton.edu/projects/2016/3DMatch/downloads/gaps/bicycle000002.off
    ./msh2df bicycle000002.off bicycle000002.raw -v # see comments in msh2df.cpp for more arguments
    
    # Download visualization script
    wget http://3dvision.princeton.edu/projects/2016/3DMatch/downloads/gaps/showTDF.m
    
  • Run the visualization script in Matlab

    % Visualize TDF voxel grid of mesh
    showTDF;
    
  1. Depth map to TDF voxel grid
  • Project depth map into a point cloud in 3D camera space and convert from point cloud to TDF voxel grid (see above)
  • Alternative: Convert from depth map(s) into a TSDF volume (see instructions here) and compute the absolute value of each voxel (aka. projective TDF values, which behave differently near the view boundaries and regions of missing depth)

Training 3DMatch from RGB-D Reconstructions

See folder 3dmatch-toolbox/training

Code for training 3DMatch with Marvin, a lightweight GPU-only neural network framework. Includes Siamese network architecture .json file training/net.json and a CUDA/C++ Marvin data layer in training/match.hpp that randomly samples correspondences from RGB-D reconstruction datasets (which can be downloaded from our project webpage).

Quick Start

  1. Compile Marvin

    cd 3dmatch-toolbox/training
    ./compile.sh
    
  2. Download several training and testing scenes from RGB-D reconstruction datasets (download more scenes here)

    cd ../data
    mkdir train && mkdir test && mkdir backup
    cd train
    wget http://3dvision.princeton.edu/projects/2016/3DMatch/downloads/rgbd-datasets/sun3d-brown_cogsci_1-brown_cogsci_1.zip
    wget http://3dvision.princeton.edu/projects/2016/3DMatch/downloads/rgbd-datasets/7-scenes-heads.zip
    wget http://3dvision.princeton.edu/projects/2016/3DMatch/downloads/rgbd-datasets/sun3d-harvard_c11-hv_c11_2.zip
    unzip sun3d-brown_cogsci_1-brown_cogsci_1.zip
    unzip 7-scenes-heads.zip
    unzip sun3d-harvard_c11-hv_c11_2.zip
    mv *.zip ../backup
    cd ../test
    wget http://3dvision.princeton.edu/projects/2016/3DMatch/downloads/rgbd-datasets/sun3d-hotel_umd-maryland_hotel3.zip
    unzip sun3d-hotel_umd-maryland_hotel3.zip
    mv *.zip ../backup
    cd ../../training
    
  3. Train a 3DMatch model from scratch over correspondences from the RGB-D scenes saved in data/train

    ./marvin train net.json
    
  4. (Optional) Train 3DMatch using pre-trained weights from a Marvin tensor file

    ./marvin train net.json your-pre-trained-weights.marvin
    

Additional Setup Instructions

You can download more scenes from RGB-D reconstruction datasets on our project webpage. These datasets have been converted into a unified format, which is compatible with our Marvin data layer used to train 3DMatch. Save at least one scene into data/train and another scene into data/test such that the folder hierarchy looks something like this:

|——— training
     |——— core
          |——— marvin.hpp
          |——— ...
|——— data
     |——— train
          |——— rgbd-dataset-scene-1
               |——— seq-01
               |——— seq-02
               |——— camera-intrinsics.txt
               |——— ...
          |——— ...
     |——— test
          |——— rgbd-dataset-scene-2
               |——— seq-01
               |——— camera-intrinsics.txt
               |——— ...

Multi-Frame Depth TSDF Fusion

See folder 3dmatch-toolbox/depth-fusion

CUDA/C++ code to fuse multiple registered depth maps into a TSDF voxel volume (Curless and Levoy 1996), which can then be used to create surface meshes and point clouds.

Demo

This demo fuses 50 registered depth maps from directory data/sample/depth-fusion-demo/rgbd-frames into a TSDF voxel volume, and creates a surface point cloud tsdf.ply

cd 3dmatch-toolbox/depth-fusion
./compile.sh
./demo # output saved to tsdf.ply

Evaluation Code

See folder 3dmatch-toolbox/evaluation

Evaluation code for the Keypoint Matching Benchmark and Geometric Registration Benchmark, as well as a reference implementation for the experiments in our paper.

Keypoint Matching Benchmark

See folder 3dmatch-toolbox/evaluation/keypoint-matching

Benchmark description and leaderboard can be found here.

Evaluation Example
  1. Navigate to 3dmatch-toolbox/evaluation/keypoint-matching and run the following in Matlab:

    % Evaluate 3DMatch (3dmatch.log) on the validation set (validation-set-gt.log)
    getError;
    
Run 3DMatch on the validation set to generate a .log file (3dmatch.log)
  1. Compile C++/CUDA code to compute 3DMatch descriptors with Marvin

    cd 3dmatch-toolbox/evaluation/keypoint-matching
    ./compile.sh
    
  2. Download our 3DMatch pre-trained weights

    ./download-weights.sh # 3dmatch-weights-snapshot-137000.marvin
    
  3. Download the validation set and test set

    ./download-validation.sh # validation-set.mat
    ./download-test.sh # test-set.mat
    
  4. Modify and run the following script in Matlab:

    % Runs 3DMatch on the validation set and generates 3dmatch.log
    test3DMatch;
    
Generate your own correspondence dataset from RGB-D reconstructions
  1. Download one or more scenes from RGB-D reconstruction datasets on our project webpage. Organize the folder hierarchy as above.

  2. Modify and run the following script in Matlab:

    makeCorresDataset;
    

Geometric Registration Benchmark

See folder 3dmatch-toolbox/evaluation/geometric-registration

Includes Matlab code to run evaluation on the geometric registration benchmarks described here. Overview:

  • getKeyptsAndDesc.m - generates intermediate data (TDF voxel volumes, keypoints, and 3DMatch descriptors) for the scene fragments. You can also download our pre-computed data here.
  • runFragmentRegistration.m - read intermediate data and run RANSAC-based registration for every pair of fragments.
  • writeLog - read registration results from every pair of fragments and create a .log file
  • evaluate.m - compute precision and recall from .log files for evaluation
Evaluation Example

Run the following in Matlab:

% Evaluate 3DMatch on the geometric registration benchmark
evaluate;

Note: the TDF voxel grids of the scene fragments from the synthetic benchmark were computed using the deprecated code for accurate TDF (see deprecated/pointCloud2AccTDF.m). 3DMatch pre-trained weights fine-tuned on training fragments can be downloaded here.

Model Fitting for 6D Object Pose Estimation in the Amazon Picking Challenge

See folder 3dmatch-toolbox/evaluation/model-fitting-apc

Includes code and pre-trained models to evaluate 3DMatch for model fitting on the Shelf & Tote dataset. You can download our pre-computed data (TDF voxel grid volumes for objects and scans, surface keypoints, descriptors, and pose predictions) here. For an evaluation example, run Matlab script getError.m

Mesh Correspondence in Shape2Pose

See folder 3dmatch-toolbox/evaluation/mesh-correspondence-shape2pose

Includes code to generate mesh correspondence visualizations on the meshes from the Shape2Pose dataset using 3DMatch. You can also download our pre-computed data (TDF voxel grid volumes of the meshes, surface keypoints, 3DMatch descriptors) here. For a quick visualization, run the Matlab script keypointRetrieval.m.

评论

暂无评论