### Build PyCOLMAP from source on Linux/macOS Source: https://colmap.github.io/pycolmap/index.html Build PyCOLMAP from source on Linux and macOS after installing COLMAP from source. Ensure COLMAP is installed first. ```bash python -m pip install . ``` -------------------------------- ### Install PyCOLMAP using pip Source: https://colmap.github.io/pycolmap/index.html Install pre-built wheels for PyCOLMAP on Linux, macOS, and Windows using pip. For GPU acceleration on Linux, consider the pycolmap-cuda12 package. ```bash pip install pycolmap ``` -------------------------------- ### FeatureMatcher.match_guided Source: https://colmap.github.io/pycolmap/pycolmap.html Performs guided matching using existing two-view geometry. ```APIDOC ## match_guided ### Description Perform guided matching using existing two-view geometry. Updates the two_view_geometry in-place. ### Parameters #### Request Body - **max_error** (SupportsFloat) - Required - Maximum allowed error. - **keypoints1** (pycolmap.FeatureKeypoints) - Required - Keypoints from the first image. - **descriptors1** (pycolmap.FeatureDescriptors) - Required - Descriptors from the first image. - **camera1** (pycolmap.Camera) - Required - Camera model for the first image. - **keypoints2** (pycolmap.FeatureKeypoints) - Required - Keypoints from the second image. - **descriptors2** (pycolmap.FeatureDescriptors) - Required - Descriptors from the second image. - **camera2** (pycolmap.Camera) - Required - Camera model for the second image. - **two_view_geometry** (pycolmap.TwoViewGeometry) - Required - The two-view geometry to update. ``` -------------------------------- ### LightGlueONNXMatchingOptions Initialization Source: https://colmap.github.io/pycolmap/pycolmap.html Options for configuring LightGlue matching using ONNX models. Supports initialization with default values, a dictionary, or keyword arguments. ```python class pycolmap.LightGlueONNXMatchingOptions(_* args_, _** kwargs_) Overloaded function. 1. `__init__(self: pycolmap.LightGlueONNXMatchingOptions) -> None` 2. `__init__(self: pycolmap.LightGlueONNXMatchingOptions, arg0: dict) -> None` 3. `__init__(self: pycolmap.LightGlueONNXMatchingOptions, **kwargs) -> None` ``` -------------------------------- ### SequentialPairingOptions Source: https://colmap.github.io/pycolmap/pycolmap.html Configuration options for sequential image pairing. ```APIDOC ## SequentialPairingOptions ### Description Configuration class for sequential image matching strategies. ### Properties - **overlap** (int) - Number of overlapping image pairs. Default: 10. - **quadratic_overlap** (bool) - Whether to match images against quadratic neighbors. Default: True. - **expand_rig_images** (bool) - Whether to match against neighboring rig frames. Default: True. - **loop_detection** (bool) - Whether to enable loop detection. Default: False. - **loop_detection_period** (int) - Frequency of loop detection. Default: 10. - **loop_detection_num_images** (int) - Number of images to retrieve in loop detection. Default: 50. ``` -------------------------------- ### AlikedMatchingOptions Initialization Source: https://colmap.github.io/pycolmap/pycolmap.html Options for configuring Aliked matching. Supports initialization with default values, a dictionary, or keyword arguments. ```python class pycolmap.AlikedMatchingOptions(_* args_, _** kwargs_) Overloaded function. 1. `__init__(self: pycolmap.AlikedMatchingOptions) -> None` 2. `__init__(self: pycolmap.AlikedMatchingOptions, arg0: dict) -> None` 3. `__init__(self: pycolmap.AlikedMatchingOptions, **kwargs) -> None` ``` -------------------------------- ### Initialize DelaunayMeshingOptions Source: https://colmap.github.io/pycolmap/pycolmap.html Overloaded constructors for configuring Delaunay meshing parameters. ```python 1. `__init__(self: pycolmap.DelaunayMeshingOptions) → None` 2. `__init__(self: pycolmap.DelaunayMeshingOptions, arg0: dict) → None` ``` -------------------------------- ### Perform Feature Matching Source: https://colmap.github.io/pycolmap/pycolmap.html Methods for standard and guided feature matching between two images. ```python match( _self : pycolmap.FeatureMatcher_, _keypoints1 : pycolmap.FeatureKeypoints_, _descriptors1 : pycolmap.FeatureDescriptors_, _keypoints2 : pycolmap.FeatureKeypoints_, _descriptors2 : pycolmap.FeatureDescriptors_, ) → Annotated[numpy.typing.NDArray[numpy.uint32], '[m, 2]'] ``` ```python match_guided( _self : pycolmap.FeatureMatcher_, _max_error : SupportsFloat_, _keypoints1 : pycolmap.FeatureKeypoints_, _descriptors1 : pycolmap.FeatureDescriptors_, _camera1 : pycolmap.Camera_, _keypoints2 : pycolmap.FeatureKeypoints_, _descriptors2 : pycolmap.FeatureDescriptors_, _camera2 : pycolmap.Camera_, _two_view_geometry : pycolmap.TwoViewGeometry_, ) → None ``` -------------------------------- ### Ceres Solver Options Source: https://colmap.github.io/pycolmap/pycolmap.html Options for the Ceres solver. Using this member requires having PyCeres installed. ```APIDOC ## Ceres Solver Options ### Description Options for the Ceres solver. Using this member requires having PyCeres installed. ### Properties - **minimizer_type** (MinimizerType) - Default: MinimizerType.TRUST_REGION - Type of minimizer to use. - **line_search_direction_type** (LineSearchDirectionType) - Default: LineSearchDirectionType.LBFGS - Type of line search direction. - **line_search_type** (LineSearchType) - Default: LineSearchType.WOLFE - Type of line search. - **nonlinear_conjugate_gradient_type** (NonlinearConjugateGradientType) - Default: NonlinearConjugateGradientType.FLETCHER_REEVES - Type of nonlinear conjugate gradient. - **max_lbfgs_rank** (int) - Default: 20 - Maximum rank for L-BFGS. - **use_approximate_eigenvalue_bfgs_scaling** (bool) - Default: False - Whether to use approximate eigenvalue scaling for BFGS. - **line_search_interpolation_type** (LineSearchInterpolationType) - Default: LineSearchInterpolationType.CUBIC - Type of line search interpolation. - **min_line_search_step_size** (float) - Default: 1e-09 - Minimum line search step size. - **line_search_sufficient_function_decrease** (float) - Default: 0.0001 - Sufficient function decrease for line search. - **max_line_search_step_contraction** (float) - Default: 0.001 - Maximum step contraction for line search. - **min_line_search_step_contraction** (float) - Default: 0.6 - Minimum step contraction for line search. - **max_num_line_search_step_size_iterations** (int) - Default: 20 - Maximum iterations for line search step size. - **max_num_line_search_direction_restarts** (int) - Default: 5 - Maximum restarts for line search direction. - **line_search_sufficient_curvature_decrease** (float) - Default: 0.9 - Sufficient curvature decrease for line search. - **max_line_search_step_expansion** (float) - Default: 10.0 - Maximum step expansion for line search. - **trust_region_strategy_type** (TrustRegionStrategyType) - Default: TrustRegionStrategyType.LEVENBERG_MARQUARDT - Type of trust region strategy. - **dogleg_type** (DoglegType) - Default: DoglegType.TRADITIONAL_DOGLEG - Type of dogleg. - **use_nonmonotonic_steps** (bool) - Default: False - Whether to use non-monotonic steps. - **max_consecutive_nonmonotonic_steps** (int) - Default: 10 - Maximum consecutive non-monotonic steps. - **max_num_iterations** (int) - Default: 100 - Maximum number of iterations. - **max_solver_time_in_seconds** (float) - Default: 1000000000.0 - Maximum solver time in seconds. - **num_threads** (int) - Default: -1 - Number of threads to use (-1 for auto). - **initial_trust_region_radius** (float) - Default: 10000.0 - Initial trust region radius. - **max_trust_region_radius** (float) - Default: 1e+16 - Maximum trust region radius. - **min_trust_region_radius** (float) - Default: 1e-32 - Minimum trust region radius. - **min_relative_decrease** (float) - Default: 0.001 - Minimum relative decrease. - **min_lm_diagonal** (float) - Default: 1e-06 - Minimum Levenberg-Marquardt diagonal. - **max_lm_diagonal** (float) - Default: 1e+32 - Maximum Levenberg-Marquardt diagonal. - **max_num_consecutive_invalid_steps** (int) - Default: 10 - Maximum consecutive invalid steps. - **function_tolerance** (float) - Default: 0.0 - Function tolerance. - **gradient_tolerance** (float) - Default: 0.0001 - Gradient tolerance. - **parameter_tolerance** (float) - Default: 0.0 - Parameter tolerance. - **linear_solver_type** (LinearSolverType) - Default: LinearSolverType.SPARSE_NORMAL_CHOLESKY - Type of linear solver. - **preconditioner_type** (PreconditionerType) - Default: PreconditionerType.JACOBI - Type of preconditioner. - **visibility_clustering_type** (VisibilityClusteringType) - Default: VisibilityClusteringType.CANONICAL_VIEWS - Type of visibility clustering. - **dense_linear_algebra_library_type** (DenseLinearAlgebraLibraryType) - Default: DenseLinearAlgebraLibraryType.EIGEN - Type of dense linear algebra library. - **sparse_linear_algebra_library_type** (SparseLinearAlgebraLibraryType) - Default: SparseLinearAlgebraLibraryType.SUITE_SPARSE - Type of sparse linear algebra library. - **use_explicit_schur_complement** (bool) - Default: False - Whether to use explicit Schur complement. - **dynamic_sparsity** (bool) - Default: False - Whether to use dynamic sparsity. - **use_inner_iterations** (bool) - Default: False - Whether to use inner iterations. - **inner_iteration_tolerance** (float) - Default: 0.001 - Tolerance for inner iterations. - **min_linear_solver_iterations** (int) - Default: 0 - Minimum linear solver iterations. - **max_linear_solver_iterations** (int) - Default: 200 - Maximum linear solver iterations. - **eta** (float) - Default: 0.1 - Eta parameter for trust region. - **jacobi_scaling** (bool) - Default: True - Whether to use Jacobi scaling. - **logging_type** (LoggingType) - Default: LoggingType.SILENT - Type of logging. - **minimizer_progress_to_stdout** (bool) - Default: False - Whether to print minimizer progress to stdout. - **trust_region_problem_dump_directory** (str) - Default: '/tmp' - Directory to dump trust region problems. - **trust_region_problem_dump_format_type** (DumpFormatType) - Default: DumpFormatType.TEXTFILE - Format type for dumping trust region problems. - **check_gradients** (bool) - Default: False - Whether to check gradients. - **gradient_check_relative_precision** (float) - Default: 1e-08 - Relative precision for gradient check. - **gradient_check_numeric_derivative_relative_step_size** (float) - Default: 1e-06 - Relative step size for numeric derivative in gradient check. - **update_state_every_iteration** (bool) - Default: False - Whether to update state every iteration. ### Methods - **check()**: Returns true if the options are valid. - **summary(write_type=False)**: Returns a summary string of the options. - **mergedict(**kwargs**)**: Merges options from a dictionary. - **todict(recursive=True)**: Converts the options to a dictionary. ``` -------------------------------- ### Initialize PoissonMeshingOptions Source: https://colmap.github.io/pycolmap/pycolmap.html Overloaded constructors for configuring Poisson meshing parameters. ```python 1. `__init__(self: pycolmap.PoissonMeshingOptions) → None` 2. `__init__(self: pycolmap.PoissonMeshingOptions, arg0: dict) → None` 3. `__init__(self: pycolmap.PoissonMeshingOptions, **kwargs) → None` ``` -------------------------------- ### Initialize StereoFusionOptions Source: https://colmap.github.io/pycolmap/pycolmap.html Overloaded constructors for configuring stereo fusion parameters. ```python 1. `__init__(self: pycolmap.StereoFusionOptions) → None` 2. `__init__(self: pycolmap.StereoFusionOptions, arg0: dict) → None` 3. `__init__(self: pycolmap.StereoFusionOptions, **kwargs) → None` ``` -------------------------------- ### GET /compare_reconstructions Source: https://colmap.github.io/pycolmap/pycolmap.html Compares two reconstructions based on reprojection error and projection center error. ```APIDOC ## GET /compare_reconstructions ### Description Compares two reconstruction objects and returns a dictionary of metrics. ### Method GET ### Endpoint /compare_reconstructions ### Parameters #### Query Parameters - **reconstruction1** (pycolmap.Reconstruction) - Required - First reconstruction. - **reconstruction2** (pycolmap.Reconstruction) - Required - Second reconstruction. - **alignment_error** (str) - Optional - Type of error, default 'reprojection'. - **min_inlier_observations** (SupportsFloat) - Optional - Default 0.3. - **max_reproj_error** (SupportsFloat) - Optional - Default 8.0. - **max_proj_center_error** (SupportsFloat) - Optional - Default 0.1. ### Response #### Success Response (200) - **result** (dict | None) - Dictionary containing comparison metrics. ``` -------------------------------- ### SiftMatchingOptions Initialization Source: https://colmap.github.io/pycolmap/pycolmap.html Options for configuring SIFT matching. Supports initialization with default values, a dictionary, or keyword arguments. ```python 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` ``` -------------------------------- ### Build PyCOLMAP from source on Windows Source: https://colmap.github.io/pycolmap/index.html Build PyCOLMAP from source on Windows after installing COLMAP via VCPKG. This command specifies the CMake toolchain file and target triplet for VCPKG. ```powershell python -m pip install . ` --cmake.define.CMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" ` --cmake.define.VCPKG_TARGET_TRIPLET="x64-windows" ``` -------------------------------- ### Create FeatureMatcher Source: https://colmap.github.io/pycolmap/pycolmap.html Static method to instantiate a feature matcher with specific options and device. ```python static create( _options : pycolmap.FeatureMatchingOptions | None = None_, _device : pycolmap.Device = Device.auto_, ) → pycolmap.FeatureMatcher ``` -------------------------------- ### Get Other Parameters Covariance Source: https://colmap.github.io/pycolmap/pycolmap.html Calculates the tangent space covariance for any variable parameter block. Returns null if the parameter block is not a variable. Rows/columns are omitted if dimensions are kept constant. ```python get_other_params_cov( _self : pycolmap.BACovariance_, _param : Annotated[numpy.typing.ArrayLike, numpy.float64]_, ) → Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]'] | None ``` -------------------------------- ### Get Camera Covariance from World Source: https://colmap.github.io/pycolmap/pycolmap.html Calculates the covariance for a camera's pose relative to the world. Returns null if the image is not a variable. Covariance is in tangent space order [rotation, translation]. ```python get_cam_cov_from_world( _self : pycolmap.BACovariance_, _image_id : SupportsInt_, ) → Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]'] | None ``` -------------------------------- ### Core Components and Options Source: https://colmap.github.io/pycolmap/index.html Overview of key classes and options for configuring COLMAP pipelines. ```APIDOC ## Core Components and Options ### Description This section lists the primary classes and option structures used for configuring and managing COLMAP operations. ### Classes - `IncrementalTriangulatorOptions` - `IncrementalTriangulator` - `ImageSelectionMethod` - `IncrementalMapperOptions` - `LocalBundleAdjustmentReport` - `IncrementalMapper` - `IncrementalPipelineOptions` - `IncrementalPipelineCallback` - `IncrementalPipelineStatus` - `IncrementalPipeline` - `DepthMap` - `NormalMap` - `MVSModel` - `CameraMode` - `ImageReaderOptions` - `FileCopyType` - `PairGenerator` - `ExhaustivePairGenerator` - `VocabTreePairGenerator` - `SequentialPairGenerator` - `SpatialPairGenerator` - `ImportedPairGenerator` ### Cost Functions - `ReprojErrorCost()` - `RigReprojErrorCost()` - `SampsonErrorCost()` - `AbsolutePosePriorCost()` - `AbsolutePosePositionPriorCost()` - `RelativePosePriorCost()` - `Point3DAlignmentCost()` ``` -------------------------------- ### Get Relative Pose Covariance Between Cameras Source: https://colmap.github.io/pycolmap/pycolmap.html Calculates the relative pose covariance between two cameras. Returns null if dimensions are kept constant for either pose, requiring custom logic for such cases. ```python 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 ``` -------------------------------- ### Initialize Incremental Pipeline Source: https://colmap.github.io/pycolmap/pycolmap.html Constructs an IncrementalPipeline object. Use the database cache for faster initialization if available. ```python IncrementalPipeline(options: pycolmap.IncrementalPipelineOptions, database: pycolmap.Database, reconstruction_manager: pycolmap.ReconstructionManager) -> None IncrementalPipeline(options: pycolmap.IncrementalPipelineOptions, database_cache: pycolmap.DatabaseCache, reconstruction_manager: pycolmap.ReconstructionManager) -> None ``` -------------------------------- ### Get Cross Camera Covariance from World Source: https://colmap.github.io/pycolmap/pycolmap.html Calculates the cross-covariance between two cameras' poses relative to the world. Returns null if either image is not a variable. Covariance is in tangent space order [rotation, translation]. ```python get_cam_cross_cov_from_world( _self : pycolmap.BACovariance_, _image_id1 : SupportsInt_, _image_id2 : SupportsInt_, ) → Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]'] | None ``` -------------------------------- ### Initialize FeatureMatchingOptions Source: https://colmap.github.io/pycolmap/pycolmap.html Overloaded constructors for creating a FeatureMatchingOptions object. ```python __init__(self: pycolmap.FeatureMatchingOptions, type: pycolmap.FeatureMatcherType = ) → None ``` ```python __init__(self: pycolmap.FeatureMatchingOptions, arg0: dict) → None ``` ```python __init__(self: pycolmap.FeatureMatchingOptions, **kwargs) → None ``` -------------------------------- ### LightGlueONNXMatchingOptions Methods Source: https://colmap.github.io/pycolmap/pycolmap.html Utility methods for LightGlueONNXMatchingOptions, including checking validity, generating a summary string, merging dictionaries, and converting to a dictionary. ```python check(_self : pycolmap.LightGlueONNXMatchingOptions_) -> bool ``` ```python summary(_self : pycolmap.LightGlueONNXMatchingOptions_, _write_type : bool = False_) -> str ``` ```python mergedict(_self : object_, _kwargs : dict_) -> None ``` ```python todict(_self : pycolmap.LightGlueONNXMatchingOptions_, _recursive : bool = True_) -> dict ``` -------------------------------- ### BruteForceONNXMatchingOptions Initialization Source: https://colmap.github.io/pycolmap/pycolmap.html Options for configuring brute-force matching using ONNX models. Supports initialization with default values, a dictionary, or keyword arguments. ```python class pycolmap.BruteForceONNXMatchingOptions(_* args_, _** kwargs_) Overloaded function. 1. `__init__(self: pycolmap.BruteForceONNXMatchingOptions) -> None` 2. `__init__(self: pycolmap.BruteForceONNXMatchingOptions, arg0: dict) -> None` 3. `__init__(self: pycolmap.BruteForceONNXMatchingOptions, **kwargs) -> None` ``` -------------------------------- ### Manage Reconstruction Lifecycle Source: https://colmap.github.io/pycolmap/pycolmap.html Methods to prepare and clean up the mapper for a reconstruction session. ```python begin_reconstruction( _self : pycolmap.IncrementalMapper_, _reconstruction : pycolmap.Reconstruction_, ) → None ``` ```python end_reconstruction(_self : pycolmap.IncrementalMapper_, _discard : bool_) → None ``` -------------------------------- ### IncrementalPipelineOptions Methods Source: https://colmap.github.io/pycolmap/pycolmap.html Methods for retrieving configuration options and checking pipeline status. ```APIDOC ## IncrementalPipelineOptions Methods ### Description Methods for retrieving configuration options and checking pipeline status. ### Methods - **get_mapper** (_self: pycolmap.IncrementalPipelineOptions_) -> pycolmap.IncrementalMapperOptions: Get mapper options with shared settings applied. - **get_triangulation** (_self: pycolmap.IncrementalPipelineOptions_) -> pycolmap.IncrementalTriangulatorOptions: Get triangulation options with shared settings applied. - **get_local_bundle_adjustment** (_self: pycolmap.IncrementalPipelineOptions_) -> pycolmap.BundleAdjustmentOptions: Get local bundle adjustment options. - **get_global_bundle_adjustment** (_self: pycolmap.IncrementalPipelineOptions_) -> pycolmap.BundleAdjustmentOptions: Get global bundle adjustment options. - **is_initial_pair_provided** (_self: pycolmap.IncrementalPipelineOptions_) -> bool: Check whether both initial image identifiers are provided. - **check** (_self: pycolmap.IncrementalPipelineOptions_) -> bool: - **summary** (_self: pycolmap.IncrementalPipelineOptions_, _write_type: bool = False_) -> str: - **mergedict** (_self: object_, _kwargs: dict_) -> None: - **todict** (_self: pycolmap.IncrementalPipelineOptions_, _recursive: bool = True_) -> dict: ``` -------------------------------- ### VocabTreePairingOptions Source: https://colmap.github.io/pycolmap/pycolmap.html Configuration options for vocabulary tree-based image pairing. ```APIDOC ## VocabTreePairingOptions ### Description Configuration class for vocabulary tree pairing settings. ### Properties - **num_images_after_verification** (int) - How many images to return after spatial verification. Default: 0. - **max_num_features** (int) - Maximum number of features to use for indexing. Default: -1. - **vocab_tree_path** (PosixPath) - Path to the vocabulary tree. Default: . - **match_list_path** (PosixPath) - Optional path to file with specific image names to match. Default: . - **num_threads** (int) - Number of threads. Default: -1. ``` -------------------------------- ### Image Class Overview Source: https://colmap.github.io/pycolmap/pycolmap.html Provides an overview of the pycolmap.Image class, its constructors, and key properties. ```APIDOC ## Class pycolmap.Image ### Description Represents an image within the COLMAP structure, holding information about its keypoints, camera, and pose. ### Constructors Overloaded function with multiple signatures: 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` ### Properties - **image_id** (int) - Unique identifier of the image. (default: 4294967295) - **camera_id** (int) - Unique identifier of the camera. (default: 4294967295) - **frame_id** (int) - Unique identifier of the frame. (default: 4294967295) - **data_id** (data_t) - Unique identifier of the data. (default: data_t(sensor_id=sensor_t(type=SensorType.CAMERA, id=4294967295), id=4294967295)) - **camera** (NoneType) - The associated camera object. (default: None) - **frame** (NoneType) - The associated frame object. (default: None) - **name** (str) - Name of the image. (default: ) - **has_pose** (bool) - Whether the image has a valid pose. (default: False) - **points2D** (Point2DList) - Array of Points2D (=keypoints). (default: Point2DList[]) - **num_points3D** (int) - Get the number of triangulations, i.e. the number of points that are part of a 3D point track. (default: 0) ``` -------------------------------- ### Initialize Reconstruction Source: https://colmap.github.io/pycolmap/pycolmap.html Initializes a new reconstruction by finding and registering an initial image pair. Requires a mapper, mapper options, and a reconstruction object. ```python initialize_reconstruction( _self : pycolmap.IncrementalPipeline_, _mapper : pycolmap.IncrementalMapper_, _mapper_options : pycolmap.IncrementalMapperOptions_, _reconstruction : pycolmap.Reconstruction_, ) -> pycolmap.IncrementalPipelineStatus ``` -------------------------------- ### PyCOLMAP Rig and Dataset Synthesis Source: https://colmap.github.io/pycolmap/pycolmap.html This section covers functionalities for handling camera rigs and synthesizing datasets for testing and development. ```APIDOC ## PyCOLMAP Rig and Dataset Synthesis ### Description This section details the components for defining and utilizing camera rigs, as well as synthesizing datasets and noise for experimental purposes. ### Rig Handling - **`Rig`**: Represents a collection of calibrated cameras mounted on a rigid structure. - **`RigMap`**: A map from rig ID to `Rig` objects. - **`read_rig_config(path)`**: Reads rig configuration from a file. - **`apply_rig_config(rig_config, image)`**: Applies rig configuration to an image. ### Dataset Synthesis - **`SyntheticDatasetMatchConfig`**: Configuration for matching in synthetic datasets. - **`SyntheticDatasetOptions`**: General options for synthesizing a dataset. - **`synthesize_dataset(options)`**: Generates a synthetic dataset based on provided options. ### Noise Synthesis - **`SyntheticNoiseOptions`**: Options for synthesizing noise. - **`synthesize_noise(options)`**: Adds synthetic noise to data. ### Image Synthesis - **`SyntheticImageOptions`**: Options for synthesizing images. - **`synthesize_images(options)`**: Generates synthetic images. ``` -------------------------------- ### AlikedMatchingOptions Methods Source: https://colmap.github.io/pycolmap/pycolmap.html Utility methods for AlikedMatchingOptions, including checking validity, generating a summary string, merging dictionaries, and converting to a dictionary. ```python check(_self : pycolmap.AlikedMatchingOptions_) -> bool ``` ```python summary(_self : pycolmap.AlikedMatchingOptions_, _write_type : bool = False_) -> str ``` ```python mergedict(_self : object_, _kwargs : dict_) -> None ``` ```python todict(_self : pycolmap.AlikedMatchingOptions_, _recursive : bool = True_) -> dict ``` -------------------------------- ### ImportedPairingOptions Source: https://colmap.github.io/pycolmap/pycolmap.html Configuration options for importing pre-defined image matches. ```APIDOC ## ImportedPairingOptions ### Description Configuration class for importing existing match lists. ### Properties - **block_size** (int) - Number of image pairs to match in one batch. Default: 1225. - **match_list_path** (PosixPath) - Path to the file with the matches. Default: . ``` -------------------------------- ### Initialize Reconstruction Geometry Source: https://colmap.github.io/pycolmap/pycolmap.html Methods for finding and registering initial image pairs to seed the reconstruction. ```python find_initial_image_pair( _self : pycolmap.IncrementalMapper_, _options : pycolmap.IncrementalMapperOptions_, _image_id1 : SupportsInt_, _image_id2 : SupportsInt_, ) → tuple[tuple[int, int], pycolmap.Rigid3d] | None ``` ```python estimate_initial_two_view_geometry( _self : pycolmap.IncrementalMapper_, _options : pycolmap.IncrementalMapperOptions_, _image_id1 : SupportsInt_, _image_id2 : SupportsInt_, ) → pycolmap.Rigid3d | None ``` ```python register_initial_image_pair( _self : pycolmap.IncrementalMapper_, _options : pycolmap.IncrementalMapperOptions_, _two_view_geometry : SupportsInt_, _image_id1 : SupportsInt_, _image_id2 : pycolmap.Rigid3d_, ) → None ``` -------------------------------- ### FeatureMatcher.create Source: https://colmap.github.io/pycolmap/pycolmap.html Creates a new feature matcher instance based on the provided options and device. ```APIDOC ## static create ### Description Creates a new feature matcher instance. ### Parameters #### Query Parameters - **options** (pycolmap.FeatureMatchingOptions | None) - Optional - Configuration options for the matcher. - **device** (pycolmap.Device) - Optional - The device to use for matching (default: Device.auto). ### Response - **returns** (pycolmap.FeatureMatcher) - A new instance of the feature matcher. ``` -------------------------------- ### Data Import and Preprocessing Functions Source: https://colmap.github.io/pycolmap/index.html Functions for importing images and performing initial camera and image processing. ```APIDOC ## Data Import and Preprocessing Functions ### Description These functions handle the initial steps of importing image data and inferring camera parameters. ### Functions - `import_images()`: Imports images into the COLMAP project. - `infer_camera_from_image()`: Infers camera parameters from an image. - `undistort_images()`: Undistorts images based on inferred or provided camera parameters. ``` -------------------------------- ### Run Patch-Match Stereo Source: https://colmap.github.io/pycolmap/pycolmap.html Executes the Patch-Match-Stereo algorithm, which requires CUDA support. ```python 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 ``` -------------------------------- ### Initialize TrackElement Source: https://colmap.github.io/pycolmap/pycolmap.html Overloaded constructors for creating a TrackElement object. ```python __init__(self: pycolmap.TrackElement) → None ``` ```python __init__(self: pycolmap.TrackElement, image_id: typing.SupportsInt, point2D_idx: typing.SupportsInt) → None ``` -------------------------------- ### AlikedMatchingOptions Properties Source: https://colmap.github.io/pycolmap/pycolmap.html Configuration properties for Aliked matching, including options for brute-force and LightGlue sub-matchers. ```python property brute_force Brute-force matching options. (BruteForceONNXMatchingOptions, default: BruteForceONNXMatchingOptions(min_cossim=0.85, max_ratio=1.0, cross_check=True, model_path=’https://github.com/colmap/colmap/releases/download/3.13.0/bruteforce-matcher.onnx;bruteforce-matcher.onnx;3c1282f96d83f5ffc861a873298d08bbe5219f59af59223f5ceab5c41a182a47’)) ``` ```python property lightglue LightGlue matching options. (LightGlueONNXMatchingOptions, default: LightGlueONNXMatchingOptions(min_score=0.1, model_path=’https://github.com/colmap/colmap/releases/download/3.13.0/aliked-lightglue.onnx;aliked-lightglue.onnx;b9a5de7204648b18a8cf5dcac819f9d30de1a5961ef03756803c8b86c2dceb8d’)) ``` -------------------------------- ### Rig Configuration Source: https://colmap.github.io/pycolmap/pycolmap.html Classes and methods for defining and managing rig configurations, including camera and sensor properties. ```APIDOC ## Class: RigConfigCamera ### Description Represents camera configuration within a rig. ### Properties - **ref_sensor** (bool, default: False) - Indicates if this camera is a reference sensor. - **image_prefix** (str, default: '') - Prefix for images associated with this camera. - **cam_from_rig** (NoneType, default: None) - Transformation from rig to camera coordinates. - **camera** (NoneType, default: None) - The camera intrinsic parameters. ### Methods #### GET /rig_config_camera/summary ##### Description Get a summary string of the rig camera configuration. ##### Parameters - **write_type** (bool, default: False) - Whether to include type information in the summary. ##### Response - **summary** (str) #### POST /rig_config_camera/mergedict ##### Description Merge a dictionary of keyword arguments into the rig camera configuration. ##### Parameters - **kwargs** (dict) - The dictionary of parameters to merge. #### GET /rig_config_camera/todict ##### Description Convert the rig camera configuration to a dictionary. ##### Parameters - **recursive** (bool, default: True) - Whether to recursively convert nested objects. ##### Response - **dictionary** (dict) ## Class: RigConfig ### Description Represents a configuration for a camera rig. ``` -------------------------------- ### Initialize LocalBundleAdjustmentReport Source: https://colmap.github.io/pycolmap/pycolmap.html Overloaded constructors for the LocalBundleAdjustmentReport class. ```python 1. __init__(self: pycolmap.LocalBundleAdjustmentReport) → None 2. __init__(self: pycolmap.LocalBundleAdjustmentReport, arg0: dict) → None 3. __init__(self: pycolmap.LocalBundleAdjustmentReport, **kwargs) → None ``` -------------------------------- ### IncrementalPipeline Constructor Source: https://colmap.github.io/pycolmap/pycolmap.html Initializes the IncrementalPipeline class. It can be constructed with either a Database or a DatabaseCache. ```python IncrementalPipeline(_* args_, _** kwargs_) __init__(self: pycolmap.IncrementalPipeline, options: pycolmap.IncrementalPipelineOptions, database: pycolmap.Database, reconstruction_manager: pycolmap.ReconstructionManager) -> None __init__(self: pycolmap.IncrementalPipeline, options: pycolmap.IncrementalPipelineOptions, database_cache: pycolmap.DatabaseCache, reconstruction_manager: pycolmap.ReconstructionManager) -> None ``` -------------------------------- ### LightGlueONNXMatchingOptions Properties Source: https://colmap.github.io/pycolmap/pycolmap.html Configuration properties for ONNX LightGlue matching, including the minimum score threshold and the path to the ONNX model file. ```python property min_score Minimum match score threshold. (float, default: 0.1) ``` ```python property model_path Path to the LightGlue ONNX model file. (str, default: ) ``` -------------------------------- ### BundleAdjustmentConfig Methods Source: https://colmap.github.io/pycolmap/pycolmap.html Methods for configuring the bundle adjustment process, including managing images and camera intrinsics. ```APIDOC ## BundleAdjustmentConfig Methods ### Description Methods to configure the bundle adjustment process by adding/removing images and setting camera intrinsic constraints. ### Methods - **add_image(image_id: SupportsInt) -> None**: Adds an image to the bundle adjustment configuration. - **has_image(image_id: SupportsInt) -> bool**: Checks if an image is included in the configuration. - **remove_image(image_id: SupportsInt) -> None**: Removes an image from the configuration. - **set_constant_cam_intrinsics(camera_id: SupportsInt) -> None**: Sets camera intrinsics as constant. - **set_variable_cam_intrinsics(camera_id: SupportsInt) -> None**: Sets camera intrinsics as variable. ``` -------------------------------- ### PyCOLMAP AlikedExtractionOptions Class Source: https://colmap.github.io/pycolmap/pycolmap.html Configuration options for Aliked feature extraction. ```APIDOC ## PyCOLMAP AlikedExtractionOptions Class ### Description Configuration options for Aliked feature extraction. ### Methods - `__init__(self: pycolmap.AlikedExtractionOptions, *args, **kwargs) → None` ``` -------------------------------- ### Rig Configuration API Source: https://colmap.github.io/pycolmap/pycolmap.html Functions for reading and applying rig configurations to a database. ```APIDOC ## pycolmap.read_rig_config ### Description Read the rig configuration from a .json file. ### Parameters - **path** (os.PathLike | str | bytes) - Required - The path to the rig configuration file. ### Response - **list[pycolmap.RigConfig]** - A list of rig configurations. ## pycolmap.apply_rig_config ### Description Applies the given rig configuration to the database and optionally derives camera rig extrinsics and intrinsics from the reconstruction. ### Parameters - **configs** (collections.abc.Sequence[pycolmap.RigConfig]) - Required - The rig configurations to apply. - **database** (pycolmap.Database) - Required - The database to update. - **reconstruction** (pycolmap.Reconstruction) - Optional - The reconstruction to update. ``` -------------------------------- ### Absolute Pose Refinement Options Source: https://colmap.github.io/pycolmap/pycolmap.html Configure options for non-linear absolute pose refinement. Includes iteration limits, tolerances, and prior settings. ```python 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 max_num_iterations (int, default: 100) property loss_function_scale (float, default: 1.0) property refine_focal_length (bool, default: False) property refine_extra_params (bool, default: False) property print_summary (bool, default: False) property use_position_prior (bool, default: False) property position_prior_in_world (ndarray, default: [0. 0. 0.]) property position_prior_covariance (ndarray, default: [[1. 0. 0.] [0. 1. 0.] [0. 0. 1.]]) summary(_self : pycolmap.AbsolutePoseRefinementOptions_, _write_type : bool = False_) -> str mergedict(_self : object_, _kwargs : dict_) -> None todict(_self : pycolmap.AbsolutePoseRefinementOptions_, _recursive : bool = True_) -> dict } ``` -------------------------------- ### Run Incremental Mapping Pipeline Source: https://colmap.github.io/pycolmap/pycolmap.html Executes the full incremental mapping pipeline. This method should be called after the pipeline has been configured. ```python run(_self : pycolmap.IncrementalPipeline_) -> None ``` -------------------------------- ### pycolmap.logging Source: https://colmap.github.io/pycolmap/pycolmap.html Provides logging capabilities with different levels and configuration options. ```APIDOC ## pycolmap.logging ### Description This module provides functionalities for logging messages within the pycolmap library. It supports various log levels and allows configuration of log destinations and verbosity. ### Classes - `Level`: An enumeration for log levels (INFO, WARNING, ERROR, FATAL). ### Level Members - `INFO` (0) - `WARNING` (1) - `ERROR` (2) - `FATAL` (3) ### Global Logging Settings - `minloglevel` (int): Minimum log level to report. - `stderrthreshold` (int): Threshold for logging to stderr. - `log_dir` (str): Directory for log files. - `logtostderr` (bool): Whether to log to stderr. - `alsologtostderr` (bool): Whether to also log to stderr. - `logtostdout` (bool): Whether to log to stdout. - `colorlogtostdout` (bool): Whether to use color for stdout logging. - `colorlogtostderr` (bool): Whether to use color for stderr logging. - `verbose_level` (int): Verbosity level for detailed logging. ### Static Methods - `set_log_destination(level: pycolmap.logging.Level, path: os.PathLike | str | bytes) -> None`: Sets the destination for log files. - `verbose(level: SupportsInt, message: str) -> None`: Logs a message at a specified verbose level. - `info(message: str) -> None`: Logs an informational message. - `warning(message: str) -> None`: Logs a warning message. - `error(message: str) -> None`: Logs an error message. - `fatal(message: str) -> None`: Logs a fatal error message. ``` -------------------------------- ### Poisson Meshing Options Source: https://colmap.github.io/pycolmap/pycolmap.html Configuration options for Poisson surface reconstruction. ```APIDOC ## POISSON MESHING OPTIONS ### Description Configuration options for the Poisson surface reconstruction algorithm, used to generate a mesh from a point cloud. ### Class `pycolmap.PoissonMeshingOptions` ### Properties - `point_weight` (float, default: 1.0) - Importance of point samples in the screened Poisson equation formulation. - `depth` (int, default: 13) - Maximum depth of the tree for surface reconstruction. Corresponds to a maximum voxel grid resolution of 2^depth x 2^depth x 2^depth. - `color` (bool, default: True) - If True, assumes input has colors and extrapolates them to the mesh vertices. The float value specifies the relative importance of finer color estimates. - `trim` (float, default: 10.0) - Value for mesh trimming. Subsets with signal values less than this are discarded. - `num_threads` (int, default: -1) - The number of threads used for the Poisson reconstruction. ### Methods - `check(self: pycolmap.PoissonMeshingOptions) -> bool` - `summary(self: pycolmap.PoissonMeshingOptions, _write_type: bool = False) -> str` - `mergedict(self: object, **kwargs: dict) -> None` - `todict(self: pycolmap.PoissonMeshingOptions, _recursive: bool = True) -> dict` ``` -------------------------------- ### Absolute Pose Estimation Options Source: https://colmap.github.io/pycolmap/pycolmap.html Configure options for absolute pose estimation. Includes RANSAC parameters and focal length estimation. ```python 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) 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, num_threads=1)) summary(_self : pycolmap.AbsolutePoseEstimationOptions_, _write_type : bool = False_) -> str mergedict(_self : object_, _kwargs : dict_) -> None todict(_self : pycolmap.AbsolutePoseEstimationOptions_, _recursive : bool = True_) -> dict } ``` -------------------------------- ### Camera Class API Source: https://colmap.github.io/pycolmap/pycolmap.html Methods and properties for configuring and managing camera models. ```APIDOC ## Camera Class ### create_from_model_id Creates a camera instance using a model ID. - **camera_id** (SupportsInt) - **model** (pycolmap.CameraModelId) - **focal_length** (SupportsFloat) - **width** (SupportsInt) - **height** (SupportsInt) ### create_from_model_name Creates a camera instance using a model name string. - **camera_id** (SupportsInt) - **model_name** (str) - **focal_length** (SupportsFloat) - **width** (SupportsInt) - **height** (SupportsInt) ### Properties - **camera_id** (int) - **model** (CameraModelId) - **width** (int) - **height** (int) - **params** (ndarray) ### Methods - **calibration_matrix()** -> Returns [3, 3] numpy array. - **params_to_string()** -> Returns comma-separated string of parameters. - **set_params_from_string(params: str)** -> Sets parameters from string, returns bool. ```