OpenMVG: A Clean C++ Framework for Reproducible 3D Reconstruction from Images
If you've ever wanted to turn a pile of photos into a 3D model, you know the pain: camera calibration, feature matching, bundle adjustment, and all the little details that can break your pipeline. OpenMVG (Open Multiple View Geometry) is a C++ framework that handles the heavy lifting — cleanly, modularly, and with reproducibility in mind. It's not a black box. It's a toolbox you can actually understand and extend.
What It Does
OpenMVG is a library for Structure from Motion (SfM) and Multi-View Stereo (MVS). In plain English: give it a set of overlapping images, and it will:
- Detect and match features (like SIFT, AKAZE, or custom ones).
- Estimate camera positions and orientations (including intrinsics and extrinsics).
- Reconstruct a sparse 3D point cloud of the scene.
- Optionally generate dense point clouds or meshes via MVS.
The key word here is reproducible. The framework is designed so you can get the same results from the same inputs — no hidden randomness, no sneaky dependencies. This is a big deal for research or production pipelines where you need to trust the output.
Why It’s Cool
A few things make OpenMVG stand out:
- Modular C++ design. Each step (feature extraction, matching, reconstruction) is a separate, well-defined module. You can swap components, add your own algorithms, or just learn how SfM works under the hood.
- Camera calibration built in. It handles a wide range of camera models (pinhole, fisheye, even radial distortion). No need to guess or pre-calibrate everything.
- Robust bundle adjustment. Uses Ceres Solver under the hood, but also offers its own robust estimation routines. You get high quality geometric verification.
- No external dependencies for the core. It uses its own linear algebra and geometry libraries (though you can plug in Eigen/OpenCV if you want). This makes it easy to compile and embed.
- Active development and documentation. The repo has solid Doxygen-style docs, a wiki, and example datasets to get you started.
Use cases? Archaeology, drone mapping, photogrammetry, or just messing around with your phone photos. Teams at Google, Intel, and various universities have used it in research.
How to Try It
The easiest way to start is to build from source. OpenMVG uses CMake, so it's straightforward.
git clone https://github.com/openMVG/openMVG.git
cd openMVG
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
That gives you the openMVG_main_SfMInit_ImageListing, openMVG_main_ComputeMatches, openMVG_main_SfM, and a few other executables. Or you can use the library directly in your own C++ project.
For a quick demo, grab one of the example image sets from the GitHub repository (there's a src/openMVG_Samples folder). Follow the README.md to run the pipeline on a small set of images. You'll get a colored point cloud in PLY format that you can view with MeshLab or CloudCompare.
If you want a GUI for visualization, OpenMVG also has experimental support for Qt-based viewers. But honestly, command line is the way to go — it's cleaner and more scriptable.
Final Thoughts
OpenMVG is that rare project that combines academic rigor with practical usability. It won't hold your hand like a one-click photogrammetry tool, but that's exactly the point. You get to see and control every step of the reconstruction. If you're a developer who wants to understand 3D vision or build a custom SfM pipeline without reinventing the wheel, this is a fantastic starting point. The code is clear, the community is responsive, and the results are reproducible. Give it a try — you'll probably learn something new.
Found this via @githubprojects
Repository: https://github.com/openMVG/openMVG