• Stars
    star
    676
  • Rank 66,790 (Top 2 %)
  • Language
    C++
  • License
    BSD 3-Clause "New...
  • Created over 1 year ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A toolbox for mapping and localization with line features.

LIMAP

The documentations on brief tutorials and APIs are available here.

LIMAP is a toolbox for mapping and localization with line features. The system was initially described in the highlight paper 3D Line Mapping Revisited at CVPR 2023 in Vancouver, Canada. Contributors to this project are from the Computer Vision and Geometry Group at ETH Zurich.

In this project, we provide interfaces for various geometric operations on 2D/3D lines. We support off-the-shelf SfM software including VisualSfM, Bundler, and COLMAP to initialize the camera poses to build 3D line maps on the database. The line detectors, matchers, and vanishing point estimators are abstracted to ensure flexibility to support recent advances and future development.

Next step: Hybrid incremental SfM is under development and will be included in the next round of release.

Installation

Install the dependencies as follows:

  • CMake >= 3.17
  • COLMAP [Guide]
  • PoseLib [Guide]
  • HDF5
sudo apt-get install libhdf5-dev
  • Python 3.9 + required packages
git submodule update --init --recursive

# Refer to https://pytorch.org/get-started/previous-versions/ to install pytorch compatible with your CUDA
python -m pip install torch==1.12.0 torchvision==0.13.0 
python -m pip install -r requirements.txt

To install the LIMAP Python package:

python -m pip install -Ive . 

To double check if the package is successfully installed:

python -c "import limap"

Quickstart

Example of Line Mapping

Download the test scene (100 images) with the following command.

bash scripts/quickstart.sh

To run Fitnmerge (line mapping with available depth maps) on Hypersim (visualization is enabled by default):

python runners/hypersim/fitnmerge.py --output_dir outputs/quickstart_fitnmerge

To run Line Mapping (RGB-only) on Hypersim (visualization is enabled by default):

python runners/hypersim/triangulation.py --output_dir outputs/quickstart_triangulation

To run Visualization of the 3D line maps after the reconstruction:

python visualize_3d_lines.py --input_dir outputs/quickstart_triangulation/finaltracks # add the camera frustums with "--imagecols outputs/quickstart_triangulation/imagecols.npy"

[Tips] Options are stored in the config folder: cfgs. You can easily change the options with the Python argument parser. The following shows an example:

python runners/hypersim/triangulation.py --sfm.hloc.descriptor sift --line2d.detector.method lsd \
                                         --line2d.visualize --triangulation.IoU_threshold 0.2 \
                                         --skip_exists --n_visible_views 5

In particular, --skip_exists is a very useful option to avoid running point-based SfM and line detection/description repeatedly in each pass.

Also, the combination LSD detector + Endpoints NN matcher can be enabled with --default_config_file cfgs/triangulation/default_fast.yaml for high efficiency (while with non-negligible performance degradation).

Example of Hybrid Point-Line Localization

We provide two query examples for localization from the Stairs scene in the 7Scenes Dataset, where traditional point-based methods normally struggle due to the repeated steps and lack of texture. The examples are provided in .npy files: runners/tests/localization/localization_test_data_stairs_[1|2].npy, which contains the necessary 2D-3D point and line correspondences along with the necessary configurations.

To run the examples, for instance the first one:

python runners/tests/localization.py --data runners/tests/localization_test_data_stairs_1.npy

The script will print the pose error estimated using point-only (hloc), and the pose error estimated by our hybrid point-line localization framework. In addition, two images will be created in the output folder (default to outputs/test/localization) showing the inliers point and line correspondences in hybrid localization projected using the two estimated camera pose (by point-only and point+line) onto the query image with 2D point and line detections marked. An improved accuracy of the hybrid point-line method is expected to be observed.

Supported line detectors, matchers and VP estimators

If you wish to use the methods with separate installation needed you need to install it yourself with the corresponding guides. This is to avoid potential issues at the LIMAP installation to ensure a quicker start.

Note: PR on integration of new features are very welcome.

The following line detectors are currently supported:

The following line descriptors/matchers are currently supported:

The following vanishing point estimators are currently supported:

Citation

If you use this code in your project, please consider citing the following paper:

@InProceedings{Liu_2023_LIMAP,
    author = {Liu, Shaohui and Yu, Yifan and Pautrat, Rémi and Pollefeys, Marc and Larsson, Viktor},
    title = {3D Line Mapping Revisited},
    booktitle = {Computer Vision and Pattern Recognition (CVPR)},
    year = {2023},
}

Contributors

This project is mainly developed and maintained by Shaohui Liu, Yifan Yu, Rémi Pautrat, and Viktor Larsson. Issues and contributions are very welcome at any time.

More Repositories

1

LightGlue

LightGlue: Local Feature Matching at Light Speed (ICCV 2023)
Python
3,261
star
2

Hierarchical-Localization

Visual localization made easy with hloc
Python
3,054
star
3

nice-slam

[CVPR'22] NICE-SLAM: Neural Implicit Scalable Encoding for SLAM
Python
1,415
star
4

pixel-perfect-sfm

Pixel-Perfect Structure-from-Motion with Featuremetric Refinement (ICCV 2021, Best Student Paper Award)
C++
1,317
star
5

pixloc

Back to the Feature: Learning Robust Camera Localization from Pixels to Pose (CVPR 2021)
JavaScript
745
star
6

glue-factory

Training library for local feature detection and matching
Python
702
star
7

GlueStick

Joint Deep Matcher for Points and Lines 🖼️💥🖼️ (ICCV 2023)
Jupyter Notebook
543
star
8

SOLD2

Joint deep network for feature line detection and description
Jupyter Notebook
541
star
9

DeepLSD

Implementation of the paper "DeepLSD: Line Segment Detection and Refinement with Deep Image Gradients"
Jupyter Notebook
453
star
10

sfm-disambiguation-colmap

Making Structure-from-Motion (COLMAP) more robust to symmetries and duplicated structures
Python
277
star
11

pyceres

Factor graphs with Ceres in Python
C++
233
star
12

visloc-iccv2021

ETH-Microsoft dataset for the ICCV 2021 visual localization challenge
203
star
13

EMAP

[CVPR'24] 3D Neural Edge Reconstruction
Python
147
star
14

nicer-slam

[3DV'24 Best Paper Honorable Mention] NICER-SLAM: Neural Implicit Scene Encoding for RGB SLAM
Python
146
star
15

nerf-on-the-go

[CVPR'24] NeRF On-the-go: Exploiting Uncertainty for Distractor-free NeRFs in the Wild
Python
124
star
16

VP-Estimation-with-Prior-Gravity

Vanishing Point Estimation in Uncalibrated Images with Prior Gravity Direction (ICCV 2023)
C++
90
star
17

glace

[CVPR 2024] GLACE: Global Local Accelerated Coordinate Encoding
Python
68
star
18

px-ros-pkg

A repository for PIXHAWK open source code running on ROS
C
50
star
19

LabelMaker

Jupyter Notebook
50
star
20

raybender

Fast CPU rendering in Python using the Intel® Embree backend
C++
38
star
21

pcdmeshing

Point cloud meshing with CGAL
C++
38
star
22

implicit_dist

C++
23
star
23

hololens_ros

C#
12
star
24

depthsplat

DepthSplat: Connecting Gaussian Splatting and Depth
5
star
25

spot_pose_estimation

Python
2
star