This codebase contains some utility functionality using which COLMAP can be run and some information about the scene can be retrieved.
The file run.py
contains the function extract_and_save_metadata
which can (optionally) run COLMAP and then extract information about the scene. The word "optionally" is mentioned because the user can opt to skip running COLMAP if the output of a previous COLMAP run is available and compatible with this codebase. If the user opts to run COLMAP, then the function run_colmap
(which is defined in colmap_wrapper.py
) runs the feature extractor, exhaustive matcher and mapper. Please refer to colmap_wrapper.py
for more information.
The information about the scene is collected and stored in a CSV file. The CSV file would contain information about the camera models, camera parameters, camera pose, near and far bounds for each image. While the information about the camera models, camera parameters and camera pose are computed by COLMAP, the near and far bounds are computed in the function extract_and_save_metadata
in run.py
.
Please refer to the docstrings, code and comments in the files run.py
and colmap_wrapper.py
to understand how this codebase works and how to set the parameters in params.yaml
.
- Install COLMAP by following the instructions in their documentation.
- Git clone this repository and change your directory to where this repository was cloned in your local filesystem.
- For example, if you git cloned this repository to the path
/path/to/colmap_utils
, please runcd /path/to/colmap_utils
- For example, if you git cloned this repository to the path
- Create a virtual environment using your preferred method. Install dependencies for this library using
pip install -r requirements.txt
- Change your directory to the path where this repository was cloned in your local filesystem.
- For example, if you git cloned this repository to the path
/path/to/colmap_utils
, please runcd /path/to/colmap_utils
- For example, if you git cloned this repository to the path
- Activate the virtual environment where you had previously installed the dependencies.
- Set parameters in
params.yaml
appropriately. - Run
python run.py
to (optionally) run colmap and extract information about the scene.