cars_mesh.tools.metrics

Evaluation metrics

Module Contents

Classes

PointCloudMetrics

Compute metrics between two points clouds

Functions

mean_squared_distance(→ float)

root_mean_squared_distance(→ float)

mean_distance(→ float)

median_distance(→ float)

hausdorff_asym_distance(→ float)

hausdorff_sym_distance(→ float)

chamfer_distance(→ float)

point_to_plane_distance(→ numpy.ndarray)

The point-to-plane distance first computes the normal of the surface at

cars_mesh.tools.metrics.mean_squared_distance(dist: numpy.array) float[source]
cars_mesh.tools.metrics.root_mean_squared_distance(dist: numpy.array) float[source]
cars_mesh.tools.metrics.mean_distance(dist: numpy.array) float[source]
cars_mesh.tools.metrics.median_distance(dist: numpy.array) float[source]
cars_mesh.tools.metrics.hausdorff_asym_distance(dist: numpy.array) float[source]
cars_mesh.tools.metrics.hausdorff_sym_distance(dist_1: numpy.array, dist_2: numpy.array) float[source]
cars_mesh.tools.metrics.chamfer_distance(dist_1: numpy.array, dist_2: numpy.array) float[source]
cars_mesh.tools.metrics.point_to_plane_distance(pcd_in, pcd_ref, knn=30, workers=1, use_open3d=True, **kwargs) numpy.ndarray[source]

The point-to-plane distance first computes the normal of the surface at every point in the reference point cloud as an indication of the local surface. The displacement of every corresponding point in the noisy point cloud is then projected onto the normal to calculate the point-to-plane distance.

Source: Lang Zhou, Guoxing Sun, Yong Li, Weiqing Li, Zhiyong Su, Point cloud denoising review: from classical to deep learning-based approaches, Graphical Models, Volume 121, 2022, 101140, ISSN 1524-0703, https://doi.org/10.1016/j.gmod.2022.101140.

class cars_mesh.tools.metrics.PointCloudMetrics(pcd_in: cars_mesh.tools.handlers.PointCloud, pcd_ref: cars_mesh.tools.handlers.PointCloud, **kwargs)[source]

Compute metrics between two points clouds Nearest neighbours are computed during the initialisation step in order to share this information between different metrics and avoid a costly recomputing step.

mean_squared_distance(mode) tuple[source]

Mean squared distance (or error, MSE)

Parameters:

mode (str) – Mode of computation. Either ‘p2p’ (point to point) or ‘p2s’ (point to surface):

root_mean_squared_distance(mode) tuple[source]

Root mean squared distance (or error, RMSE)

Parameters:

mode (str) – Mode of computation. Either ‘p2p’ (point to point) or ‘p2s’ (point to surface):

mean_distance(mode) tuple[source]

Mean distance (or error)

Parameters:

mode (str) – Mode of computation. Either ‘p2p’ (point to point) or ‘p2s’ (point to surface):

median_distance(mode) tuple[source]

Median distance (or error)

Parameters:

mode (str) – Mode of computation. Either ‘p2p’ (point to point) or ‘p2s’ (point to surface):

hausdorff_asym_distance(mode) tuple[source]

Hausdorff asymmetric distance

Parameters:

mode (str) – Mode of computation. Either ‘p2p’ (point to point) or ‘p2s’ (point to surface):

hausdorff_sym_distance(mode) float[source]

Hausdorff symmetric distance

Parameters:

mode (str) – Mode of computation. Either ‘p2p’ (point to point) or ‘p2s’ (point to surface):

chamfer_distance(mode) float[source]

Chamfer distance

Parameters:

mode (str) – Mode of computation. Either ‘p2p’ (point to point) or ‘p2s’ (point to surface):

_serialize_ply_distances(filepath: str, pcd: cars_mesh.tools.handlers.PointCloud, distances: numpy.ndarray) None[source]

Serialize a textured mesh as a PLY file

Parameters:

filepath (str) – Filepath to the texture image

visualize_distances(output_dir) None[source]

Save distances as a scalar field to be visualised on a viewer

Parameters:

output_dir (str) – Path to the output directory