limap

cvgBSD-3-Clause活跃维护

用点、线、面、消失点等结构化几何特征做三维视觉建图、定位和 SfM 的 C++ 工具箱,弥补纯点特征在低纹理场景下的不足。

A toolbox for 3D visual mapping, localization, and SfM with structured geometric features (points, lines, planes, vanishing points, wireframes, etc.).

v2.0.0发布于 2026-09-04 01:43 UTC910star102fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
python -m pip install pylimap
硬件要求按 README 说明

README 未说明具体显存要求;深度学习检测器与匹配器需要 CUDA,项目已在 Linux、macOS、Windows 上测试。

需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把线、面、消失点等结构化几何特征与点一起联合优化的 3D 建图、定位与 SfM 工具箱

用点、线、面、消失点等结构化几何特征做三维视觉建图、定位和 SfM 的 C++ 工具箱,弥补纯点特征在低纹理场景下的不足。

核心能力

  • 将线、消失点、平面、线框与参数化基元作为一等公民联合优化
  • 提供已知位姿下的点线三角化建图流水线
  • 支持点线联合的相机定位,含未标定查询
  • 提供整体增量式 SfM,可从零恢复位姿与结构
  • 输出兼容 COLMAP 模型,可用 COLMAP GUI 与 pycolmap 读取

容易踩的坑

PyPI 的 pylimap 只含 Core 模式,重建还需从 requirements.txt 安装未上 PyPI 的 hloc;Python 3.13 无 open3d wheel,无法做 3D 可视化且 pxwplanar 平面检测器被跳过;HAWP、TP-LSD、LBD、RoMa、Progressive-X、UPAL 需按 misc/install 指南单独克隆安装。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

2 个版本v2.0.0
  1. v2.0.02.0.0最新正式版2026-09-04 · 2026-09-04 01:43 UTC

    LIMAP 2.0.0 turns this open-source project from a line mapping library into a holistic 3D visual mapping and localization toolbox. Notably, the release brings in the incremental SfM pipeline introduced in Robust Incremental Structure-from-Motion with Hybrid Features (ECCV 2024) and further improved in Stable and Scalable Bundle Adjustment of Holistic 3D Structures (ECCV 2026), and unifies the whole toolbox with the COLMAP ecosystem.

    Unification with the COLMAP ecosystem

    The point side of the pipeline is COLMAP now, including the scene types, camera models, database, correspondence graph, various robust estimators and the incremental mapper logic. LIMAP adds structures on top instead of maintaining a parallel implementation. The unification is the result of substantial engineering efforts on both ends.

    • A reconstruction is written as a plain COLMAP model — cameras.bin, images.bin, points3D.bin, rigs.bin, frames.bin — with the line, group and wireframe structures alongside it under structures/. There is no conversion step and no LIMAP-specific container in between, so any output can be opened directly in the COLMAP GUI and read back with pycolmap. We also provide additional data structures for reading the new holistic reconstruction format, built by composition around the COLMAP reconstruction object.
    • Line, group and point correspondences ride in the same TwoViewGeometry structures, split over COLMAP's database.db and LIMAP's structure_database.db.
    • Active advances on the COLMAP side carry over directly by bumping the pinned FetchContent tag: multi-camera rig support, improved two-view geometry estimation, newly introduced utilities, and upstream bug fixes. As of the release date, LIMAP pins COLMAP 4.2.0, released in the same week.

    Holistic incremental SfM

    • New holistic incremental mapper that reconstructs from images alone, jointly optimizing points, lines, vanishing points, planes and the wireframe together with the camera poses (limap.cli.structure_incremental_sfm, or automatic_structure_incremental_reconstruction for frontend + mapper).
    • Uncalibrated input supported end to end: focal lengths are estimated jointly with the poses, in both SfM and localization. The underlying PnPL and PnPLF solvers were thoroughly tested and upstreamed to PoseLib, and are used directly through wrapped interfaces.
    • Consistent accuracy gains over COLMAP given the same sparse point features and matches, particularly in structured indoor environments. The runtime overhead over COLMAP is ~30% on large scenes, with similar scaling behavior.
    • HolisticReconstruction enables unified I/O across triangulation, localization and SfM. With poses given, limap.cli.automatic_structure_triangulation automatically reconstructs vanishing points, planes and the wireframe on top of points and lines.

    Structures beyond lines

    • Groups as a first-class abstraction — vanishing points, planes and parametric primitives (spheres, cylinders, ellipsoids, cuboids, cones), with 3D estimators and verification for each.
    • The wireframe connecting the structures is reconstructed and optimized alongside them.
    • New stable and scalable holistic bundle adjustment over all the 3D structures (ECCV 2026), replacing the previous line-only refinement.
    • Integrated the new plane detector PxwPlanar, from Pixel-wise Planarity for High-Precision Monocular Plane Segmentation (ECCV 2026).

    Packaging and platforms

    • Published on PyPI as pylimap — pip install pylimap gets the compiled core with no build. The import name stays limap.
    • Wheels for Linux, macOS and Windows, Python 3.10–3.13. All three platforms are tested in CI.
    • Third-party dependencies (COLMA
  2. v1.0.01.0.02026-09-02 · 2026-09-02 14:37 UTC
    查看更新说明

    [Note] This is the first tagged release of LIMAP, the line mapping and localization library introduced in 2023. It stabilizes the current codebase in preparation for a major upcoming update that introduces SfM utilities and full alignment with the COLMAP ecosystem.

    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.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    LIMAP

    The documentations on brief tutorials and APIs are available here.

    LIMAP is a toolbox for holistic 3D mapping, localization and structure from motion (SfM) with structured features. Alongside keypoints, it treats lines, vanishing points, planes, parametric primitives (spheres, cylinders, ellipsoids, cuboids, cones) and the wireframe connecting them as first-class citizens of the reconstruction, optimized jointly with the camera poses. It grew out of the highlight paper 3D Line Mapping Revisited at CVPR 2023 in Vancouver, Canada, with the SfM pipeline introduced and further improved in subsequent papers at ECCV 2024 and ECCV 2026 (please refer to the Citations section for details). Contributors to this project are from the Computer Vision and Geometry Group at ETH Zurich.

    Three pipelines are provided:

    • Visual mapping / triangulation — build a holistic 3D model from images whose camera poses are already known, for instance from an existing COLMAP reconstruction.
    • Visual localization — estimate the camera pose of a query image with respect to an existing 3D model, using point and line correspondences jointly. Both calibrated and uncalibrated queries are supported.
    • Holistic incremental SfM — recover the camera poses and the 3D model together from images alone, with nothing given as input. Calibrated and uncalibrated inputs are both supported.

    [!NOTE] Starting from LIMAP 2.0.0, the toolbox is fully compatible with the COLMAP ecosystem (version 4.2.0 as of Sep 1, 2026): a reconstruction is written as a plain COLMAP model, with the line, group and wireframe structures alongside it under structures/, so any output can be opened in COLMAP GUI and read with pycolmap. The unification runs deeper than the file format: the point side of the pipeline comes directly from COLMAP, consolidating with its scene types, database, estimators, correspondence graph, and various incremental mapper logic, with LIMAP adding the structures on top instead of maintaining a parallel implementation. Advances on the COLMAP side therefore carry over directly: multi-camera rig support, improved two-view geometry estimation, etc.

    The line detectors, matchers, vanishing point estimators and plane detectors are abstracted behind registries to ensure flexibility to support recent advances and future development.

    Installation

    LIMAP has been tested on Linux, macOS and Windows.

    Dependencies:

    • Python 3.10/11/12/13
    • CMake >= 3.17
    • CUDA (for deep learning based detectors/matchers)
    • System dependencies [Per-platform guide]

    Note that one cannot visualize reconstructions on Python 3.13, as there are no published wheels available for open3d and our 3D viewer depends on it.

    Starting from 2.0.0, each official release is published to PyPI as pylimap, which installs the compiled core library without building it:

    python -m pip install pylimap
    

    The distribution is named pylimap; the import name is still limap. A wheel provides the Core only mode described below, so the extras and the git-sourced detectors remain opt-in on top.

    To build and install the LIMAP Python package from source:

    python -m pip install -r requirements.txt   # git-sourced detectors and matchers
    python -m pip install -Ive ".[all]"
    

    To double check if the package is successfully installed:

    python -c "import limap; print(limap.__version__)"
    

    For faster incremental rebuilds during development (reuses the CMake build directory instead of rebuilding from scratch):

    python -m pip install -Cbuild-dir=./pylimap_build --no-build-isolation -Ive .
    

    Core only — the compiled library and its Python API, and nothing else:

    python -m pip install -Ive .
    

    This gives you the geometry types, reading and writing of reconstructions, and the estimators and bundle adjustment, all operating on data you already have. It does not let you reconstruct from images, which needs hloc, nor detect 2D lines, nor visualize anything. This is also the mode a published wheel provides — the extras and the git-sourced detectors are always opt-in on top.

    Developer — adds pytest and the pinned formatters on top of the full install:

    python -m pip install -r requirements.txt
    python -m pip install -Ive ".[all,dev]"
    
    extracontents
    vizmatplotlib, seaborn, open3d — needed by limap.visualize
    line2deinops, scikit-image, pillow — support code for the 2D line detectors
    devpytest, ruff, clang-format
    allviz + line2d
    • Running a reconstruction needs hloc, which comes from requirements.txt rather than from the package metadata: it is not published on PyPI, so it cannot be declared as a dependency. Without it the package imports fine, but the point frontend will fail when it is first used.
    • open3d publishes no wheels for Python 3.13+, and all 3D visualization depends on it, so visualize_holistic_recon.py, visualize_colmap_model.py and the 3D helpers in limap.visualize do not run there. The pxwplanar plane detector also depends on open3d, so it is skipped on 3.13 as well. Line and point reconstruction are unaffected — no pipeline touches open3d.
    • Several further methods (HAWP, TP-LSD, LBD, RoMa, Progressive-X, UPAL) are not installed by any of the above. Each is cloned and pip-installed separately. See the per-method guides under misc/install/, also linked from the detector and matcher lists further down.

    If bundle adjustment aborts with Intel MKL FATAL ERROR: Cannot load libmkl_avx2.so or libmkl_def.so, _limap.so is resolving to an inconsistent system MKL. Point the extension at a coherent one (${CONDA_PREFIX}/lib, or any directory holding a consistent MKL):

    python -m pip install patchelf
    LIMAP_SO=$(python -c 'import limap._limap as m; print(m.__file__)')
    patchelf --set-rpath "${CONDA_PREFIX}/lib" "$LIMAP_SO"
    ldd "$LIMAP_SO" | grep mkl   # none should resolve to /lib/x86_64-linux-gnu
    

    Re-apply after rebuilding. Prefer this to putting the directory on LD_LIBRARY_PATH, which affects every program in the shell.

    Quickstart

    Example of Point-Line Triangulation

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

    bash scripts/quickstart.sh
    

    Step 1: Undistort images to pinhole cameras

    First, prepare the Hypersim scene by undistorting images and creating a COLMAP model:

    python runners/hypersim/undistort_images.py \
        --data_dir data \
        --scene_id ai_001_001 \
        --output_dir outputs/quickstart \
        --max_image_dim 800
    

    This creates:

    • outputs/quickstart/init_model/ - Initial COLMAP model
    • outputs/quickstart/undistorted/images/ - Undistorted images
    • outputs/quickstart/undistorted/sparse/ - Undistorted COLMAP model

    Step 2: Run point-line triangulation

    Then, run point-line triangulation on the undistorted images:

    python -m limap.cli.automatic_point_line_triangulation \
        -m outputs/quickstart/undistorted/sparse \
        -i outputs/quickstart/undistorted/images \
        -o outputs/quickstart/triangulation
    

    Visualization

    To visualize the full reconstruction (points + lines):

    python visualize_holistic_recon.py --input_dir outputs/quickstart/triangulation/final_model --cam_scale 0.1
    

    To visualize points only (using pycolmap):

    python visualize_colmap_model.py --input_dir outputs/quickstart/triangulation/final_model --cam_scale 0.1
    

    Example of Hybrid Point-Line Localization

    We provide an example of hybrid point-line localization on the Stairs scene of the 7Scenes dataset.

    Prepare the dataset following the hloc 7Scenes pipeline (scene images together with the SIFT SfM models, DenseVLAD retrieval pairs, and rendered depth maps), laid out under a single datasets/7scenes root. Then run:

    python runners/7scenes/localization.py --dataset datasets/7scenes -s stairs --skip_exists
    

    Add --use_dense_depth to build the line map from rendered depth maps instead of triangulation, or --use_points_only for the point-only baseline. The runner prints the pose errors for point-only (hloc) versus hybrid point-line localization; an improved accuracy from adding lines is expected.

    We also support localization without knowing the query intrinsics, by adding the --uncalibrated flag:

    python runners/7scenes/localization.py --dataset datasets/7scenes -s stairs --skip_exists --uncalibrated
    

    The focal length is then estimated jointly with the pose from the same point and line correspondences. Lines give a consistent improvement here, both on the pose and on the consistency of the recovered focal length across queries.

    Example of Holistic Incremental SfM

    The same test scene can be reconstructed from scratch (no input poses) with the holistic incremental mapper, which jointly optimizes points, lines, vanishing points, planes and the wireframe:

    python experiments/benchmark_sfm.py \
        --dataset hypersim \
        --scenes ai_001_001 \
        --data_dir data \
        --output_dir outputs/quickstart_sfm
    

    This writes outputs/quickstart_sfm/hypersim/ai_001_001/holistic/models/ and prints relative pose AUC against the ground-truth poses. Add --methods holistic pycolmap to run the COLMAP mapper alongside it on the same features and matches.

    We also support structure from motion without knowing the intrinsics, by adding the --uncalibrated flag:

    python experiments/benchmark_sfm.py \
        --dataset hypersim \
        --scenes ai_001_001 \
        --data_dir data \
        --output_dir outputs/quickstart_sfm_uncalibrated \
        --uncalibrated
    

    Nominal relative pose AUC over five runs on this quickstart scene:

    [email protected][email protected]AUC@1AUC@3AUC@5
    COLMAP, calibrated33.7 ± 1.569.2 ± 0.485.5 ± 0.393.1 ± 0.193.7 ± 0.1
    Holistic (ours), calibrated51.6 ± 2.481.5 ± 2.292.0 ± 2.497.6 ± 0.297.9 ± 0.1
    COLMAP, uncalibrated31.8 ± 1.465.4 ± 5.881.7 ± 7.689.8 ± 8.190.5 ± 8.2
    Holistic (ours), uncalibrated50.1 ± 3.480.7 ± 1.692.7 ± 1.497.6 ± 0.197.9 ± 0.0

    Other datasets are selected with --dataset {hypersim,scannetpp,eth3d,7scenes,1dsfm}, each read directly from its own release via --data_dir.

    Supported line detectors, matchers, VP and plane 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.

    Each method below links its BibTeX entry, collected in misc/citations.md. Please cite the ones you use.

    The following line detectors are currently supported:

    The following line descriptors/matchers are currently supported:

    UPAL detects and describes both points and lines in a single network pass, so it can drive the point frontend too: see cfgs/structure_triangulation/upal.yaml.

    The following vanishing point estimators are currently supported:

    The following plane detectors are currently supported:

    No separate installation is needed: pxwplanar is pulled in by requirements.txt and its weights download from Hugging Face on first use. It does require the MoGe fork that pxwplanar pins; another MoGe install in the same environment will shadow it and break metric prediction on CUDA.

    Citations

    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},
    }
    

    If you use the holistic incremental SfM pipeline, please consider additionally citing:

    @InProceedings{Liu_2024_Robust,
        author = {Liu, Shaohui and Gao, Yidan and Zhang, Tianyi and Pautrat, Rémi and Schönberger, Johannes L. and Larsson, Viktor and Pollefeys, Marc},
        title = {Robust Incremental Structure-from-Motion with Hybrid Features},
        booktitle = {European Conference on Computer Vision (ECCV)},
        year = {2024},
    }
    
    @InProceedings{Liu_2026_Stable,
        author = {Liu, Shaohui and Pautrat, Rémi and Barath, Daniel and Hartley, Richard and Larsson, Viktor and Pollefeys, Marc},
        title = {Stable and Scalable Bundle Adjustment of Holistic 3D Structures},
        booktitle = {European Conference on Computer Vision (ECCV)},
        year = {2026},
    }
    

    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.