cars_mesh.core.filter

Filtering methods aiming at removing outliers or groups of outliers from the point cloud.

Module Contents

Functions

statistical_filtering_outliers_o3d(...)

This method removes points which have mean distances with their k nearest

radius_filtering_outliers_o3(...)

This method removes points that have few neighbors in a given sphere

local_density_analysis(...)

Compute the probability of a point to be an outlier based on the local

cars_mesh.core.filter.statistical_filtering_outliers_o3d(pcd: cars_mesh.tools.handlers.PointCloud, nb_neighbors: int, std_factor: float) cars_mesh.tools.handlers.PointCloud[source]

This method removes points which have mean distances with their k nearest neighbors that are greater than a distance threshold (dist_thresh).

This threshold is computed from the mean (mean_distances) and standard deviation (stddev_distances) of all the points mean distances with their k nearest neighbors:

dist_thresh = mean_distances + std_factor * stddev_distances

Parameters:
  • pcd (PointCloud) – Point cloud data

  • nb_neighbors (int) – Number of neighbors

  • std_factor (float) – Multiplication factor to use to compute the distance threshold

Returns:

pcd – Filtered point cloud data

Return type:

PointCloud

cars_mesh.core.filter.radius_filtering_outliers_o3(pcd: cars_mesh.tools.handlers.PointCloud, radius: float, nb_points: int) cars_mesh.tools.handlers.PointCloud[source]

This method removes points that have few neighbors in a given sphere around them. For each point, it computes the number of neighbors contained in a sphere of chosen radius, if this number is lower than nb_point, this point is deleted.

Parameters:
  • pcd (PointCloud) – Point cloud data

  • radius (float) – Defines the radius of the sphere that will be used for counting the neighbors

  • nb_points (int) – Defines the minimum amount of points that the sphere should contain

Returns:

pcd – Filtered point cloud data

Return type:

PointCloud

cars_mesh.core.filter.local_density_analysis(pcd: cars_mesh.tools.handlers.PointCloud, nb_neighbors: int, proba_thresh: None | float = None) cars_mesh.tools.handlers.PointCloud[source]

Compute the probability of a point to be an outlier based on the local density.

Reference: Xiaojuan Ning, Fan Li, Ge Tian, and Yinghui Wang (2018). “An efficient outlier removal method for scattered point cloud data”.

Parameters:
  • pcd (PointCloud) – Point cloud data

  • nb_neighbors (int) – Number of neighbors to consider

  • proba_thresh (float (default = None)) – Probability threshold of a point to be an outlier. If ‘None’, then it is computed automatically per point as: proba_thresh_i = 0.1 * dist_average_i with dist_average_i: Average distance of the point i to its neighbours

Returns:

pcd – Filtered point cloud data

Return type:

PointCloud