pycolmap

class pycolmap.Device(*args, **kwargs)

Members:

auto

cpu

cuda

Overloaded function.

  1. __init__(self: pycolmap.Device, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.Device, name: str) None

auto = Device.auto
cpu = Device.cpu
cuda = Device.cuda
Device.name -> str
property value
class pycolmap.SensorType(*args, **kwargs)

Members:

INVALID

CAMERA

IMU

Overloaded function.

  1. __init__(self: pycolmap.SensorType, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.SensorType, name: str) None

CAMERA = SensorType.CAMERA
IMU = SensorType.IMU
INVALID = SensorType.INVALID
SensorType.name -> str
property value
class pycolmap.sensor_t(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.sensor_t) None

  2. __init__(self: pycolmap.sensor_t, type: pycolmap.SensorType, id: typing.SupportsInt) None

  3. __init__(self: pycolmap.sensor_t, arg0: dict) None

  4. __init__(self: pycolmap.sensor_t, **kwargs) None

property id

(int, default: 4294967295)

mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.sensor_t, write_type: bool = False) str
todict(self: pycolmap.sensor_t, recursive: bool = True) dict
property type

(SensorType, default: SensorType.INVALID)

class pycolmap.data_t(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.data_t) None

  2. __init__(self: pycolmap.data_t, sensor_id: pycolmap.sensor_t, id: typing.SupportsInt) None

  3. __init__(self: pycolmap.data_t, arg0: dict) None

  4. __init__(self: pycolmap.data_t, **kwargs) None

property id

(int, default: 4294967295)

mergedict(self: object, kwargs: dict) None
property sensor_id

(sensor_t, default: sensor_t(type=SensorType.INVALID, id=4294967295))

summary(self: pycolmap.data_t, write_type: bool = False) str
todict(self: pycolmap.data_t, recursive: bool = True) dict
pycolmap.image_pair_to_pair_id(image_id1: SupportsInt, image_id2: SupportsInt) int
pycolmap.pair_id_to_image_pair(pair_id: SupportsInt) tuple[int, int]
pycolmap.should_swap_image_pair(image_id1: SupportsInt, image_id2: SupportsInt) bool
class pycolmap.logging
ERROR = <Level.ERROR: 2>
FATAL = <Level.FATAL: 3>
INFO = <Level.INFO: 0>
class Level(self: pycolmap.logging.Level, value: SupportsInt)

Members:

INFO

WARNING

ERROR

FATAL

ERROR = <Level.ERROR: 2>
FATAL = <Level.FATAL: 3>
INFO = <Level.INFO: 0>
WARNING = <Level.WARNING: 1>
logging.Level.name -> str
property value
WARNING = <Level.WARNING: 1>
alsologtostderr = True
static error(message: str) None
static fatal(message: str) None
static info(message: str) None
log_dir = ''
logtostderr = False
minloglevel = 0
static set_log_destination(level: pycolmap.logging.Level, path: os.PathLike | str | bytes) None
stderrthreshold = 2
static verbose(level: SupportsInt, message: str) None
verbose_level = 0
static warning(message: str) None
class pycolmap.Timer(self: pycolmap.Timer)
elapsed_hours(self: pycolmap.Timer) float
elapsed_micro_seconds(self: pycolmap.Timer) float
elapsed_minutes(self: pycolmap.Timer) float
elapsed_seconds(self: pycolmap.Timer) float
pause(self: pycolmap.Timer) None
print_hours(self: pycolmap.Timer) None
print_minutes(self: pycolmap.Timer) None
print_seconds(self: pycolmap.Timer) None
reset(self: pycolmap.Timer) None
restart(self: pycolmap.Timer) None
resume(self: pycolmap.Timer) None
start(self: pycolmap.Timer) None
class pycolmap.Rotation3d(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Rotation3d) None

  2. __init__(self: pycolmap.Rotation3d, xyzw: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[4, 1]"]) None

Quaternion in [x,y,z,w] format.

  1. __init__(self: pycolmap.Rotation3d, matrix: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 3]"]) None

3x3 rotation matrix.

  1. __init__(self: pycolmap.Rotation3d, axis_angle: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 1]"]) None

Axis-angle 3D vector.

  1. __init__(self: pycolmap.Rotation3d, arg0: dict) None

  2. __init__(self: pycolmap.Rotation3d, **kwargs) None

angle(self: pycolmap.Rotation3d) float
angle_to(self: pycolmap.Rotation3d, other: pycolmap.Rotation3d) float
static from_buffer(array: Annotated[numpy.typing.ArrayLike, numpy.float64]) pycolmap.Rotation3d

Create from numpy array view (zero-copy if contiguous).

inverse(self: pycolmap.Rotation3d) pycolmap.Rotation3d
matrix(self: pycolmap.Rotation3d) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']
mergedict(self: object, kwargs: dict) None
norm(self: pycolmap.Rotation3d) float
normalize(self: pycolmap.Rotation3d) None
property quat

Quaternion in [x,y,z,w] format. (ndarray, default: [0. 0. 0. 1.])

summary(self: pycolmap.Rotation3d, write_type: bool = False) str
todict(self: pycolmap.Rotation3d, recursive: bool = True) dict
class pycolmap.AlignedBox3d(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.AlignedBox3d) None

  2. __init__(self: pycolmap.AlignedBox3d, min: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 1]"], max: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 1]"]) None

  3. __init__(self: pycolmap.AlignedBox3d, arg0: dict) None

  4. __init__(self: pycolmap.AlignedBox3d, **kwargs) None

contains_bbox(self: pycolmap.AlignedBox3d, other: pycolmap.AlignedBox3d) bool
contains_point(
self: pycolmap.AlignedBox3d,
point: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'],
) bool
diagonal(self: pycolmap.AlignedBox3d) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']
property max

(ndarray, default: [-1.79769313e+308 -1.79769313e+308 -1.79769313e+308])

mergedict(self: object, kwargs: dict) None
property min

(ndarray, default: [1.79769313e+308 1.79769313e+308 1.79769313e+308])

summary(self: pycolmap.AlignedBox3d, write_type: bool = False) str
todict(self: pycolmap.AlignedBox3d, recursive: bool = True) dict
class pycolmap.Rigid3d(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Rigid3d) None

  2. __init__(self: pycolmap.Rigid3d, rotation: Rotation3d, translation: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 1]"]) None

  3. __init__(self: pycolmap.Rigid3d, matrix: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 4]"]) None

3x4 transformation matrix.

  1. __init__(self: pycolmap.Rigid3d, arg0: dict) None

  2. __init__(self: pycolmap.Rigid3d, **kwargs) None

adjoint(self: pycolmap.Rigid3d) Annotated[numpy.typing.NDArray[numpy.float64], '[6, 6]']
adjoint_inverse(self: pycolmap.Rigid3d) Annotated[numpy.typing.NDArray[numpy.float64], '[6, 6]']
static interpolate(
cam_from_world1: pycolmap.Rigid3d,
cam_from_world2: pycolmap.Rigid3d,
t: SupportsFloat,
) pycolmap.Rigid3d
inverse(self: pycolmap.Rigid3d) pycolmap.Rigid3d
matrix(self: pycolmap.Rigid3d) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 4]']
mergedict(self: object, kwargs: dict) None
property params

(ndarray, default: [0. 0. 0. 1. 0. 0. 0.])

property rotation

(Rotation3d, default: Rotation3d(xyzw=[0, 0, 0, 1]))

summary(self: pycolmap.Rigid3d, write_type: bool = False) str
tgt_origin_in_src(self: pycolmap.Rigid3d) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']
todict(self: pycolmap.Rigid3d, recursive: bool = True) dict
property translation

(ndarray, default: [0. 0. 0.])

pycolmap.get_covariance_for_inverse(
rigid3d: pycolmap.Rigid3d,
covar: Annotated[numpy.typing.ArrayLike, numpy.float64, '[6, 6]'],
) Annotated[numpy.typing.NDArray[numpy.float64], '[6, 6]']
pycolmap.get_covariance_for_composed_rigid3d(
left_rigid3d: pycolmap.Rigid3d,
joint_covar: Annotated[numpy.typing.ArrayLike, numpy.float64, '[12, 12]'],
) Annotated[numpy.typing.NDArray[numpy.float64], '[6, 6]']
pycolmap.get_covariance_for_relative_rigid3d(
base_rigid3d: pycolmap.Rigid3d,
target_rigid3d: pycolmap.Rigid3d,
joint_covar: Annotated[numpy.typing.ArrayLike, numpy.float64, '[12, 12]'],
) Annotated[numpy.typing.NDArray[numpy.float64], '[6, 6]']
pycolmap.average_quaternions(
quats: collections.abc.Sequence[Rotation3d],
weights: collections.abc.Sequence[SupportsFloat],
) Rotation3d
pycolmap.interpolate_camera_poses(
cam1_from_world: pycolmap.Rigid3d,
cam2_from_world: pycolmap.Rigid3d,
t: SupportsFloat,
) pycolmap.Rigid3d
class pycolmap.Sim3d(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Sim3d) None

  2. __init__(self: pycolmap.Sim3d, scale: typing.SupportsFloat, rotation: Rotation3d, translation: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 1]"]) None

  3. __init__(self: pycolmap.Sim3d, matrix: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 4]"]) None

3x4 transformation matrix.

  1. __init__(self: pycolmap.Sim3d, arg0: dict) None

  2. __init__(self: pycolmap.Sim3d, **kwargs) None

inverse(self: pycolmap.Sim3d) pycolmap.Sim3d
matrix(self: pycolmap.Sim3d) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 4]']
mergedict(self: object, kwargs: dict) None
property params

(ndarray, default: [0. 0. 0. 1. 0. 0. 0. 1.])

property rotation

(Rotation3d, default: Rotation3d(xyzw=[0, 0, 0, 1]))

property scale

(ndarray, default: 1.0)

summary(self: pycolmap.Sim3d, write_type: bool = False) str
todict(self: pycolmap.Sim3d, recursive: bool = True) dict
transform_camera_world(self: pycolmap.Sim3d, cam_from_world: pycolmap.Rigid3d) pycolmap.Rigid3d
property translation

(ndarray, default: [0. 0. 0.])

class pycolmap.PosePriorCoordinateSystem(*args, **kwargs)

Members:

UNDEFINED

WGS84

CARTESIAN

Overloaded function.

  1. __init__(self: pycolmap.PosePriorCoordinateSystem, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.PosePriorCoordinateSystem, name: str) None

CARTESIAN = PosePriorCoordinateSystem.CARTESIAN
UNDEFINED = PosePriorCoordinateSystem.UNDEFINED
WGS84 = PosePriorCoordinateSystem.WGS84
PosePriorCoordinateSystem.name -> str
property value
class pycolmap.PosePrior(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.PosePrior) None

  2. __init__(self: pycolmap.PosePrior, arg0: dict) None

  3. __init__(self: pycolmap.PosePrior, **kwargs) None

property coordinate_system

(PosePriorCoordinateSystem, default: PosePriorCoordinateSystem.UNDEFINED)

property corr_data_id

(data_t, default: data_t(sensor_id=sensor_t(type=SensorType.INVALID, id=4294967295), id=4294967295))

property gravity

(ndarray, default: [nan nan nan])

has_gravity(self: pycolmap.PosePrior) bool
has_position(self: pycolmap.PosePrior) bool
has_position_cov(self: pycolmap.PosePrior) bool
is_covariance_valid(*args, **kwargs) object

Deprecated, use has_position_cov instead.

is_valid(*args, **kwargs) object

Deprecated, use has_position instead.

mergedict(self: object, kwargs: dict) None
property pose_prior_id

(int, default: 4294967295)

property position

(ndarray, default: [nan nan nan])

property position_covariance

(ndarray, default: [[nan nan nan] [nan nan nan] [nan nan nan]])

summary(self: pycolmap.PosePrior, write_type: bool = False) str
todict(self: pycolmap.PosePrior, recursive: bool = True) dict
class pycolmap.GPSTransfromEllipsoid(*args, **kwargs)

Members:

GRS80

WGS84

Overloaded function.

  1. __init__(self: pycolmap.GPSTransfromEllipsoid, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.GPSTransfromEllipsoid, name: str) None

GRS80 = GPSTransfromEllipsoid.GRS80
WGS84 = GPSTransfromEllipsoid.WGS84
GPSTransfromEllipsoid.name -> str
property value
class pycolmap.GPSTransform(self: pycolmap.GPSTransform, ellipsoid: pycolmap.GPSTransfromEllipsoid = GPSTransfromEllipsoid.GRS80)
ecef_to_ellipsoid(
self: pycolmap.GPSTransform,
xyz_in_ecef: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 3]']
ecef_to_enu(
self: pycolmap.GPSTransform,
xyz_in_ecef: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
ref_ecef: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'],
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 3]']
ellipsoid_to_ecef(
self: pycolmap.GPSTransform,
lat_lon_alt: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 3]']
ellipsoid_to_enu(
self: pycolmap.GPSTransform,
lat_lon_alt: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
ref_lat: SupportsFloat,
ref_lon: SupportsFloat,
ref_alt: SupportsFloat,
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 3]']
ellipsoid_to_utm(
self: pycolmap.GPSTransform,
lat_lon_alt: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
) tuple[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 3]'], int]
enu_to_ecef(
self: pycolmap.GPSTransform,
xyz_in_enu: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
ref_lat: SupportsFloat,
ref_lon: SupportsFloat,
ref_alt: SupportsFloat,
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 3]']
enu_to_ellipsoid(
self: pycolmap.GPSTransform,
xyz_in_enu: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
ref_lat: SupportsFloat,
ref_lon: SupportsFloat,
ref_alt: SupportsFloat,
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 3]']
utm_to_ellipsoid(
self: pycolmap.GPSTransform,
xyz_in_utm: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
zone: SupportsInt,
is_north: bool,
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 3]']
pycolmap.pose_from_homography_matrix(
H: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 3]'],
K1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 3]'],
K2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 3]'],
cam_rays1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
cam_rays2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
) dict

Recover the most probable pose from the given homography matrix using the cheirality check.

pycolmap.essential_matrix_from_pose(
cam2_from_cam1: pycolmap.Rigid3d,
) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']

Construct essential matrix from relative pose.

pycolmap.triangulate_point(
cam1_from_world: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 4]'],
cam2_from_world: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 4]'],
cam_point1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[2, 1]'],
cam_point2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[2, 1]'],
) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]'] | None

Triangulate point in world from two-view observation.

pycolmap.calculate_triangulation_angle(
proj_center1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'],
proj_center2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'],
point3D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'],
) float

Calculate triangulation angle in radians.

pycolmap.triangulate_mid_point(
cam2_from_cam1: pycolmap.Rigid3d,
cam_ray1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'],
cam_ray2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'],
) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]'] | None

Triangulate mid-point in first camera from two-view observation.

class pycolmap.RANSACOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.RANSACOptions) None

  2. __init__(self: pycolmap.RANSACOptions, arg0: dict) None

  3. __init__(self: pycolmap.RANSACOptions, **kwargs) None

check(self: pycolmap.RANSACOptions) None
property confidence

(float, default: 0.9999)

property dyn_num_trials_multiplier

(float, default: 3.0)

property max_error

(float, default: 4.0)

property max_num_trials

(int, default: 100000)

mergedict(self: object, kwargs: dict) None
property min_inlier_ratio

(float, default: 0.01)

property min_num_trials

(int, default: 1000)

property random_seed

(int, default: -1)

summary(self: pycolmap.RANSACOptions, write_type: bool = False) str
todict(self: pycolmap.RANSACOptions, recursive: bool = True) dict
class pycolmap.BitmapRescaleFilter(*args, **kwargs)

Members:

BILINEAR

BOX

Overloaded function.

  1. __init__(self: pycolmap.BitmapRescaleFilter, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.BitmapRescaleFilter, name: str) None

BILINEAR = BitmapRescaleFilter.BILINEAR
BOX = BitmapRescaleFilter.BOX
BitmapRescaleFilter.name -> str
property value
class pycolmap.Bitmap(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Bitmap) None

  2. __init__(self: pycolmap.Bitmap, width: typing.SupportsInt, height: typing.SupportsInt, as_rgb: bool, linear_colorspace: bool = False) None

property bits_per_pixel

Number of bits per pixel (8 for grey, 24 for RGB).

property channels

Number of channels of the image.

clone(self: pycolmap.Bitmap) pycolmap.Bitmap

Clone the image to a new bitmap.

clone_as_grey(self: pycolmap.Bitmap) pycolmap.Bitmap

Clone the image as grayscale.

clone_as_rgb(self: pycolmap.Bitmap) pycolmap.Bitmap

Clone the image as RGB.

exif_altitude(self: pycolmap.Bitmap) float | None

Extract EXIF altitude. Returns None if not available.

exif_camera_model(self: pycolmap.Bitmap) str | None

Extract EXIF camera model. Returns None if not available.

exif_focal_length(self: pycolmap.Bitmap) float | None

Extract EXIF focal length. Returns None if not available.

exif_latitude(self: pycolmap.Bitmap) float | None

Extract EXIF latitude. Returns None if not available.

exif_longitude(self: pycolmap.Bitmap) float | None

Extract EXIF longitude. Returns None if not available.

static from_array(
array: Annotated[numpy.typing.ArrayLike, numpy.uint8],
linear_colorspace: bool = False,
) pycolmap.Bitmap

Create bitmap as a copy of array. Returns RGB bitmap, if array has shape (H, W, 3), or grayscale bitmap, if array has shape (H, W[, 1]).

property height

Height of the image.

property is_empty

Whether the image is empty.

property is_grey

Whether the image is greyscale.

property is_rgb

Whether the image is colorscale.

property pitch

Scan line size in bytes (stride).

static read(path: os.PathLike | str | bytes, as_rgb: bool, linearize_colorspace: bool = False) pycolmap.Bitmap | None

Read bitmap at given path and convert to grey- or colorscale. Defaults to keeping the original colorspace (potentially non-linear) for image processing.

rescale(
self: pycolmap.Bitmap,
new_width: SupportsInt,
new_height: SupportsInt,
filter: pycolmap.BitmapRescaleFilter = BitmapRescaleFilter.BILINEAR,
) None

Rescale image to the new dimensions.

set_jpeg_quality(self: pycolmap.Bitmap, quality: SupportsInt) None

Set compression quality when writing to JPEG in the range [1, 100]. Lower values reduce quality and file size. By default, bitmaps are written in superb (100) quality, if not otherwise specified.

to_array(self: pycolmap.Bitmap) numpy.typing.NDArray[numpy.uint8]
property width

Width of the image.

write(self: pycolmap.Bitmap, path: os.PathLike | str | bytes, delinearize_colorspace: bool = True) bool

Write bitmap to file at given path. Defaults to converting to sRGB colorspace for file storage.

class pycolmap.Rig(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Rig) None

  2. __init__(self: pycolmap.Rig, arg0: dict) None

  3. __init__(self: pycolmap.Rig, **kwargs) None

add_ref_sensor(self: pycolmap.Rig, arg0: pycolmap.sensor_t) None

sensor_idAdd reference sensor.

add_sensor(self: pycolmap.Rig, arg0: pycolmap.sensor_t, arg1: pycolmap.Rigid3d | None) None

sensor_idAdd non-reference sensor.

has_sensor(self: pycolmap.Rig, arg0: pycolmap.sensor_t) bool

Whether the rig has a specific sensor.

has_sensor_from_rig(self: pycolmap.Rig, sensor_id: pycolmap.sensor_t) bool

Check if sensor has calibrated transformation from rig.

is_ref_sensor(self: pycolmap.Rig, arg0: pycolmap.sensor_t) bool

Check whether the given sensor is the reference sensor.

mergedict(self: object, kwargs: dict) None
property non_ref_sensors

Access all sensors in the rig except for reference sensor (dict, default: {})

num_sensors(self: pycolmap.Rig) int

The number of sensors in the rig.

property ref_sensor_id

The reference sensor’s identifier. (sensor_t, default: sensor_t(type=SensorType.INVALID, id=4294967295))

reset_sensor_from_rig(self: pycolmap.Rig, sensor_id: pycolmap.sensor_t) None

Reset the sensor’s calibration.

property rig_id

Unique identifier of the rig. (int, default: 4294967295)

sensor_from_rig(self: pycolmap.Rig, sensor_id: pycolmap.sensor_t) pycolmap.Rigid3d | None

The the transformation from rig to the sensor.

sensor_ids(self: pycolmap.Rig) set[pycolmap.sensor_t]

Get all sensor ids (including the reference sensor) in the rig.

set_sensor_from_rig(
self: pycolmap.Rig,
sensor_id: pycolmap.sensor_t,
sensor_from_rig: pycolmap.Rigid3d | None,
) None

Set the sensor_from_rig transformation.

summary(self: pycolmap.Rig, write_type: bool = False) str
todict(self: pycolmap.Rig, recursive: bool = True) dict
class pycolmap.RigMap(self: pycolmap.RigMap)
items(self: pycolmap.RigMap) pycolmap.ItemsView
keys(self: pycolmap.RigMap) pycolmap.KeysView
values(self: pycolmap.RigMap) pycolmap.ValuesView
class pycolmap.KeysView
class pycolmap.ValuesView
class pycolmap.ItemsView
class pycolmap.FeatureExtractorType(self: pycolmap.FeatureExtractorType, value: SupportsInt)

Members:

UNDEFINED

SIFT

SIFT = <FeatureExtractorType.SIFT: 0>
UNDEFINED = <FeatureExtractorType.UNDEFINED: -1>
FeatureExtractorType.name -> str
property value
class pycolmap.FeatureDescriptors(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.FeatureDescriptors) None

  2. __init__(self: pycolmap.FeatureDescriptors, type: pycolmap.FeatureExtractorType, data: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8, "[m, n]"]) None

  3. __init__(self: pycolmap.FeatureDescriptors, arg0: dict) None

  4. __init__(self: pycolmap.FeatureDescriptors, **kwargs) None

property data

(ndarray, default: [])

mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.FeatureDescriptors, write_type: bool = False) str
todict(self: pycolmap.FeatureDescriptors, recursive: bool = True) dict
property type

(FeatureExtractorType, default: FeatureExtractorType.UNDEFINED)

class pycolmap.FeatureDescriptorsFloat(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.FeatureDescriptorsFloat) None

  2. __init__(self: pycolmap.FeatureDescriptorsFloat, type: pycolmap.FeatureExtractorType, data: typing.Annotated[numpy.typing.ArrayLike, numpy.float32, "[m, n]"]) None

  3. __init__(self: pycolmap.FeatureDescriptorsFloat, arg0: dict) None

  4. __init__(self: pycolmap.FeatureDescriptorsFloat, **kwargs) None

property data

(ndarray, default: [])

mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.FeatureDescriptorsFloat, write_type: bool = False) str
todict(self: pycolmap.FeatureDescriptorsFloat, recursive: bool = True) dict
property type

(FeatureExtractorType, default: FeatureExtractorType.UNDEFINED)

class pycolmap.FeatureKeypoint(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.FeatureKeypoint) None

  2. __init__(self: pycolmap.FeatureKeypoint, arg0: dict) None

  3. __init__(self: pycolmap.FeatureKeypoint, **kwargs) None

property a11

(float, default: 1.0)

property a12

(float, default: 0.0)

property a21

(float, default: 0.0)

property a22

(float, default: 1.0)

compute_orientation(self: pycolmap.FeatureKeypoint) float
compute_scale(self: pycolmap.FeatureKeypoint) float
compute_scale_x(self: pycolmap.FeatureKeypoint) float
compute_scale_y(self: pycolmap.FeatureKeypoint) float
compute_shear(self: pycolmap.FeatureKeypoint) float
static from_shape_parameters(
arg0: SupportsFloat,
arg1: SupportsFloat,
arg2: SupportsFloat,
arg3: SupportsFloat,
arg4: SupportsFloat,
arg5: SupportsFloat,
) pycolmap.FeatureKeypoint
mergedict(self: object, kwargs: dict) None
rescale(*args, **kwargs)

Overloaded function.

  1. rescale(self: pycolmap.FeatureKeypoint, arg0: typing.SupportsFloat) None

  2. rescale(self: pycolmap.FeatureKeypoint, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat) None

summary(self: pycolmap.FeatureKeypoint, write_type: bool = False) str
todict(self: pycolmap.FeatureKeypoint, recursive: bool = True) dict
property x

(float, default: 0.0)

property y

(float, default: 0.0)

class pycolmap.FeatureKeypoints(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.FeatureKeypoints) None

  2. __init__(self: pycolmap.FeatureKeypoints, arg0: pycolmap.FeatureKeypoints) None

Copy constructor

  1. __init__(self: pycolmap.FeatureKeypoints, arg0: collections.abc.Iterable) None

append(self: pycolmap.FeatureKeypoints, x: pycolmap.FeatureKeypoint) None

Add an item to the end of the list

clear(self: pycolmap.FeatureKeypoints) None

Clear the contents

count(self: pycolmap.FeatureKeypoints, x: pycolmap.FeatureKeypoint) int

Return the number of times x appears in the list

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: pycolmap.FeatureKeypoints, L: pycolmap.FeatureKeypoints) None

Extend the list by appending all the items in the given list

  1. extend(self: pycolmap.FeatureKeypoints, L: collections.abc.Iterable) None

Extend the list by appending all the items in the given list

insert(self: pycolmap.FeatureKeypoints, i: SupportsInt, x: pycolmap.FeatureKeypoint) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: pycolmap.FeatureKeypoints) pycolmap.FeatureKeypoint

Remove and return the last item

  1. pop(self: pycolmap.FeatureKeypoints, i: typing.SupportsInt) pycolmap.FeatureKeypoint

Remove and return the item at index i

remove(self: pycolmap.FeatureKeypoints, x: pycolmap.FeatureKeypoint) None

Remove the first item from the list whose value is x. It is an error if there is no such item.

class pycolmap.FeatureMatch(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.FeatureMatch) None

  2. __init__(self: pycolmap.FeatureMatch, arg0: typing.SupportsInt, arg1: typing.SupportsInt) None

  3. __init__(self: pycolmap.FeatureMatch, arg0: dict) None

  4. __init__(self: pycolmap.FeatureMatch, **kwargs) None

mergedict(self: object, kwargs: dict) None
property point2D_idx1

(int, default: 4294967295)

property point2D_idx2

(int, default: 4294967295)

summary(self: pycolmap.FeatureMatch, write_type: bool = False) str
todict(self: pycolmap.FeatureMatch, recursive: bool = True) dict
class pycolmap.FeatureMatches(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.FeatureMatches) None

  2. __init__(self: pycolmap.FeatureMatches, arg0: pycolmap.FeatureMatches) None

Copy constructor

  1. __init__(self: pycolmap.FeatureMatches, arg0: collections.abc.Iterable) None

append(self: pycolmap.FeatureMatches, x: pycolmap.FeatureMatch) None

Add an item to the end of the list

clear(self: pycolmap.FeatureMatches) None

Clear the contents

count(self: pycolmap.FeatureMatches, x: pycolmap.FeatureMatch) int

Return the number of times x appears in the list

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: pycolmap.FeatureMatches, L: pycolmap.FeatureMatches) None

Extend the list by appending all the items in the given list

  1. extend(self: pycolmap.FeatureMatches, L: collections.abc.Iterable) None

Extend the list by appending all the items in the given list

insert(self: pycolmap.FeatureMatches, i: SupportsInt, x: pycolmap.FeatureMatch) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: pycolmap.FeatureMatches) pycolmap.FeatureMatch

Remove and return the last item

  1. pop(self: pycolmap.FeatureMatches, i: typing.SupportsInt) pycolmap.FeatureMatch

Remove and return the item at index i

remove(self: pycolmap.FeatureMatches, x: pycolmap.FeatureMatch) None

Remove the first item from the list whose value is x. It is an error if there is no such item.

class pycolmap.Normalization(*args, **kwargs)

Members:

L1_ROOT : L1-normalizes each descriptor followed by element-wise square rooting. This normalization is usually better than standard L2-normalization. See ‘Three things everyone should know to improve object retrieval’, Relja Arandjelovic and Andrew Zisserman, CVPR 2012.

L2 : Each vector is L2-normalized.

Overloaded function.

  1. __init__(self: pycolmap.Normalization, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.Normalization, name: str) None

L1_ROOT = Normalization.L1_ROOT
L2 = Normalization.L2
Normalization.name -> str
property value
class pycolmap.SiftExtractionOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.SiftExtractionOptions) None

  2. __init__(self: pycolmap.SiftExtractionOptions, arg0: dict) None

  3. __init__(self: pycolmap.SiftExtractionOptions, **kwargs) None

check(self: pycolmap.SiftExtractionOptions) bool
property darkness_adaptivity

Whether to adapt the feature detection depending on the image darkness. only available on GPU. (bool, default: False)

property domain_size_pooling

“Domain-Size Pooling in Local Descriptors and NetworkArchitectures”, J. Dong and S. Soatto, CVPR 2015 (bool, default: False)

property dsp_max_scale

(float, default: 3.0)

property dsp_min_scale

(float, default: 0.16666666666666666)

property dsp_num_scales

(int, default: 10)

property edge_threshold

Edge threshold for detection. (float, default: 10.0)

property estimate_affine_shape

Estimate affine shape of SIFT features in the form of oriented ellipses as opposed to original SIFT which estimates oriented disks. (bool, default: False)

property first_octave

First octave in the pyramid, i.e. -1 upsamples the image by one level. (int, default: -1)

property max_num_features

Maximum number of features to detect, keeping larger-scale features. (int, default: 8192)

property max_num_orientations

Maximum number of orientations per keypoint if not estimate_affine_shape. (int, default: 2)

mergedict(self: object, kwargs: dict) None
property normalization

L1_ROOT or L2 descriptor normalization (Normalization, default: Normalization.L1_ROOT)

property num_octaves

(int, default: 4)

property octave_resolution

Number of levels per octave. (int, default: 3)

property peak_threshold

Peak threshold for detection. (float, default: 0.006666666666666667)

summary(self: pycolmap.SiftExtractionOptions, write_type: bool = False) str
todict(self: pycolmap.SiftExtractionOptions, recursive: bool = True) dict
property upright

Fix the orientation to 0 for upright features (bool, default: False)

class pycolmap.FeatureExtractionOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.FeatureExtractionOptions) None

  2. __init__(self: pycolmap.FeatureExtractionOptions, arg0: dict) None

  3. __init__(self: pycolmap.FeatureExtractionOptions, **kwargs) None

check(self: pycolmap.FeatureExtractionOptions) bool
property gpu_index

Index of the GPU used for feature matching. For multi-GPU matching, you should separate multiple GPU indices by comma, e.g., ‘0,1,2,3’. (str, default: -1)

property max_image_size

Maximum image size, otherwise image will be down-scaled. (int, default: 3200)

mergedict(self: object, kwargs: dict) None
property num_threads

Number of threads for feature matching and geometric verification. (int, default: -1)

property sift

(SiftExtractionOptions, default: SiftExtractionOptions(max_num_features=8192, first_octave=-1, num_octaves=4, octave_resolution=3, peak_threshold=0.006666666666666667, edge_threshold=10.0, estimate_affine_shape=False, max_num_orientations=2, upright=False, darkness_adaptivity=False, domain_size_pooling=False, dsp_min_scale=0.16666666666666666, dsp_max_scale=3.0, dsp_num_scales=10, normalization=Normalization.L1_ROOT))

summary(self: pycolmap.FeatureExtractionOptions, write_type: bool = False) str
todict(self: pycolmap.FeatureExtractionOptions, recursive: bool = True) dict
property use_gpu

(bool, default: True)

class pycolmap.Sift(
self: pycolmap.Sift,
options: pycolmap.FeatureExtractionOptions | None = None,
device: pycolmap.Device = Device.auto,
)
property device
extract(*args, **kwargs)

Overloaded function.

  1. extract(self: pycolmap.Sift, image: typing.Annotated[numpy.typing.NDArray[numpy.uint8], "[m, n]", "flags.c_contiguous"]) tuple[typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, 4]"], typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, n]"]]

  2. extract(self: pycolmap.Sift, image: typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, n]", "flags.c_contiguous"]) tuple[typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, 4]"], typing.Annotated[numpy.typing.NDArray[numpy.float32], "[m, n]"]]

property options
class pycolmap.SiftMatchingOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.SiftMatchingOptions) None

  2. __init__(self: pycolmap.SiftMatchingOptions, arg0: dict) None

  3. __init__(self: pycolmap.SiftMatchingOptions, **kwargs) None

check(self: pycolmap.SiftMatchingOptions) bool
property cpu_brute_force_matcher

Whether to use brute-force instead of faiss based CPU matching. (bool, default: False)

property cross_check

Whether to enable cross checking in matching. (bool, default: True)

property max_distance

Maximum distance to best match. (float, default: 0.7)

property max_ratio

Maximum distance ratio between first and second best match. (float, default: 0.8)

mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.SiftMatchingOptions, write_type: bool = False) str
todict(self: pycolmap.SiftMatchingOptions, recursive: bool = True) dict
class pycolmap.FeatureMatchingOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.FeatureMatchingOptions) None

  2. __init__(self: pycolmap.FeatureMatchingOptions, arg0: dict) None

  3. __init__(self: pycolmap.FeatureMatchingOptions, **kwargs) None

check(self: pycolmap.FeatureMatchingOptions) bool
property gpu_index

Index of the GPU used for feature matching. For multi-GPU matching, you should separate multiple GPU indices by comma, e.g., “0,1,2,3”. (str, default: -1)

property guided_matching

Whether to perform guided matching, if geometric verification succeeds. (bool, default: False)

property max_num_matches

Maximum number of matches. (int, default: 32768)

mergedict(self: object, kwargs: dict) None
property num_threads

(int, default: -1)

property rig_verification

Whether to perform geometric verification using rig constraints between pairs of non-trivial frames. If disabled, performs geometric two-view verification for non-trivial frames without rig constraints. Ignored when skip_geometric_verification is enabled. (bool, default: False)

property sift

(SiftMatchingOptions, default: SiftMatchingOptions(max_ratio=0.8, max_distance=0.7, cross_check=True, cpu_brute_force_matcher=False))

property skip_geometric_verification

Skips the geometric verification stage and forwards matches unchanged. Ignored when guided matching is enabled, because guided matching depends on the two-view geometry produced by geometric verification. (bool, default: False)

property skip_image_pairs_in_same_frame

Whether to skip matching images within the same frame. This is useful for the case of non-overlapping cameras in a rig. (bool, default: False)

summary(self: pycolmap.FeatureMatchingOptions, write_type: bool = False) str
todict(self: pycolmap.FeatureMatchingOptions, recursive: bool = True) dict
property use_gpu

(bool, default: True)

class pycolmap.Point2D(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Point2D) None

  2. __init__(self: pycolmap.Point2D, xy: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[2, 1]"], point3D_id: typing.SupportsInt = pycolmap.INVALID_POINT3D_ID) None

  3. __init__(self: pycolmap.Point2D, arg0: dict) None

  4. __init__(self: pycolmap.Point2D, **kwargs) None

has_point3D(self: pycolmap.Point2D) bool
mergedict(self: object, kwargs: dict) None
property point3D_id

(int, default: 18446744073709551615)

summary(self: pycolmap.Point2D, write_type: bool = False) str
todict(self: pycolmap.Point2D, recursive: bool = True) dict
x(self: pycolmap.Point2D) float
property xy

(ndarray, default: [0. 0.])

y(self: pycolmap.Point2D) float
class pycolmap.Point2DList(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Point2DList) None

  2. __init__(self: pycolmap.Point2DList, arg0: pycolmap.Point2DList) None

Copy constructor

  1. __init__(self: pycolmap.Point2DList, arg0: collections.abc.Iterable) None

append(self: pycolmap.Point2DList, x: pycolmap.Point2D) None

Add an item to the end of the list

clear(self: pycolmap.Point2DList) None

Clear the contents

count(self: pycolmap.Point2DList, x: pycolmap.Point2D) int

Return the number of times x appears in the list

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: pycolmap.Point2DList, L: pycolmap.Point2DList) None

Extend the list by appending all the items in the given list

  1. extend(self: pycolmap.Point2DList, L: collections.abc.Iterable) None

Extend the list by appending all the items in the given list

insert(self: pycolmap.Point2DList, i: SupportsInt, x: pycolmap.Point2D) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: pycolmap.Point2DList) pycolmap.Point2D

Remove and return the last item

  1. pop(self: pycolmap.Point2DList, i: typing.SupportsInt) pycolmap.Point2D

Remove and return the item at index i

remove(self: pycolmap.Point2DList, x: pycolmap.Point2D) None

Remove the first item from the list whose value is x. It is an error if there is no such item.

class pycolmap.CameraModelId(*args, **kwargs)

Members:

INVALID

SIMPLE_PINHOLE

PINHOLE

SIMPLE_RADIAL

SIMPLE_RADIAL_FISHEYE

RADIAL

RADIAL_FISHEYE

OPENCV

OPENCV_FISHEYE

FULL_OPENCV

FOV

THIN_PRISM_FISHEYE

RAD_TAN_THIN_PRISM_FISHEYE

SIMPLE_DIVISION

DIVISION

SIMPLE_FISHEYE

FISHEYE

Overloaded function.

  1. __init__(self: pycolmap.CameraModelId, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.CameraModelId, name: str) None

DIVISION = CameraModelId.DIVISION
FISHEYE = CameraModelId.FISHEYE
FOV = CameraModelId.FOV
FULL_OPENCV = CameraModelId.FULL_OPENCV
INVALID = CameraModelId.INVALID
OPENCV = CameraModelId.OPENCV
OPENCV_FISHEYE = CameraModelId.OPENCV_FISHEYE
PINHOLE = CameraModelId.PINHOLE
RADIAL = CameraModelId.RADIAL
RADIAL_FISHEYE = CameraModelId.RADIAL_FISHEYE
RAD_TAN_THIN_PRISM_FISHEYE = CameraModelId.RAD_TAN_THIN_PRISM_FISHEYE
SIMPLE_DIVISION = CameraModelId.SIMPLE_DIVISION
SIMPLE_FISHEYE = CameraModelId.SIMPLE_FISHEYE
SIMPLE_PINHOLE = CameraModelId.SIMPLE_PINHOLE
SIMPLE_RADIAL = CameraModelId.SIMPLE_RADIAL
SIMPLE_RADIAL_FISHEYE = CameraModelId.SIMPLE_RADIAL_FISHEYE
THIN_PRISM_FISHEYE = CameraModelId.THIN_PRISM_FISHEYE
CameraModelId.name -> str
property value
class pycolmap.Camera(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Camera) None

  2. __init__(self: pycolmap.Camera, arg0: dict) None

  3. __init__(self: pycolmap.Camera, **kwargs) None

calibration_matrix(self: pycolmap.Camera) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']

Compute calibration matrix from params.

cam_from_img(*args, **kwargs)

Overloaded function.

  1. cam_from_img(self: pycolmap.Camera, image_point: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[2, 1]"]) typing.Annotated[numpy.typing.NDArray[numpy.float64], "[2, 1]"] | None

Unproject point in image plane to camera frame.

  1. cam_from_img(self: pycolmap.Camera, image_points: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 2]"]) typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 2]"]

Unproject list of points in image plane to camera frame.

  1. cam_from_img(self: pycolmap.Camera, image_points: pycolmap.Point2DList) typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 2]"]

Unproject list of points in image plane to camera frame.

cam_from_img_threshold(self: pycolmap.Camera, threshold: SupportsFloat) float

Convert pixel threshold in image plane to world space.

property camera_id

Unique identifier of the camera. (int, default: 4294967295)

create(*args, **kwargs) object

Deprecated, use create_from_model_id instead.

static create_from_model_id(
camera_id: SupportsInt,
model: pycolmap.CameraModelId,
focal_length: SupportsFloat,
width: SupportsInt,
height: SupportsInt,
) pycolmap.Camera
static create_from_model_name(
camera_id: SupportsInt,
model_name: str,
focal_length: SupportsFloat,
width: SupportsInt,
height: SupportsInt,
) pycolmap.Camera

Create camera from model name string.

extra_params_idxs(self: pycolmap.Camera) list[int]

Indices of extra parameters in params property.

property focal_length
focal_length_idxs(self: pycolmap.Camera) list[int]

Indices of focal length parameters in params property.

property focal_length_x
property focal_length_y
has_bogus_params(
self: pycolmap.Camera,
min_focal_length_ratio: SupportsFloat,
max_focal_length_ratio: SupportsFloat,
max_extra_param: SupportsFloat,
) bool

Check whether camera has bogus parameters.

property has_prior_focal_length

(bool, default: False)

property height

Height of camera sensor. (int, default: 0)

img_from_cam(*args, **kwargs)

Overloaded function.

  1. img_from_cam(self: pycolmap.Camera, cam_point: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 1]"]) typing.Annotated[numpy.typing.NDArray[numpy.float64], "[2, 1]"] | None

Project point from camera frame to image plane.

  1. img_from_cam(self: pycolmap.Camera, cam_points: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 3]"]) typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 2]"]

Project list of points from camera frame to image plane.

is_undistorted(self: pycolmap.Camera) bool

Check whether camera is already undistorted.

mean_focal_length(self: pycolmap.Camera) float
mergedict(self: object, kwargs: dict) None
property model

Camera model. (CameraModelId, default: CameraModelId.INVALID)

property model_name

Camera model name as string. (str, default: )

property params

Camera parameters. (ndarray, default: [])

property params_info

Get human-readable information about the parameter vector ordering.

params_to_string(self: pycolmap.Camera) str

Concatenate parameters as comma-separated list.

principal_point_idxs(self: pycolmap.Camera) list[int]

Indices of principal point parameters in params property.

property principal_point_x
property principal_point_y
rescale(*args, **kwargs)

Overloaded function.

  1. rescale(self: pycolmap.Camera, new_width: typing.SupportsInt, new_height: typing.SupportsInt) None

Rescale the camera dimensions and accordingly the focal length and the principal point.

  1. rescale(self: pycolmap.Camera, scale: typing.SupportsFloat) None

Rescale the camera dimensions and accordingly the focal length and the principal point.

property sensor_id

Unique identifier of the sensor. (sensor_t, default: sensor_t(type=SensorType.CAMERA, id=4294967295))

set_params_from_string(self: pycolmap.Camera, params: str) bool

Set camera parameters from comma-separated list.

summary(self: pycolmap.Camera, write_type: bool = False) str
todict(self: pycolmap.Camera, recursive: bool = True) dict
verify_params(self: pycolmap.Camera) bool

Check whether parameters are valid, i.e. the parameter vector has the correct dimensions that match the specified camera model.

property width

Width of camera sensor. (int, default: 0)

class pycolmap.CameraMap(self: pycolmap.CameraMap)
items(self: pycolmap.CameraMap) pycolmap.ItemsView
keys(self: pycolmap.CameraMap) pycolmap.KeysView
values(self: pycolmap.CameraMap) pycolmap.ValuesView
class pycolmap.Frame(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Frame) None

  2. __init__(self: pycolmap.Frame, arg0: dict) None

  3. __init__(self: pycolmap.Frame, **kwargs) None

add_data_id(self: pycolmap.Frame, arg0: pycolmap.data_t) None

Associate data with frame.

clear_data_ids(self: pycolmap.Frame) None

Clear all the associated data.

property data_ids

The associated data. (set, default: set())

data_ids_by_sensor(self: pycolmap.Frame, type: pycolmap.SensorType) list[pycolmap.data_t]

The associated data for a given sensor type.

property frame_id

Unique identifier of the frame. (int, default: 4294967295)

has_data(self: pycolmap.Frame, arg0: pycolmap.data_t) bool

Check whether frame has associated data.

has_pose(self: pycolmap.Frame) bool

Whether the frame has a valid pose.

has_rig_id(self: pycolmap.Frame) bool

Check whether the rig_id is set.

property image_ids

The associated image data. (list, default: [])

mergedict(self: object, kwargs: dict) None
num_data_ids(self: pycolmap.Frame) int

Number of associated data items in frame.

reset_pose(self: pycolmap.Frame) None

Invalidate the pose of the frame.

reset_rig_ptr(self: pycolmap.Frame) None

Make the rig pointer a nullptr.

property rig

The associated rig object. (NoneType, default: None)

property rig_from_world

The pose of the frame, defined as the transformation from world to rig space. (NoneType, default: None)

property rig_id

Unique identifier of the rig. (int, default: 4294967295)

sensor_from_world(self: pycolmap.Frame, sensor_id: pycolmap.sensor_t) pycolmap.Rigid3d

The transformation from the world to a specific sensor.

set_cam_from_world(self: pycolmap.Frame, camera_id: SupportsInt, cam_from_world: pycolmap.Rigid3d) None

Set the world to frame from the given camera from world transformation.

summary(self: pycolmap.Frame, write_type: bool = False) str
todict(self: pycolmap.Frame, recursive: bool = True) dict
class pycolmap.FrameMap(self: pycolmap.FrameMap)
items(self: pycolmap.FrameMap) pycolmap.ItemsView
keys(self: pycolmap.FrameMap) pycolmap.KeysView
values(self: pycolmap.FrameMap) pycolmap.ValuesView
class pycolmap.Image(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Image) None

  2. __init__(self: pycolmap.Image, name: str = '', points2D: pycolmap.Point2DList = Point2DList(), camera_id: typing.SupportsInt = pycolmap.INVALID_CAMERA_ID, image_id: typing.SupportsInt = pycolmap.INVALID_IMAGE_ID) None

  3. __init__(self: pycolmap.Image, name: str = '', keypoints: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, 2]"] = array([], shape=(0, 2), dtype=float64), camera_id: typing.SupportsInt = pycolmap.INVALID_CAMERA_ID, image_id: typing.SupportsInt = pycolmap.INVALID_IMAGE_ID) None

  4. __init__(self: pycolmap.Image, arg0: dict) None

  5. __init__(self: pycolmap.Image, **kwargs) None

cam_from_world(self: pycolmap.Image) pycolmap.Rigid3d

The pose of the image, defined as the transformation from world to camera space. This method is read-only and support non-trivial frame (rig).

property camera

The associated camera object. (NoneType, default: None)

property camera_id

Unique identifier of the camera. (int, default: 4294967295)

property data_id

Unique identifier of the data. (data_t, default: data_t(sensor_id=sensor_t(type=SensorType.CAMERA, id=4294967295), id=4294967295))

property frame

The associated frame object. (NoneType, default: None)

property frame_id

Unique identifier of the frame. (int, default: 4294967295)

get_observation_point2D_idxs(self: pycolmap.Image) list[int]

Get the indices of 2D points that observe a 3D point.

get_observation_points2D(self: pycolmap.Image) pycolmap.Point2DList

Get the 2D points that observe a 3D point.

has_camera_id(self: pycolmap.Image) bool

Check whether identifier of camera has been set.

has_camera_ptr(self: pycolmap.Image) bool

Check whether the camera pointer has been set.

has_frame_id(self: pycolmap.Image) bool

Check whether identifier of frame has been set.

has_frame_ptr(self: pycolmap.Image) bool

Check whether the frame pointer has been set.

has_point3D(self: pycolmap.Image, point3D_id: SupportsInt) bool

Check whether one of the image points is part of a 3D point track.

property has_pose

Whether the image has a valid pose. (bool, default: False)

property image_id

Unique identifier of the image. (int, default: 4294967295)

is_ref_in_frame(self: pycolmap.Image) bool

Check if the image was captured by the reference sensor in the rig.

mergedict(self: object, kwargs: dict) None
property name

Name of the image. (str, default: )

num_points2D(self: pycolmap.Image) int

Get the number of image points (keypoints).

property num_points3D

Get the number of triangulations, i.e. the number of points that are part of a 3D point track. (int, default: 0)

point2D(self: pycolmap.Image, point2D_idx: SupportsInt) pycolmap.Point2D

Direct accessor for a point2D.

property points2D

Array of Points2D (=keypoints). (Point2DList, default: Point2DList[])

project_point(
self: pycolmap.Image,
point3D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'],
) Annotated[numpy.typing.NDArray[numpy.float64], '[2, 1]'] | None

Project 3D point onto the image

projection_center(self: pycolmap.Image) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']

Extract the projection center in world space.

reset_camera_ptr(self: pycolmap.Image) None

Make the camera pointer a nullptr.

reset_frame_ptr(self: pycolmap.Image) None

Make the frame pointer a nullptr.

reset_point3D_for_point2D(self: pycolmap.Image, point2D_idx: SupportsInt) None

Set the point as not triangulated, i.e. it is not part of a 3D point track

set_point3D_for_point2D(
self: pycolmap.Image,
point2D_Idx: SupportsInt,
point3D_id: SupportsInt,
) None

Set the point as triangulated, i.e. it is part of a 3D point track.

summary(self: pycolmap.Image, write_type: bool = False) str
todict(self: pycolmap.Image, recursive: bool = True) dict
viewing_direction(self: pycolmap.Image) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']

Extract the viewing direction of the image.

class pycolmap.ImageMap(self: pycolmap.ImageMap)
items(self: pycolmap.ImageMap) pycolmap.ItemsView
keys(self: pycolmap.ImageMap) pycolmap.KeysView
values(self: pycolmap.ImageMap) pycolmap.ValuesView
class pycolmap.TrackElement(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.TrackElement) None

  2. __init__(self: pycolmap.TrackElement, image_id: typing.SupportsInt, point2D_idx: typing.SupportsInt) None

  3. __init__(self: pycolmap.TrackElement, arg0: dict) None

  4. __init__(self: pycolmap.TrackElement, **kwargs) None

property image_id

(int, default: 4294967295)

mergedict(self: object, kwargs: dict) None
property point2D_idx

(int, default: 4294967295)

summary(self: pycolmap.TrackElement, write_type: bool = False) str
todict(self: pycolmap.TrackElement, recursive: bool = True) dict
class pycolmap.Track(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Track) None

  2. __init__(self: pycolmap.Track, elements: collections.abc.Sequence[pycolmap.TrackElement]) None

  3. __init__(self: pycolmap.Track, arg0: dict) None

  4. __init__(self: pycolmap.Track, **kwargs) None

add_element(*args, **kwargs)

Overloaded function.

  1. add_element(self: pycolmap.Track, image_id: typing.SupportsInt, point2D_idx: typing.SupportsInt) None

Add an observation to the track.

  1. add_element(self: pycolmap.Track, element: pycolmap.TrackElement) None

add_elements(self: pycolmap.Track, elements: collections.abc.Sequence[pycolmap.TrackElement]) None

Add multiple elements.

compress(self: pycolmap.Track) None

Shrink capacity to fit size.

delete_element(*args, **kwargs)

Overloaded function.

  1. delete_element(self: pycolmap.Track, image_id: typing.SupportsInt, point2D_idx: typing.SupportsInt) None

Delete observation from track.

  1. delete_element(self: pycolmap.Track, index: typing.SupportsInt) None

Remove TrackElement at index.

element(self: pycolmap.Track, index: SupportsInt) pycolmap.TrackElement

Access specific element by index.

property elements

(list, default: [])

length(self: pycolmap.Track) int

Track Length.

mergedict(self: object, kwargs: dict) None
reserve(self: pycolmap.Track, num_elements: SupportsInt) None

Reserve capacity for elements.

set_element(self: pycolmap.Track, index: SupportsInt, element: pycolmap.TrackElement) None

Set element at specific index.

summary(self: pycolmap.Track, write_type: bool = False) str
todict(self: pycolmap.Track, recursive: bool = True) dict
class pycolmap.Point3D(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Point3D) None

  2. __init__(self: pycolmap.Point3D, arg0: dict) None

  3. __init__(self: pycolmap.Point3D, **kwargs) None

property color

(ndarray, default: [0 0 0])

property error

(float, default: -1.0)

has_error(self: pycolmap.Point3D) bool

Check if error has been computed.

mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.Point3D, write_type: bool = False) str
todict(self: pycolmap.Point3D, recursive: bool = True) dict
property track

(Track, default: Track(elements=[]))

property xyz

(ndarray, default: [0. 0. 0.])

class pycolmap.Point3DMap(self: pycolmap.Point3DMap)
items(self: pycolmap.Point3DMap) pycolmap.ItemsView
keys(self: pycolmap.Point3DMap) pycolmap.KeysView
values(self: pycolmap.Point3DMap) pycolmap.ValuesView
class pycolmap.TwoViewGeometryConfiguration(*args, **kwargs)

Members:

UNDEFINED

DEGENERATE

CALIBRATED

CALIBRATED_RIG

UNCALIBRATED

PLANAR

PANORAMIC

PLANAR_OR_PANORAMIC

WATERMARK

MULTIPLE

Overloaded function.

  1. __init__(self: pycolmap.TwoViewGeometryConfiguration, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.TwoViewGeometryConfiguration, name: str) None

CALIBRATED = TwoViewGeometryConfiguration.CALIBRATED
CALIBRATED_RIG = TwoViewGeometryConfiguration.CALIBRATED_RIG
DEGENERATE = TwoViewGeometryConfiguration.DEGENERATE
MULTIPLE = TwoViewGeometryConfiguration.MULTIPLE
PANORAMIC = TwoViewGeometryConfiguration.PANORAMIC
PLANAR = TwoViewGeometryConfiguration.PLANAR
PLANAR_OR_PANORAMIC = TwoViewGeometryConfiguration.PLANAR_OR_PANORAMIC
UNCALIBRATED = TwoViewGeometryConfiguration.UNCALIBRATED
UNDEFINED = TwoViewGeometryConfiguration.UNDEFINED
WATERMARK = TwoViewGeometryConfiguration.WATERMARK
TwoViewGeometryConfiguration.name -> str
property value
class pycolmap.TwoViewGeometry(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.TwoViewGeometry) None

  2. __init__(self: pycolmap.TwoViewGeometry, arg0: dict) None

  3. __init__(self: pycolmap.TwoViewGeometry, **kwargs) None

property E

(NoneType, default: None)

property F

(NoneType, default: None)

property H

(NoneType, default: None)

property cam2_from_cam1

(NoneType, default: None)

property config

(int, default: 0)

property inlier_matches

(ndarray, default: [])

invert(self: pycolmap.TwoViewGeometry) None
mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.TwoViewGeometry, write_type: bool = False) str
todict(self: pycolmap.TwoViewGeometry, recursive: bool = True) dict
property tri_angle

(float, default: -1.0)

class pycolmap.Correspondence(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Correspondence) None

  2. __init__(self: pycolmap.Correspondence, image_id: typing.SupportsInt, point2D_idx: typing.SupportsInt) None

  3. __init__(self: pycolmap.Correspondence, arg0: dict) None

  4. __init__(self: pycolmap.Correspondence, **kwargs) None

property image_id

(int, default: 4294967295)

mergedict(self: object, kwargs: dict) None
property point2D_idx

(int, default: 4294967295)

summary(self: pycolmap.Correspondence, write_type: bool = False) str
todict(self: pycolmap.Correspondence, recursive: bool = True) dict
class pycolmap.CorrespondenceRange
property empty

Whether the range is empty.

to_list(self: pycolmap.CorrespondenceRange) list[pycolmap.Correspondence]

Convert range to list of correspondences.

class pycolmap.CorrespondenceGraph(self: pycolmap.CorrespondenceGraph)
add_image(
self: pycolmap.CorrespondenceGraph,
image_id: SupportsInt,
num_points2D: SupportsInt,
) None
add_two_view_geometry(
self: pycolmap.CorrespondenceGraph,
image_id1: SupportsInt,
image_id2: SupportsInt,
two_view_geometry: pycolmap.TwoViewGeometry,
) None
exists_image(self: pycolmap.CorrespondenceGraph, image_id: SupportsInt) bool
extract_correspondences(
self: pycolmap.CorrespondenceGraph,
image_id: SupportsInt,
point2D_idx: SupportsInt,
) list[pycolmap.Correspondence]
extract_matches_between_images(
self: pycolmap.CorrespondenceGraph,
image_id1: SupportsInt,
image_id2: SupportsInt,
) Annotated[numpy.typing.NDArray[numpy.uint32], '[m, 2]']
extract_transitive_correspondences(
self: pycolmap.CorrespondenceGraph,
image_id: SupportsInt,
point2D_idx: SupportsInt,
transitivity: SupportsInt,
) list[pycolmap.Correspondence]
extract_two_view_geometry(
self: pycolmap.CorrespondenceGraph,
image_id1: SupportsInt,
image_id2: SupportsInt,
extract_inlier_matches: bool,
) pycolmap.TwoViewGeometry
finalize(self: pycolmap.CorrespondenceGraph) None
find_correspondences(
self: pycolmap.CorrespondenceGraph,
image_id: SupportsInt,
point2D_idx: SupportsInt,
) pycolmap.CorrespondenceRange

Find range of correspondences of an image observation.

find_correspondences_between_images(*args, **kwargs) object

Deprecated, use extract_matches_between_images instead.

has_correspondences(
self: pycolmap.CorrespondenceGraph,
image_id: SupportsInt,
point2D_idx: SupportsInt,
) bool
image_pairs(self: pycolmap.CorrespondenceGraph) list[int]
is_two_view_observation(
self: pycolmap.CorrespondenceGraph,
image_id: SupportsInt,
point2D_idx: SupportsInt,
) bool
num_correspondences_between_all_images(*args, **kwargs) object

Deprecated, use num_matches_between_all_images instead.

num_correspondences_between_images(*args, **kwargs) object

Deprecated, use num_matches_between_images instead.

num_correspondences_for_image(
self: pycolmap.CorrespondenceGraph,
image_id: SupportsInt,
) int
num_image_pairs(self: pycolmap.CorrespondenceGraph) int
num_images(self: pycolmap.CorrespondenceGraph) int
num_matches_between_all_images(self: pycolmap.CorrespondenceGraph) dict[int, int]
num_matches_between_images(
self: pycolmap.CorrespondenceGraph,
image_id1: SupportsInt,
image_id2: SupportsInt,
) int
num_observations_for_image(self: pycolmap.CorrespondenceGraph, image_id: SupportsInt) int
class pycolmap.Database(self: pycolmap.Database)
clear_all_tables(self: pycolmap.Database) None
clear_cameras(self: pycolmap.Database) None
clear_descriptors(self: pycolmap.Database) None
clear_frames(self: pycolmap.Database) None
clear_images(self: pycolmap.Database) None
clear_keypoints(self: pycolmap.Database) None
clear_matches(self: pycolmap.Database) None
clear_pose_priors(self: pycolmap.Database) None
clear_rigs(self: pycolmap.Database) None
clear_two_view_geometries(self: pycolmap.Database) None
close(self: pycolmap.Database) None
delete_inlier_matches(
self: pycolmap.Database,
image_id1: SupportsInt,
image_id2: SupportsInt,
) None
delete_matches(self: pycolmap.Database, image_id1: SupportsInt, image_id2: SupportsInt) None
delete_two_view_geometry(
self: pycolmap.Database,
image_id1: SupportsInt,
image_id2: SupportsInt,
) None
exists_camera(self: pycolmap.Database, camera_id: SupportsInt) bool
exists_descriptors(self: pycolmap.Database, image_id: SupportsInt) bool
exists_frame(self: pycolmap.Database, frame_id: SupportsInt) bool
exists_image(*args, **kwargs)

Overloaded function.

  1. exists_image(self: pycolmap.Database, image_id: typing.SupportsInt) bool

  2. exists_image(self: pycolmap.Database, name: str) bool

exists_keypoints(self: pycolmap.Database, image_id: SupportsInt) bool
exists_matches(self: pycolmap.Database, image_id1: SupportsInt, image_id2: SupportsInt) bool
exists_pose_prior(
self: pycolmap.Database,
pose_prior_id: SupportsInt,
is_deprecated_image_prior: bool = True,
) bool
exists_rig(self: pycolmap.Database, rig_id: SupportsInt) bool
exists_two_view_geometry(
self: pycolmap.Database,
image_id1: SupportsInt,
image_id2: SupportsInt,
) bool
static merge(database1: pycolmap.Database, database2: pycolmap.Database, merged_database: pycolmap.Database) None
num_cameras(self: pycolmap.Database) int
num_descriptors(self: pycolmap.Database) int
num_descriptors_for_image(self: pycolmap.Database, image_id: SupportsInt) int
num_frames(self: pycolmap.Database) int
num_images(self: pycolmap.Database) int
num_inlier_matches(self: pycolmap.Database) int
num_keypoints(self: pycolmap.Database) int
num_keypoints_for_image(self: pycolmap.Database, image_id: SupportsInt) int
num_matched_image_pairs(self: pycolmap.Database) int
num_matches(self: pycolmap.Database) int
num_pose_priors(self: pycolmap.Database) int
num_rigs(self: pycolmap.Database) int
num_verified_image_pairs(self: pycolmap.Database) int
static open(path: os.PathLike | str | bytes) pycolmap.Database
read_all_cameras(self: pycolmap.Database) list[pycolmap.Camera]
read_all_frames(self: pycolmap.Database) list[pycolmap.Frame]
read_all_images(self: pycolmap.Database) list[pycolmap.Image]
read_all_matches(
self: pycolmap.Database,
) tuple[list[int], list[Annotated[numpy.typing.NDArray[numpy.uint32], '[m, 2]']]]
read_all_pose_priors(self: pycolmap.Database) list[pycolmap.PosePrior]
read_all_rigs(self: pycolmap.Database) list[pycolmap.Rig]
read_camera(self: pycolmap.Database, camera_id: SupportsInt) pycolmap.Camera
read_descriptors(self: pycolmap.Database, image_id: SupportsInt) pycolmap.FeatureDescriptors
read_frame(self: pycolmap.Database, frame_id: SupportsInt) pycolmap.Frame
read_image(self: pycolmap.Database, image_id: SupportsInt) pycolmap.Image
read_image_with_name(self: pycolmap.Database, name: str) pycolmap.Image | None
read_keypoints(
self: pycolmap.Database,
image_id: SupportsInt,
) Annotated[numpy.typing.NDArray[numpy.float32], '[m, n]']
read_matches(
self: pycolmap.Database,
image_id1: SupportsInt,
image_id2: SupportsInt,
) Annotated[numpy.typing.NDArray[numpy.uint32], '[m, 2]']
read_num_matches(self: pycolmap.Database) tuple[list[int], list[int]]
read_pose_prior(
self: pycolmap.Database,
pose_prior_id: SupportsInt,
is_deprecated_image_prior: bool = True,
) pycolmap.PosePrior
read_rig(self: pycolmap.Database, rig_id: SupportsInt) pycolmap.Rig
read_rig_with_sensor(self: pycolmap.Database, sensor_id: pycolmap.sensor_t) pycolmap.Rig | None
read_two_view_geometries(self: pycolmap.Database) tuple[list[int], list[pycolmap.TwoViewGeometry]]
read_two_view_geometry(
self: pycolmap.Database,
image_id1: SupportsInt,
image_id2: SupportsInt,
) pycolmap.TwoViewGeometry
read_two_view_geometry_num_inliers(self: pycolmap.Database) tuple[list[int], list[int]]
update_camera(self: pycolmap.Database, camera: pycolmap.Camera) None
update_frame(self: pycolmap.Database, frame: pycolmap.Frame) None
update_image(self: pycolmap.Database, image: pycolmap.Image) None
update_keypoints(
self: pycolmap.Database,
image_id: SupportsInt,
keypoints: Annotated[numpy.typing.ArrayLike, numpy.float32, '[m, n]'],
) None
update_pose_prior(self: pycolmap.Database, pose_prior: pycolmap.PosePrior) None
update_rig(self: pycolmap.Database, rig: pycolmap.Rig) None
update_two_view_geometry(
self: pycolmap.Database,
image_id1: SupportsInt,
image_id2: SupportsInt,
two_view_geometry: pycolmap.TwoViewGeometry,
) None
write_camera(self: pycolmap.Database, camera: pycolmap.Camera, use_camera_id: bool = False) int
write_descriptors(
self: pycolmap.Database,
image_id: SupportsInt,
descriptors: pycolmap.FeatureDescriptors,
) None
write_frame(self: pycolmap.Database, frame: pycolmap.Frame, use_frame_id: bool = False) int
write_image(self: pycolmap.Database, image: pycolmap.Image, use_image_id: bool = False) int
write_keypoints(
self: pycolmap.Database,
image_id: SupportsInt,
keypoints: Annotated[numpy.typing.ArrayLike, numpy.float32, '[m, n]'],
) None
write_matches(
self: pycolmap.Database,
image_id1: SupportsInt,
image_id2: SupportsInt,
matches: Annotated[numpy.typing.ArrayLike, numpy.uint32, '[m, 2]'],
) None
write_pose_prior(
self: pycolmap.Database,
pose_prior: pycolmap.PosePrior,
use_pose_prior_id: bool = False,
) int
write_rig(self: pycolmap.Database, rig: pycolmap.Rig, use_rig_id: bool = False) int
write_two_view_geometry(
self: pycolmap.Database,
image_id1: SupportsInt,
image_id2: SupportsInt,
two_view_geometry: pycolmap.TwoViewGeometry,
) None
class pycolmap.DatabaseTransaction(self: pycolmap.DatabaseTransaction, database: pycolmap.Database)
class pycolmap.DatabaseCacheOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.DatabaseCacheOptions) None

  2. __init__(self: pycolmap.DatabaseCacheOptions, arg0: dict) None

  3. __init__(self: pycolmap.DatabaseCacheOptions, **kwargs) None

property convert_pose_priors_to_enu

Whether to convert pose priors to ENU coordinate system. (bool, default: False)

property ignore_watermarks

Whether to ignore watermark image pairs. (bool, default: False)

property image_names

Only load the data for a subset of the images. All images are used if empty. (set, default: set())

mergedict(self: object, kwargs: dict) None
property min_num_matches

Only load image pairs with a minimum number of matches. (int, default: 0)

summary(self: pycolmap.DatabaseCacheOptions, write_type: bool = False) str
todict(self: pycolmap.DatabaseCacheOptions, recursive: bool = True) dict
class pycolmap.DatabaseCache(self: pycolmap.DatabaseCache)
add_camera(self: pycolmap.DatabaseCache, arg0: pycolmap.Camera) None
add_frame(self: pycolmap.DatabaseCache, arg0: pycolmap.Frame) None
add_image(self: pycolmap.DatabaseCache, arg0: pycolmap.Image) None
add_pose_prior(self: pycolmap.DatabaseCache, arg0: pycolmap.PosePrior) None
add_rig(self: pycolmap.DatabaseCache, arg0: pycolmap.Rig) None
camera(self: pycolmap.DatabaseCache, camera_id: SupportsInt) pycolmap.Camera
property cameras
property correspondence_graph
static create(database: pycolmap.Database, options: pycolmap.DatabaseCacheOptions) pycolmap.DatabaseCache
static create_from_cache(
database_cache: pycolmap.DatabaseCache,
options: pycolmap.DatabaseCacheOptions,
) pycolmap.DatabaseCache
exists_camera(self: pycolmap.DatabaseCache, camera_id: SupportsInt) bool
exists_frame(self: pycolmap.DatabaseCache, frame_id: SupportsInt) bool
exists_image(self: pycolmap.DatabaseCache, image_id: SupportsInt) bool
exists_rig(self: pycolmap.DatabaseCache, rig_id: SupportsInt) bool
find_image_with_name(self: pycolmap.DatabaseCache, name: str) pycolmap.Image
frame(self: pycolmap.DatabaseCache, frame_id: SupportsInt) pycolmap.Frame
property frames
image(self: pycolmap.DatabaseCache, image_id: SupportsInt) pycolmap.Image
property images
load(
self: pycolmap.DatabaseCache,
database: pycolmap.Database,
options: pycolmap.DatabaseCacheOptions,
) None
num_cameras(self: pycolmap.DatabaseCache) int
num_frames(self: pycolmap.DatabaseCache) int
num_images(self: pycolmap.DatabaseCache) int
num_pose_priors(self: pycolmap.DatabaseCache) int
num_rigs(self: pycolmap.DatabaseCache) int
property pose_priors
rig(self: pycolmap.DatabaseCache, rig_id: SupportsInt) pycolmap.Rig
property rigs
class pycolmap.Reconstruction(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.Reconstruction) None

  2. __init__(self: pycolmap.Reconstruction, reconstruction: pycolmap.Reconstruction) None

  3. __init__(self: pycolmap.Reconstruction, path: os.PathLike | str | bytes) None

add_camera(self: pycolmap.Reconstruction, camera: pycolmap.Camera) None

Add new camera. There is only one camera per image, while multiple images might be taken by the same camera.

add_camera_with_trivial_rig(self: pycolmap.Reconstruction, camera: pycolmap.Camera) None

Add a new camera and also create a trivial rig whose rig_id matches the camera_id. The camera becomes the rig’s only sensor.

add_frame(self: pycolmap.Reconstruction, frame: pycolmap.Frame) None

Add new frame.

add_image(self: pycolmap.Reconstruction, image: pycolmap.Image) None

Add new image. Its camera must have been added before. If its camera object is unset, it will be automatically populated from the added cameras.

add_image_with_trivial_frame(*args, **kwargs)

Overloaded function.

  1. add_image_with_trivial_frame(self: pycolmap.Reconstruction, image: pycolmap.Image) None

Add a new image and create a frame with the same ID (frame_id = image_id). Assumes a rig exists whose rig_id equals the camera_id of the image.

  1. add_image_with_trivial_frame(self: pycolmap.Reconstruction, image: pycolmap.Image, cam_from_world: pycolmap.Rigid3d) None

Add a new image, create a trivial frame (frame_id = image_id), and also register the frame with an input pose.

add_observation(
self: pycolmap.Reconstruction,
point3D_id: SupportsInt,
track_element: pycolmap.TrackElement,
) None

Add observation to existing 3D point.

add_point3D(
self: pycolmap.Reconstruction,
xyz: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'],
track: pycolmap.Track,
color: Annotated[numpy.typing.ArrayLike, numpy.uint8, '[3, 1]'] = array([0, 0, 0], dtype=uint8),
) int

Add new 3D object, and return its unique ID.

add_point3D_with_id(
self: pycolmap.Reconstruction,
point3D_id: SupportsInt,
point3D: pycolmap.Point3D,
) None

Add new 3D point with known ID.

add_rig(self: pycolmap.Reconstruction, rig: pycolmap.Rig) None

Add new rig.

camera(self: pycolmap.Reconstruction, camera_id: SupportsInt) pycolmap.Camera

Direct accessor for a camera.

property cameras
compute_bounding_box(
self: pycolmap.Reconstruction,
min_percentile: SupportsFloat = 0.0,
max_percentile: SupportsFloat = 1.0,
use_images: bool = False,
) pycolmap.AlignedBox3d
compute_centroid(
self: pycolmap.Reconstruction,
min_percentile: SupportsFloat = 0.0,
max_percentile: SupportsFloat = 1.0,
use_images: bool = False,
) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']
compute_mean_observations_per_reg_image(self: pycolmap.Reconstruction) float
compute_mean_reprojection_error(self: pycolmap.Reconstruction) float
compute_mean_track_length(self: pycolmap.Reconstruction) float
compute_num_observations(self: pycolmap.Reconstruction) int
create_image_dirs(self: pycolmap.Reconstruction, path: os.PathLike | str | bytes) None

Create all image sub-directories in the given path.

crop(self: pycolmap.Reconstruction, bbox: pycolmap.AlignedBox3d) pycolmap.Reconstruction
delete_all_points2D_and_points3D(self: pycolmap.Reconstruction) None

Delete all 2D points of all images and all 3D points.

delete_observation(
self: pycolmap.Reconstruction,
image_id: SupportsInt,
point2D_idx: SupportsInt,
) None

Delete one observation from an image and the corresponding 3D point. Note that this deletes the entire 3D point, if the track has two elements prior to calling this method.

delete_point3D(self: pycolmap.Reconstruction, point3D_id: SupportsInt) None

Delete a 3D point, and all its references in the observed images.

deregister_frame(self: pycolmap.Reconstruction, frame_id: SupportsInt) None

De-register an existing frame, and all its references.

exists_camera(self: pycolmap.Reconstruction, camera_id: SupportsInt) bool
exists_frame(self: pycolmap.Reconstruction, frame_id: SupportsInt) bool
exists_image(self: pycolmap.Reconstruction, image_id: SupportsInt) bool
exists_point3D(self: pycolmap.Reconstruction, point3D_id: SupportsInt) bool
exists_rig(self: pycolmap.Reconstruction, rig_id: SupportsInt) bool
export_PLY(self: pycolmap.Reconstruction, output_path: os.PathLike | str | bytes) None

Export 3D points to PLY format (.ply).

extract_colors_for_all_images(self: pycolmap.Reconstruction, path: os.PathLike | str | bytes) None

Extract colors for all 3D points by computing the mean color of all images.

extract_colors_for_image(
self: pycolmap.Reconstruction,
image_id: SupportsInt,
path: os.PathLike | str | bytes,
) bool

Extract colors for 3D points of given image. Colors will be extracted only for 3D points which are completely black. Return True if the image could be read at the given path.

find_common_reg_image_ids(
self: pycolmap.Reconstruction,
other: pycolmap.Reconstruction,
) list[tuple[int, int]]

Find images that are both present in this and the given reconstruction.

find_image_with_name(self: pycolmap.Reconstruction, name: str) pycolmap.Image

Find image with matching name. Returns None if no match is found.

frame(self: pycolmap.Reconstruction, frame_id: SupportsInt) pycolmap.Frame

Direct accessor for a frame.

property frames
image(self: pycolmap.Reconstruction, image_id: SupportsInt) pycolmap.Image

Direct accessor for an image.

property images
import_PLY(self: pycolmap.Reconstruction, path: os.PathLike | str | bytes) None

Import from PLY format. Note that these import functions areonly intended for visualization of data and usable for reconstruction.

is_valid(self: pycolmap.Reconstruction) bool

Check whether the reconstruction object is internally consistent.

load(self: pycolmap.Reconstruction, database_cache: pycolmap.DatabaseCache) None
merge_points3D(
self: pycolmap.Reconstruction,
point3D_id1: SupportsInt,
point3D_id2: SupportsInt,
) int

Merge two 3D points and return new identifier of new 3D point.The location of the merged 3D point is a weighted average of the two original 3D point’s locations according to their track lengths.

normalize(
self: pycolmap.Reconstruction,
fixed_scale: bool = False,
extent: SupportsFloat = 10.0,
min_percentile: SupportsFloat = 0.1,
max_percentile: SupportsFloat = 0.9,
use_images: bool = True,
) pycolmap.Sim3d

Normalize scene by scaling and translation to avoid degeneratevisualization after bundle adjustment and to improve numericalstability of algorithms.

Translates scene such that the mean of the camera centers or pointlocations are at the origin of the coordinate system.

Scales scene such that the minimum and maximum camera centers (or points) are at the given extent, whereas min_percentile and max_percentile determine the minimum and maximum percentiles of the camera centers (or points) considered.

num_cameras(self: pycolmap.Reconstruction) int
num_frames(self: pycolmap.Reconstruction) int
num_images(self: pycolmap.Reconstruction) int
num_points3D(self: pycolmap.Reconstruction) int
num_reg_frames(self: pycolmap.Reconstruction) int
num_reg_images(self: pycolmap.Reconstruction) int
num_rigs(self: pycolmap.Reconstruction) int
point3D(self: pycolmap.Reconstruction, point3D_id: SupportsInt) pycolmap.Point3D

Direct accessor for a Point3D.

point3D_ids(self: pycolmap.Reconstruction) set[int]
property points3D
read(self: pycolmap.Reconstruction, path: os.PathLike | str | bytes) None

Read reconstruction in COLMAP format. Prefer binary.

read_binary(self: pycolmap.Reconstruction, path: os.PathLike | str | bytes) None
read_text(self: pycolmap.Reconstruction, path: os.PathLike | str | bytes) None
reg_frame_ids(self: pycolmap.Reconstruction) list[int]
reg_image_ids(self: pycolmap.Reconstruction) list[int]
register_frame(self: pycolmap.Reconstruction, frame_id: SupportsInt) None

Register an existing frame.

rig(self: pycolmap.Reconstruction, rig_id: SupportsInt) pycolmap.Rig

Direct accessor for a rig.

property rigs
set_rigs_and_frames(
self: pycolmap.Reconstruction,
rigs: collections.abc.Sequence[pycolmap.Rig],
frames: collections.abc.Sequence[pycolmap.Frame],
) None

Set rigs and frames together.

summary(self: pycolmap.Reconstruction) str
tear_down(self: pycolmap.Reconstruction) None
transcribe_image_ids_to_database(self: pycolmap.Reconstruction, database: pycolmap.Database) None

Update image identifiers to match the database by name.

transform(self: pycolmap.Reconstruction, new_from_old_world: pycolmap.Sim3d) None

Apply the 3D similarity transformation to all images and points.

update_point_3d_errors(self: pycolmap.Reconstruction) None
write(self: pycolmap.Reconstruction, output_dir: os.PathLike | str | bytes) None

Write reconstruction in COLMAP binary format.

write_binary(self: pycolmap.Reconstruction, path: os.PathLike | str | bytes) None
write_text(self: pycolmap.Reconstruction, path: os.PathLike | str | bytes) None
class pycolmap.ReconstructionManager(self: pycolmap.ReconstructionManager)
add(self: pycolmap.ReconstructionManager) int
clear(self: pycolmap.ReconstructionManager) None
delete(self: pycolmap.ReconstructionManager, idx: SupportsInt) None
get(self: pycolmap.ReconstructionManager, idx: SupportsInt) pycolmap.Reconstruction
read(self: pycolmap.ReconstructionManager, path: os.PathLike | str | bytes) int
size(self: pycolmap.ReconstructionManager) int
write(self: pycolmap.ReconstructionManager, path: os.PathLike | str | bytes) None
class pycolmap.RigConfigCamera(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.RigConfigCamera) None

  2. __init__(self: pycolmap.RigConfigCamera, arg0: dict) None

  3. __init__(self: pycolmap.RigConfigCamera, **kwargs) None

property cam_from_rig

(NoneType, default: None)

property camera

(NoneType, default: None)

property image_prefix

(str, default: )

mergedict(self: object, kwargs: dict) None
property ref_sensor

(bool, default: False)

summary(self: pycolmap.RigConfigCamera, write_type: bool = False) str
todict(self: pycolmap.RigConfigCamera, recursive: bool = True) dict
class pycolmap.RigConfig(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.RigConfig) None

  2. __init__(self: pycolmap.RigConfig, arg0: dict) None

  3. __init__(self: pycolmap.RigConfig, **kwargs) None

property cameras

(list, default: [])

mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.RigConfig, write_type: bool = False) str
todict(self: pycolmap.RigConfig, recursive: bool = True) dict
pycolmap.read_rig_config(path: os.PathLike | str | bytes) list[pycolmap.RigConfig]

Read the rig configuration from a .json file.

pycolmap.apply_rig_config(
configs: collections.abc.Sequence[pycolmap.RigConfig],
database: pycolmap.Database,
reconstruction: pycolmap.Reconstruction = None,
) None

Applies the given rig configuration to the database and optionally derives camera rig extrinsics and intrinsics from the reconstruction, if not defined in the config. If the reconstruction is provided, it is also updated with the provided config and any previous rigs/frames are cleared and overwritten.

class pycolmap.SyntheticDatasetMatchConfig(*args, **kwargs)

Members:

EXHAUSTIVE

CHAINED

SPARSE

Overloaded function.

  1. __init__(self: pycolmap.SyntheticDatasetMatchConfig, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.SyntheticDatasetMatchConfig, name: str) None

CHAINED = SyntheticDatasetMatchConfig.CHAINED
EXHAUSTIVE = SyntheticDatasetMatchConfig.EXHAUSTIVE
SPARSE = SyntheticDatasetMatchConfig.SPARSE
SyntheticDatasetMatchConfig.name -> str
property value
class pycolmap.SyntheticDatasetOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.SyntheticDatasetOptions) None

  2. __init__(self: pycolmap.SyntheticDatasetOptions, arg0: dict) None

  3. __init__(self: pycolmap.SyntheticDatasetOptions, **kwargs) None

property camera_has_prior_focal_length

(bool, default: False)

property camera_height

(int, default: 768)

property camera_model_id

(CameraModelId, default: CameraModelId.SIMPLE_RADIAL)

property camera_params

(list, default: [1280.0, 512.0, 384.0, 0.05])

property camera_width

(int, default: 1024)

property feature_type

The type of feature descriptors to synthesize. (FeatureExtractorType, default: FeatureExtractorType.SIFT)

property inlier_match_ratio

(float, default: 1.0)

property match_config

(SyntheticDatasetMatchConfig, default: SyntheticDatasetMatchConfig.EXHAUSTIVE)

property match_sparsity

Sparsity parameter for SPARSE match config [0,1]. (float, default: 0.0)

mergedict(self: object, kwargs: dict) None
property num_cameras_per_rig

(int, default: 1)

property num_frames_per_rig

(int, default: 5)

property num_points2D_without_point3D

(int, default: 10)

property num_points3D

(int, default: 100)

property num_rigs

(int, default: 2)

property prior_gravity

(bool, default: False)

property prior_gravity_in_world

Prior gravity direction in world coordinates. (ndarray, default: [0. 1. 0.])

property prior_position

(bool, default: False)

property prior_position_coordinate_system

(PosePriorCoordinateSystem, default: PosePriorCoordinateSystem.CARTESIAN)

property sensor_from_rig_rotation_stddev

Random rotation in degrees around the z-axis of the sensor. (float, default: 5.0)

property sensor_from_rig_translation_stddev

(float, default: 0.05)

summary(self: pycolmap.SyntheticDatasetOptions, write_type: bool = False) str
todict(self: pycolmap.SyntheticDatasetOptions, recursive: bool = True) dict
property two_view_geometry_has_relative_pose

Whether to include decomposed relative poses in two-view geometries. (bool, default: False)

pycolmap.synthesize_dataset(
options: pycolmap.SyntheticDatasetOptions,
database: pycolmap.Database = None,
) pycolmap.Reconstruction
class pycolmap.SyntheticNoiseOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.SyntheticNoiseOptions) None

  2. __init__(self: pycolmap.SyntheticNoiseOptions, arg0: dict) None

  3. __init__(self: pycolmap.SyntheticNoiseOptions, **kwargs) None

mergedict(self: object, kwargs: dict) None
property point2D_stddev

(float, default: 0.0)

property point3D_stddev

(float, default: 0.0)

property prior_gravity_stddev

(float, default: 1.0)

property prior_position_stddev

(float, default: 1.5)

property rig_from_world_rotation_stddev

Random rotation in degrees around the z-axis of the rig. (float, default: 0.0)

property rig_from_world_translation_stddev

(float, default: 0.0)

summary(self: pycolmap.SyntheticNoiseOptions, write_type: bool = False) str
todict(self: pycolmap.SyntheticNoiseOptions, recursive: bool = True) dict
pycolmap.synthesize_noise(
options: pycolmap.SyntheticNoiseOptions,
reconstruction: pycolmap.Reconstruction,
database: pycolmap.Database = None,
) None
class pycolmap.SyntheticImageOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.SyntheticImageOptions) None

  2. __init__(self: pycolmap.SyntheticImageOptions, arg0: dict) None

  3. __init__(self: pycolmap.SyntheticImageOptions, **kwargs) None

property feature_patch_max_brightness

(int, default: 128)

property feature_patch_radius

Random rotation in degrees around the z-axis of the rig. (int, default: 15)

property feature_peak_radius

(int, default: 2)

mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.SyntheticImageOptions, write_type: bool = False) str
todict(self: pycolmap.SyntheticImageOptions, recursive: bool = True) dict
pycolmap.synthesize_images(
options: pycolmap.SyntheticImageOptions,
reconstruction: pycolmap.Reconstruction,
image_path: os.PathLike | str | bytes,
) None
class pycolmap.PoseGraphEdge(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.PoseGraphEdge) None

  2. __init__(self: pycolmap.PoseGraphEdge, cam2_from_cam1: pycolmap.Rigid3d) None

  3. __init__(self: pycolmap.PoseGraphEdge, arg0: dict) None

  4. __init__(self: pycolmap.PoseGraphEdge, **kwargs) None

property cam2_from_cam1

Relative pose from image 1 to image 2. (Rigid3d, default: Rigid3d(rotation_xyzw=[0, 0, 0, 1], translation=[0, 0, 0]))

invert(self: pycolmap.PoseGraphEdge) None

Invert the geometry to match swapped image order.

mergedict(self: object, kwargs: dict) None
property num_matches

Number of two-view matches used to compute the relative pose. (int, default: 0)

summary(self: pycolmap.PoseGraphEdge, write_type: bool = False) str
todict(self: pycolmap.PoseGraphEdge, recursive: bool = True) dict
property valid

Whether this edge is valid for reconstruction. (bool, default: True)

class pycolmap.PoseGraphEdgeMap(self: pycolmap.PoseGraphEdgeMap)
items(self: pycolmap.PoseGraphEdgeMap) pycolmap.ItemsView
keys(self: pycolmap.PoseGraphEdgeMap) pycolmap.KeysView
values(self: pycolmap.PoseGraphEdgeMap) pycolmap.ValuesView
class pycolmap.PoseGraph(self: pycolmap.PoseGraph)
add_edge(
self: pycolmap.PoseGraph,
image_id1: SupportsInt,
image_id2: SupportsInt,
edge: pycolmap.PoseGraphEdge,
) pycolmap.PoseGraphEdge

Add a new edge between two images. Throws if edge already exists.

clear(self: pycolmap.PoseGraph) None

Remove all edges.

compute_largest_connected_frame_component(
self: pycolmap.PoseGraph,
reconstruction: pycolmap.Reconstruction,
filter_unregistered: bool = True,
) set[int]

Compute the largest connected component of frames. If filter_unregistered is True, only considers frames with poses.

delete_edge(self: pycolmap.PoseGraph, image_id1: SupportsInt, image_id2: SupportsInt) bool

Delete the edge between two images. Returns True if deleted.

property edges

Access to all edges in the pose graph.

property empty

Whether the pose graph has no edges.

get_edge(
self: pycolmap.PoseGraph,
image_id1: SupportsInt,
image_id2: SupportsInt,
) pycolmap.PoseGraphEdge

Get a copy of the edge between two images. Automatically handles geometric inversion if image order was swapped.

has_edge(self: pycolmap.PoseGraph, image_id1: SupportsInt, image_id2: SupportsInt) bool

Check if an edge exists between two images.

invalidate_pairs_outside_active_image_ids(
self: pycolmap.PoseGraph,
active_image_ids: collections.abc.Set[SupportsInt],
) None

Mark image pairs as invalid if either image is not in the active set.

is_valid(self: pycolmap.PoseGraph, pair_id: SupportsInt) bool

Check if an edge is marked as valid.

load(self: pycolmap.PoseGraph, corr_graph: pycolmap.CorrespondenceGraph) None

Load edges from a correspondence graph.

mark_connected_components(
self: pycolmap.PoseGraph,
reconstruction: pycolmap.Reconstruction,
min_num_images: SupportsInt = -1,
) dict

Mark connected clusters of images. Returns dict with num_components and cluster_ids mapping frame IDs to cluster IDs.

property num_edges

Number of edges in the pose graph.

set_invalid_edge(self: pycolmap.PoseGraph, pair_id: SupportsInt) None

Mark an edge as invalid.

set_valid_edge(self: pycolmap.PoseGraph, pair_id: SupportsInt) None

Mark an edge as valid.

update_edge(
self: pycolmap.PoseGraph,
image_id1: SupportsInt,
image_id2: SupportsInt,
edge: pycolmap.PoseGraphEdge,
) None

Update an existing edge. Throws if edge does not exist.

class pycolmap.UndistortCameraOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.UndistortCameraOptions) None

  2. __init__(self: pycolmap.UndistortCameraOptions, arg0: dict) None

  3. __init__(self: pycolmap.UndistortCameraOptions, **kwargs) None

property blank_pixels

(float, default: 0.0)

property max_image_size

(int, default: -1)

property max_scale

(float, default: 2.0)

mergedict(self: object, kwargs: dict) None
property min_scale

(float, default: 0.2)

property roi_max_x

(float, default: 1.0)

property roi_max_y

(float, default: 1.0)

property roi_min_x

(float, default: 0.0)

property roi_min_y

(float, default: 0.0)

summary(self: pycolmap.UndistortCameraOptions, write_type: bool = False) str
todict(self: pycolmap.UndistortCameraOptions, recursive: bool = True) dict
pycolmap.undistort_camera(options: pycolmap.UndistortCameraOptions, camera: pycolmap.Camera) pycolmap.Camera

Undistort camera.

pycolmap.undistort_image(
options: pycolmap.UndistortCameraOptions,
distorted_image: pycolmap.Bitmap,
distorted_camera: pycolmap.Camera,
) tuple[pycolmap.Bitmap, pycolmap.Camera]

Undistort image and corresponding camera.

class pycolmap.AbsolutePoseEstimationOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.AbsolutePoseEstimationOptions) None

  2. __init__(self: pycolmap.AbsolutePoseEstimationOptions, arg0: dict) None

  3. __init__(self: pycolmap.AbsolutePoseEstimationOptions, **kwargs) None

property estimate_focal_length

(bool, default: False)

mergedict(self: object, kwargs: dict) None
property ransac

(RANSACOptions, default: RANSACOptions(max_error=12.0, min_inlier_ratio=0.1, confidence=0.99999, dyn_num_trials_multiplier=3.0, min_num_trials=100, max_num_trials=10000, random_seed=-1))

summary(self: pycolmap.AbsolutePoseEstimationOptions, write_type: bool = False) str
todict(self: pycolmap.AbsolutePoseEstimationOptions, recursive: bool = True) dict
class pycolmap.AbsolutePoseRefinementOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.AbsolutePoseRefinementOptions) None

  2. __init__(self: pycolmap.AbsolutePoseRefinementOptions, arg0: dict) None

  3. __init__(self: pycolmap.AbsolutePoseRefinementOptions, **kwargs) None

property gradient_tolerance

(float, default: 1.0)

property loss_function_scale

(float, default: 1.0)

property max_num_iterations

(int, default: 100)

mergedict(self: object, kwargs: dict) None
property print_summary

(bool, default: False)

property refine_extra_params

(bool, default: False)

property refine_focal_length

(bool, default: False)

summary(self: pycolmap.AbsolutePoseRefinementOptions, write_type: bool = False) str
todict(self: pycolmap.AbsolutePoseRefinementOptions, recursive: bool = True) dict
pycolmap.estimate_absolute_pose(
points2D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points3D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
camera: pycolmap.Camera,
estimation_options: pycolmap.AbsolutePoseEstimationOptions = AbsolutePoseEstimationOptions(),
) dict | None

Robustly estimate absolute pose using LO-RANSAC without non-linear refinement.

pycolmap.refine_absolute_pose(
cam_from_world: pycolmap.Rigid3d,
points2D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points3D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
inlier_mask: Annotated[numpy.typing.ArrayLike, numpy.bool, '[m, 1]'],
camera: pycolmap.Camera,
refinement_options: pycolmap.AbsolutePoseRefinementOptions = AbsolutePoseRefinementOptions(),
return_covariance: bool = False,
) dict | None

Non-linear refinement of absolute pose.

pycolmap.estimate_and_refine_absolute_pose(
points2D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points3D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
camera: pycolmap.Camera,
estimation_options: pycolmap.AbsolutePoseEstimationOptions = AbsolutePoseEstimationOptions(),
refinement_options: pycolmap.AbsolutePoseRefinementOptions = AbsolutePoseRefinementOptions(),
return_covariance: bool = False,
) dict | None

Robust absolute pose estimation with LO-RANSAC followed by non-linear refinement.

pycolmap.estimate_relative_pose(
cam_rays1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
cam_rays2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
options: pycolmap.RANSACOptions = RANSACOptions(),
) dict | None

Robustly estimate relative pose using LO-RANSAC without non-linear refinement.

pycolmap.refine_relative_pose(
cam2_from_cam1: pycolmap.Rigid3d,
cam_rays1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
cam_rays2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
inlier_mask: Annotated[numpy.typing.ArrayLike, numpy.bool, '[m, 1]'],
options: pycolmap.pyceres.SolverOptions = SolverOptions(minimizer_type=MinimizerType.TRUST_REGION, line_search_direction_type=LineSearchDirectionType.LBFGS, line_search_type=LineSearchType.WOLFE, nonlinear_conjugate_gradient_type=NonlinearConjugateGradientType.FLETCHER_REEVES, max_lbfgs_rank=20, use_approximate_eigenvalue_bfgs_scaling=False, line_search_interpolation_type=LineSearchInterpolationType.CUBIC, min_line_search_step_size=1e-09, line_search_sufficient_function_decrease=0.0001, max_line_search_step_contraction=0.001, min_line_search_step_contraction=0.6, max_num_line_search_step_size_iterations=20, max_num_line_search_direction_restarts=5, line_search_sufficient_curvature_decrease=0.9, max_line_search_step_expansion=10.0, trust_region_strategy_type=TrustRegionStrategyType.LEVENBERG_MARQUARDT, dogleg_type=DoglegType.TRADITIONAL_DOGLEG, use_nonmonotonic_steps=False, max_consecutive_nonmonotonic_steps=5, max_num_iterations=50, max_solver_time_in_seconds=1000000000.0, num_threads=1, initial_trust_region_radius=10000.0, max_trust_region_radius=1e+16, min_trust_region_radius=1e-32, min_relative_decrease=0.001, min_lm_diagonal=1e-06, max_lm_diagonal=1e+32, max_num_consecutive_invalid_steps=5, function_tolerance=1e-06, gradient_tolerance=1e-10, parameter_tolerance=1e-08, linear_solver_type=LinearSolverType.SPARSE_NORMAL_CHOLESKY, preconditioner_type=PreconditionerType.JACOBI, visibility_clustering_type=VisibilityClusteringType.CANONICAL_VIEWS, dense_linear_algebra_library_type=DenseLinearAlgebraLibraryType.EIGEN, sparse_linear_algebra_library_type=SparseLinearAlgebraLibraryType.SUITE_SPARSE, use_explicit_schur_complement=False, dynamic_sparsity=False, use_inner_iterations=False, inner_iteration_tolerance=0.001, min_linear_solver_iterations=0, max_linear_solver_iterations=500, eta=0.1, jacobi_scaling=True, logging_type=LoggingType.PER_MINIMIZER_ITERATION, minimizer_progress_to_stdout=False, trust_region_problem_dump_directory='/tmp', trust_region_problem_dump_format_type=DumpFormatType.TEXTFILE, check_gradients=False, gradient_check_relative_precision=1e-08, gradient_check_numeric_derivative_relative_step_size=1e-06, update_state_every_iteration=False),
) dict | None

Non-linear refinement of relative pose.

pycolmap.estimate_affine2d(
src: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
tgt: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
) Annotated[numpy.typing.NDArray[numpy.float64], '[2, 3]'] | None

Estimate the 2D affine transform tgt_from_src.

pycolmap.estimate_affine2d_robust(
src: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
tgt: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
estimation_options: pycolmap.RANSACOptions = RANSACOptions(),
) dict | None

Robustly estimate the 2D affine transform tgt_from_src using LO-RANSAC.

class pycolmap.ImageAlignmentError(self: pycolmap.ImageAlignmentError)
property image_name
property proj_center_error
property rotation_error_deg
pycolmap.align_reconstructions_via_reprojections(
src_reconstruction: pycolmap.Reconstruction,
tgt_reconstruction: pycolmap.Reconstruction,
min_inlier_observations: SupportsFloat = 0.3,
max_reproj_error: SupportsFloat = 8.0,
) pycolmap.Sim3d | None
pycolmap.align_reconstructions_via_proj_centers(
src_reconstruction: pycolmap.Reconstruction,
tgt_reconstruction: pycolmap.Reconstruction,
max_proj_center_error: SupportsFloat,
) pycolmap.Sim3d | None
pycolmap.align_reconstructions_via_points(
src_reconstruction: pycolmap.Reconstruction,
tgt_reconstruction: pycolmap.Reconstruction,
min_common_observations: SupportsInt = 3,
max_error: SupportsFloat = 0.005,
min_inlier_ratio: SupportsFloat = 0.9,
) pycolmap.Sim3d | None
pycolmap.align_reconstruction_to_locations(
src: pycolmap.Reconstruction,
tgt_image_names: collections.abc.Sequence[str],
tgt_locations: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
min_common_images: SupportsInt,
ransac_options: pycolmap.RANSACOptions,
) pycolmap.Sim3d | None
pycolmap.compare_reconstructions(
reconstruction1: pycolmap.Reconstruction,
reconstruction2: pycolmap.Reconstruction,
alignment_error: str = 'reprojection',
min_inlier_observations: SupportsFloat = 0.3,
max_reproj_error: SupportsFloat = 8.0,
max_proj_center_error: SupportsFloat = 0.1,
) dict | None
pycolmap.align_reconstruction_to_orig_rig_scales(
orig_rigs: collections.abc.Mapping[SupportsInt, pycolmap.Rig],
reconstruction: pycolmap.Reconstruction,
) bool
class pycolmap.BundleAdjustmentTerminationType(*args, **kwargs)

Members:

CONVERGENCE

NO_CONVERGENCE

FAILURE

USER_SUCCESS

USER_FAILURE

Overloaded function.

  1. __init__(self: pycolmap.BundleAdjustmentTerminationType, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.BundleAdjustmentTerminationType, name: str) None

CONVERGENCE = BundleAdjustmentTerminationType.CONVERGENCE
FAILURE = BundleAdjustmentTerminationType.FAILURE
NO_CONVERGENCE = BundleAdjustmentTerminationType.NO_CONVERGENCE
USER_FAILURE = BundleAdjustmentTerminationType.USER_FAILURE
USER_SUCCESS = BundleAdjustmentTerminationType.USER_SUCCESS
BundleAdjustmentTerminationType.name -> str
property value
class pycolmap.BundleAdjustmentSummary(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.BundleAdjustmentSummary) None

  2. __init__(self: pycolmap.BundleAdjustmentSummary, arg0: dict) None

  3. __init__(self: pycolmap.BundleAdjustmentSummary, **kwargs) None

brief_report(self: pycolmap.BundleAdjustmentSummary) str
is_solution_usable(self: pycolmap.BundleAdjustmentSummary) bool
mergedict(self: object, kwargs: dict) None
property num_residuals

(int, default: 0) (int, default: 0)

summary(self: pycolmap.BundleAdjustmentSummary, write_type: bool = False) str
property termination_type

(BundleAdjustmentTerminationType, default: BundleAdjustmentTerminationType.FAILURE) (BundleAdjustmentTerminationType, default: BundleAdjustmentTerminationType.FAILURE)

todict(self: pycolmap.BundleAdjustmentSummary, recursive: bool = True) dict
class pycolmap.CeresBundleAdjustmentSummary(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.CeresBundleAdjustmentSummary) None

  2. __init__(self: pycolmap.CeresBundleAdjustmentSummary, arg0: dict) None

  3. __init__(self: pycolmap.CeresBundleAdjustmentSummary, **kwargs) None

property ceres_summary

Full Ceres solver summary. (SolverSummary, default: SolverSummary(minimizer_type=MinimizerType.TRUST_REGION, termination_type=TerminationType.FAILURE, message=’ceres::Solve was not called.’, initial_cost=-1.0, final_cost=-1.0, fixed_cost=-1.0, num_successful_steps=-1, num_unsuccessful_steps=-1, num_inner_iteration_steps=-1, num_line_search_steps=-1, preprocessor_time_in_seconds=-1.0, minimizer_time_in_seconds=-1.0, postprocessor_time_in_seconds=-1.0, total_time_in_seconds=-1.0, linear_solver_time_in_seconds=-1.0, num_linear_solves=-1, residual_evaluation_time_in_seconds=-1.0, num_residual_evaluations=-1, jacobian_evaluation_time_in_seconds=-1.0, num_jacobian_evaluations=-1, inner_iteration_time_in_seconds=-1.0, line_search_cost_evaluation_time_in_seconds=-1.0, line_search_gradient_evaluation_time_in_seconds=-1.0, line_search_polynomial_minimization_time_in_seconds=-1.0, line_search_total_time_in_seconds=-1.0, num_parameter_blocks=-1, num_parameters=-1, num_effective_parameters=-1, num_residual_blocks=-1, num_residuals=-1, num_parameter_blocks_reduced=-1, num_parameters_reduced=-1, num_effective_parameters_reduced=-1, num_residual_blocks_reduced=-1, num_residuals_reduced=-1, is_constrained=False, num_threads_given=-1, num_threads_used=-1, linear_solver_type_given=LinearSolverType.SPARSE_NORMAL_CHOLESKY, linear_solver_type_used=LinearSolverType.SPARSE_NORMAL_CHOLESKY, schur_structure_given=’’, schur_structure_used=’’, inner_iterations_given=False, inner_iterations_used=False, preconditioner_type_given=PreconditionerType.IDENTITY, preconditioner_type_used=PreconditionerType.IDENTITY, visibility_clustering_type=VisibilityClusteringType.CANONICAL_VIEWS, trust_region_strategy_type=TrustRegionStrategyType.LEVENBERG_MARQUARDT, dogleg_type=DoglegType.TRADITIONAL_DOGLEG, dense_linear_algebra_library_type=DenseLinearAlgebraLibraryType.EIGEN, sparse_linear_algebra_library_type=SparseLinearAlgebraLibraryType.NO_SPARSE, line_search_direction_type=LineSearchDirectionType.LBFGS, line_search_type=LineSearchType.WOLFE, line_search_interpolation_type=LineSearchInterpolationType.CUBIC, nonlinear_conjugate_gradient_type=NonlinearConjugateGradientType.FLETCHER_REEVES, max_lbfgs_rank=-1))

mergedict(self: object, kwargs: dict) None
todict(self: pycolmap.CeresBundleAdjustmentSummary, recursive: bool = True) dict
class pycolmap.BundleAdjustmentGauge(*args, **kwargs)

Members:

UNSPECIFIED

TWO_CAMS_FROM_WORLD

THREE_POINTS

Overloaded function.

  1. __init__(self: pycolmap.BundleAdjustmentGauge, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.BundleAdjustmentGauge, name: str) None

THREE_POINTS = BundleAdjustmentGauge.THREE_POINTS
TWO_CAMS_FROM_WORLD = BundleAdjustmentGauge.TWO_CAMS_FROM_WORLD
UNSPECIFIED = BundleAdjustmentGauge.UNSPECIFIED
BundleAdjustmentGauge.name -> str
property value
class pycolmap.BundleAdjustmentBackend(*args, **kwargs)

Members:

CERES

Overloaded function.

  1. __init__(self: pycolmap.BundleAdjustmentBackend, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.BundleAdjustmentBackend, name: str) None

CERES = BundleAdjustmentBackend.CERES
BundleAdjustmentBackend.name -> str
property value
class pycolmap.BundleAdjustmentConfig(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.BundleAdjustmentConfig) None

  2. __init__(self: pycolmap.BundleAdjustmentConfig, arg0: dict) None

  3. __init__(self: pycolmap.BundleAdjustmentConfig, **kwargs) None

add_constant_point(self: pycolmap.BundleAdjustmentConfig, point3D_id: SupportsInt) None
add_image(self: pycolmap.BundleAdjustmentConfig, image_id: SupportsInt) None
add_variable_point(self: pycolmap.BundleAdjustmentConfig, point3D_id: SupportsInt) None
property constant_cam_intrinsics

(set, default: set())

property constant_points

(set, default: set())

property constant_rig_from_world_poses

(set, default: set())

property constant_sensor_from_rig_poses

(set, default: set())

fix_gauge(self: pycolmap.BundleAdjustmentConfig, arg0: pycolmap.BundleAdjustmentGauge) None
property fixed_gauge

(BundleAdjustmentGauge, default: BundleAdjustmentGauge.UNSPECIFIED)

has_constant_cam_intrinsics(
self: pycolmap.BundleAdjustmentConfig,
camera_id: SupportsInt,
) bool
has_constant_point(self: pycolmap.BundleAdjustmentConfig, point3D_id: SupportsInt) bool
has_constant_rig_from_world_pose(
self: pycolmap.BundleAdjustmentConfig,
frame_id: SupportsInt,
) bool
has_constant_sensor_from_rig_pose(
self: pycolmap.BundleAdjustmentConfig,
sensor_id: pycolmap.sensor_t,
) bool
has_image(self: pycolmap.BundleAdjustmentConfig, image_id: SupportsInt) bool
has_point(self: pycolmap.BundleAdjustmentConfig, point3D_id: SupportsInt) bool
has_variable_point(self: pycolmap.BundleAdjustmentConfig, point3D_id: SupportsInt) bool
property images

(set, default: set())

mergedict(self: object, kwargs: dict) None
num_constant_cam_intrinsics(self: pycolmap.BundleAdjustmentConfig) int
num_constant_points(self: pycolmap.BundleAdjustmentConfig) int
num_constant_rig_from_world_poses(self: pycolmap.BundleAdjustmentConfig) int
num_constant_sensor_from_rig_poses(self: pycolmap.BundleAdjustmentConfig) int
num_points(self: pycolmap.BundleAdjustmentConfig) int
num_residuals(
self: pycolmap.BundleAdjustmentConfig,
reconstruction: pycolmap.Reconstruction,
) int
num_variable_points(self: pycolmap.BundleAdjustmentConfig) int
remove_constant_point(
self: pycolmap.BundleAdjustmentConfig,
point3D_id: SupportsInt,
) None
remove_image(self: pycolmap.BundleAdjustmentConfig, image_id: SupportsInt) None
remove_variable_point(
self: pycolmap.BundleAdjustmentConfig,
point3D_id: SupportsInt,
) None
set_constant_cam_intrinsics(
self: pycolmap.BundleAdjustmentConfig,
camera_id: SupportsInt,
) None
set_constant_rig_from_world_pose(
self: pycolmap.BundleAdjustmentConfig,
frame_id: SupportsInt,
) None
set_constant_sensor_from_rig_pose(
self: pycolmap.BundleAdjustmentConfig,
sensor_id: pycolmap.sensor_t,
) None
set_variable_cam_intrinsics(
self: pycolmap.BundleAdjustmentConfig,
camera_id: SupportsInt,
) None
set_variable_rig_from_world_pose(
self: pycolmap.BundleAdjustmentConfig,
frame_id: SupportsInt,
) None
set_variable_sensor_from_rig_pose(
self: pycolmap.BundleAdjustmentConfig,
sensor_id: pycolmap.sensor_t,
) None
summary(self: pycolmap.BundleAdjustmentConfig, write_type: bool = False) str
todict(self: pycolmap.BundleAdjustmentConfig, recursive: bool = True) dict
property variable_points

(set, default: set())

class pycolmap.LossFunctionType(*args, **kwargs)

Members:

TRIVIAL

SOFT_L1

CAUCHY

HUBER

Overloaded function.

  1. __init__(self: pycolmap.LossFunctionType, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.LossFunctionType, name: str) None

CAUCHY = LossFunctionType.CAUCHY
HUBER = LossFunctionType.HUBER
SOFT_L1 = LossFunctionType.SOFT_L1
TRIVIAL = LossFunctionType.TRIVIAL
LossFunctionType.name -> str
property value
class pycolmap.CeresBundleAdjustmentOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.CeresBundleAdjustmentOptions) None

  2. __init__(self: pycolmap.CeresBundleAdjustmentOptions, arg0: dict) None

  3. __init__(self: pycolmap.CeresBundleAdjustmentOptions, **kwargs) None

property auto_select_solver_type

Whether to automatically select solver type based on problem size. When False, uses the linear_solver_type and preconditioner_type from solver_options directly. (bool, default: True)

check(self: pycolmap.CeresBundleAdjustmentOptions) bool
create_loss_function(self: pycolmap.CeresBundleAdjustmentOptions) ceres::LossFunction
create_solver_options(
self: pycolmap.CeresBundleAdjustmentOptions,
config: pycolmap.BundleAdjustmentConfig,
problem: ceres::Problem,
) pycolmap.pyceres.SolverOptions
property gpu_index

Which GPU to use for solving the problem. (str, default: -1)

property loss_function_scale

Scaling factor determines residual at which robustification takes place. (float, default: 1.0)

property loss_function_type

Loss function types: Trivial (non-robust) and Cauchy (robust) loss. (LossFunctionType, default: LossFunctionType.TRIVIAL)

property max_num_images_direct_dense_cpu_solver

Threshold to switch between direct, sparse, and iterative solvers. (int, default: 50)

property max_num_images_direct_dense_gpu_solver

Threshold to switch between direct, sparse, and iterative solvers. (int, default: 200)

property max_num_images_direct_sparse_cpu_solver

Threshold to switch between direct, sparse, and iterative solvers. (int, default: 1000)

property max_num_images_direct_sparse_gpu_solver

Threshold to switch between direct, sparse, and iterative solvers. (int, default: 4000)

mergedict(self: object, kwargs: dict) None
property min_num_images_gpu_solver

Minimum number of images to use the GPU solver. (int, default: 50)

property min_num_residuals_for_cpu_multi_threading

Minimum number of residuals to enable multi-threading. Note that single-threaded is typically better for small bundle adjustment problems due to the overhead of threading. (int, default: 50000)

property solver_options

Options for the Ceres solver. Using this member requires having PyCeres installed. (SolverOptions, default: SolverOptions(minimizer_type=MinimizerType.TRUST_REGION, line_search_direction_type=LineSearchDirectionType.LBFGS, line_search_type=LineSearchType.WOLFE, nonlinear_conjugate_gradient_type=NonlinearConjugateGradientType.FLETCHER_REEVES, max_lbfgs_rank=20, use_approximate_eigenvalue_bfgs_scaling=False, line_search_interpolation_type=LineSearchInterpolationType.CUBIC, min_line_search_step_size=1e-09, line_search_sufficient_function_decrease=0.0001, max_line_search_step_contraction=0.001, min_line_search_step_contraction=0.6, max_num_line_search_step_size_iterations=20, max_num_line_search_direction_restarts=5, line_search_sufficient_curvature_decrease=0.9, max_line_search_step_expansion=10.0, trust_region_strategy_type=TrustRegionStrategyType.LEVENBERG_MARQUARDT, dogleg_type=DoglegType.TRADITIONAL_DOGLEG, use_nonmonotonic_steps=False, max_consecutive_nonmonotonic_steps=10, max_num_iterations=100, max_solver_time_in_seconds=1000000000.0, num_threads=-1, initial_trust_region_radius=10000.0, max_trust_region_radius=1e+16, min_trust_region_radius=1e-32, min_relative_decrease=0.001, min_lm_diagonal=1e-06, max_lm_diagonal=1e+32, max_num_consecutive_invalid_steps=10, function_tolerance=0.0, gradient_tolerance=0.0001, parameter_tolerance=0.0, linear_solver_type=LinearSolverType.SPARSE_NORMAL_CHOLESKY, preconditioner_type=PreconditionerType.JACOBI, visibility_clustering_type=VisibilityClusteringType.CANONICAL_VIEWS, dense_linear_algebra_library_type=DenseLinearAlgebraLibraryType.EIGEN, sparse_linear_algebra_library_type=SparseLinearAlgebraLibraryType.SUITE_SPARSE, use_explicit_schur_complement=False, dynamic_sparsity=False, use_inner_iterations=False, inner_iteration_tolerance=0.001, min_linear_solver_iterations=0, max_linear_solver_iterations=200, eta=0.1, jacobi_scaling=True, logging_type=LoggingType.SILENT, minimizer_progress_to_stdout=False, trust_region_problem_dump_directory=’/tmp’, trust_region_problem_dump_format_type=DumpFormatType.TEXTFILE, check_gradients=False, gradient_check_relative_precision=1e-08, gradient_check_numeric_derivative_relative_step_size=1e-06, update_state_every_iteration=False))

summary(self: pycolmap.CeresBundleAdjustmentOptions, write_type: bool = False) str
todict(self: pycolmap.CeresBundleAdjustmentOptions, recursive: bool = True) dict
property use_gpu

Whether to use Ceres’ CUDA linear algebra library, if available. (bool, default: False)

class pycolmap.BundleAdjustmentOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.BundleAdjustmentOptions) None

  2. __init__(self: pycolmap.BundleAdjustmentOptions, arg0: dict) None

  3. __init__(self: pycolmap.BundleAdjustmentOptions, **kwargs) None

property backend

Solver backend to use for bundle adjustment. (BundleAdjustmentBackend, default: BundleAdjustmentBackend.CERES)

property ceres

Ceres-specific bundle adjustment options. (CeresBundleAdjustmentOptions, default: CeresBundleAdjustmentOptions(loss_function_type=LossFunctionType.TRIVIAL, loss_function_scale=1.0, use_gpu=False, gpu_index=’-1’, solver_options=SolverOptions(minimizer_type=MinimizerType.TRUST_REGION, line_search_direction_type=LineSearchDirectionType.LBFGS, line_search_type=LineSearchType.WOLFE, nonlinear_conjugate_gradient_type=NonlinearConjugateGradientType.FLETCHER_REEVES, max_lbfgs_rank=20, use_approximate_eigenvalue_bfgs_scaling=False, line_search_interpolation_type=LineSearchInterpolationType.CUBIC, min_line_search_step_size=1e-09, line_search_sufficient_function_decrease=0.0001, max_line_search_step_contraction=0.001, min_line_search_step_contraction=0.6, max_num_line_search_step_size_iterations=20, max_num_line_search_direction_restarts=5, line_search_sufficient_curvature_decrease=0.9, max_line_search_step_expansion=10.0, trust_region_strategy_type=TrustRegionStrategyType.LEVENBERG_MARQUARDT, dogleg_type=DoglegType.TRADITIONAL_DOGLEG, use_nonmonotonic_steps=False, max_consecutive_nonmonotonic_steps=10, max_num_iterations=100, max_solver_time_in_seconds=1000000000.0, num_threads=-1, initial_trust_region_radius=10000.0, max_trust_region_radius=1e+16, min_trust_region_radius=1e-32, min_relative_decrease=0.001, min_lm_diagonal=1e-06, max_lm_diagonal=1e+32, max_num_consecutive_invalid_steps=10, function_tolerance=0.0, gradient_tolerance=0.0001, parameter_tolerance=0.0, linear_solver_type=LinearSolverType.SPARSE_NORMAL_CHOLESKY, preconditioner_type=PreconditionerType.JACOBI, visibility_clustering_type=VisibilityClusteringType.CANONICAL_VIEWS, dense_linear_algebra_library_type=DenseLinearAlgebraLibraryType.EIGEN, sparse_linear_algebra_library_type=SparseLinearAlgebraLibraryType.SUITE_SPARSE, use_explicit_schur_complement=False, dynamic_sparsity=False, use_inner_iterations=False, inner_iteration_tolerance=0.001, min_linear_solver_iterations=0, max_linear_solver_iterations=200, eta=0.1, jacobi_scaling=True, logging_type=LoggingType.SILENT, minimizer_progress_to_stdout=False, trust_region_problem_dump_directory=’/tmp’, trust_region_problem_dump_format_type=DumpFormatType.TEXTFILE, check_gradients=False, gradient_check_relative_precision=1e-08, gradient_check_numeric_derivative_relative_step_size=1e-06, update_state_every_iteration=False), min_num_images_gpu_solver=50, min_num_residuals_for_cpu_multi_threading=50000, max_num_images_direct_dense_cpu_solver=50, max_num_images_direct_sparse_cpu_solver=1000, max_num_images_direct_dense_gpu_solver=200, max_num_images_direct_sparse_gpu_solver=4000, auto_select_solver_type=True))

check(self: pycolmap.BundleAdjustmentOptions) bool
property constant_rig_from_world_rotation

Whether to keep the rotation component of rig_from_world constant. Only takes effect when refine_rig_from_world is true. (bool, default: False)

mergedict(self: object, kwargs: dict) None
property min_track_length

Minimum track length for a 3D point. (int, default: 0)

property print_summary

Whether to print a final summary. (bool, default: True)

property refine_extra_params

Whether to refine the extra parameter group. (bool, default: True)

property refine_focal_length

Whether to refine the focal length parameter group. (bool, default: True)

property refine_points3D

Whether to refine 3D points. (bool, default: True)

property refine_principal_point

Whether to refine the principal point parameter group. (bool, default: False)

property refine_rig_from_world

Whether to refine the frame from world extrinsic parameter group. (bool, default: True)

property refine_sensor_from_rig

Whether to refine the sensor from rig extrinsic parameter group. (bool, default: True)

summary(self: pycolmap.BundleAdjustmentOptions, write_type: bool = False) str
todict(self: pycolmap.BundleAdjustmentOptions, recursive: bool = True) dict
class pycolmap.CeresPosePriorBundleAdjustmentOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.CeresPosePriorBundleAdjustmentOptions) None

  2. __init__(self: pycolmap.CeresPosePriorBundleAdjustmentOptions, arg0: dict) None

  3. __init__(self: pycolmap.CeresPosePriorBundleAdjustmentOptions, **kwargs) None

check(self: pycolmap.CeresPosePriorBundleAdjustmentOptions) bool
mergedict(self: object, kwargs: dict) None
property prior_position_loss_function_type

Loss function for prior position loss. (LossFunctionType, default: LossFunctionType.TRIVIAL)

property prior_position_loss_scale

Threshold on the residual for the robust loss (chi2 for 3DOF at 95% = 7.815). (float, default: 2.7954834829151074)

summary(
self: pycolmap.CeresPosePriorBundleAdjustmentOptions,
write_type: bool = False,
) str
todict(
self: pycolmap.CeresPosePriorBundleAdjustmentOptions,
recursive: bool = True,
) dict
class pycolmap.PosePriorBundleAdjustmentOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.PosePriorBundleAdjustmentOptions) None

  2. __init__(self: pycolmap.PosePriorBundleAdjustmentOptions, arg0: dict) None

  3. __init__(self: pycolmap.PosePriorBundleAdjustmentOptions, **kwargs) None

property alignment_ransac

RANSAC options for Sim3 alignment. (RANSACOptions, default: RANSACOptions(max_error=0.0, min_inlier_ratio=0.1, confidence=0.99, dyn_num_trials_multiplier=3.0, min_num_trials=0, max_num_trials=2147483647, random_seed=-1))

property ceres

Ceres-specific pose prior bundle adjustment options. (CeresPosePriorBundleAdjustmentOptions, default: CeresPosePriorBundleAdjustmentOptions(prior_position_loss_function_type=LossFunctionType.TRIVIAL, prior_position_loss_scale=2.7954834829151074))

check(self: pycolmap.PosePriorBundleAdjustmentOptions) bool
mergedict(self: object, kwargs: dict) None
property prior_position_fallback_stddev

Fallback if no prior position covariance is provided. (float, default: 1.0)

summary(
self: pycolmap.PosePriorBundleAdjustmentOptions,
write_type: bool = False,
) str
todict(self: pycolmap.PosePriorBundleAdjustmentOptions, recursive: bool = True) dict
class pycolmap.BundleAdjuster(
self: pycolmap.BundleAdjuster,
options: pycolmap.BundleAdjustmentOptions,
config: pycolmap.BundleAdjustmentConfig,
)
property config
property options
solve(self: pycolmap.BundleAdjuster) pycolmap.BundleAdjustmentSummary
class pycolmap.CeresBundleAdjuster(
self: pycolmap.CeresBundleAdjuster,
options: pycolmap.BundleAdjustmentOptions,
config: pycolmap.BundleAdjustmentConfig,
)
property problem
pycolmap.create_default_bundle_adjuster(
options: pycolmap.BundleAdjustmentOptions,
config: pycolmap.BundleAdjustmentConfig,
reconstruction: pycolmap.Reconstruction,
) pycolmap.BundleAdjuster
pycolmap.create_default_ceres_bundle_adjuster(
options: pycolmap.BundleAdjustmentOptions,
config: pycolmap.BundleAdjustmentConfig,
reconstruction: pycolmap.Reconstruction,
) pycolmap.BundleAdjuster
pycolmap.create_pose_prior_bundle_adjuster(
options: pycolmap.BundleAdjustmentOptions,
prior_options: pycolmap.PosePriorBundleAdjustmentOptions,
config: pycolmap.BundleAdjustmentConfig,
pose_priors: collections.abc.Sequence[pycolmap.PosePrior],
reconstruction: pycolmap.Reconstruction,
) pycolmap.BundleAdjuster
pycolmap.create_pose_prior_ceres_bundle_adjuster(
options: pycolmap.BundleAdjustmentOptions,
prior_options: pycolmap.PosePriorBundleAdjustmentOptions,
config: pycolmap.BundleAdjustmentConfig,
pose_priors: collections.abc.Sequence[pycolmap.PosePrior],
reconstruction: pycolmap.Reconstruction,
) pycolmap.BundleAdjuster
class pycolmap.BACovarianceOptionsParams(*args, **kwargs)

Members:

POSES

POINTS

POSES_AND_POINTS

ALL

Overloaded function.

  1. __init__(self: pycolmap.BACovarianceOptionsParams, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.BACovarianceOptionsParams, name: str) None

ALL = BACovarianceOptionsParams.ALL
POINTS = BACovarianceOptionsParams.POINTS
POSES = BACovarianceOptionsParams.POSES
POSES_AND_POINTS = BACovarianceOptionsParams.POSES_AND_POINTS
BACovarianceOptionsParams.name -> str
property value
class pycolmap.ExperimentalPoseParam(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.ExperimentalPoseParam) None

  2. __init__(self: pycolmap.ExperimentalPoseParam, arg0: dict) None

  3. __init__(self: pycolmap.ExperimentalPoseParam, **kwargs) None

property cam_from_world

(NoneType, default: None)

property image_id

(int, default: 4294967295)

mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.ExperimentalPoseParam, write_type: bool = False) str
todict(self: pycolmap.ExperimentalPoseParam, recursive: bool = True) dict
class pycolmap.BACovarianceOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.BACovarianceOptions) None

  2. __init__(self: pycolmap.BACovarianceOptions, arg0: dict) None

  3. __init__(self: pycolmap.BACovarianceOptions, **kwargs) None

property damping

Damping factor for the Hessian in the Schur complement solver. Enables to robustly deal with poorly conditioned parameters. (float, default: 1e-08)

property experimental_custom_poses

WARNING: This option will be removed in a future release, use at your own risk. For custom bundle adjustment problems, this enables to specify a custom set of pose parameter blocks to consider. Note that these pose blocks must not necessarily be part of the reconstruction but they must follow the standard requirement for applying the Schur complement trick. (list, default: [])

mergedict(self: object, kwargs: dict) None
property params

For which parameters to compute the covariance. (BACovarianceOptionsParams, default: BACovarianceOptionsParams.ALL)

summary(self: pycolmap.BACovarianceOptions, write_type: bool = False) str
todict(self: pycolmap.BACovarianceOptions, recursive: bool = True) dict
class pycolmap.BACovariance
get_cam2_cov_from_cam1(
self: pycolmap.BACovariance,
image_id1: SupportsInt,
cam1_from_world: pycolmap.Rigid3d,
image_id2: SupportsInt,
cam2_from_world: pycolmap.Rigid3d,
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]'] | None

Get relative pose covariance in the order [rotation, translation]. This function returns null if some dimensions are kept constant for either of the two poses. This does not mean that one cannot get relative pose covariance for such case, but requires custom logic to fill in zero block in the covariance matrix.

get_cam_cov_from_world(
self: pycolmap.BACovariance,
image_id: SupportsInt,
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]'] | None

Tangent space covariance in the order [rotation, translation]. If some dimensions are kept constant, the respective rows/columns are omitted. Returns null if image is not a variable in the problem.

get_cam_cross_cov_from_world(
self: pycolmap.BACovariance,
image_id1: SupportsInt,
image_id2: SupportsInt,
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]'] | None

Tangent space covariance in the order [rotation, translation]. If some dimensions are kept constant, the respective rows/columns are omitted. Returns null if image is not a variable in the problem.

get_other_params_cov(
self: pycolmap.BACovariance,
param: Annotated[numpy.typing.ArrayLike, numpy.float64],
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]'] | None

Tangent space covariance for any variable parameter block in the problem. If some dimensions are kept constant, the respective rows/columns are omitted. Returns null if parameter block not a variable in the problem.

get_point_cov(
self: pycolmap.BACovariance,
point3D_id: SupportsInt,
) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]'] | None

Covariance for 3D points, conditioned on all other variables set constant. If some dimensions are kept constant, the respective rows/columns are omitted. Returns null if 3D point not a variable in the problem.

pycolmap.estimate_ba_covariance(
options: pycolmap.BACovarianceOptions,
reconstruction: pycolmap.Reconstruction,
bundle_adjuster: pycolmap.CeresBundleAdjuster,
) pycolmap.BACovariance | None

Computes covariances for the parameters in a bundle adjustment problem. It is important that the problem has a structure suitable for solving using the Schur complement trick. This is the case for the standard configuration of bundle adjustment problems, but be careful if you modify the underlying problem with custom residuals. Returns null if the estimation was not successful.

pycolmap.estimate_ba_covariance_from_problem(
options: pycolmap.BACovarianceOptions,
reconstruction: pycolmap.Reconstruction,
problem: ceres::Problem,
) pycolmap.BACovariance | None

Computes covariances for the parameters in a bundle adjustment problem. It is important that the problem has a structure suitable for solving using the Schur complement trick. This is the case for the standard configuration of bundle adjustment problems, but be careful if you modify the underlying problem with custom residuals. Returns null if the estimation was not successful.

pycolmap.estimate_essential_matrix(
points2D1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points2D2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
camera1: pycolmap.Camera,
camera2: pycolmap.Camera,
estimation_options: pycolmap.RANSACOptions = RANSACOptions(),
) dict | None

Robustly estimate essential matrix with LO-RANSAC and decompose it using the cheirality check.

pycolmap.estimate_fundamental_matrix(
points2D1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points2D2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
estimation_options: pycolmap.RANSACOptions = RANSACOptions(),
) dict | None

Robustly estimate fundamental matrix with LO-RANSAC.

pycolmap.estimate_generalized_absolute_pose(
points2D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points3D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
camera_idxs: collections.abc.Sequence[SupportsInt],
cams_from_rig: collections.abc.Sequence[pycolmap.Rigid3d],
cameras: collections.abc.Sequence[pycolmap.Camera],
estimation_options: pycolmap.RANSACOptions = RANSACOptions(),
) dict | None
pycolmap.refine_generalized_absolute_pose(
rig_from_world: pycolmap.Rigid3d,
points2D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points3D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
inlier_mask: Annotated[numpy.typing.ArrayLike, numpy.bool, '[m, 1]'],
camera_idxs: collections.abc.Sequence[SupportsInt],
cams_from_rig: collections.abc.Sequence[pycolmap.Rigid3d],
cameras: collections.abc.Sequence[pycolmap.Camera],
refinement_options: pycolmap.AbsolutePoseRefinementOptions = AbsolutePoseRefinementOptions(),
return_covariance: bool = False,
) dict | None

Robustly estimate generalized absolute pose using LO-RANSACfollowed by non-linear refinement.

pycolmap.estimate_and_refine_generalized_absolute_pose(
points2D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points3D: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
camera_idxs: collections.abc.Sequence[SupportsInt],
cams_from_rig: collections.abc.Sequence[pycolmap.Rigid3d],
cameras: collections.abc.Sequence[pycolmap.Camera],
estimation_options: pycolmap.RANSACOptions = RANSACOptions(),
refinement_options: pycolmap.AbsolutePoseRefinementOptions = AbsolutePoseRefinementOptions(),
return_covariance: bool = False,
) dict | None

Robustly estimate generalized absolute pose using LO-RANSACfollowed by non-linear refinement.

pycolmap.estimate_generalized_relative_pose(
points2D1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points2D2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
camera_idxs1: collections.abc.Sequence[SupportsInt],
camera_idxs2: collections.abc.Sequence[SupportsInt],
cams_from_rig: collections.abc.Sequence[pycolmap.Rigid3d],
cameras: collections.abc.Sequence[pycolmap.Camera],
estimation_options: pycolmap.RANSACOptions = RANSACOptions(),
) dict | None
pycolmap.estimate_homography_matrix(
points2D1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points2D2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
estimation_options: pycolmap.RANSACOptions = RANSACOptions(),
) dict | None

Robustly estimate homography matrix using LO-RANSAC.

pycolmap.estimate_rigid3d(
src: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
tgt: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
) pycolmap.Rigid3d | None

Estimate the 3D rigid transform tgt_from_src.

pycolmap.estimate_rigid3d_robust(
src: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
tgt: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
estimation_options: pycolmap.RANSACOptions = RANSACOptions(),
) pycolmap.Rigid3d | None

Robustly estimate the 3D rigid transform tgt_from_src using LO-RANSAC.

pycolmap.estimate_sim3d(
src: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
tgt: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
) pycolmap.Sim3d | None

Estimate the 3D similarity transform tgt_from_src.

pycolmap.estimate_sim3d_robust(
src: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
tgt: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 3]'],
estimation_options: pycolmap.RANSACOptions = RANSACOptions(),
) pycolmap.Sim3d | None

Robustly estimate the 3D similarity transform tgt_from_src using LO-RANSAC.

class pycolmap.TriangulationResidualType(*args, **kwargs)

Members:

ANGULAR_ERROR

REPROJECTION_ERROR

Overloaded function.

  1. __init__(self: pycolmap.TriangulationResidualType, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.TriangulationResidualType, name: str) None

ANGULAR_ERROR = TriangulationResidualType.ANGULAR_ERROR
REPROJECTION_ERROR = TriangulationResidualType.REPROJECTION_ERROR
TriangulationResidualType.name -> str
property value
class pycolmap.EstimateTriangulationOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.EstimateTriangulationOptions) None

  2. __init__(self: pycolmap.EstimateTriangulationOptions, arg0: dict) None

  3. __init__(self: pycolmap.EstimateTriangulationOptions, **kwargs) None

mergedict(self: object, kwargs: dict) None
property min_tri_angle

Minimum triangulation angle in radians. (float, default: 0.0)

property ransac

RANSAC options. (RANSACOptions, default: RANSACOptions(max_error=0.03490658503988659, min_inlier_ratio=0.02, confidence=0.9999, dyn_num_trials_multiplier=3.0, min_num_trials=0, max_num_trials=10000, random_seed=-1))

property residual_type

Employed residual type. (TriangulationResidualType, default: TriangulationResidualType.ANGULAR_ERROR)

summary(self: pycolmap.EstimateTriangulationOptions, write_type: bool = False) str
todict(self: pycolmap.EstimateTriangulationOptions, recursive: bool = True) dict
pycolmap.estimate_triangulation(
points: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
cams_from_world: collections.abc.Sequence[pycolmap.Rigid3d],
cameras: collections.abc.Sequence[pycolmap.Camera],
options: pycolmap.EstimateTriangulationOptions = EstimateTriangulationOptions(),
) dict | None

Robustly estimate 3D point from observations in multiple views using LO-RANSAC

class pycolmap.TwoViewGeometryOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.TwoViewGeometryOptions) None

  2. __init__(self: pycolmap.TwoViewGeometryOptions, arg0: dict) None

  3. __init__(self: pycolmap.TwoViewGeometryOptions, **kwargs) None

property compute_relative_pose

(bool, default: False)

property detect_watermark

(bool, default: True)

property filter_stationary_matches

(bool, default: False)

property force_H_use

(bool, default: False)

property max_H_inlier_ratio

(float, default: 0.8)

mergedict(self: object, kwargs: dict) None
property min_E_F_inlier_ratio

(float, default: 0.95)

property min_inlier_ratio

(float, default: 0.0)

property min_num_inliers

(int, default: 15)

property multiple_ignore_watermark

(bool, default: True)

property multiple_models

(bool, default: False)

property ransac

(RANSACOptions, default: RANSACOptions(max_error=4.0, min_inlier_ratio=0.25, confidence=0.999, dyn_num_trials_multiplier=3.0, min_num_trials=100, max_num_trials=10000, random_seed=-1))

property stationary_matches_max_error

(float, default: 4.0)

summary(self: pycolmap.TwoViewGeometryOptions, write_type: bool = False) str
todict(self: pycolmap.TwoViewGeometryOptions, recursive: bool = True) dict
property watermark_border_size

(float, default: 0.1)

property watermark_detection_max_error

(float, default: 4.0)

property watermark_min_inlier_ratio

(float, default: 0.7)

pycolmap.estimate_calibrated_two_view_geometry(
camera1: pycolmap.Camera,
points1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
camera2: pycolmap.Camera,
points2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
matches: Annotated[numpy.typing.ArrayLike, numpy.uint32, '[m, 2]'] = None,
options: pycolmap.TwoViewGeometryOptions = TwoViewGeometryOptions(),
) pycolmap.TwoViewGeometry
pycolmap.estimate_two_view_geometry(
camera1: pycolmap.Camera,
points1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
camera2: pycolmap.Camera,
points2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
matches: Annotated[numpy.typing.ArrayLike, numpy.uint32, '[m, 2]'] = None,
options: pycolmap.TwoViewGeometryOptions = TwoViewGeometryOptions(),
) pycolmap.TwoViewGeometry
pycolmap.estimate_two_view_geometry_pose(
camera1: pycolmap.Camera,
points1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
camera2: pycolmap.Camera,
points2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
geometry: pycolmap.TwoViewGeometry,
) bool
pycolmap.compute_squared_sampson_error(
points2D1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
points2D2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 2]'],
E: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 3]'],
) list[float]

Calculate the squared Sampson error for a given essential or fundamental matrix.

class pycolmap.GravityRefinerOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.GravityRefinerOptions) None

  2. __init__(self: pycolmap.GravityRefinerOptions, arg0: dict) None

  3. __init__(self: pycolmap.GravityRefinerOptions, **kwargs) None

property max_gravity_error

Maximum allowed angle error in degrees. (float, default: 1.0)

property max_outlier_ratio

Maximum ratio that gravity should be consistent with. (float, default: 0.5)

mergedict(self: object, kwargs: dict) None
property min_num_neighbors

Minimum neighbors required for refinement. (int, default: 7)

summary(self: pycolmap.GravityRefinerOptions, write_type: bool = False) str
todict(self: pycolmap.GravityRefinerOptions, recursive: bool = True) dict
pycolmap.run_gravity_refinement(
options: pycolmap.GravityRefinerOptions,
pose_graph: pycolmap.PoseGraph,
reconstruction: pycolmap.Reconstruction,
pose_priors: collections.abc.Sequence[pycolmap.PosePrior],
) None

Refine gravity stored in pose priors using relative rotations from the pose graph. Modifies pose_priors in-place.

class pycolmap.RotationWeightType(*args, **kwargs)

Members:

GEMAN_MCCLURE

HALF_NORM

Overloaded function.

  1. __init__(self: pycolmap.RotationWeightType, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.RotationWeightType, name: str) None

GEMAN_MCCLURE = RotationWeightType.GEMAN_MCCLURE
HALF_NORM = RotationWeightType.HALF_NORM
RotationWeightType.name -> str
property value
class pycolmap.RotationEstimatorOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.RotationEstimatorOptions) None

  2. __init__(self: pycolmap.RotationEstimatorOptions, arg0: dict) None

  3. __init__(self: pycolmap.RotationEstimatorOptions, **kwargs) None

property filter_unregistered

Only consider frames with existing poses for connected components. (bool, default: False)

property gravity_dir

Gravity direction vector. (ndarray, default: [0. 1. 0.])

property irls_loss_parameter_sigma

Point where Huber-like cost switches from L1 to L2 (degrees). (float, default: 5.0)

property irls_step_convergence_threshold

Average step size threshold to terminate IRLS. (float, default: 0.001)

property l1_step_convergence_threshold

Average step size threshold to terminate L1 minimization. (float, default: 0.001)

property max_num_irls_iterations

Number of IRLS iterations to perform. (int, default: 100)

property max_num_l1_iterations

Maximum number of L1 minimization iterations. (int, default: 5)

property max_rotation_error_deg

Filter pairs with rotation error exceeding this threshold (degrees). (float, default: 10.0)

mergedict(self: object, kwargs: dict) None
property random_seed

PRNG seed. -1 for non-deterministic, >=0 for deterministic. (int, default: -1)

property skip_initialization

Skip maximum spanning tree initialization. (bool, default: False)

summary(self: pycolmap.RotationEstimatorOptions, write_type: bool = False) str
todict(self: pycolmap.RotationEstimatorOptions, recursive: bool = True) dict
property use_gravity

Use gravity priors for rotation averaging. (bool, default: True)

property use_stratified

Use stratified solving for mixed gravity systems. (bool, default: True)

property weight_type

Weight type for IRLS: GEMAN_MCCLURE or HALF_NORM. (RotationWeightType, default: RotationWeightType.GEMAN_MCCLURE)

pycolmap.run_rotation_averaging(
options: pycolmap.RotationEstimatorOptions,
pose_graph: pycolmap.PoseGraph,
reconstruction: pycolmap.Reconstruction,
pose_priors: collections.abc.Sequence[pycolmap.PosePrior],
) bool

High-level rotation averaging solver that handles rig expansion. Returns True if rotation averaging succeeded.

class pycolmap.GlobalPositionerOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.GlobalPositionerOptions) None

  2. __init__(self: pycolmap.GlobalPositionerOptions, arg0: dict) None

  3. __init__(self: pycolmap.GlobalPositionerOptions, **kwargs) None

property generate_random_points

Whether to initialize 3D point positions randomly. (bool, default: True)

property generate_random_positions

Whether to initialize camera positions randomly. (bool, default: True)

property generate_scales

Whether to initialize scales to constant 1 or derive from positions. (bool, default: True)

property gpu_index

GPU device index (-1 for auto). (str, default: -1)

property loss_function_scale

Scaling factor for the loss function. (float, default: 0.1)

mergedict(self: object, kwargs: dict) None
property min_num_images_gpu_solver

Minimum number of images to use GPU solver. (int, default: 50)

property min_num_view_per_track

Minimum number of views per track. (int, default: 3)

property optimize_points

Whether to optimize 3D point positions. (bool, default: True)

property optimize_positions

Whether to optimize camera positions. (bool, default: True)

property optimize_scales

Whether to optimize scales. (bool, default: True)

property random_seed

PRNG seed for random initialization. -1 for non-deterministic. (int, default: -1)

summary(self: pycolmap.GlobalPositionerOptions, write_type: bool = False) str
todict(self: pycolmap.GlobalPositionerOptions, recursive: bool = True) dict
property use_gpu

Whether to use GPU for optimization. (bool, default: True)

property use_parameter_block_ordering

Whether to use custom parameter block ordering. (bool, default: True)

pycolmap.run_global_positioning(
options: pycolmap.GlobalPositionerOptions,
pose_graph: pycolmap.PoseGraph,
reconstruction: pycolmap.Reconstruction,
) bool

Solve global positioning using point-to-camera constraints. Returns True if optimization succeeded.

class pycolmap.ImageScore(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.ImageScore) None

  2. __init__(self: pycolmap.ImageScore, arg0: dict) None

  3. __init__(self: pycolmap.ImageScore, **kwargs) None

property image_id

(int, default: -1)

mergedict(self: object, kwargs: dict) None
property score

(float, default: 0.0)

summary(self: pycolmap.ImageScore, write_type: bool = False) str
todict(self: pycolmap.ImageScore, recursive: bool = True) dict
class pycolmap.VisualIndex(self: pycolmap.VisualIndex)
class BuildOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.VisualIndex.BuildOptions) None

  2. __init__(self: pycolmap.VisualIndex.BuildOptions, arg0: dict) None

  3. __init__(self: pycolmap.VisualIndex.BuildOptions, **kwargs) None

mergedict(self: object, kwargs: dict) None
property num_checks

(int, default: 256)

property num_iterations

(int, default: 100)

property num_rounds

(int, default: 3)

property num_threads

(int, default: -1)

property num_visual_words

(int, default: 65536)

summary(self: pycolmap.VisualIndex.BuildOptions, write_type: bool = False) str
todict(self: pycolmap.VisualIndex.BuildOptions, recursive: bool = True) dict
class IndexOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.VisualIndex.IndexOptions) None

  2. __init__(self: pycolmap.VisualIndex.IndexOptions, arg0: dict) None

  3. __init__(self: pycolmap.VisualIndex.IndexOptions, **kwargs) None

mergedict(self: object, kwargs: dict) None
property num_checks

(int, default: 64)

property num_neighbors

(int, default: 1)

property num_threads

(int, default: -1)

summary(self: pycolmap.VisualIndex.IndexOptions, write_type: bool = False) str
todict(self: pycolmap.VisualIndex.IndexOptions, recursive: bool = True) dict
class QueryOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.VisualIndex.QueryOptions) None

  2. __init__(self: pycolmap.VisualIndex.QueryOptions, arg0: dict) None

  3. __init__(self: pycolmap.VisualIndex.QueryOptions, **kwargs) None

property max_num_images

(int, default: -1)

mergedict(self: object, kwargs: dict) None
property num_checks

(int, default: 64)

property num_images_after_verification

(int, default: 0)

property num_neighbors

(int, default: 5)

property num_threads

(int, default: -1)

summary(self: pycolmap.VisualIndex.QueryOptions, write_type: bool = False) str
todict(self: pycolmap.VisualIndex.QueryOptions, recursive: bool = True) dict
add(
self: pycolmap.VisualIndex,
arg0: pycolmap.VisualIndex.IndexOptions,
arg1: SupportsInt,
arg2: pycolmap.FeatureKeypoints,
arg3: pycolmap.FeatureDescriptorsFloat,
) None
build(
self: pycolmap.VisualIndex,
arg0: pycolmap.VisualIndex.BuildOptions,
arg1: pycolmap.FeatureDescriptorsFloat,
) None
static create(arg0: SupportsInt, arg1: SupportsInt) pycolmap.VisualIndex
desc_dim(self: pycolmap.VisualIndex) int
embedding_dim(self: pycolmap.VisualIndex) int
feature_type(self: pycolmap.VisualIndex) pycolmap.FeatureExtractorType
is_image_indexed(self: pycolmap.VisualIndex, arg0: SupportsInt) bool
num_images(self: pycolmap.VisualIndex) int
num_visual_words(self: pycolmap.VisualIndex) int
prepare(self: pycolmap.VisualIndex) None
query(*args, **kwargs)

Overloaded function.

  1. query(self: pycolmap.VisualIndex, arg0: pycolmap.VisualIndex.QueryOptions, arg1: pycolmap.FeatureDescriptorsFloat, arg2: collections.abc.Sequence[pycolmap.ImageScore]) None

  2. query(self: pycolmap.VisualIndex, arg0: pycolmap.VisualIndex.QueryOptions, arg1: pycolmap.FeatureKeypoints, arg2: pycolmap.FeatureDescriptorsFloat, arg3: collections.abc.Sequence[pycolmap.ImageScore]) None

static read(arg0: os.PathLike | str | bytes) pycolmap.VisualIndex
write(self: pycolmap.VisualIndex, arg0: os.PathLike | str | bytes) None
class pycolmap.ImagePairStat(self: pycolmap.ImagePairStat)
property num_total_corrs
property num_tri_corrs
class pycolmap.ObservationManager(
self: pycolmap.ObservationManager,
reconstruction: pycolmap.Reconstruction,
correspondence_graph: pycolmap.CorrespondenceGraph = None,
)
add_observation(
self: pycolmap.ObservationManager,
point3D_id: SupportsInt,
track_element: pycolmap.TrackElement,
) None

Add observation to existing 3D point.

add_point3D(
self: pycolmap.ObservationManager,
xyz: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'],
track: pycolmap.Track,
color: Annotated[numpy.typing.ArrayLike, numpy.uint8, '[3, 1]'] = array([0, 0, 0], dtype=uint8),
) int

Add new 3D object, and return its unique ID.

decrement_correspondence_has_point3D(
self: pycolmap.ObservationManager,
image_id: SupportsInt,
point2D_idx: SupportsInt,
) None

Indicate that another image has a point that is not triangulated any more and has a correspondence to this image point. This assumesthat IncrementCorrespondenceHasPoint3D was called for the sameimage point and correspondence before.

delete_observation(
self: pycolmap.ObservationManager,
image_id: SupportsInt,
point2D_idx: SupportsInt,
) None

Delete one observation from an image and the corresponding 3D point. Note that this deletes the entire 3D point, if the track has two elements prior to calling this method.

delete_point3D(self: pycolmap.ObservationManager, point3D_id: SupportsInt) None

Delete a 3D point, and all its references in the observed images.

deregister_frame(self: pycolmap.ObservationManager, frame_id: SupportsInt) None

De-register an existing frame, and all its references.

filter_all_points3D(
self: pycolmap.ObservationManager,
max_reproj_error: SupportsFloat,
min_tri_angle: SupportsFloat,
) int

Filter 3D points with large reprojection error, negative depth, orinsufficient triangulation angle. Return the number of filtered observations.

filter_frames(
self: pycolmap.ObservationManager,
min_focal_length_ratio: SupportsFloat,
max_focal_length_ratio: SupportsFloat,
max_extra_param: SupportsFloat,
) list[int]

Filter frames without observations or bogus camera parameters.Return the identifiers of the filtered frames.

filter_observations_with_negative_depth(self: pycolmap.ObservationManager) int

Filter observations that have negative depth. Return the number of filtered observations.

filter_points3D(
self: pycolmap.ObservationManager,
max_reproj_error: SupportsFloat,
min_tri_angle: SupportsFloat,
point3D_ids: collections.abc.Set[SupportsInt],
) int

Filter 3D points with large reprojection error, negative depth, orinsufficient triangulation angle. Return the number of filtered observations.

filter_points3D_in_images(
self: pycolmap.ObservationManager,
max_reproj_error: SupportsFloat,
min_tri_angle: SupportsFloat,
image_ids: collections.abc.Set[SupportsInt],
) int

Filter 3D points with large reprojection error, negative depth, orinsufficient triangulation angle. Return the number of filtered observations.

filter_points3D_with_short_tracks(
self: pycolmap.ObservationManager,
min_track_length: SupportsInt,
) int

Filter points with track length below threshold. Return the number of filtered observations.

property image_pairs
increment_correspondence_has_point3D(
self: pycolmap.ObservationManager,
image_id: SupportsInt,
point2D_idx: SupportsInt,
) None

Indicate that another image has a point that is triangulated and has a correspondence to this image point.

merge_points3D(
self: pycolmap.ObservationManager,
point3D_id1: SupportsInt,
point3D_id2: SupportsInt,
) int

Merge two 3D points and return new identifier of new 3D point.The location of the merged 3D point is a weighted average of the two original 3D point’s locations according to their track lengths.

num_correspondences(self: pycolmap.ObservationManager, image_id: SupportsInt) int

Number of correspondences for all image points.

num_observations(self: pycolmap.ObservationManager, image_id: SupportsInt) int

Number of observations, i.e. the number of image points thathave at least one correspondence to another image.

num_visible_correspondences(self: pycolmap.ObservationManager, image_id: SupportsInt) int

Number of visible correspondences for all image points.

num_visible_points3D(self: pycolmap.ObservationManager, image_id: SupportsInt) int

Get the number of observations that see a triangulated point, i.e. the number of image points that have at least one correspondence toa triangulated point in another image.

point3D_visibility_score(self: pycolmap.ObservationManager, image_id: SupportsInt) int

Get the score of triangulated observations. In contrast to`NumVisiblePoints3D`, this score also captures the distributionof triangulated observations in the image. This is useful to select the next best image in incremental reconstruction, because amore uniform distribution of observations results in more robust registration.

register_frame(self: pycolmap.ObservationManager, frame_id: SupportsInt) None

Register an existing frame, and all its references.

class pycolmap.IncrementalTriangulatorOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.IncrementalTriangulatorOptions) None

  2. __init__(self: pycolmap.IncrementalTriangulatorOptions, arg0: dict) None

  3. __init__(self: pycolmap.IncrementalTriangulatorOptions, **kwargs) None

check(self: pycolmap.IncrementalTriangulatorOptions) bool
property complete_max_reproj_error

Maximum reprojection error to complete an existing triangulation. (float, default: 4.0)

property complete_max_transitivity

Maximum transitivity for track completion. (int, default: 5)

property continue_max_angle_error

Maximum angular error to continue existing triangulations. (float, default: 2.0)

property create_max_angle_error

Maximum angular error to create new triangulations. (float, default: 2.0)

property ignore_two_view_tracks

Whether to ignore two-view tracks. (bool, default: True)

property max_extra_param

The threshold used to filter and ignore images with degenerate intrinsics. (float, default: 1.0)

property max_focal_length_ratio

The threshold used to filter and ignore images with degenerate intrinsics. (float, default: 10.0)

property max_transitivity

Maximum transitivity to search for correspondences. (int, default: 1)

property merge_max_reproj_error

Maximum reprojection error in pixels to merge triangulations. (float, default: 4.0)

mergedict(self: object, kwargs: dict) None
property min_angle

Minimum pairwise triangulation angle for a stable triangulation. (float, default: 1.5)

property min_focal_length_ratio

The threshold used to filter and ignore images with degenerate intrinsics. (float, default: 0.1)

property random_seed

PRNG seed for all stochastic methods during triangulation. (int, default: -1)

property re_max_angle_error

Maximum angular error to re-triangulate under-reconstructed image pairs. (float, default: 5.0)

property re_max_trials

Maximum number of trials to re-triangulate an image pair. (int, default: 1)

property re_min_ratio

Minimum ratio of common triangulations between an image pair over the number of correspondences between that image pair to be considered as under-reconstructed. (float, default: 0.2)

summary(self: pycolmap.IncrementalTriangulatorOptions, write_type: bool = False) str
todict(self: pycolmap.IncrementalTriangulatorOptions, recursive: bool = True) dict
class pycolmap.IncrementalTriangulator(
self: pycolmap.IncrementalTriangulator,
correspondence_graph: pycolmap.CorrespondenceGraph,
reconstruction: pycolmap.Reconstruction,
observation_manager: pycolmap.ObservationManager = None,
)
add_modified_point3D(
self: pycolmap.IncrementalTriangulator,
point3D_id: SupportsInt,
) None
clear_modified_points3D(self: pycolmap.IncrementalTriangulator) None
complete_all_tracks(
self: pycolmap.IncrementalTriangulator,
options: pycolmap.IncrementalTriangulatorOptions,
) int
complete_image(
self: pycolmap.IncrementalTriangulator,
options: pycolmap.IncrementalTriangulatorOptions,
image_id: SupportsInt,
) int
complete_tracks(
self: pycolmap.IncrementalTriangulator,
options: pycolmap.IncrementalTriangulatorOptions,
point3D_ids: collections.abc.Set[SupportsInt],
) int
merge_all_tracks(
self: pycolmap.IncrementalTriangulator,
options: pycolmap.IncrementalTriangulatorOptions,
) int
merge_tracks(
self: pycolmap.IncrementalTriangulator,
options: pycolmap.IncrementalTriangulatorOptions,
point3D_ids: collections.abc.Set[SupportsInt],
) int
retriangulate(
self: pycolmap.IncrementalTriangulator,
options: pycolmap.IncrementalTriangulatorOptions,
) int
triangulate_image(
self: pycolmap.IncrementalTriangulator,
options: pycolmap.IncrementalTriangulatorOptions,
image_id: SupportsInt,
) int
class pycolmap.ImageSelectionMethod(*args, **kwargs)

Members:

MAX_VISIBLE_POINTS_NUM

MAX_VISIBLE_POINTS_RATIO

MIN_UNCERTAINTY

Overloaded function.

  1. __init__(self: pycolmap.ImageSelectionMethod, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.ImageSelectionMethod, name: str) None

MAX_VISIBLE_POINTS_NUM = ImageSelectionMethod.MAX_VISIBLE_POINTS_NUM
MAX_VISIBLE_POINTS_RATIO = ImageSelectionMethod.MAX_VISIBLE_POINTS_RATIO
MIN_UNCERTAINTY = ImageSelectionMethod.MIN_UNCERTAINTY
ImageSelectionMethod.name -> str
property value
class pycolmap.IncrementalMapperOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.IncrementalMapperOptions) None

  2. __init__(self: pycolmap.IncrementalMapperOptions, arg0: dict) None

  3. __init__(self: pycolmap.IncrementalMapperOptions, **kwargs) None

property abs_pose_max_error

Maximum reprojection error in absolute pose estimation. (float, default: 12.0)

property abs_pose_min_inlier_ratio

Minimum inlier ratio in absolute pose estimation. (float, default: 0.25)

property abs_pose_min_num_inliers

Minimum number of inliers in absolute pose estimation. (int, default: 30)

property abs_pose_refine_extra_params

Whether to estimate the extra parameters in absolute pose estimation. (bool, default: True)

property abs_pose_refine_focal_length

Whether to estimate the focal length in absolute pose estimation. (bool, default: True)

property ba_global_ignore_redundant_points3D

Whether to ignore redundant 3D points in bundle adjustment when jointly optimizing all parameters. If this is enabled, then the bundle adjustment problem is first solved with a reduced set of 3D points and then the remaining 3D points are optimized in a second step with all other parameters fixed. Points excplicitly configured as constant or variable are not ignored. This is only activated when the reconstruction has reached sufficient size with at least 10 registered frames. (bool, default: False)

property ba_global_prune_points_min_coverage_gain

The minimum coverage gain for any 3D point to be included in the optimization. A larger value means more 3D points are ignored. (float, default: 0.05)

property ba_local_min_tri_angle

Minimum triangulation for images to be chosen in local bundle adjustment. (float, default: 6.0)

property ba_local_num_images

Number of images to optimize in local bundle adjustment. (int, default: 6)

check(self: pycolmap.IncrementalMapperOptions) bool
property constant_cameras

List of cameras for which to fix the camera parameters independent of refine_focal_length, refine_principal_point, and refine_extra_params. (set, default: set())

property constant_rigs

List of rigs for which to fix the sensor_from_rig transformation, independent of ba_refine_sensor_from_rig. (set, default: set())

property filter_max_reproj_error

Maximum reprojection error in pixels for observations. (float, default: 4.0)

property filter_min_tri_angle

Minimum triangulation angle in degrees for stable 3D points. (float, default: 1.5)

property fix_existing_frames

If reconstruction is provided as input, fix the existing frame poses. (bool, default: False)

property image_selection_method

Method to find and select next best image to register. (ImageSelectionMethod, default: ImageSelectionMethod.MIN_UNCERTAINTY)

property init_max_error

Maximum error in pixels for two-view geometry estimation for initial image pair. (float, default: 4.0)

property init_max_forward_motion

Maximum forward motion for initial image pair. (float, default: 0.95)

property init_max_reg_trials

Maximum number of trials to use an image for initialization. (int, default: 2)

property init_min_num_inliers

Minimum number of inliers for initial image pair. (int, default: 100)

property init_min_tri_angle

Minimum triangulation angle for initial image pair. (float, default: 16.0)

property max_extra_param

The threshold used to filter and ignore images with degenerate intrinsics. (float, default: 1.0)

property max_focal_length_ratio

The threshold used to filter and ignore images with degenerate intrinsics. (float, default: 10.0)

property max_reg_trials

Maximum number of trials to register an image. (int, default: 3)

mergedict(self: object, kwargs: dict) None
property min_focal_length_ratio

The threshold used to filter and ignore images with degenerate intrinsics. (float, default: 0.1)

property num_threads

Number of threads. (int, default: -1)

property random_seed

PRNG seed for all stochastic methods during reconstruction. (int, default: -1)

summary(self: pycolmap.IncrementalMapperOptions, write_type: bool = False) str
todict(self: pycolmap.IncrementalMapperOptions, recursive: bool = True) dict
class pycolmap.LocalBundleAdjustmentReport(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.LocalBundleAdjustmentReport) None

  2. __init__(self: pycolmap.LocalBundleAdjustmentReport, arg0: dict) None

  3. __init__(self: pycolmap.LocalBundleAdjustmentReport, **kwargs) None

mergedict(self: object, kwargs: dict) None
property num_adjusted_observations

(int, default: 0)

property num_completed_observations

(int, default: 0)

property num_filtered_observations

(int, default: 0)

property num_merged_observations

(int, default: 0)

summary(self: pycolmap.LocalBundleAdjustmentReport, write_type: bool = False) str
todict(self: pycolmap.LocalBundleAdjustmentReport, recursive: bool = True) dict
class pycolmap.IncrementalMapper(self: pycolmap.IncrementalMapper, database_cache: pycolmap.DatabaseCache)
adjust_global_bundle(
self: pycolmap.IncrementalMapper,
options: pycolmap.IncrementalMapperOptions,
ba_options: pycolmap.BundleAdjustmentOptions,
) bool
adjust_local_bundle(
self: pycolmap.IncrementalMapper,
options: pycolmap.IncrementalMapperOptions,
ba_options: pycolmap.BundleAdjustmentOptions,
tri_options: pycolmap.IncrementalTriangulatorOptions,
image_id: SupportsInt,
point3D_ids: collections.abc.Set[SupportsInt],
) pycolmap.LocalBundleAdjustmentReport
begin_reconstruction(
self: pycolmap.IncrementalMapper,
reconstruction: pycolmap.Reconstruction,
) None
clear_modified_points3D(self: pycolmap.IncrementalMapper) None
complete_and_merge_tracks(
self: pycolmap.IncrementalMapper,
tri_options: pycolmap.IncrementalTriangulatorOptions,
) int
complete_tracks(
self: pycolmap.IncrementalMapper,
tri_options: pycolmap.IncrementalTriangulatorOptions,
) int
end_reconstruction(self: pycolmap.IncrementalMapper, discard: bool) None
estimate_initial_two_view_geometry(
self: pycolmap.IncrementalMapper,
options: pycolmap.IncrementalMapperOptions,
image_id1: SupportsInt,
image_id2: SupportsInt,
) pycolmap.Rigid3d | None
property existing_frame_ids
filter_frames(self: pycolmap.IncrementalMapper, options: pycolmap.IncrementalMapperOptions) int
filter_points(self: pycolmap.IncrementalMapper, options: pycolmap.IncrementalMapperOptions) int
property filtered_frames
find_initial_image_pair(
self: pycolmap.IncrementalMapper,
options: pycolmap.IncrementalMapperOptions,
image_id1: SupportsInt,
image_id2: SupportsInt,
) tuple[tuple[int, int], pycolmap.Rigid3d] | None
find_local_bundle(
self: pycolmap.IncrementalMapper,
options: pycolmap.IncrementalMapperOptions,
image_id: SupportsInt,
) list[int]
find_next_images(
self: pycolmap.IncrementalMapper,
options: pycolmap.IncrementalMapperOptions,
structure_less: bool,
) list[int]
get_modified_points3D(self: pycolmap.IncrementalMapper) set[int]
iterative_global_refinement(
self: pycolmap.IncrementalMapper,
max_num_refinements: SupportsInt,
max_refinement_change: SupportsFloat,
options: pycolmap.IncrementalMapperOptions,
ba_options: pycolmap.BundleAdjustmentOptions,
tri_options: pycolmap.IncrementalTriangulatorOptions,
normalize_reconstruction: bool = True,
) None
iterative_local_refinement(
self: pycolmap.IncrementalMapper,
max_num_refinements: SupportsInt,
max_refinement_change: SupportsFloat,
options: pycolmap.IncrementalMapperOptions,
ba_options: pycolmap.BundleAdjustmentOptions,
tri_options: pycolmap.IncrementalTriangulatorOptions,
image_id: SupportsInt,
) None
merge_tracks(
self: pycolmap.IncrementalMapper,
tri_options: pycolmap.IncrementalTriangulatorOptions,
) int
property num_reg_frames_per_rig
property num_reg_images_per_camera
num_shared_reg_images(self: pycolmap.IncrementalMapper) int
num_total_reg_images(self: pycolmap.IncrementalMapper) int
property observation_manager
property reconstruction
register_initial_image_pair(
self: pycolmap.IncrementalMapper,
options: pycolmap.IncrementalMapperOptions,
two_view_geometry: SupportsInt,
image_id1: SupportsInt,
image_id2: pycolmap.Rigid3d,
) None
register_next_image(
self: pycolmap.IncrementalMapper,
options: pycolmap.IncrementalMapperOptions,
image_id: SupportsInt,
) bool
register_next_structure_less_image(
self: pycolmap.IncrementalMapper,
options: pycolmap.IncrementalMapperOptions,
image_id: SupportsInt,
) bool
reset_initialization_stats(self: pycolmap.IncrementalMapper) None
retriangulate(
self: pycolmap.IncrementalMapper,
tri_options: pycolmap.IncrementalTriangulatorOptions,
) int
triangulate_image(
self: pycolmap.IncrementalMapper,
tri_options: pycolmap.IncrementalTriangulatorOptions,
image_id: SupportsInt,
) int
property triangulator
class pycolmap.IncrementalPipelineOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.IncrementalPipelineOptions) None

  2. __init__(self: pycolmap.IncrementalPipelineOptions, arg0: dict) None

  3. __init__(self: pycolmap.IncrementalPipelineOptions, **kwargs) None

property ba_global_frames_freq

The growth rates after which to perform global bundle adjustment. (int, default: 500)

property ba_global_frames_ratio

The growth rates after which to perform global bundle adjustment. (float, default: 1.1)

property ba_global_function_tolerance

Ceres solver function tolerance for global bundle adjustment. (float, default: 0.0)

property ba_global_max_num_iterations

The maximum number of global bundle adjustment iterations. (int, default: 50)

property ba_global_max_refinement_change

The thresholds for iterative bundle adjustment refinements. (float, default: 0.0005)

property ba_global_max_refinements

The thresholds for iterative bundle adjustment refinements. (int, default: 5)

property ba_global_points_freq

The growth rates after which to perform global bundle adjustment. (int, default: 250000)

property ba_global_points_ratio

The growth rates after which to perform global bundle adjustment. (float, default: 1.1)

property ba_gpu_index

Index of CUDA GPU to use for BA, if available. (str, default: -1)

property ba_local_function_tolerance

Ceres solver function tolerance for local bundle adjustment. (float, default: 0.0)

property ba_local_max_num_iterations

The maximum number of local bundle adjustment iterations. (int, default: 25)

property ba_local_max_refinement_change

The thresholds for iterative bundle adjustment refinements. (float, default: 0.001)

property ba_local_max_refinements

The thresholds for iterative bundle adjustment refinements. (int, default: 2)

property ba_min_num_residuals_for_cpu_multi_threading

The minimum number of residuals per bundle adjustment problem to enable multi-threading solving of the problems. (int, default: 50000)

property ba_refine_extra_params

Whether to refine extra parameters during the reconstruction. (bool, default: True)

property ba_refine_focal_length

Whether to refine the focal length during the reconstruction. (bool, default: True)

property ba_refine_principal_point

Whether to refine the principal point during the reconstruction. (bool, default: False)

property ba_refine_sensor_from_rig

Whether to refine rig poses during the reconstruction. (bool, default: True)

property ba_use_gpu

Whether to use Ceres’ CUDA sparse linear algebra library, if available. (bool, default: False)

check(self: pycolmap.IncrementalPipelineOptions) bool
property constant_cameras

List of cameras for which to fix the camera parameters independent of refine_focal_length, refine_principal_point, and refine_extra_params. (set, default: set())

property constant_rigs

List of rigs for which to fix the sensor_from_rig transformation, independent of ba_refine_sensor_from_rig. (set, default: set())

property extract_colors

Whether to extract colors for reconstructed points. (bool, default: True)

property fix_existing_frames

If reconstruction is provided as input, fix the existing frame poses. (bool, default: False)

get_global_bundle_adjustment(
self: pycolmap.IncrementalPipelineOptions,
) pycolmap.BundleAdjustmentOptions
get_local_bundle_adjustment(
self: pycolmap.IncrementalPipelineOptions,
) pycolmap.BundleAdjustmentOptions
get_mapper(self: pycolmap.IncrementalPipelineOptions) pycolmap.IncrementalMapperOptions
get_triangulation(
self: pycolmap.IncrementalPipelineOptions,
) pycolmap.IncrementalTriangulatorOptions
property ignore_watermarks

Whether to ignore the inlier matches of watermark image pairs. (bool, default: False)

property image_names

Optional list of image names to reconstruct. If no images are specified, all images will be reconstructed by default. (list, default: [])

property image_path

The image path at which to find the images to extract point colors. (PosixPath, default: .)

property init_image_id1

The image identifier of the first image used to initialize the reconstruction. (int, default: -1)

property init_image_id2

The image identifier of the second image used to initialize the reconstruction. Determined automatically if left unspecified. (int, default: -1)

property init_num_trials

The number of trials to initialize the reconstruction. (int, default: 200)

is_initial_pair_provided(self: pycolmap.IncrementalPipelineOptions) bool
property mapper

Options of the IncrementalMapper. (IncrementalMapperOptions, default: IncrementalMapperOptions(init_min_num_inliers=100, init_max_error=4.0, init_max_forward_motion=0.95, init_min_tri_angle=16.0, init_max_reg_trials=2, abs_pose_max_error=12.0, abs_pose_min_num_inliers=30, abs_pose_min_inlier_ratio=0.25, abs_pose_refine_focal_length=True, abs_pose_refine_extra_params=True, ba_local_num_images=6, ba_local_min_tri_angle=6.0, ba_global_ignore_redundant_points3D=False, ba_global_prune_points_min_coverage_gain=0.05, min_focal_length_ratio=0.1, max_focal_length_ratio=10.0, max_extra_param=1.0, filter_max_reproj_error=4.0, filter_min_tri_angle=1.5, max_reg_trials=3, fix_existing_frames=False, constant_rigs=set(), constant_cameras=set(), num_threads=-1, random_seed=-1, image_selection_method=ImageSelectionMethod.MIN_UNCERTAINTY))

property max_extra_param

The threshold used to filter and ignore images with degenerate intrinsics. (float, default: 1.0)

property max_focal_length_ratio

The threshold used to filter and ignore images with degenerate intrinsics. (float, default: 10.0)

property max_model_overlap

The maximum number of overlapping images between sub-models. If the current sub-models shares more than this number of images with another model, then the reconstruction is stopped. (int, default: 20)

property max_num_models

The number of sub-models to reconstruct. (int, default: 50)

property max_runtime_seconds

Maximum runtime in seconds for the reconstruction process. If set to a non-positive value, the process will run until completion. (int, default: -1)

mergedict(self: object, kwargs: dict) None
property min_focal_length_ratio

The threshold used to filter and ignore images with degenerate intrinsics. (float, default: 0.1)

property min_model_size

The minimum number of registered images of a sub-model, otherwise the sub-model is discarded. Note that the first sub-model is always kept independent of size. If the model contains at least half of the total number of images, we also always keep it. (int, default: 10)

property min_num_matches

The minimum number of matches for inlier matches to be considered. (int, default: 15)

property multiple_models

Whether to reconstruct multiple sub-models. (bool, default: True)

property num_threads

The number of threads to use during reconstruction. (int, default: -1)

property prior_position_loss_scale

Threshold on the residual for the robust position prior loss (chi2 for 3DOF at 95% = 7.815). (float, default: 7.815)

property random_seed

PRNG seed for all stochastic methods during reconstruction. (int, default: -1)

property snapshot_frames_freq

Frequency of registered images according to which reconstruction snapshots will be saved. (int, default: 0)

property snapshot_path

Path to a folder in which reconstruction snapshots will be saved during incremental reconstruction. (PosixPath, default: .)

property structure_less_registration_fallback

Enable fallback to structure-less image registration using 2D-2D correspondences, if structured-based registration fails using 2D-3D correspondences. (bool, default: True)

property structure_less_registration_only

Only use structure-less and skip structure-based image registration. (bool, default: False)

summary(self: pycolmap.IncrementalPipelineOptions, write_type: bool = False) str
todict(self: pycolmap.IncrementalPipelineOptions, recursive: bool = True) dict
property triangulation

Options of the IncrementalTriangulator. (IncrementalTriangulatorOptions, default: IncrementalTriangulatorOptions(max_transitivity=1, create_max_angle_error=2.0, continue_max_angle_error=2.0, merge_max_reproj_error=4.0, complete_max_reproj_error=4.0, complete_max_transitivity=5, re_max_angle_error=5.0, re_min_ratio=0.2, re_max_trials=1, min_angle=1.5, ignore_two_view_tracks=True, min_focal_length_ratio=0.1, max_focal_length_ratio=10.0, max_extra_param=1.0, random_seed=-1))

property use_prior_position

Whether to use priors on the camera positions. (bool, default: False)

property use_robust_loss_on_prior_position

Whether to use a robust loss on prior camera positions. (bool, default: False)

class pycolmap.IncrementalPipelineCallback(*args, **kwargs)

Members:

INITIAL_IMAGE_PAIR_REG_CALLBACK

NEXT_IMAGE_REG_CALLBACK

LAST_IMAGE_REG_CALLBACK

Overloaded function.

  1. __init__(self: pycolmap.IncrementalPipelineCallback, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.IncrementalPipelineCallback, name: str) None

INITIAL_IMAGE_PAIR_REG_CALLBACK = IncrementalPipelineCallback.INITIAL_IMAGE_PAIR_REG_CALLBACK
LAST_IMAGE_REG_CALLBACK = IncrementalPipelineCallback.LAST_IMAGE_REG_CALLBACK
NEXT_IMAGE_REG_CALLBACK = IncrementalPipelineCallback.NEXT_IMAGE_REG_CALLBACK
IncrementalPipelineCallback.name -> str
property value
class pycolmap.IncrementalPipelineStatus(*args, **kwargs)

Members:

SUCCESS

INTERRUPTED

CONTINUE

STOP

UNKNOWN_SENSOR_FROM_RIG

NO_INITIAL_PAIR

BAD_INITIAL_PAIR

Overloaded function.

  1. __init__(self: pycolmap.IncrementalPipelineStatus, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.IncrementalPipelineStatus, name: str) None

BAD_INITIAL_PAIR = IncrementalPipelineStatus.BAD_INITIAL_PAIR
CONTINUE = IncrementalPipelineStatus.CONTINUE
INTERRUPTED = IncrementalPipelineStatus.INTERRUPTED
NO_INITIAL_PAIR = IncrementalPipelineStatus.NO_INITIAL_PAIR
STOP = IncrementalPipelineStatus.STOP
SUCCESS = IncrementalPipelineStatus.SUCCESS
UNKNOWN_SENSOR_FROM_RIG = IncrementalPipelineStatus.UNKNOWN_SENSOR_FROM_RIG
IncrementalPipelineStatus.name -> str
property value
class pycolmap.IncrementalPipeline(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.IncrementalPipeline, options: pycolmap.IncrementalPipelineOptions, database: pycolmap.Database, reconstruction_manager: pycolmap.ReconstructionManager) None

  2. __init__(self: pycolmap.IncrementalPipeline, options: pycolmap.IncrementalPipelineOptions, database_cache: pycolmap.DatabaseCache, reconstruction_manager: pycolmap.ReconstructionManager) None

add_callback(
self: pycolmap.IncrementalPipeline,
id: SupportsInt,
func: collections.abc.Callable[[], None],
) None
callback(self: pycolmap.IncrementalPipeline, id: SupportsInt) None
check_reached_max_runtime(self: pycolmap.IncrementalPipeline) bool
check_run_global_refinement(
self: pycolmap.IncrementalPipeline,
reconstruction: pycolmap.Reconstruction,
ba_prev_num_reg_images: SupportsInt,
ba_prev_num_points: SupportsInt,
) bool
property database_cache
initialize_reconstruction(
self: pycolmap.IncrementalPipeline,
mapper: pycolmap.IncrementalMapper,
mapper_options: pycolmap.IncrementalMapperOptions,
reconstruction: pycolmap.Reconstruction,
) pycolmap.IncrementalPipelineStatus
property options
reconstruct(
self: pycolmap.IncrementalPipeline,
mapper: pycolmap.IncrementalMapper,
mapper_options: pycolmap.IncrementalMapperOptions,
continue_reconstruction: bool,
) pycolmap.IncrementalPipelineStatus
reconstruct_sub_model(
self: pycolmap.IncrementalPipeline,
mapper: pycolmap.IncrementalMapper,
mapper_options: pycolmap.IncrementalMapperOptions,
reconstruction: pycolmap.Reconstruction,
) pycolmap.IncrementalPipelineStatus
property reconstruction_manager
run(self: pycolmap.IncrementalPipeline) None
class pycolmap.DepthMap(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.DepthMap) None

  2. __init__(self: pycolmap.DepthMap, width: typing.SupportsInt, height: typing.SupportsInt, depth_min: typing.SupportsFloat, depth_max: typing.SupportsFloat) None

property depth_max

Maximum depth value.

property depth_min

Minimum depth value.

downsize(self: pycolmap.DepthMap, max_width: SupportsInt, max_height: SupportsInt) None

Downsize depth map to fit maximum dimensions.

static from_array(
array: Annotated[numpy.typing.ArrayLike, numpy.float32],
depth_min: SupportsFloat,
depth_max: SupportsFloat,
) pycolmap.DepthMap

Create depth map as a copy of array. Returns depth map with shape (H, W).

property height

Height of the depth map.

read(self: pycolmap.DepthMap, path: os.PathLike | str | bytes) None

Read depth map from file at given path.

rescale(self: pycolmap.DepthMap, factor: SupportsFloat) None

Rescale depth map.

to_array(self: pycolmap.DepthMap) numpy.typing.NDArray[numpy.float32]
to_bitmap(
self: pycolmap.DepthMap,
min_percentile: SupportsFloat,
max_percentile: SupportsFloat,
) pycolmap.Bitmap

Convert depth map to bitmap for visualization.

property width

Width of the depth map.

write(self: pycolmap.DepthMap, path: os.PathLike | str | bytes) None

Write depth map to file at given path.

class pycolmap.NormalMap(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.NormalMap) None

  2. __init__(self: pycolmap.NormalMap, width: typing.SupportsInt, height: typing.SupportsInt) None

downsize(self: pycolmap.NormalMap, max_width: SupportsInt, max_height: SupportsInt) None

Downsize normal map to fit maximum dimensions.

static from_array(array: Annotated[numpy.typing.ArrayLike, numpy.float32]) pycolmap.NormalMap

Create normal map as a copy of array. Returns normal map with shape (H, W, 3) where the 3 channels represent the x, y, z components of the normal vectors.

property height

Height of the normal map.

read(self: pycolmap.NormalMap, path: os.PathLike | str | bytes) None

Read normal map from file at given path.

rescale(self: pycolmap.NormalMap, factor: SupportsFloat) None

Rescale normal map.

to_array(self: pycolmap.NormalMap) numpy.typing.NDArray[numpy.float32]
to_bitmap(self: pycolmap.NormalMap) pycolmap.Bitmap

Convert normal map to bitmap for visualization.

property width

Width of the normal map.

write(self: pycolmap.NormalMap, path: os.PathLike | str | bytes) None

Write normal map to file at given path.

class pycolmap.MVSModel(self: pycolmap.MVSModel)
compute_depth_ranges(self: pycolmap.MVSModel) list[tuple[float, float]]

Compute robust minimum and maximum depths from the sparse point cloud.

compute_shared_points(self: pycolmap.MVSModel) list[dict[int, int]]

Compute the number of shared points between all overlapping images.

compute_triangulation_angles(
self: pycolmap.MVSModel,
percentile: SupportsFloat = 50.0,
) list[dict[int, float]]

Compute the median triangulation angles between all overlapping images.

get_image_idx(self: pycolmap.MVSModel, name: str) int

Get the image index for the given image name.

get_image_name(self: pycolmap.MVSModel, image_idx: SupportsInt) str

Get the image name for the given image index.

get_max_overlapping_images(
self: pycolmap.MVSModel,
num_images: SupportsInt,
min_triangulation_angle: SupportsFloat,
) list[list[int]]

Determine maximally overlapping images for each image, sorted by number of shared points subject to a minimum triangulation angle.

get_max_overlapping_images_from_pmvs(self: pycolmap.MVSModel) list[list[int]]

Get overlapping images defined in the PMVS vis.dat file.

read(self: pycolmap.MVSModel, path: os.PathLike | str | bytes, format: str) None

Read the model from the given path in the specified format.

read_from_colmap(
self: pycolmap.MVSModel,
path: os.PathLike | str | bytes,
sparse_path: os.PathLike | str | bytes = PosixPath('sparse'),
images_path: os.PathLike | str | bytes = PosixPath('images'),
) None

Read the model from a COLMAP reconstruction.

read_from_pmvs(self: pycolmap.MVSModel, path: os.PathLike | str | bytes) None

Read the model from PMVS output.

class pycolmap.CameraMode(*args, **kwargs)

Members:

AUTO

SINGLE

PER_FOLDER

PER_IMAGE

Overloaded function.

  1. __init__(self: pycolmap.CameraMode, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.CameraMode, name: str) None

AUTO = CameraMode.AUTO
PER_FOLDER = CameraMode.PER_FOLDER
PER_IMAGE = CameraMode.PER_IMAGE
SINGLE = CameraMode.SINGLE
CameraMode.name -> str
property value
class pycolmap.ImageReaderOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.ImageReaderOptions) None

  2. __init__(self: pycolmap.ImageReaderOptions, arg0: dict) None

  3. __init__(self: pycolmap.ImageReaderOptions, **kwargs) None

property camera_mask_path

Optional path to an image file specifying a mask for all images. No features will be extracted in regions where the mask is black (pixel intensity value 0 in grayscale) (PosixPath, default: .)

property camera_model

Name of the camera model. (str, default: SIMPLE_RADIAL)

property camera_params

Manual specification of camera parameters. If empty, camera parameters will be extracted from EXIF, i.e. principal point and focal length. (str, default: )

check(self: pycolmap.ImageReaderOptions) bool
property default_focal_length_factor

If camera parameters are not specified manually and the image does not have focal length EXIF information, the focal length is set to the value default_focal_length_factor * max(width, height). (float, default: 1.2)

property existing_camera_id

Whether to explicitly use an existing camera for all images. Note that in this case the specified camera model and parameters are ignored. (int, default: -1)

property mask_path

Optional root path to folder which contains imagemasks. For a given image, the corresponding maskmust have the same sub-path below this root as theimage has below image_path. The filename must beequal, aside from the added extension .png. For example, for an image image_path/abc/012.jpg,the mask would be mask_path/abc/012.jpg.png. Nofeatures will be extracted in regions where themask image is black (pixel intensity value 0 ingrayscale). (PosixPath, default: .)

mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.ImageReaderOptions, write_type: bool = False) str
todict(self: pycolmap.ImageReaderOptions, recursive: bool = True) dict
class pycolmap.FileCopyType(*args, **kwargs)

Members:

copy

softlink

hardlink

Overloaded function.

  1. __init__(self: pycolmap.FileCopyType, value: typing.SupportsInt) None

  2. __init__(self: pycolmap.FileCopyType, name: str) None

copy = FileCopyType.copy
FileCopyType.name -> str
property value
pycolmap.import_images(
database_path: os.PathLike | str | bytes,
image_path: os.PathLike | str | bytes,
camera_mode: pycolmap.CameraMode = CameraMode.AUTO,
image_names: collections.abc.Sequence[str] = [],
options: pycolmap.ImageReaderOptions = ImageReaderOptions(),
) None

Import images into a database

pycolmap.infer_camera_from_image(
image_path: os.PathLike | str | bytes,
options: pycolmap.ImageReaderOptions = ImageReaderOptions(),
) pycolmap.Camera

Guess the camera parameters from the EXIF metadata

pycolmap.undistort_images(
output_path: os.PathLike | str | bytes,
input_path: os.PathLike | str | bytes,
image_path: os.PathLike | str | bytes,
image_names: collections.abc.Sequence[str] = [],
output_type: str = 'COLMAP',
copy_policy: pycolmap.FileCopyType = FileCopyType.copy,
num_patch_match_src_images: SupportsInt = -1,
undistort_options: pycolmap.UndistortCameraOptions = UndistortCameraOptions(),
jpeg_quality: SupportsInt = -1,
) None

Undistort images

pycolmap.extract_features(
database_path: os.PathLike | str | bytes,
image_path: os.PathLike | str | bytes,
image_names: collections.abc.Sequence[str] = [],
camera_mode: pycolmap.CameraMode = CameraMode.AUTO,
reader_options: pycolmap.ImageReaderOptions = ImageReaderOptions(),
extraction_options: pycolmap.FeatureExtractionOptions = FeatureExtractionOptions(),
device: pycolmap.Device = Device.auto,
) None

Extract SIFT Features and write them to database

class pycolmap.ExhaustivePairingOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.ExhaustivePairingOptions) None

  2. __init__(self: pycolmap.ExhaustivePairingOptions, arg0: dict) None

  3. __init__(self: pycolmap.ExhaustivePairingOptions, **kwargs) None

property block_size

(int, default: 50)

check(self: pycolmap.ExhaustivePairingOptions) bool
mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.ExhaustivePairingOptions, write_type: bool = False) str
todict(self: pycolmap.ExhaustivePairingOptions, recursive: bool = True) dict
class pycolmap.SpatialPairingOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.SpatialPairingOptions) None

  2. __init__(self: pycolmap.SpatialPairingOptions, arg0: dict) None

  3. __init__(self: pycolmap.SpatialPairingOptions, **kwargs) None

check(self: pycolmap.SpatialPairingOptions) bool
property ignore_z

Whether to ignore the Z-component of the location prior. (bool, default: True)

property max_distance

The maximum distance between the query and nearest neighbor [meters]. (float, default: 100.0)

property max_num_neighbors

The maximum number of nearest neighbors to match. (int, default: 50)

mergedict(self: object, kwargs: dict) None
property min_num_neighbors

The minimum number of nearest neighbors to match. Neighbors include those within max_distance or to satisfy min_num_neighbors. (int, default: 0)

property num_threads

(int, default: -1)

summary(self: pycolmap.SpatialPairingOptions, write_type: bool = False) str
todict(self: pycolmap.SpatialPairingOptions, recursive: bool = True) dict
class pycolmap.VocabTreePairingOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.VocabTreePairingOptions) None

  2. __init__(self: pycolmap.VocabTreePairingOptions, arg0: dict) None

  3. __init__(self: pycolmap.VocabTreePairingOptions, **kwargs) None

check(self: pycolmap.VocabTreePairingOptions) bool
property match_list_path

Optional path to file with specific image names to match. (PosixPath, default: .)

property max_num_features

The maximum number of features to use for indexing an image. (int, default: -1)

mergedict(self: object, kwargs: dict) None
property num_checks

Number of nearest-neighbor checks to use in retrieval. (int, default: 64)

property num_images

Number of images to retrieve for each query image. (int, default: 100)

property num_images_after_verification

How many images to return after spatial verification. Set to 0 to turn off spatial verification. (int, default: 0)

property num_nearest_neighbors

Number of nearest neighbors to retrieve per query feature. (int, default: 5)

property num_threads

(int, default: -1)

summary(self: pycolmap.VocabTreePairingOptions, write_type: bool = False) str
todict(self: pycolmap.VocabTreePairingOptions, recursive: bool = True) dict
property vocab_tree_path

Path to the vocabulary tree. (PosixPath, default: https:/github.com/colmap/colmap/releases/download/3.11.1/vocab_tree_faiss_flickr100K_words256K.bin;vocab_tree_faiss_flickr100K_words256K.bin;96ca8ec8ea60b1f73465aaf2c401fd3b3ca75cdba2d3c50d6a2f6f760f275ddc)

class pycolmap.SequentialPairingOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.SequentialPairingOptions) None

  2. __init__(self: pycolmap.SequentialPairingOptions, arg0: dict) None

  3. __init__(self: pycolmap.SequentialPairingOptions, **kwargs) None

check(self: pycolmap.SequentialPairingOptions) bool
property expand_rig_images

Whether to match an image against all images in neighboring rig frames. If no rigs/frames are configured in the database, this option is ignored. (bool, default: True)

property loop_detection

Loop detection is invoked every loop_detection_period images. (bool, default: False)

property loop_detection_max_num_features

The maximum number of features to use for indexing an image. If an image has more features, only the largest-scale features will be indexed. (int, default: -1)

property loop_detection_num_checks

Number of nearest-neighbor checks to use in retrieval. (int, default: 64)

property loop_detection_num_images

The number of images to retrieve in loop detection. This number should be significantly larger than the sequential matching overlap. (int, default: 50)

property loop_detection_num_images_after_verification

How many images to return after spatial verification. Set to 0 to turn off spatial verification. (int, default: 0)

property loop_detection_num_nearest_neighbors

Number of nearest neighbors to retrieve per query feature. (int, default: 1)

property loop_detection_period

The frequency at which loop detection is triggered, in number of images. (int, default: 10)

mergedict(self: object, kwargs: dict) None
property num_threads

Number of threads for loop detection indexing and retrieval. (int, default: -1)

property overlap

Number of overlapping image pairs. (int, default: 10)

property quadratic_overlap

Whether to match images against their quadratic neighbors. (bool, default: True)

summary(self: pycolmap.SequentialPairingOptions, write_type: bool = False) str
todict(self: pycolmap.SequentialPairingOptions, recursive: bool = True) dict
vocab_tree_options(self: pycolmap.SequentialPairingOptions) pycolmap.VocabTreePairingOptions
property vocab_tree_path

Path to the vocabulary tree. (PosixPath, default: https:/github.com/colmap/colmap/releases/download/3.11.1/vocab_tree_faiss_flickr100K_words256K.bin;vocab_tree_faiss_flickr100K_words256K.bin;96ca8ec8ea60b1f73465aaf2c401fd3b3ca75cdba2d3c50d6a2f6f760f275ddc)

class pycolmap.ImportedPairingOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.ImportedPairingOptions) None

  2. __init__(self: pycolmap.ImportedPairingOptions, arg0: dict) None

  3. __init__(self: pycolmap.ImportedPairingOptions, **kwargs) None

property block_size

Number of image pairs to match in one batch. (int, default: 1225)

check(self: pycolmap.ImportedPairingOptions) bool
property match_list_path

Path to the file with the matches. (PosixPath, default: .)

mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.ImportedPairingOptions, write_type: bool = False) str
todict(self: pycolmap.ImportedPairingOptions, recursive: bool = True) dict
class pycolmap.ExistingMatchedPairingOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.ExistingMatchedPairingOptions) None

  2. __init__(self: pycolmap.ExistingMatchedPairingOptions, arg0: dict) None

  3. __init__(self: pycolmap.ExistingMatchedPairingOptions, **kwargs) None

property batch_size

(int, default: 1000)

check(self: pycolmap.ExistingMatchedPairingOptions) bool
mergedict(self: object, kwargs: dict) None
summary(self: pycolmap.ExistingMatchedPairingOptions, write_type: bool = False) str
todict(self: pycolmap.ExistingMatchedPairingOptions, recursive: bool = True) dict
class pycolmap.GeometricVerifierOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.GeometricVerifierOptions) None

  2. __init__(self: pycolmap.GeometricVerifierOptions, arg0: dict) None

  3. __init__(self: pycolmap.GeometricVerifierOptions, **kwargs) None

mergedict(self: object, kwargs: dict) None
property num_threads

(int, default: -1)

property rig_verification

(bool, default: False)

summary(self: pycolmap.GeometricVerifierOptions, write_type: bool = False) str
todict(self: pycolmap.GeometricVerifierOptions, recursive: bool = True) dict
property use_existing_relative_pose

(bool, default: False)

pycolmap.match_exhaustive(
database_path: os.PathLike | str | bytes,
matching_options: pycolmap.FeatureMatchingOptions = FeatureMatchingOptions(),
pairing_options: pycolmap.ExhaustivePairingOptions = ExhaustivePairingOptions(),
verification_options: pycolmap.TwoViewGeometryOptions = TwoViewGeometryOptions(),
device: pycolmap.Device = Device.auto,
) None

Exhaustive feature matching

pycolmap.match_spatial(
database_path: os.PathLike | str | bytes,
matching_options: pycolmap.FeatureMatchingOptions = FeatureMatchingOptions(),
pairing_options: pycolmap.SpatialPairingOptions = SpatialPairingOptions(),
verification_options: pycolmap.TwoViewGeometryOptions = TwoViewGeometryOptions(),
device: pycolmap.Device = Device.auto,
) None

Spatial feature matching

pycolmap.match_vocabtree(
database_path: os.PathLike | str | bytes,
matching_options: pycolmap.FeatureMatchingOptions = FeatureMatchingOptions(),
pairing_options: pycolmap.VocabTreePairingOptions = VocabTreePairingOptions(),
verification_options: pycolmap.TwoViewGeometryOptions = TwoViewGeometryOptions(),
device: pycolmap.Device = Device.auto,
) None

Vocab tree feature matching

pycolmap.match_sequential(
database_path: os.PathLike | str | bytes,
matching_options: pycolmap.FeatureMatchingOptions = FeatureMatchingOptions(),
pairing_options: pycolmap.SequentialPairingOptions = SequentialPairingOptions(),
verification_options: pycolmap.TwoViewGeometryOptions = TwoViewGeometryOptions(),
device: pycolmap.Device = Device.auto,
) None

Sequential feature matching

pycolmap.verify_matches(
database_path: os.PathLike | str | bytes,
pairs_path: os.PathLike | str | bytes,
options: pycolmap.TwoViewGeometryOptions = TwoViewGeometryOptions(),
) None

Run geometric verification of the matches

pycolmap.geometric_verification(
database_path: os.PathLike | str | bytes,
verifier_options: pycolmap.GeometricVerifierOptions = GeometricVerifierOptions(),
pairing_options: pycolmap.ExistingMatchedPairingOptions = ExistingMatchedPairingOptions(),
two_view_geometry_options: pycolmap.TwoViewGeometryOptions = TwoViewGeometryOptions(),
) None

Run geometric verification on all image pairs in the database

pycolmap.guided_geometric_verification(
reconstruction: pycolmap.Reconstruction,
database_path: os.PathLike | str | bytes,
pairing_options: pycolmap.ExistingMatchedPairingOptions = ExistingMatchedPairingOptions(),
two_view_geometry_options: pycolmap.TwoViewGeometryOptions = TwoViewGeometryOptions(),
num_threads: SupportsInt = -1,
) None

Run geometric verification given an existing colmap reconstruction on all image pairs in the database

class pycolmap.PairGenerator
all_pairs(self: pycolmap.PairGenerator) list[tuple[int, int]]
has_finished(self: pycolmap.PairGenerator) bool
next(self: pycolmap.PairGenerator) list[tuple[int, int]]
reset(self: pycolmap.PairGenerator) None
class pycolmap.ExhaustivePairGenerator(
self: pycolmap.ExhaustivePairGenerator,
options: pycolmap.ExhaustivePairingOptions,
database: pycolmap.Database,
)
class pycolmap.VocabTreePairGenerator(
self: pycolmap.VocabTreePairGenerator,
options: pycolmap.VocabTreePairingOptions,
database: pycolmap.Database,
query_image_ids: collections.abc.Sequence[SupportsInt] = [],
)
class pycolmap.SequentialPairGenerator(
self: pycolmap.SequentialPairGenerator,
options: pycolmap.SequentialPairingOptions,
database: pycolmap.Database,
)
class pycolmap.SpatialPairGenerator(
self: pycolmap.SpatialPairGenerator,
options: pycolmap.SpatialPairingOptions,
database: pycolmap.Database,
)
class pycolmap.ImportedPairGenerator(
self: pycolmap.ImportedPairGenerator,
options: pycolmap.ImportedPairingOptions,
database: pycolmap.Database,
)
pycolmap.triangulate_points(
reconstruction: pycolmap.Reconstruction,
database_path: os.PathLike | str | bytes,
image_path: os.PathLike | str | bytes,
output_path: os.PathLike | str | bytes,
clear_points: bool = True,
options: pycolmap.IncrementalPipelineOptions = IncrementalPipelineOptions(),
refine_intrinsics: bool = False,
) pycolmap.Reconstruction

Triangulate 3D points from known camera poses

pycolmap.incremental_mapping(
database_path: os.PathLike | str | bytes,
image_path: os.PathLike | str | bytes,
output_path: os.PathLike | str | bytes,
options: pycolmap.IncrementalPipelineOptions = IncrementalPipelineOptions(),
input_path: os.PathLike | str | bytes = '',
initial_image_pair_callback: collections.abc.Callable[[], None] = None,
next_image_callback: collections.abc.Callable[[], None] = None,
) dict[int, pycolmap.Reconstruction]

Recover 3D points and unknown camera poses

pycolmap.bundle_adjustment(
reconstruction: pycolmap.Reconstruction,
options: pycolmap.BundleAdjustmentOptions = BundleAdjustmentOptions(),
) None

Jointly refine 3D points and camera poses

class pycolmap.PatchMatchOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.PatchMatchOptions) None

  2. __init__(self: pycolmap.PatchMatchOptions, arg0: dict) None

  3. __init__(self: pycolmap.PatchMatchOptions, **kwargs) None

property allow_missing_files

Whether to tolerate missing images/maps in the problem setup (bool, default: False)

property cache_size

Cache size in gigabytes for patch match. (float, default: 32.0)

check(self: pycolmap.PatchMatchOptions) bool
property depth_max

(float, default: -1.0)

property depth_min

(float, default: -1.0)

property filter

Whether to enable filtering. (bool, default: True)

property filter_geom_consistency_max_cost

Maximum forward-backward reprojection error for pixel to be geometrically consistent. (float, default: 1.0)

property filter_min_ncc

Minimum NCC coefficient for pixel to be photo-consistent. (float, default: 0.10000000149011612)

property filter_min_num_consistent

Minimum number of source images have to be consistent for pixel not to be filtered. (int, default: 2)

property filter_min_triangulation_angle

Minimum triangulation angle to be stable. (float, default: 3.0)

property geom_consistency

Whether to add a regularized geometric consistency term to the cost function. If true, the depth_maps and normal_maps must not be null. (bool, default: True)

property geom_consistency_max_cost

Maximum geometric consistency cost in terms of the forward-backward reprojection error in pixels. (float, default: 3.0)

property geom_consistency_regularizer

The relative weight of the geometric consistency term w.r.t. to the photo-consistency term. (float, default: 0.30000001192092896)

property gpu_index

Index of the GPU used for patch match. For multi-GPU usage, you should separate multiple GPU indices by comma, e.g., “0,1,2,3”. (str, default: -1)

property incident_angle_sigma

Spread of the incident angle likelihood function. (float, default: 0.8999999761581421)

property max_image_size

Maximum image size in either dimension. (int, default: -1)

mergedict(self: object, kwargs: dict) None
property min_triangulation_angle

Minimum triangulation angle in degrees. (float, default: 1.0)

property ncc_sigma

Spread of the NCC likelihood function. (float, default: 0.6000000238418579)

property num_iterations

Number of coordinate descent iterations. (int, default: 5)

property num_samples

Number of random samples to draw in Monte Carlo sampling. (int, default: 15)

property sigma_color

Color sigma for bilaterally weighted NCC. (float, default: 0.20000000298023224)

property sigma_spatial

Spatial sigma for bilaterally weighted NCC. (float, default: -1.0)

summary(self: pycolmap.PatchMatchOptions, write_type: bool = False) str
todict(self: pycolmap.PatchMatchOptions, recursive: bool = True) dict
property window_radius

Half window size to compute NCC photo-consistency cost. (int, default: 5)

property window_step

Number of pixels to skip when computing NCC. (int, default: 1)

property write_consistency_graph

Whether to write the consistency graph. (bool, default: False)

pycolmap.patch_match_stereo(
workspace_path: os.PathLike | str | bytes,
workspace_format: str = 'COLMAP',
pmvs_option_name: str = 'option-all',
options: pycolmap.PatchMatchOptions = PatchMatchOptions(),
config_path: os.PathLike | str | bytes = '',
) None

Runs Patch-Match-Stereo (requires CUDA)

class pycolmap.StereoFusionOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.StereoFusionOptions) None

  2. __init__(self: pycolmap.StereoFusionOptions, arg0: dict) None

  3. __init__(self: pycolmap.StereoFusionOptions, **kwargs) None

property bounding_box

Bounding box Tuple[min, max] (tuple, default: (array([-3.4028235e+38, -3.4028235e+38, -3.4028235e+38], dtype=float32), array([3.4028235e+38, 3.4028235e+38, 3.4028235e+38], dtype=float32)))

property cache_size

Cache size in gigabytes for fusion. (float, default: 32.0)

check(self: pycolmap.StereoFusionOptions) bool
property check_num_images

Number of overlapping images to transitively check for fusing points. (int, default: 50)

property mask_path

Path for PNG masks. Same format expected as ImageReaderOptions. (PosixPath, default: .)

property max_depth_error

Maximum relative difference between measured and projected depth. (float, default: 0.009999999776482582)

property max_image_size

Maximum image size in either dimension. (int, default: -1)

property max_normal_error

Maximum angular difference in degrees of normals of pixels to be fused. (float, default: 10.0)

property max_num_pixels

Maximum number of pixels to fuse into a single point. (int, default: 10000)

property max_reproj_error

Maximum relative difference between measured and projected pixel. (float, default: 2.0)

property max_traversal_depth

Maximum depth in consistency graph traversal. (int, default: 100)

mergedict(self: object, kwargs: dict) None
property min_num_pixels

Minimum number of fused pixels to produce a point. (int, default: 5)

property num_threads

The number of threads to use during fusion. (int, default: -1)

summary(self: pycolmap.StereoFusionOptions, write_type: bool = False) str
todict(self: pycolmap.StereoFusionOptions, recursive: bool = True) dict
property use_cache

Flag indicating whether to use LRU cache or pre-load all data (bool, default: False)

pycolmap.stereo_fusion(
output_path: os.PathLike | str | bytes,
workspace_path: os.PathLike | str | bytes,
workspace_format: str = 'COLMAP',
pmvs_option_name: str = 'option-all',
input_type: str = 'geometric',
options: pycolmap.StereoFusionOptions = StereoFusionOptions(),
output_type: str = 'bin',
) pycolmap.Reconstruction

Stereo Fusion

class pycolmap.PoissonMeshingOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.PoissonMeshingOptions) None

  2. __init__(self: pycolmap.PoissonMeshingOptions, arg0: dict) None

  3. __init__(self: pycolmap.PoissonMeshingOptions, **kwargs) None

check(self: pycolmap.PoissonMeshingOptions) bool
property color

If specified, the reconstruction code assumes that the input is equippedwith colors and will extrapolate the color values to the vertices of thereconstructed mesh. The floating point value specifies the relativeimportance of finer color estimates over lower ones. (bool, default: True)

property depth

This integer is the maximum depth of the tree that will be used for surfacereconstruction. Running at depth d corresponds to solving on a voxel gridwhose resolution is no larger than 2^d x 2^d x 2^d. Note that since thereconstructor adapts the octree to the sampling density, the specifiedreconstruction depth is only an upper bound. (int, default: 13)

mergedict(self: object, kwargs: dict) None
property num_threads

The number of threads used for the Poisson reconstruction. (int, default: -1)

property point_weight

This floating point value specifies the importance that interpolation ofthe point samples is given in the formulation of the screened Poissonequation. The results of the original (unscreened) Poisson Reconstructioncan be obtained by setting this value to 0. (float, default: 1.0)

summary(self: pycolmap.PoissonMeshingOptions, write_type: bool = False) str
todict(self: pycolmap.PoissonMeshingOptions, recursive: bool = True) dict
property trim

This floating point values specifies the value for mesh trimming. Thesubset of the mesh with signal value less than the trim value is discarded. (float, default: 10.0)

class pycolmap.DelaunayMeshingOptions(*args, **kwargs)

Overloaded function.

  1. __init__(self: pycolmap.DelaunayMeshingOptions) None

  2. __init__(self: pycolmap.DelaunayMeshingOptions, arg0: dict) None

  3. __init__(self: pycolmap.DelaunayMeshingOptions, **kwargs) None

check(self: pycolmap.DelaunayMeshingOptions) bool
property distance_sigma_factor

The factor that is applied to the computed distance sigma, which isautomatically computed as the 25th percentile of edge lengths. A highervalue will increase the smoothness of the surface. (float, default: 1.0)

property max_depth_dist

Maximum relative depth difference between input point and a vertex of anexisting cell in the Delaunay triangulation, otherwise a new vertex iscreated in the triangulation. (float, default: 0.05)

property max_proj_dist

Unify input points into one cell in the Delaunay triangulation that fallwithin a reprojected radius of the given pixels. (float, default: 20.0)

property max_side_length_factor

Filtering thresholds for outlier surface mesh faces. If the longest side ofa mesh face (longest out of 3) exceeds the side lengths of all faces at acertain percentile by the given factor, then it is considered an outliermesh face and discarded. (float, default: 25.0)

property max_side_length_percentile

Filtering thresholds for outlier surface mesh faces. If the longest side ofa mesh face (longest out of 3) exceeds the side lengths of all faces at acertain percentile by the given factor, then it is considered an outliermesh face and discarded. (float, default: 95.0)

mergedict(self: object, kwargs: dict) None
property num_threads

The number of threads to use for reconstruction. Default is all threads. (int, default: -1)

property quality_regularization

A higher quality regularization leads to a smoother surface. (float, default: 1.0)

summary(self: pycolmap.DelaunayMeshingOptions, write_type: bool = False) str
todict(self: pycolmap.DelaunayMeshingOptions, recursive: bool = True) dict
property visibility_sigma

The standard deviation of wrt. the number of images seen by each point.Increasing this value decreases the influence of points seen in few images. (float, default: 3.0)

pycolmap.poisson_meshing(
input_path: os.PathLike | str | bytes,
output_path: os.PathLike | str | bytes,
options: pycolmap.PoissonMeshingOptions = PoissonMeshingOptions(),
) None

Perform Poisson surface reconstruction and return true if successful.

pycolmap.sparse_delaunay_meshing(
input_path: os.PathLike | str | bytes,
output_path: os.PathLike | str | bytes,
options: pycolmap.DelaunayMeshingOptions = DelaunayMeshingOptions(),
) None

Delaunay meshing of sparse COLMAP reconstructions.

pycolmap.dense_delaunay_meshing(
input_path: os.PathLike | str | bytes,
output_path: os.PathLike | str | bytes,
options: pycolmap.DelaunayMeshingOptions = DelaunayMeshingOptions(),
) None

Delaunay meshing of dense COLMAP reconstructions.

pycolmap.set_random_seed(seed: SupportsInt) None

Initialize the PRNG with the given seed.

class pycolmap.ostream(self: pycolmap.ostream, stdout: bool = True, stderr: bool = True)