cars_mesh.tools.metrics ======================= .. py:module:: cars_mesh.tools.metrics .. autoapi-nested-parse:: Evaluation metrics Classes ------- .. autoapisummary:: cars_mesh.tools.metrics.PointCloudMetrics Functions --------- .. autoapisummary:: cars_mesh.tools.metrics.mean_squared_distance cars_mesh.tools.metrics.root_mean_squared_distance cars_mesh.tools.metrics.mean_distance cars_mesh.tools.metrics.median_distance cars_mesh.tools.metrics.hausdorff_asym_distance cars_mesh.tools.metrics.hausdorff_sym_distance cars_mesh.tools.metrics.chamfer_distance cars_mesh.tools.metrics.point_to_plane_distance Module Contents --------------- .. py:function:: mean_squared_distance(dist: numpy.array) -> float .. py:function:: root_mean_squared_distance(dist: numpy.array) -> float .. py:function:: mean_distance(dist: numpy.array) -> float .. py:function:: median_distance(dist: numpy.array) -> float .. py:function:: hausdorff_asym_distance(dist: numpy.array) -> float .. py:function:: hausdorff_sym_distance(dist_1: numpy.array, dist_2: numpy.array) -> float .. py:function:: chamfer_distance(dist_1: numpy.array, dist_2: numpy.array) -> float .. py:function:: point_to_plane_distance(pcd_in, pcd_ref, knn=30, workers=1, use_open3d=True, **kwargs) -> numpy.ndarray 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. .. py:class:: PointCloudMetrics(pcd_in: cars_mesh.tools.handlers.PointCloud, pcd_ref: cars_mesh.tools.handlers.PointCloud, **kwargs) 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. .. py:attribute:: pcd_in .. py:attribute:: pcd_ref .. py:attribute:: modes :value: ['p2p', 'p2s'] .. py:attribute:: metrics .. py:attribute:: dist_p2p_in_ref .. py:attribute:: dist_p2p_ref_in .. py:attribute:: dist_p2s_in_ref .. py:attribute:: dist_p2s_ref_in .. py:method:: mean_squared_distance(mode) -> tuple Mean squared distance (or error, MSE) :param mode: Mode of computation. Either 'p2p' (point to point) or 'p2s' (point to surface): :type mode: str .. py:method:: root_mean_squared_distance(mode) -> tuple Root mean squared distance (or error, RMSE) :param mode: Mode of computation. Either 'p2p' (point to point) or 'p2s' (point to surface): :type mode: str .. py:method:: mean_distance(mode) -> tuple Mean distance (or error) :param mode: Mode of computation. Either 'p2p' (point to point) or 'p2s' (point to surface): :type mode: str .. py:method:: median_distance(mode) -> tuple Median distance (or error) :param mode: Mode of computation. Either 'p2p' (point to point) or 'p2s' (point to surface): :type mode: str .. py:method:: hausdorff_asym_distance(mode) -> tuple Hausdorff asymmetric distance :param mode: Mode of computation. Either 'p2p' (point to point) or 'p2s' (point to surface): :type mode: str .. py:method:: hausdorff_sym_distance(mode) -> float Hausdorff symmetric distance :param mode: Mode of computation. Either 'p2p' (point to point) or 'p2s' (point to surface): :type mode: str .. py:method:: chamfer_distance(mode) -> float Chamfer distance :param mode: Mode of computation. Either 'p2p' (point to point) or 'p2s' (point to surface): :type mode: str .. py:method:: _serialize_ply_distances(filepath: str, pcd: cars_mesh.tools.handlers.PointCloud, distances: numpy.ndarray) -> None Serialize a textured mesh as a PLY file :param filepath: Filepath to the texture image :type filepath: str .. py:method:: visualize_distances(output_dir) -> None Save distances as a scalar field to be visualised on a viewer :param output_dir: Path to the output directory :type output_dir: str