This project implements the components of Multiple View Geometry for tasks like camera calibration, stereo vision, structure from motion, etc.
This repository provides a set of tools related to Multiple View Geometry. The goal is to provide concise implementations of major components and tools used in this topic and understand the mathematics and techniques under the hood. Even though performance is taken into account to some degree, however, it's not the highest priority here.
WARNING:
- Note that this repository is in its very early stage and there's a lot of work to be done. Also, there is no guarantee that things will all work as expected.
- The intention is to use this project for Python, so CMake lookup/install-related stuff is not implemented.
The core multi-view-geometry algorithms are implemented in C++ and exposed to
Python through pybind11; the rest of the toolkit (datasets, features, scripts)
is Python. The required Python version is 3.10.
Required (found via find_package):
apt-get install build-essential cmake make python3-dev \
libopencv-dev libeigen3-dev libboost-filesystem-devRecommended but optional — fmt, Ceres, pybind11 and GTest are fetched
from source by CMake when they are missing, so installing them only speeds up
the first build:
apt-get install libfmt-dev libceres-dev pybind11-dev libgtest-devNumPy 2.x: the bindings need pybind11
>= 2.12. Ubuntu 22.04 ships 2.9.1, so when only the system package is present the build automatically fetches a newer pybind11 — no action needed.
python3 -m venv .venv # or: uv venv .venv
source .venv/bin/activate
pip install -r requirements.txt # runtime deps (heavy: pulls torch, open3d, ...)
pip install -e . # or: uv pip install -e . --no-build-isolationpip install -e . builds the two pybind11 extensions and co-locates the C++
shared libraries next to them (via an $ORIGIN RPATH), so no system-wide
cmake --install is required to use the package from Python.
For the geometry core and tests only, the heavy requirements.txt is not
needed — numpy scipy opencv-python matplotlib sympy tqdm loguru luigi click
is enough.
Run the Python tests with:
pip install pytest pytest-xdist
pytest src/testscmake -S . -B build -DBUILD_MVGKIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
ctest --test-dir build --output-on-failurepip install pre-commit
pre-commit install --install-hooks # installs the formatting and commit-msg hooksCommits must follow Conventional Commits
with a scope, e.g. fix(estimation): correct RANSAC return.
This project is released under GPLv3.