limap.evaluation package

Evaluation of a reconstructed line map against a ground truth: a mesh, a point cloud, or a set of reference 3D lines. The mesh and point cloud evaluators share an interface – point and line distances to the ground-truth surface, and the inlier and outlier parts of a segment under a threshold.

Evaluate w.r.t. a mesh

class limap.evaluation.MeshEvaluator
ComputeDistLine(self: limap._limap._evaluation.MeshEvaluator, line: limap._limap._geometry.Line3d, n_samples: SupportsInt | SupportsIndex = 1000) float

Compute the distance for a set of uniformly sampled points along the line

Parameters:
  • line (Line3d) – Line3d: instance

  • n_samples (int, optional) – number of samples (default = 1000)

Returns:

the computed distances

Return type:

np.array of shape (n_samples,)

ComputeDistPoint(self: limap._limap._evaluation.MeshEvaluator, arg0: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) float

Compute the distance from a query point to the mesh

:param np.array of shape: The query point :type np.array of shape: 3,

Returns:

The distance from the point to the GT mesh

Return type:

float

ComputeInlierRatio(self: limap._limap._evaluation.MeshEvaluator, line: limap._limap._geometry.Line3d, threshold: SupportsFloat | SupportsIndex, n_samples: SupportsInt | SupportsIndex = 1000) float

Compute the percentage of the line lying with a certain threshold to the mesh

Parameters:
  • line (Line3d) – Line3d: instance

  • threshold (float) – threshold

  • n_samples (int, optional) – number of samples (default = 1000)

Returns:

The computed percentage

Return type:

float

ComputeInlierSegs(self: limap._limap._evaluation.MeshEvaluator, lines: collections.abc.Sequence[limap._limap._geometry.Line3d], threshold: SupportsFloat | SupportsIndex, n_samples: SupportsInt | SupportsIndex = 1000) list[limap._limap._geometry.Line3d]

Compute the inlier parts of the lines that are within a certain threshold to the mesh, for visualization.

Parameters:
  • lines (list[limap.geometry.Line3d]) – Input 3D line segments

  • threshold (float) – threshold

  • n_samples (int) – number of samples (default = 1000)

Returns:

Inlier parts of all the lines, useful for visualization

Return type:

list[limap.geometry.Line3d]

ComputeOutlierSegs(self: limap._limap._evaluation.MeshEvaluator, lines: collections.abc.Sequence[limap._limap._geometry.Line3d], threshold: SupportsFloat | SupportsIndex, n_samples: SupportsInt | SupportsIndex = 1000) list[limap._limap._geometry.Line3d]

Compute the outlier parts of the lines that are at least a certain threshold far away from the mesh, for visualization.

Parameters:
  • lines (list[limap.geometry.Line3d]) – Input 3D line segments

  • threshold (float) – threshold

  • n_samples (int) – number of samples (default = 1000)

Returns:

Outlier parts of all the lines, useful for visualization

Return type:

list[limap.geometry.Line3d]

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: limap._limap._evaluation.MeshEvaluator) -> None

    Default constructor

  2. __init__(self: limap._limap._evaluation.MeshEvaluator, arg0: str, arg1: typing.SupportsFloat | typing.SupportsIndex) -> None

    Constructor from a mesh file (str) and a scale (float)

Evaluate w.r.t. a point cloud

Distances are queried through a K-D tree, which can be built once and then saved and reloaded.

class limap.evaluation.PointCloudEvaluator

The evaluator for line maps with respect to a GT point cloud (using a K-D Tree).

Build(self: limap._limap._evaluation.PointCloudEvaluator) None

Build the indexes of the K-D Tree

ComputeDistLine(self: limap._limap._evaluation.PointCloudEvaluator, line: limap._limap._geometry.Line3d, n_samples: SupportsInt | SupportsIndex = 1000) float

Compute the distance for a set of uniformly sampled points along the line

Parameters:
  • line (Line3d) – Line3d: instance

  • n_samples (int, optional) – number of samples (default = 1000)

Returns:

the computed distances

Return type:

np.array of shape (n_samples,)

ComputeDistPoint(self: limap._limap._evaluation.PointCloudEvaluator, arg0: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) float

Compute the distance from a query point to the point cloud

:param np.array of shape: The query point :type np.array of shape: 3,

Returns:

The distance from the point to the GT point cloud

Return type:

float

ComputeDistsforEachPoint(self: limap._limap._evaluation.PointCloudEvaluator, arg0: collections.abc.Sequence[limap._limap._geometry.Line3d]) list[float]
ComputeDistsforEachPoint_KDTree(self: limap._limap._evaluation.PointCloudEvaluator, arg0: collections.abc.Sequence[limap._limap._geometry.Line3d]) list[float]
ComputeInlierRatio(self: limap._limap._evaluation.PointCloudEvaluator, line: limap._limap._geometry.Line3d, threshold: SupportsFloat | SupportsIndex, n_samples: SupportsInt | SupportsIndex = 1000) float

Compute the percentage of the line lying with a certain threshold to the point cloud

Parameters:
  • line (Line3d) – Line3d: instance

  • threshold (float) – threshold

  • n_samples (int, optional) – number of samples (default = 1000)

Returns:

The computed percentage

Return type:

float

ComputeInlierSegs(self: limap._limap._evaluation.PointCloudEvaluator, lines: collections.abc.Sequence[limap._limap._geometry.Line3d], threshold: SupportsFloat | SupportsIndex, n_samples: SupportsInt | SupportsIndex = 1000) list[limap._limap._geometry.Line3d]

Compute the inlier parts of the lines that are within a certain threshold to the point cloud, for visualization.

Parameters:
  • lines (list[limap.geometry.Line3d]) – Input 3D line segments

  • threshold (float) – threshold

  • n_samples (int) – number of samples (default = 1000)

Returns:

Inlier parts of all the lines, useful for visualization

Return type:

list[limap.geometry.Line3d]

ComputeOutlierSegs(self: limap._limap._evaluation.PointCloudEvaluator, lines: collections.abc.Sequence[limap._limap._geometry.Line3d], threshold: SupportsFloat | SupportsIndex, n_samples: SupportsInt | SupportsIndex = 1000) list[limap._limap._geometry.Line3d]

Compute the outlier parts of the lines that are at least a certain threshold far away from the point cloud, for visualization.

Parameters:
  • lines (list[limap.geometry.Line3d]) – Input 3D line segments

  • threshold (float) – threshold

  • n_samples (int) – number of samples (default = 1000)

Returns:

Outlier parts of all the lines, useful for visualization

Return type:

list[limap.geometry.Line3d]

Load(self: limap._limap._evaluation.PointCloudEvaluator, arg0: str) None

Read the pre-built K-D Tree from a file

Parameters:

filename (str) – The file to read from

Save(self: limap._limap._evaluation.PointCloudEvaluator, arg0: str) None

Save the built K-D Tree into a file

Parameters:

filename (str) – The file to write to

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: limap._limap._evaluation.PointCloudEvaluator) -> None

    Default constructor

  2. __init__(self: limap._limap._evaluation.PointCloudEvaluator, arg0: collections.abc.Sequence[typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[3, 1]”]]) -> None

    Constructor from list[np.array] of shape (3,)

  3. __init__(self: limap._limap._evaluation.PointCloudEvaluator, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[m, n]”]) -> None

    Constructor from np.array of shape (N, 3)

Evaluate w.r.t. reference lines

Recall of the reference lines covered by the reconstruction, and of the reconstructed lines supported by a reference.

class limap.evaluation.RefLineEvaluator
ComputeRecallRef(self: limap._limap._evaluation.RefLineEvaluator, lines: collections.abc.Sequence[limap._limap._geometry.Line3d], threshold: SupportsFloat | SupportsIndex, n_samples: SupportsInt | SupportsIndex = 1000) float
ComputeRecallTested(self: limap._limap._evaluation.RefLineEvaluator, lines: collections.abc.Sequence[limap._limap._geometry.Line3d], threshold: SupportsFloat | SupportsIndex, n_samples: SupportsInt | SupportsIndex = 1000) float
SumLength(self: limap._limap._evaluation.RefLineEvaluator) float
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: limap._limap._evaluation.RefLineEvaluator) -> None

  2. __init__(self: limap._limap._evaluation.RefLineEvaluator, arg0: collections.abc.Sequence[limap._limap._geometry.Line3d]) -> None