Skip to content
github-actions[bot] edited this page Nov 23, 2026 · 15 revisions

Input

OpenMVS pipeline needs as input a set of camera poses and the corresponding images (undistorted, or with the lens distortion of their Brown cameras), plus the sparse point-cloud generated by the Structure-from-Motion pipeline. There are several ways to generate the necessary input:

  1. Run the native SfM module, CreateStructure, directly on a folder of images. It produces a .sfm scene that can additionally be exported as a .mvs project with the --export-mvs flag, feeding the downstream MVS pipeline with zero external dependencies. Video can be ingested first via ExtractKeyframes, including 360° / equirectangular video.

  2. The most generic way is to generate a native OpenMVS project. In order to do this, just copy and include libs/IO/Interface.h (self contained) into your project, fill the structure with your data and save it to a file using the included serialization support. As an example, see OpenMVG exporter openMVG_main_openMVG2openMVS.

  3. OpenMVG output is supported by OpenMVS. In order to convert a project from OpenMVG to OpenMVS either use the OpenMVG integrated exporter openMVG_main_openMVG2openMVS, or at the building stage make sure to point the CMake tool to the OpenMVG installation folder to generate an importer.

  4. COLMAP projects are supported by OpenMVS through the InterfaceCOLMAP app: either the dense output (undistorted images and project files) or directly the sparse model with the SIMPLE_PINHOLE, PINHOLE, SIMPLE_RADIAL, RADIAL, OPENCV or FULL_OPENCV cameras (the distorted images are undistorted when read), including the feature observations of the sparse points.

  5. BlocksExchange XML open exchange format used by Bentley iTwin Capture Modeler / ContextCapture and Agisoft Metashape is supported through InterfaceMetashape, including the Brown lens distortion of the cameras (the images are undistorted when read), spherical (equirectangular) cameras and the tie-point measurements as feature observations.

  6. Polycam projects are supported through InterfacePolycam.

  7. MVSNet-style scenes (pre-computed depth predictions plus camera poses) are supported through InterfaceMVSNet.

The input camera poses should contain full calibration: intrinsics and extrinsics. The intrinsics are represented as a standard calibration matrix K composed of the focal-lengths fx and fy and the principal point cx and cy. K values can be in pixels, but in order to be more generic to the input images, they should be normalized by 1/MAX(width,height) of the corresponding image. Using a normalized K matrix, makes the project immune to possible manual re-scaling of the images after the SfM process. The extrinsics represent a pose using a rotation matrix R and a position C. In order to project a 3D point X from world coordinates to image coordinates K*R(X-C) is used. The projection in image coordinates uses the convention that the center of a pixel is defined at integer coordinates, i.e. the center is at (0, 0) and the top left corner is at (-0.5, -0.5). All matrices are expected in row-major format.

Each camera carries a projection model (project version 8):

  • PINHOLE (0): the standard K * R * (X - C) projection described above; the images are used as they are.
  • BROWN (1): a pinhole K plus the Brown-Conrady lens distortion of the image files, stored as params in the OpenCV order and meaning, k1,k2,p1,p2,k3 or k1,k2,p1,p2,k3,k4,k5,k6 (rational model). A Brown camera must carry its resolution. The image paths point to the original, distorted, files: libs/MVS undistorts the pixels when it reads them, so every module sees a pinhole camera K' of the same resolution, cv::getOptimalNewCameraMatrix with free scaling 0.6 (SEACAVE::UndistortedK, libs/Math/Camera/CameraUndistort.h). The pixels of K' without a source in the file are excluded through the ignore mask, and the depth-maps are in the K' frame. Saving the scene writes the camera back as it was read.
  • SPHERICAL (2): an equirectangular panorama whose width is twice its height; K is the angular camera matrix fx = W/2π, fy = H/π, cx = (W-1)/2, cy = (H-1)/2 (pixels per radian, longitude and elevation 0 at the principal point), so it normalizes and scales like a pinhole K. Spherical images are processed natively during Structure-from-Motion and DensifyPointCloud estimates and fuses their depth-maps natively; the mesh stages (ReconstructMesh, RefineMesh, TextureMesh) refuse such a scene. CreateStructure --spherical-export cubemap writes instead each panorama as a rig of rendered pinhole cube-map faces, which the whole MVS pipeline consumes.

The cameras written by an older producer, and every camera that does not set its model, are PINHOLE. Version 8 costs one byte per camera, plus the coefficients of the Brown cameras.

Optionally, each view of a point can carry its observation: the pixel of the feature in the image file as it is on disk (distorted for a Brown camera), pixel-center convention. The project stores them only when its flags has HAS_OBSERVATIONS (one byte before the points), so a project without observations costs nothing more. CreateStructure writes them through ExportMVSConfig::includeObservations; libs/MVS keeps them in PointCloud::pointObservations, in the frame of the images as the cameras see them.

OpenMVS supports central and non-central cameras. In order to accomplish this, the following structure is used:

  • Platforms
    • Cameras
    • Poses
  • Images
    • fileName
    • platformID
    • cameraID
    • poseID
    • ID

The camera poses are represented by two arrays of Platform and Image structures.

The array of platforms contains one element for each camera (central or non-central) used in the project. A Platform is represented by two arrays of Camera and Pose structures. The array of cameras contains only one camera in the case of a central camera, or multiple cameras for representing a non-central camera. For the non-central case, each camera should contain along with the camera matrix also the pose relative to the platform.

The array of images contains one element for each image contained by the project. An Image contains the image file name, plus three IDs representing the platformID, cameraID and poseID indices into the corresponding platform, camera and pose arrays. Images with missing calibration can be represented by filling poseID with NO_ID special value. Optionally, ID can be set to a desired ID used to reference this image outside OpenMVS project.

The sparse point-cloud is represented as an array of points, each one containing the position, the list of image IDs seeing it (optionally with the observations), and optionally the color and normal.

The Python reader and writer of the format is scripts/python/MvsUtils.py (loadMVSInterface, saveMVSInterface).

Output

The output is a point-cloud and/or a triangle mesh, exported by default in the PLY file format, and a texture image, exported by default as PNG.

Additional export formats:

  • OBJ — meshes (with .mtl material + texture sidecars when textured).
  • glTF 2.0 — both meshes and point-clouds, in either the ASCII .gltf form (with binary buffer sidecars) or the self-contained binary .glb form. Vertex colors / normals (point-cloud), faces and the diffuse texture map (textured mesh) round-trip. Implemented in MVS::Mesh::SaveGLTF / MVS::PointCloud::SaveGLTF on top of the header-only tiny_gltf library; load/save format is auto-selected by file extension. Both sides write the glTF-mandated z-up to y-up rotation as a matrix on the root node (never baked into the vertex buffer) and undo it on load, so the file is spec-conformant y-up, viewers show the model upright, and export/re-import is an exact identity - the two matrices are signed permutations, so their product is exactly the identity. The mesh side gets this from halfmesh; the point-cloud side applies the same convention in MVS::PointCloud::SaveGLTF / LoadGLTF, which also flattens the node hierarchy on load, so a mesh and a point-cloud exported from the same scene stay in the same frame as each other. It writes the diffuse textures beside the file, PNG unless a lossy export was requested. Caveat for old files: glTF written by OpenMVS before this change carried no node transform at all, so its z-up data now reads back rotated - nothing in such a file distinguishes it from a conformant y-up one. Re-export it if you need it. This applies to point-clouds as well as meshes.
  • Potree 2.0 — point-cloud only. Saves an LOD octree (metadata.json + hierarchy.bin + octree.bin) into a directory, ready to be streamed by the Potree web viewer. Implemented in MVS::PointCloud::SavePotree (libs/MVS/PointCloud.cpp) using the LOD octree builder in libs/Common/OctreeLOD.h. A simple Python helper, scripts/python/potree_server.py, serves the result through a self-contained Potree.js HTML page for local inspection.

TransformScene --convert 1 --export-type {ply|obj|glb|gltf|potree} is the swiss-army CLI that drives any of the above formats from an existing .mvs project, and the Viewer accepts .gltf / .glb as drag-and-drop inputs and can re-export to .ply / .obj / .glb.

Clone this wiki locally