mrdja.ransaclpexperiments.get_processing_examples
- mrdja.ransaclpexperiments.get_processing_examples(filename_pcd: str, threshold: float, iterations: int, percentage_chosen_lines: float, percentage_chosen_planes: float, indices: ndarray)[source]
Get the pointclouds of the inliers of the lines that are in indices index_1 and index_2 according to the best number of inliers, along with the equation of the plane that best fits the two lines.
- Parameters:
filename_pcd (str) – The path to the pcd file to be processed.
threshold (float) – The threshold to be used in the RANSAC algorithm.
iterations (int) – The number of iterations to be used in the RANSAC algorithm.
percentage_chosen_lines (float) – The percentage of chosen lines to be used in the RANSAC line algorithm.
percentage_chosen_planes (float) – The percentage of chosen planes to be used in the RANSAC line algorithm.
- Returns:
A tuple with the inliers and outliers point clouds.
- Return type:
Tuple[o3d.geometry.PointCloud, o3d.geometry.PointCloud]
- Example:
>>> import mrdja.ransaclpexperiments as experiments >>> import pickle as pkl >>> import open3d as o3d >>> filename_pcd = "/home/scpmaotj/open3d_data/extract/OfficePointClouds/cloud_bin_10.ply" >>> threshold = 0.02 >>> iterations = 600 >>> percentage_chosen_lines = 0.2 >>> percentage_chosen_planes = 0.05 >>> indices = [0, 10] >>> # indices = [0, 1] >>> indices = [50, 51] >>> results = experiments.get_processing_examples(filename_pcd, threshold, iterations, percentage_chosen_lines, percentage_chosen_planes, indices = indices) >>> inliers_o3d = results["inliers_o3d"] >>> outliers_o3d = results["outliers_o3d"] >>> # inliers in red >>> inliers_o3d.paint_uniform_color([1, 0, 0]) >>> o3d.visualization.draw_geometries([inliers_o3d, outliers_o3d])