Skip to contents

Reads cameras.txt and images.txt exported by COLMAP, converts orientation quaternions \((q_w, q_x, q_y, q_z)\) to \(3 \times 3\) rotation matrices \(R\), extracts the translation vector \(t\), calculates the 3D optical center \(C = -R^T t\), and constructs camera specifications ready for gs_fit().

Usage

gs_import_cameras_colmap(images_file, cameras_file = NULL)

Arguments

images_file

Path to COLMAP images.txt or the reconstruction directory containing it.

cameras_file

Path to COLMAP cameras.txt. If NULL, inferred from images_file.

Value

A named list containing camera specifications for each calibrated image.

Examples

if (FALSE) { # interactive()
library(pliman)
cams <- gs_import_cameras_colmap("sparse/0/images.txt")
}