limap.scene package
A reconstruction is a plain COLMAP model with the LIMAP structures beside it:
HolisticReconstruction pairs a pycolmap.Reconstruction with a
StructureReconstruction holding the 3D lines, groups, wireframe and
the per-image 2D structures. This module defines those types, the structure
database that carries the frontend output, and the helpers that fill it.
Reconstruction
The containers a pipeline reads and writes, serialized as a COLMAP model
plus a structures/ folder; see the output format. The manager holds several of them, as COLMAP’s
ReconstructionManager does for the point models.
- class limap.scene.HolisticReconstruction
- static exists_model(path: os.PathLike | str | bytes) bool
Check if a complete holistic reconstruction exists at path
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.HolisticReconstruction) -> None
__init__(self: limap._limap._scene.HolisticReconstruction, point_recon: pycolmap._core.Reconstruction) -> None
__init__(self: limap._limap._scene.HolisticReconstruction, path: str) -> None
- check_validity(self: limap._limap._scene.HolisticReconstruction) bool
- read(self: limap._limap._scene.HolisticReconstruction, arg0: os.PathLike | str | bytes) None
- read_binary(self: limap._limap._scene.HolisticReconstruction, arg0: os.PathLike | str | bytes) None
- read_text(self: limap._limap._scene.HolisticReconstruction, arg0: os.PathLike | str | bytes) None
- write(self: limap._limap._scene.HolisticReconstruction, arg0: os.PathLike | str | bytes) None
- write_binary(self: limap._limap._scene.HolisticReconstruction, arg0: os.PathLike | str | bytes) None
- write_text(self: limap._limap._scene.HolisticReconstruction, arg0: os.PathLike | str | bytes) None
- property point_recon
- property structure_recon
- class limap.scene.StructureReconstruction
- __init__(self: limap._limap._scene.StructureReconstruction, point_recon: pycolmap._core.Reconstruction) None
- add_group3D(*args, **kwargs)
Overloaded function.
add_group3D(self: limap._limap._scene.StructureReconstruction, group: limap._limap._scene.Group3d) -> int
Add a 3D group and return the assigned group3D_id
add_group3D(self: limap._limap._scene.StructureReconstruction, id: typing.SupportsInt | typing.SupportsIndex, group: limap._limap._scene.Group3d) -> None
Add a 3D group with a specific ID
- add_group_observation(self: limap._limap._scene.StructureReconstruction, group3D_id: SupportsInt | SupportsIndex, track_element: pycolmap._core.TrackElement) None
Add a group observation to an existing 3D group
- add_line3D(*args, **kwargs)
Overloaded function.
add_line3D(self: limap._limap._scene.StructureReconstruction, line: limap._limap._geometry.Line3d) -> int
Add a 3D line and return the assigned line3D_id
add_line3D(self: limap._limap._scene.StructureReconstruction, id: typing.SupportsInt | typing.SupportsIndex, line: limap._limap._geometry.Line3d) -> None
Add a 3D line with a specific ID
- add_line_observation(self: limap._limap._scene.StructureReconstruction, line3D_id: SupportsInt | SupportsIndex, track_element: pycolmap._core.TrackElement) None
Add a line observation to an existing 3D line
- add_structure2d(self: limap._limap._scene.StructureReconstruction, id: SupportsInt | SupportsIndex, structure: limap._limap._scene.Structure2d) None
- clear_groups3D(self: limap._limap._scene.StructureReconstruction) None
- clear_lines3D(self: limap._limap._scene.StructureReconstruction) None
- clear_structures2d(self: limap._limap._scene.StructureReconstruction) None
- compute_line_pixel_uncertainties(self: limap._limap._scene.StructureReconstruction, cauchy_scale: SupportsFloat | SupportsIndex = 1.0) dict[int, float]
Compute pixel uncertainty (std dev) for all lines using backprojected endpoints. Returns dict mapping line3D_id to uncertainty (-1 = not computable, inf = degenerate). Uses Cauchy loss (matching BA).
- construct_wireframe3d_from_2d(self: limap._limap._scene.StructureReconstruction, options: limap._limap._scene.WireframeVotingOptions = <limap._limap._scene.WireframeVotingOptions object at 0x7e10c9104bb0>) None
Construct 3D wireframe from 2D associations via voting. Edges meeting vote count and weight thresholds are added.
- delete_group3D(self: limap._limap._scene.StructureReconstruction, id: SupportsInt | SupportsIndex) None
- delete_group_observation(self: limap._limap._scene.StructureReconstruction, image_id: SupportsInt | SupportsIndex, group2D_idx: SupportsInt | SupportsIndex) None
Delete a group observation from its 3D group
- delete_line3D(self: limap._limap._scene.StructureReconstruction, id: SupportsInt | SupportsIndex) None
- delete_line_observation(self: limap._limap._scene.StructureReconstruction, image_id: SupportsInt | SupportsIndex, line2D_idx: SupportsInt | SupportsIndex) None
Delete a line observation from its 3D line
- delete_structure2d(self: limap._limap._scene.StructureReconstruction, id: SupportsInt | SupportsIndex) None
- exists_group3D(self: limap._limap._scene.StructureReconstruction, id: SupportsInt | SupportsIndex) bool
- exists_line3D(self: limap._limap._scene.StructureReconstruction, id: SupportsInt | SupportsIndex) bool
- exists_structure2d(self: limap._limap._scene.StructureReconstruction, id: SupportsInt | SupportsIndex) bool
- group(self: limap._limap._scene.StructureReconstruction, arg0: SupportsInt | SupportsIndex) limap._limap._scene.Group3dWithActiveLabels
- group3D_ids(self: limap._limap._scene.StructureReconstruction) set[int]
- initialize_all_wireframes(self: limap._limap._scene.StructureReconstruction, threshold: SupportsFloat | SupportsIndex = 2.0) None
- line(self: limap._limap._scene.StructureReconstruction, arg0: SupportsInt | SupportsIndex) limap._limap._scene.Line3dWithActiveLabels
- line3D_ids(self: limap._limap._scene.StructureReconstruction) set[int]
- load(self: limap._limap._scene.StructureReconstruction, structure_database: limap._limap._scene.StructureDatabaseCache) None
- merge_groups3D(self: limap._limap._scene.StructureReconstruction, group3D_id1: SupportsInt | SupportsIndex, group3D_id2: SupportsInt | SupportsIndex) int
Merge two 3D groups into one
- merge_lines3D(self: limap._limap._scene.StructureReconstruction, line3D_id1: SupportsInt | SupportsIndex, line3D_id2: SupportsInt | SupportsIndex) int
Merge two 3D lines into one
- num_groups3D(self: limap._limap._scene.StructureReconstruction) int
- num_lines3D(self: limap._limap._scene.StructureReconstruction) int
- read(self: limap._limap._scene.StructureReconstruction, arg0: os.PathLike | str | bytes) None
- read_binary(self: limap._limap._scene.StructureReconstruction, arg0: os.PathLike | str | bytes) None
- read_text(self: limap._limap._scene.StructureReconstruction, arg0: os.PathLike | str | bytes) None
- structure2d(self: limap._limap._scene.StructureReconstruction, arg0: SupportsInt | SupportsIndex) limap._limap._scene.Structure2d
- write(self: limap._limap._scene.StructureReconstruction, arg0: os.PathLike | str | bytes) None
- write_binary(self: limap._limap._scene.StructureReconstruction, arg0: os.PathLike | str | bytes) None
- write_text(self: limap._limap._scene.StructureReconstruction, arg0: os.PathLike | str | bytes) None
- property groups3D
- property lines3D
- property point_recon
- property structures2d
- property wireframe
- class limap.scene.HolisticReconstructionManager
- __init__(self: limap._limap._scene.HolisticReconstructionManager) None
- add(self: limap._limap._scene.HolisticReconstructionManager) int
- clear(self: limap._limap._scene.HolisticReconstructionManager) None
- delete(self: limap._limap._scene.HolisticReconstructionManager, idx: SupportsInt | SupportsIndex) None
- get(self: limap._limap._scene.HolisticReconstructionManager, idx: SupportsInt | SupportsIndex) limap._limap._scene.HolisticReconstruction
- read(self: limap._limap._scene.HolisticReconstructionManager, path: os.PathLike | str | bytes) int
- size(self: limap._limap._scene.HolisticReconstructionManager) int
- write(self: limap._limap._scene.HolisticReconstructionManager, path: os.PathLike | str | bytes) None
2D structures
What a single image observes: the line segments, groups and wireframe detected in it, together with the features associated to them.
- class limap.scene.Structure2d
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.Structure2d) -> None
__init__(self: limap._limap._scene.Structure2d, lines: collections.abc.Sequence[limap._limap._geometry.Line2d], groups: collections.abc.Sequence[limap._limap._scene.Group2d], wireframe: limap._limap._scene.Wireframe2d, num_points: typing.SupportsInt | typing.SupportsIndex = 0) -> None
- add_group(self: limap._limap._scene.Structure2d, arg0: limap._limap._scene.Group2d) None
- add_groups(self: limap._limap._scene.Structure2d, arg0: collections.abc.Sequence[limap._limap._scene.Group2d]) None
- group(self: limap._limap._scene.Structure2d, arg0: SupportsInt | SupportsIndex) limap._limap._scene.Group2d
- line(self: limap._limap._scene.Structure2d, arg0: SupportsInt | SupportsIndex) limap._limap._geometry.Line2d
- num_groups(self: limap._limap._scene.Structure2d) int
- num_lines(self: limap._limap._scene.Structure2d) int
- num_points(self: limap._limap._scene.Structure2d) int
- set_groups(self: limap._limap._scene.Structure2d, arg0: collections.abc.Sequence[limap._limap._scene.Group2d]) None
- set_lines(self: limap._limap._scene.Structure2d, arg0: collections.abc.Sequence[limap._limap._geometry.Line2d]) None
- set_num_points(self: limap._limap._scene.Structure2d, arg0: SupportsInt | SupportsIndex) None
- set_wireframe(self: limap._limap._scene.Structure2d, arg0: limap._limap._scene.Wireframe2d) None
- property groups
- property lines
- property wireframe
- class limap.scene.AssociatedFeature2d
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.AssociatedFeature2d) -> None
__init__(self: limap._limap._scene.AssociatedFeature2d, idx: typing.SupportsInt | typing.SupportsIndex, w: typing.SupportsFloat | typing.SupportsIndex = 1.0) -> None
__init__(self: limap._limap._scene.AssociatedFeature2d, kwargs: dict) -> None
__init__(self: limap._limap._scene.AssociatedFeature2d, **kwargs) -> None
- mergedict(self: object, kwargs: dict) None
- summary(self: limap._limap._scene.AssociatedFeature2d, write_type: bool = False) str
- todict(self: limap._limap._scene.AssociatedFeature2d, recursive: bool = True) dict
- property idx
- Type:
(int, default
- property w
1.0)
- Type:
(float, default
- class limap.scene.Group2d
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.Group2d) -> None
__init__(self: limap._limap._scene.Group2d, arg0: limap._limap._geometry.GroupType) -> None
__init__(self: limap._limap._scene.Group2d, type: limap._limap._geometry.GroupType, points: collections.abc.Sequence[limap._limap._scene.AssociatedFeature2d], lines: collections.abc.Sequence[limap._limap._scene.AssociatedFeature2d] = []) -> None
__init__(self: limap._limap._scene.Group2d, kwargs: dict) -> None
__init__(self: limap._limap._scene.Group2d, **kwargs) -> None
- add_line(*args, **kwargs)
Overloaded function.
add_line(self: limap._limap._scene.Group2d, arg0: limap._limap._scene.AssociatedFeature2d) -> None
add_line(self: limap._limap._scene.Group2d, arg0: typing.SupportsInt | typing.SupportsIndex) -> None
- add_lines(*args, **kwargs)
Overloaded function.
add_lines(self: limap._limap._scene.Group2d, arg0: collections.abc.Sequence[limap._limap._scene.AssociatedFeature2d]) -> None
add_lines(self: limap._limap._scene.Group2d, feats: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], weights: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> None
- add_point(*args, **kwargs)
Overloaded function.
add_point(self: limap._limap._scene.Group2d, arg0: limap._limap._scene.AssociatedFeature2d) -> None
add_point(self: limap._limap._scene.Group2d, arg0: typing.SupportsInt | typing.SupportsIndex) -> None
- add_points(*args, **kwargs)
Overloaded function.
add_points(self: limap._limap._scene.Group2d, arg0: collections.abc.Sequence[limap._limap._scene.AssociatedFeature2d]) -> None
add_points(self: limap._limap._scene.Group2d, feats: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], weights: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> None
- get_max_line_id(self: limap._limap._scene.Group2d) int | None
- get_max_point_id(self: limap._limap._scene.Group2d) int | None
- mergedict(self: object, kwargs: dict) None
- summary(self: limap._limap._scene.Group2d, write_type: bool = False) str
- todict(self: limap._limap._scene.Group2d, recursive: bool = True) dict
- property group3D_id
- Type:
(int, default
- property lines
[])
- Type:
(list, default
- property params
[])
- Type:
(list, default
- property points
[])
- Type:
(list, default
- class limap.scene.Wireframe2d
- __init__(self: limap._limap._scene.Wireframe2d) None
- add_edge(*args, **kwargs)
Overloaded function.
add_edge(self: limap._limap._scene.Wireframe2d, arg0: typing.SupportsInt | typing.SupportsIndex, arg1: typing.SupportsInt | typing.SupportsIndex, arg2: typing.SupportsFloat | typing.SupportsIndex) -> None
add_edge(self: limap._limap._scene.Wireframe2d, arg0: limap._limap._scene.WireframeConnection2d) -> None
- clear(self: limap._limap._scene.Wireframe2d) None
- count_edges(self: limap._limap._scene.Wireframe2d) int
- count_lines(self: limap._limap._scene.Wireframe2d) int
- count_neighboring_lines(self: limap._limap._scene.Wireframe2d, arg0: SupportsInt | SupportsIndex) bool
- count_neighboring_points(self: limap._limap._scene.Wireframe2d, arg0: SupportsInt | SupportsIndex) bool
- count_points(self: limap._limap._scene.Wireframe2d) int
- get_all_edges(self: limap._limap._scene.Wireframe2d) list[limap._limap._scene.WireframeConnection2d]
- get_edge(self: limap._limap._scene.Wireframe2d, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) limap._limap._scene.WireframeConnection2d
- get_edge_weight(self: limap._limap._scene.Wireframe2d, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) float
- get_neighboring_line_ids(self: limap._limap._scene.Wireframe2d, arg0: SupportsInt | SupportsIndex) list[int]
- get_neighboring_point_ids(self: limap._limap._scene.Wireframe2d, arg0: SupportsInt | SupportsIndex) list[int]
- remove_edge(*args, **kwargs)
Overloaded function.
remove_edge(self: limap._limap._scene.Wireframe2d, arg0: typing.SupportsInt | typing.SupportsIndex, arg1: typing.SupportsInt | typing.SupportsIndex) -> None
remove_edge(self: limap._limap._scene.Wireframe2d, arg0: limap._limap._scene.WireframeConnection2d) -> None
- class limap.scene.WireframeConnection2d
- __init__(self: limap._limap._scene.WireframeConnection2d) None
- property line_idx
- property point_idx
- property w
- limap.scene.create_wireframe2d(points: collections.abc.Sequence[Eigen::Matrix<double, 2, 1, 0, 2, 1>], lines: collections.abc.Sequence[limap._limap._geometry.Line2d], threshold: typing.SupportsFloat | typing.SupportsIndex = 2.0) limap._limap._scene.Wireframe2d
3D structures
Their counterparts in the reconstruction. The WithActiveLabels variants
additionally track which of their observations are currently active, a
transient state that is not serialized.
- class limap.scene.AssociatedFeature3d
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.AssociatedFeature3d) -> None
__init__(self: limap._limap._scene.AssociatedFeature3d, idx: typing.SupportsInt | typing.SupportsIndex, w: typing.SupportsFloat | typing.SupportsIndex = 1.0) -> None
- property idx
- property w
- class limap.scene.Group3d
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.Group3d) -> None
__init__(self: limap._limap._scene.Group3d, arg0: limap._limap._geometry.GroupType) -> None
__init__(self: limap._limap._scene.Group3d, arg0: limap._limap._geometry.GroupType, arg1: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None
__init__(self: limap._limap._scene.Group3d, type: limap._limap._geometry.GroupType, params: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], points: collections.abc.Sequence[limap._limap._scene.AssociatedFeature3d], lines: collections.abc.Sequence[limap._limap._scene.AssociatedFeature3d] = []) -> None
- add_line(*args, **kwargs)
Overloaded function.
add_line(self: limap._limap._scene.Group3d, arg0: limap._limap._scene.AssociatedFeature3d) -> None
add_line(self: limap._limap._scene.Group3d, arg0: typing.SupportsInt | typing.SupportsIndex) -> None
- add_lines(*args, **kwargs)
Overloaded function.
add_lines(self: limap._limap._scene.Group3d, arg0: collections.abc.Sequence[limap._limap._scene.AssociatedFeature3d]) -> None
add_lines(self: limap._limap._scene.Group3d, arg0: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], arg1: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None
- add_point(*args, **kwargs)
Overloaded function.
add_point(self: limap._limap._scene.Group3d, arg0: limap._limap._scene.AssociatedFeature3d) -> None
add_point(self: limap._limap._scene.Group3d, arg0: typing.SupportsInt | typing.SupportsIndex) -> None
- add_points(*args, **kwargs)
Overloaded function.
add_points(self: limap._limap._scene.Group3d, arg0: collections.abc.Sequence[limap._limap._scene.AssociatedFeature3d]) -> None
add_points(self: limap._limap._scene.Group3d, arg0: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], arg1: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None
- check_params(self: limap._limap._scene.Group3d, tol: SupportsFloat | SupportsIndex = 1e-06) bool
Check if params are valid and normalized
- normalize_params(self: limap._limap._scene.Group3d) None
Normalize params in-place to canonical form
- property lines
- property params
- property points
- property track
- property type
- class limap.scene.Group3dWithActiveLabels
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.Group3dWithActiveLabels) -> None
__init__(self: limap._limap._scene.Group3dWithActiveLabels, arg0: limap._limap._scene.Group3d) -> None
- cleanup_inactive_sets(self: limap._limap._scene.Group3dWithActiveLabels) None
- clear_inactive_labels(self: limap._limap._scene.Group3dWithActiveLabels) None
- count_active_associations(self: limap._limap._scene.Group3dWithActiveLabels) int
- count_active_lines(self: limap._limap._scene.Group3dWithActiveLabels) int
- count_active_points(self: limap._limap._scene.Group3dWithActiveLabels) int
- is_line_active(self: limap._limap._scene.Group3dWithActiveLabels, id: SupportsInt | SupportsIndex) bool
- is_point_active(self: limap._limap._scene.Group3dWithActiveLabels, id: SupportsInt | SupportsIndex) bool
- purge_inactive_associations(self: limap._limap._scene.Group3dWithActiveLabels) int
- set_line_active(self: limap._limap._scene.Group3dWithActiveLabels, id: SupportsInt | SupportsIndex) None
- set_line_inactive(self: limap._limap._scene.Group3dWithActiveLabels, id: SupportsInt | SupportsIndex) None
- set_point_active(self: limap._limap._scene.Group3dWithActiveLabels, id: SupportsInt | SupportsIndex) None
- set_point_inactive(self: limap._limap._scene.Group3dWithActiveLabels, id: SupportsInt | SupportsIndex) None
- class limap.scene.Line3dWithActiveLabels
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.Line3dWithActiveLabels) -> None
__init__(self: limap._limap._scene.Line3dWithActiveLabels, line: limap._limap._geometry.Line3d) -> None
- active_ratio(self: limap._limap._scene.Line3dWithActiveLabels) float
- cleanup_inactive_set(self: limap._limap._scene.Line3dWithActiveLabels) None
- clear_inactive_labels(self: limap._limap._scene.Line3dWithActiveLabels) None
- count_active_observations(self: limap._limap._scene.Line3dWithActiveLabels) int
- is_observation_active(self: limap._limap._scene.Line3dWithActiveLabels, image_id: SupportsInt | SupportsIndex) bool
- is_reliable(self: limap._limap._scene.Line3dWithActiveLabels, min_active: SupportsInt | SupportsIndex = 1) bool
- merge_inactive_from(self: limap._limap._scene.Line3dWithActiveLabels, other: limap._limap._scene.Line3dWithActiveLabels) None
- set_observation_active(self: limap._limap._scene.Line3dWithActiveLabels, image_id: SupportsInt | SupportsIndex) None
- set_observation_inactive(self: limap._limap._scene.Line3dWithActiveLabels, image_id: SupportsInt | SupportsIndex) None
- property inactive_images
- class limap.scene.Wireframe3d
- __init__(self: limap._limap._scene.Wireframe3d) None
- add_edge(*args, **kwargs)
Overloaded function.
add_edge(self: limap._limap._scene.Wireframe3d, arg0: typing.SupportsInt | typing.SupportsIndex, arg1: typing.SupportsInt | typing.SupportsIndex, arg2: typing.SupportsFloat | typing.SupportsIndex) -> None
add_edge(self: limap._limap._scene.Wireframe3d, arg0: limap._limap._scene.WireframeConnection3d) -> None
- clear(self: limap._limap._scene.Wireframe3d) None
- count_edges(self: limap._limap._scene.Wireframe3d) int
- count_lines(self: limap._limap._scene.Wireframe3d) int
- count_neighboring_lines(self: limap._limap._scene.Wireframe3d, arg0: SupportsInt | SupportsIndex) bool
- count_neighboring_points(self: limap._limap._scene.Wireframe3d, arg0: SupportsInt | SupportsIndex) bool
- count_points(self: limap._limap._scene.Wireframe3d) int
- get_all_edges(self: limap._limap._scene.Wireframe3d) list[limap._limap._scene.WireframeConnection3d]
- get_edge(self: limap._limap._scene.Wireframe3d, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) limap._limap._scene.WireframeConnection3d
- get_edge_weight(self: limap._limap._scene.Wireframe3d, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) float
- get_neighboring_line_ids(self: limap._limap._scene.Wireframe3d, arg0: SupportsInt | SupportsIndex) list[int]
- get_neighboring_point_ids(self: limap._limap._scene.Wireframe3d, arg0: SupportsInt | SupportsIndex) list[int]
- remove_edge(*args, **kwargs)
Overloaded function.
remove_edge(self: limap._limap._scene.Wireframe3d, arg0: typing.SupportsInt | typing.SupportsIndex, arg1: typing.SupportsInt | typing.SupportsIndex) -> None
remove_edge(self: limap._limap._scene.Wireframe3d, arg0: limap._limap._scene.WireframeConnection3d) -> None
- class limap.scene.WireframeConnection3d
- __init__(self: limap._limap._scene.WireframeConnection3d) None
- property line_idx
- property point_idx
- property w
- class limap.scene.WireframeVotingOptions
- __init__(self: limap._limap._scene.WireframeVotingOptions) None
- property min_num_votes
- property min_weight_sum
Matches and correspondences
Line and group correspondences ride in the same TwoViewGeometry
structures as the point matches, and are collected into a pair of
colmap::CorrespondenceGraph instances, one for lines and one for groups.
- class limap.scene.LineMatch
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.LineMatch) -> None
__init__(self: limap._limap._scene.LineMatch, line2D_idx1: typing.SupportsInt | typing.SupportsIndex, line2D_idx2: typing.SupportsInt | typing.SupportsIndex) -> None
- property line2D_idx1
- property line2D_idx2
- class limap.scene.LineMatches
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.LineMatches) -> None
__init__(self: limap._limap._scene.LineMatches, arg0: collections.abc.Sequence[limap._limap._scene.LineMatch]) -> None
Copy constructor
__init__(self: limap._limap._scene.LineMatches, arg0: collections.abc.Iterable) -> None
- append(self: collections.abc.Sequence[limap._limap._scene.LineMatch], x: limap._limap._scene.LineMatch) None
Add an item to the end of the list
- clear(self: collections.abc.Sequence[limap._limap._scene.LineMatch]) None
Clear the contents
- extend(*args, **kwargs)
Overloaded function.
extend(self: collections.abc.Sequence[limap._limap._scene.LineMatch], L: collections.abc.Sequence[limap._limap._scene.LineMatch]) -> None
Extend the list by appending all the items in the given list
extend(self: collections.abc.Sequence[limap._limap._scene.LineMatch], L: collections.abc.Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: collections.abc.Sequence[limap._limap._scene.LineMatch], i: SupportsInt | SupportsIndex, x: limap._limap._scene.LineMatch) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: collections.abc.Sequence[limap._limap._scene.LineMatch]) -> limap._limap._scene.LineMatch
Remove and return the last item
pop(self: collections.abc.Sequence[limap._limap._scene.LineMatch], i: typing.SupportsInt | typing.SupportsIndex) -> limap._limap._scene.LineMatch
Remove and return the item at index
i
- class limap.scene.GroupMatch
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.GroupMatch) -> None
__init__(self: limap._limap._scene.GroupMatch, group2D_idx1: typing.SupportsInt | typing.SupportsIndex, group2D_idx2: typing.SupportsInt | typing.SupportsIndex) -> None
- property group2D_idx1
- property group2D_idx2
- class limap.scene.GroupMatches
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.GroupMatches) -> None
__init__(self: limap._limap._scene.GroupMatches, arg0: collections.abc.Sequence[limap._limap._scene.GroupMatch]) -> None
Copy constructor
__init__(self: limap._limap._scene.GroupMatches, arg0: collections.abc.Iterable) -> None
- append(self: collections.abc.Sequence[limap._limap._scene.GroupMatch], x: limap._limap._scene.GroupMatch) None
Add an item to the end of the list
- clear(self: collections.abc.Sequence[limap._limap._scene.GroupMatch]) None
Clear the contents
- extend(*args, **kwargs)
Overloaded function.
extend(self: collections.abc.Sequence[limap._limap._scene.GroupMatch], L: collections.abc.Sequence[limap._limap._scene.GroupMatch]) -> None
Extend the list by appending all the items in the given list
extend(self: collections.abc.Sequence[limap._limap._scene.GroupMatch], L: collections.abc.Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: collections.abc.Sequence[limap._limap._scene.GroupMatch], i: SupportsInt | SupportsIndex, x: limap._limap._scene.GroupMatch) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: collections.abc.Sequence[limap._limap._scene.GroupMatch]) -> limap._limap._scene.GroupMatch
Remove and return the last item
pop(self: collections.abc.Sequence[limap._limap._scene.GroupMatch], i: typing.SupportsInt | typing.SupportsIndex) -> limap._limap._scene.GroupMatch
Remove and return the item at index
i
- class limap.scene.StructureCorrespondenceGraph
- __init__(self: limap._limap._scene.StructureCorrespondenceGraph) None
- add_group_matches(self: limap._limap._scene.StructureCorrespondenceGraph, image_id1: SupportsInt | SupportsIndex, image_id2: SupportsInt | SupportsIndex, matches: collections.abc.Sequence[limap._limap._scene.GroupMatch]) None
- add_line_matches(self: limap._limap._scene.StructureCorrespondenceGraph, image_id1: SupportsInt | SupportsIndex, image_id2: SupportsInt | SupportsIndex, matches: collections.abc.Sequence[limap._limap._scene.LineMatch]) None
- property group_graph
- property line_graph
Structure database
structure_database.db is LIMAP’s counterpart of COLMAP’s database.db:
it stores the 2D lines and groups, their associations and their matches.
- class limap.scene.StructureDatabase
- static open(path: os.PathLike | str | bytes) limap._limap._scene.StructureDatabase
- __init__(self: limap._limap._scene.StructureDatabase) None
- clear_all_tables(self: limap._limap._scene.StructureDatabase) None
- clear_group_matches(self: limap._limap._scene.StructureDatabase) None
- clear_line_matches(self: limap._limap._scene.StructureDatabase) None
- clear_structures2d(self: limap._limap._scene.StructureDatabase) None
- close(self: limap._limap._scene.StructureDatabase) None
- delete_group_matches(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) None
- delete_line_matches(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) None
- exists_group_matches(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) bool
- exists_line_matches(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) bool
- exists_structure2d(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex) bool
- read_all_group_matches(self: limap._limap._scene.StructureDatabase) list[tuple[int, list[limap._limap._scene.GroupMatch]]]
- read_all_group_matches_blob(self: limap._limap._scene.StructureDatabase) list[tuple[int, Annotated[numpy.typing.NDArray[numpy.uint32], '[m, 2]']]]
- read_all_line_matches(self: limap._limap._scene.StructureDatabase) list[tuple[int, list[limap._limap._scene.LineMatch]]]
- read_all_line_matches_blob(self: limap._limap._scene.StructureDatabase) list[tuple[int, Annotated[numpy.typing.NDArray[numpy.uint32], '[m, 2]']]]
- read_all_structures2d(self: limap._limap._scene.StructureDatabase) dict[int, limap._limap._scene.Structure2d]
- read_group_matches(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) list[limap._limap._scene.GroupMatch]
- read_group_matches_blob(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) Annotated[numpy.typing.NDArray[numpy.uint32], '[m, 2]']
- read_line_matches(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) list[limap._limap._scene.LineMatch]
- read_line_matches_blob(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) Annotated[numpy.typing.NDArray[numpy.uint32], '[m, 2]']
- read_structure2d(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex) limap._limap._scene.Structure2d
- update_structure2d(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: limap._limap._scene.Structure2d) None
- write_group_matches(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex, arg2: Annotated[numpy.typing.ArrayLike, numpy.uint32, '[m, 2]']) None
- write_line_matches(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex, arg2: Annotated[numpy.typing.ArrayLike, numpy.uint32, '[m, 2]']) None
- write_structure2d(self: limap._limap._scene.StructureDatabase, arg0: SupportsInt | SupportsIndex, arg1: limap._limap._scene.Structure2d) None
- class limap.scene.StructureDatabaseCache
- static create(struct_db: limap._limap._scene.StructureDatabase) limap._limap._scene.StructureDatabaseCache
- __init__(self: limap._limap._scene.StructureDatabaseCache) None
- structure2d(self: limap._limap._scene.StructureDatabaseCache, image_id: SupportsInt | SupportsIndex) limap._limap._scene.Structure2d
- property structure_correspondence_graph
- property structures2d
- class limap.scene.StructureDatabaseTransaction
- __init__(self: limap._limap._scene.StructureDatabaseTransaction, db: limap._limap._scene.StructureDatabase) None
- limap.scene.create_structure_db(db_path: Path, delete_if_exist=True) None
- limap.scene.initialize_structures(structure_db: StructureDatabase, image_ids: list[int], db: Database) None
- limap.scene.initialize_structures_from_reconstruction(structure_db: StructureDatabase, recon: Reconstruction) None
Initialize structures with num_points from the reconstruction.
Use this instead of initialize_structures() when skipping point detection — the COLMAP database has no imported keypoints, but the reconstruction’s image.num_points2D() has the correct count.
- limap.scene.import_line_detections(structure_db: StructureDatabase, all_2d_lines: dict[int, list[Line2d]]) None
- limap.scene.import_line_matches(structure_db: StructureDatabase, matches_dir: Path) None
- limap.scene.import_group_descriptions(structure_db: StructureDatabase, all_groups2d: dict[int, list[Group2d]]) None
Depth and point cloud readers
Interfaces for the geometry-guided pipelines, which reconstruct lines from depth maps or a point cloud instead of triangulating them.
- class limap.scene.BaseDepthReader(filename)
Base class for the depth reader storing the filename and potentially other information.
- __init__(filename)
- read(filename)
Virtual method - Read depth from a filename.
- Parameters:
filename (str) – The filename of the depth image
- Returns:
The array for the depth map
- Return type:
depth (
np.arrayof shape (H, W))
- read_depth(img_hw=None)
Read depth using the read(self, filename) function.
- Parameters:
img_hw (pair of int, optional) – The height and width for the read depth. By default we keep the original resolution of the file
- Returns:
The array for the depth map
- Return type:
depth (
np.arrayof shape (H, W))
- class limap.scene.BasePointCloudReader(filename)
Base class for point cloud readers storing the filename and potentially other information.
The point cloud should be in world coordinates and organized as an image-like array (H, W, 3) for pixel-based lookup during line fitting.
- __init__(filename)
- read(filename)
Virtual method - Read a point cloud from a filename.
- Parameters:
filename (str) – The filename of the point cloud file
- Returns:
The array for the 3D points in world coordinates, organized as an image for pixel-based lookup
- Return type:
point cloud (
np.arrayof shape (H, W, 3))
- read_point_cloud()
Read a point cloud using the read(self, filename) function.
- Returns:
The array for the 3D points in world coordinates
- Return type:
point cloud (
np.arrayof shape (H, W, 3))
COLMAP MVS models
- class limap.scene.COLMAPMVSModel
- __init__(self: limap._limap._scene.COLMAPMVSModel) None
- add_image(self: limap._limap._scene.COLMAPMVSModel, image: limap._limap._scene.COLMAPMVSImage, img_id: SupportsInt | SupportsIndex = -1) None
- add_point(self: limap._limap._scene.COLMAPMVSModel, x: SupportsFloat | SupportsIndex, y: SupportsFloat | SupportsIndex, z: SupportsFloat | SupportsIndex, image_ids: collections.abc.Sequence[SupportsInt | SupportsIndex]) None
- compute_ranges(self: limap._limap._scene.COLMAPMVSModel, range_robust: tuple[SupportsFloat | SupportsIndex, SupportsFloat | SupportsIndex], kstretch: SupportsFloat | SupportsIndex) tuple[Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]'], Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']]
- get_image_names(self: limap._limap._scene.COLMAPMVSModel) list[str]
- get_max_dice_coeff_images(self: limap._limap._scene.COLMAPMVSModel, num_images: SupportsInt | SupportsIndex, min_tri_angle: SupportsFloat | SupportsIndex) dict[int, list[int]]
- get_max_iou_images(self: limap._limap._scene.COLMAPMVSModel, num_images: SupportsInt | SupportsIndex, min_tri_angle: SupportsFloat | SupportsIndex) dict[int, list[int]]
- get_max_overlap_images(self: limap._limap._scene.COLMAPMVSModel, num_images: SupportsInt | SupportsIndex, min_tri_angle: SupportsFloat | SupportsIndex) dict[int, list[int]]
- read_from_colmap(self: limap._limap._scene.COLMAPMVSModel, path: os.PathLike | str | bytes, sparse_path: os.PathLike | str | bytes, image_path: os.PathLike | str | bytes) None
- class limap.scene.COLMAPMVSImage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: limap._limap._scene.COLMAPMVSImage) -> None
__init__(self: limap._limap._scene.COLMAPMVSImage, arg0: str, arg1: typing.SupportsInt | typing.SupportsIndex, arg2: typing.SupportsInt | typing.SupportsIndex, arg3: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], arg4: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], arg5: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None
- get_K(self: limap._limap._scene.COLMAPMVSImage) float
- get_P(self: limap._limap._scene.COLMAPMVSImage) float
- get_R(self: limap._limap._scene.COLMAPMVSImage) float
- get_T(self: limap._limap._scene.COLMAPMVSImage) float
- get_inv_P(self: limap._limap._scene.COLMAPMVSImage) float
- limap.scene.compute_neighbors(model: COLMAPMVSModel, n_neighbors: int, min_triangulation_angle: float = 1.0, neighbor_type: Literal['iou', 'overlap', 'dice'] = 'iou') dict[int, list[int]]
Compute neighboring images for each image based on point visibility.
- Parameters:
model – The COLMAP MVS model containing images and points.
n_neighbors – Number of neighbors to compute for each image.
min_triangulation_angle – Minimum triangulation angle in degrees.
neighbor_type – Type of neighbor selection metric: - “iou”: Intersection over Union of visible points - “overlap”: Number of shared visible points - “dice”: Dice coefficient of visible points
- Returns:
Dictionary mapping image ID to list of neighbor image IDs.