├── README.md └── scripts └── COLMAP-single-camera.bat /README.md: -------------------------------------------------------------------------------- 1 | COLMAP-CL 2 | ========= 3 | COLMAP-CL is an OpenCL implementation of the [COLMAP](https://demuc.de/colmap/) photogrammetry software originally developed by Johannes L. Schönberger. COLMAP and COLMAP-CL provide an interface to structure-from-motion (SFM) and dense multiview-stereo (MVS) algorithms for reconstructing 3D models from collections of images. While the original COLMAP required CUDA to achieve accelerated performance, COLMAP-CL is developed with the OpenCL API and can run on a variety of GPU platforms (AMD, Intel, NVIDIA, etc.). 4 | 5 | Getting Started 6 | --------------- 7 | Binary executables for the Windows version of COLMAP-CL can be downloaded from https://github.com/openphotogrammetry/colmap-cl/releases. After saving and unzipping the zip file, COLMAP-CL can be run via the `COLMAP.bat` file. If executed with no parameters, this file will start the GUI. 8 | 9 | In the COLMAP-CL GUI interface, novice users usually use the _Reconstruction → Automatic reconstruction_ menu option to produce a 3D model from their images. Experienced users prefer to use COLMAP-CL via scripts or the command-line interface. We've included some example scripts in the [`scripts/`](scripts) folder that execute the steps of the 3D reconstruction pipeline. 10 | 11 | Documentation 12 | ------------- 13 | COLMAP-CL is simply a port of COLMAP from CUDA to OpenCL, so the original COLMAP documentation still applies to COLMAP-CL. The COLMAP documentation site is at https://colmap.github.io/. 14 | 15 | Several introductory videos for using COLMAP are available on YouTube. One such video tutorial focusing on the GUI's automatic reconstruction process is at https://www.youtube.com/watch?v=Zm1mkOi9_1c. 16 | 17 | Support 18 | ------- 19 | For general COLMAP technical support, there is a COLMAP Google Group at https://groups.google.com/forum/#!forum/colmap (colmap@googlegroups.com) and the COLMAP GitHub issue tracker at https://github.com/colmap/colmap. 20 | 21 | If your question specifically concerns this OpenCL implementation (COLMAP-CL), please open an issue on the COLMAP-CL GitHub at https://github.com/openphotogrammetry/colmap-cl/issues. We welcome your bug reports, questions, feature requests, and other feedback! 22 | 23 | Frequently Asked Questions 24 | -------------------------- 25 | ### Does COLMAP-CL produce textured meshes? 26 | 27 | COLMAP-CL does not perform texture mapping, although it can output 3D meshes and point clouds with per-vertex colors. If you desire textured meshes, we recommend using our [MeshroomCL](https://github.com/openphotogrammetry/meshroomcl) software instead of COLMAP-CL. 28 | 29 | ### Is COLMAP-CL available for Linux? 30 | 31 | Only Windows binaries for COLMAP-CL are currently available. However, COLMAP-CL can be run in Linux using recent versions of [Wine](https://www.winehq.org/) (6.22 or later). 32 | 33 | ### How can I specify which of my GPUs that COLMAP-CL should use? 34 | 35 | In the original CUDA COLMAP, the `gpu_index` field can be used to specify which CUDA devices should be used for processing. This same field can be used in COLMAP-CL, but with a small difference due to the Platform/Device scheme for referencing OpenCL devices. In COLMAP-CL, your `gpu_index` should be computed by multiplying the platform index by 1000, and adding the device index, i.e. `gpu_index` = *platform* \*1000 + *device*. Both the platform and device indexes start from zero, and can be determined from the `clinfo` command output. 36 | 37 | Multiple GPUs can be specified with a comma-separated list. For example, if you want COLMAP-CL to use both the first device of the first platform, and the second device of the second platform, you would set `gpu_index` to the value `0,1001`. 38 | 39 | If the `gpu_index` field is left at the default value of `-1`, COLMAP-CL will try to automatically choose the best set of OpenCL devices that it can detect on your system. 40 | 41 | ### Which components of COLMAP-CL are OpenCL-accelerated? 42 | 43 | The image feature matching (`exhaustive_matcher`, `sequential_matcher`, `spatial_matcher`, `transitive_matcher`, `vocab_tree_matcher`) and dense multiview stereo (`patch_match_stereo`) modules of COLMAP have been ported to OpenCL. 44 | 45 | ### Is the OpenCL acceleration as fast as the CUDA implementation? 46 | 47 | Yes, on similar hardware, COLMAP-CL often processes data roughly as fast as the CUDA version, but sometimes faster and sometimes slower. The OpenCL version is optimized differently than CUDA COLMAP, so the performance can differ depending on your particular GPUs and input parameters. 48 | 49 | For comparison, here are some COLMAP-CL timings for SIFT feature matching (`colmap exhaustive_matcher`) on a common photogrammetry bechmarking dataset (ETH3D's *facade*, 76 images with ~940,000 total features): 50 | 51 | | Platform | Time (s) | 52 | | -------- | -------: | 53 | | COLMAP-CL CPU (28-core Xeon) | 9182 | 54 | | COLMAP-CL OpenCL (AMD Vega 56) | 261 | 55 | | COLMAP-CL OpenCL (NV RTX 2070) | 69 | 56 | | COLMAP CUDA (NV RTX 2070) | 88 | 57 | 58 | And comparing COLMAP and COLMAP-CL processing time for multiview stereo (`colmap patch_match_stereo`) on the ETH3D *pipes* dataset (default parameters, `max_image_size`=2000): 59 | 60 | |Platform | Time (s) | 61 | |-------- | -------: | 62 | |COLMAP CUDA (NV RTX 2070) | 463 | 63 | |COLMAP-CL OpenCL (NV RTX 2070) | 272 | 64 | |COLMAP-CL OpenCL (AMD Vega 56) | 205 | 65 | 66 | -------------------------------------------------------------------------------- /scripts/COLMAP-single-camera.bat: -------------------------------------------------------------------------------- 1 | :: This script for COLMAP-CL can be used to reconstruct 2 | :: a 3D model from a folder of input images. The script 3 | :: assumes that all the images were photographed with the same 4 | :: camera with the same camera settings. 5 | :: 6 | :: Set the three paths below to point to the COLMAP.bat file, 7 | :: the folder containing your input images, and a folder to 8 | :: store the project files, respectively. 9 | 10 | set COLMAP_PATH=C:\COLMAP-CL-0.8-windows\COLMAP.bat 11 | set IMAGES_DIR=C:\Users\Owner\Desktop\Images\ 12 | set WORKSPACE_DIR=C:\Users\Owner\Desktop\COLMAP-Workspace\ 13 | 14 | 15 | if not exist %WORKSPACE_DIR% mkdir %WORKSPACE_DIR% 16 | 17 | call %COLMAP_PATH% feature_extractor^ 18 | --database_path %WORKSPACE_DIR%\reconstruction.db^ 19 | --image_path %IMAGES_DIR%^ 20 | --ImageReader.camera_model OPENCV^ 21 | --ImageReader.single_camera 1 22 | 23 | call %COLMAP_PATH% exhaustive_matcher^ 24 | --database_path %WORKSPACE_DIR%\reconstruction.db^ 25 | --SiftMatching.guided_matching 1 26 | 27 | set SPARSE_DIR=%WORKSPACE_DIR%\sparse 28 | if not exist %SPARSE_DIR% mkdir %SPARSE_DIR% 29 | 30 | call %COLMAP_PATH% mapper^ 31 | --database_path %WORKSPACE_DIR%\reconstruction.db^ 32 | --image_path %IMAGES_DIR%^ 33 | --output_path %SPARSE_DIR%^ 34 | --Mapper.ba_refine_principal_point 1 35 | 36 | set DENSE_DIR=%WORKSPACE_DIR%\dense 37 | if not exist %DENSE_DIR% mkdir %DENSE_DIR% 38 | 39 | call %COLMAP_PATH% image_undistorter^ 40 | --image_path %IMAGES_DIR%^ 41 | --input_path %SPARSE_DIR%\0\^ 42 | --output_path %DENSE_DIR% 43 | 44 | call %COLMAP_PATH% patch_match_stereo^ 45 | --workspace_path %DENSE_DIR%^ 46 | --PatchMatchStereo.window_radius 5 47 | 48 | call %COLMAP_PATH% stereo_fusion^ 49 | --workspace_path %DENSE_DIR%^ 50 | --output_path %DENSE_DIR%\fused.ply 51 | 52 | call %COLMAP_PATH% poisson_mesher^ 53 | --input_path %DENSE_DIR%\fused.ply^ 54 | --output_path %DENSE_DIR%\meshed-poisson.ply^ 55 | --PoissonMeshing.depth 13 56 | 57 | call %COLMAP_PATH% delaunay_mesher^ 58 | --input_path %DENSE_DIR%^ 59 | --output_path %DENSE_DIR%\meshed-delaunay.ply 60 | --------------------------------------------------------------------------------