Abstract
Plane detection in point clouds is a common step in interpreting environments within robotics. Mobile robotic platforms must interact efficiently and safely with their surroundings, which requires capabilities such as detecting walls to avoid collisions and recognizing workbenches for object manipulation. Since these environmental elements typically appear as plane-shaped surfaces, a fast and accurate plane detector is an essential tool for robotics practitioners. RANSAC (Random Sample Consensus) is a widely used technique for plane detection that iteratively evaluates the fitness of planes by sampling three points at a time from a point cloud. In this work, we present an approach that, rather than seeking planes directly, focuses on finding lines by sampling only two points at a time. This leverages the observation that it is more likely to detect lines within the plane than to find the plane itself. To estimate planes from these lines, we perform an additional step that fits a plane for each pair of lines. Experiments conducted on three datasets, two of which are public, demonstrate that our approach outperforms the traditional RANSAC method, achieving better results while requiring fewer iterations. A public repository containing the developed code is also provided.
Similar content being viewed by others
Introduction
Understanding the environment is essential for any robotic system that aims to interact autonomously and effectively with its surroundings1. Robotic platforms are equipped with various sensors-such as cameras, lasers, or Light Detection and Ranging (LiDAR) systems-that capture two- or three-dimensional data from the external world. To interpret this data, two main strategies have been developed. Classical computer vision techniques directly search for specific features using methods such as edge detectors (e.g., the Canny algorithm)2 and shape detectors like the Hough transform3. In contrast, deep learning approaches perform semantic segmentation by assigning a class label to each pixel or voxel in a supervised manner4,5. While deep learning consistently delivers impressive results, it is also possible to incorporate prior knowledge about the environment to more efficiently detect geometric shapes, offering a stronger theoretical foundation and enhanced interpretability.
The RANSAC (Random Sample Consensus) method6 is frequently employed in robotic applications to detect planes in three-dimensional scenes. The standard RANSAC approach is relatively straightforward: select three points from a point cloud, compute the corresponding plane equation, and count the number of points within a predetermined threshold of that plane. This process is repeated a certain number of times, ultimately returning the plane with the most inliers. Diverse strategies exist for determining the number of iterations or the threshold value7.
Plane segmentation in 3D point clouds enables a robot to distinguish and categorize various elements of its environment, from large structural components to smaller, individual objects. For example, walls are core structural elements in most environments. Recognizing them allows a robot to map its surroundings, understand spatial limitations, and assess movement potential. Without this capability, robots would be prone to navigation errors and inefficiencies.
In addition to large structures like walls, plane segmentation plays a pivotal role in detecting smaller surfaces such as tables, which often serve as locations for objects a robot might need to interact with. Accurately detecting these planes helps a robot better comprehend the environment’s layout and typical object placements.
In this paper, we present RANSAC-LP4, a novel approach that searches for planes indirectly by first identifying lines. Since a line is defined by two points, compared to the three points required to define a plane, it is more likely to detect a line residing on a promising plane than to identify that plane directly. The ”LP4” in our method’s name highlights the fact that we pair lines (each defined by two points) to generate candidate planes using four points. The lines with the highest support (i.e., the greatest number of nearby points) are paired to compute the best-fit plane for the four defining points. The planes with the smallest errors relative to these four points are considered strong candidates, and a small percentage of planes (the top 5%) are subsequently tested against all the points, as in the classical RANSAC method.
The results of experiments conducted on the public S3DIS dataset, along with two other datasets, validate our claims. They demonstrate that our proposed approach, RANSAC-LP4, not only outperforms the traditional RANSAC method in terms of accuracy but also requires fewer iterations, highlighting its efficiency. Our method can be integrated into any RANSAC variant that uses vanilla RANSAC as its backbone. For instance, it could be applied immediately after some preprocessing is done on the point cloud, or before plane optimization is performed on tentative planes by a RANSAC variant. This is the main reason we tested our proposed method against vanilla RANSAC rather than state-of-the-art models: any advanced algorithm that incorporates vanilla RANSAC could benefit from our approach.
The paper is organized as follows: the next section reviews previous work. Then, the proposed approach is presented, followed by a section describing the experimental setup and results. Finally, the paper concludes with the main findings and suggestions for future work.
Related work
Plane detection and segmentation using RANSAC-based methods is a common theme in multiple robotic applications. In8 the authors present a system that extracts roof planes from LIDAR data captured from above. Their method applies RANSAC to initially extract the roof plane, then selects random points from it and removes outliers based on the number of neighboring points within a given threshold. RANSAC has also been employed to estimate the complete layout of indoor facilities, as demonstrated in9, where a RANSAC-based algorithm directly generates Building Information Modeling (BIM) data from the 3D point clouds. Additionally,10 introduces a library for processing indoor data that relies on RANSAC as its foundational algorithm.
Navigation in mobile robotics has similarly benefited from RANSAC. In11, the authors propose a spatio-temporal RANSAC method for robust estimation of planar surfaces in the robot’s environment, supported by experimental results from an automobile navigating an undercover parking lot. For detecting steps or ramps from range sensors data,12 introduces the CC-RANSAC algorithm, which focuses on the largest connected components of tentative inliers to evaluate the fitness of a plane, with applications in both general robot navigation and automated parking systems.
Methods that combine RANSAC with machine learning approaches have also been explored. For example, in13 the authors present a method that, after an initial plane segmentation using RANSAC, applies a Support Vector Machine (SVM)14 to the XYZ coordinates and RGB values of each point to predict the corresponding plane. An example of integrating deep learning with RANSAC is provided in15, where a modified version of the PointNet network16 performs semantic segmentation on the point cloud, with RANSAC refining the roof detection. Furthermore, normal estimation has been shown to enhance RANSAC performance, as demonstrated in17.
In robot grasping applications using 3D sensors, RANSAC is commonly employed as an initial filtering step. In18, the authors use RANSAC to detect and remove points corresponding to the dominant plane from the input point cloud, isolating clusters of points that are candidates for object grasping. Since human-made structures are typically composed of primitives such as planes, boxes, and spheres, the approach presented in19 leverages this idea by using RANSAC for scene understanding, identifying shelves where objects are stored, and using this information to align the end-effector with the scene. RANSAC is also applied in robot welding applications, as in20, which relies on RANSAC’s robustness to outliers to fit the model of the part to be welded from the point cloud and to determine the initial welding position.
Numerous efforts have been made to enhance RANSAC for a wide range of applications, with many variants focusing on improving accuracy, speed, robustness, or optimality. For example, LO-RANSAC21 employs a local optimization step to refine models and reduce the required number of samples; NAPSAC22 restricts sampling to spatially adjacent points to exploit the clustering of inliers; NG-RANSAC23 leverages neural networks to guide hypothesis selection; and Optimal Randomized RANSAC24 determines an optimal decision threshold for model acceptance. A more detailed account of RANSAC methods is provided in7. Our approach is designed to maximize the number of inliers obtained within a fixed number of iterations, making it applicable to any RANSAC-based framework that subsequently refines its model, such as the aforementioned LO-RANSAC.
We could also mention alternative methods that do not rely on RANSAC, but instead use other techniques. For example, in25 the authors propose a parallel 3D Hough transform algorithm that transforms LiDAR point clouds into a predefined Hough space, rasterizes the space into cells, and then employs a 3D connected component labeling technique to cluster cells with high point counts and efficiently extracts plane parameters. In contrast,26 introduces PlaneRCNN, a deep neural architecture based on a variant of Mask R-CNN27, which detects planes from a single RGB image by jointly refining segmentation masks with a novel view-consistency loss. In28 the authors introduce a fast, deterministic plane detection method for unorganized point clouds that leverages a novel planarity test based on robust statistics combined with a split-and-merge strategy, automatically tuning its parameters to the local sample distribution to accurately reconstruct even small planar regions.
Proposed approach
The iterative loop of RANSAC-like methods consists of sampling the minimum number of objects required to estimate a model from some space and then measuring the model’s fitness with respect to the entire set of objects. For plane detection in point clouds, each iteration samples three points and computes how many points lie within a predefined distance \(t\) (the threshold) of the plane defined by those three points (provided they are not collinear).
The motivation behind RANSAC-LP4 is to develop a computationally less expensive method for plane detection compared to traditional RANSAC. In other words, our goal is to achieve similar or better results (expressed as the number of inliers of the returned plane) while requiring fewer iterations. Recall that each iteration requires checking the distance of all points in the point cloud to the estimated plane, which can be time-consuming for large point clouds and may compromise real-time performance.
We define inliers as the points that lie within the threshold \(t\) of a ground-truth plane and outliers as the remaining points. Let \(\rho\) denote the inlier ratio (i.e., the ratio of inliers to the total number of points \(p\)). Then, the probability that a set of \(p\) randomly chosen points are all inliers is \(\rho ^{p}\), and the probability of drawing three inliers is \(\rho ^3\), which is the minimum required to estimate a plane. However, with probability \(\rho ^2\), two inliers may be selected, sufficient to define a line within the plane. Here ”line within the plane” is used in a non-rigorous sense, as the planes and lines in this context resemble parallelepipeds and cylinders due to the tolerance \(t\).
Thus, it is \(\frac{1}{\rho }\) times less likely to find three inliers than two, with this factor increasing as \(\rho\) decreases. In many robotic applications, \(\rho\) can be quite low since there may be many planes (e.g. walls, ceiling, ground, tables, etc.), but each represents only a fraction of the entire point cloud.
RANSAC-LP4 uses four parameters. Two are shared with traditional RANSAC:
-
n: the total number of iterations (i.e., candidate line models),
-
t : the maximum distance a point can be from a line (or plane) to be considered an inlier.
The other two parameters are specific to RANSAC-LP4:
-
\(\alpha\): the fraction of the lines to retain when selecting candidate lines,
-
\(\beta\): the fraction of candidate planes to evaluate against the entire point cloud.
RANSAC-LP4 consists of three main steps: estimating the best lines, finding candidate planes and evaluating the planes:
Step 1: Estimating the best lines
-
Sample n candidate lines by randomly selecting two points from the point cloud n times.
-
Compute the number of inliers for each line using the threshold t.
-
Retain the best \(N_\ell\) lines, where
$$\begin{aligned} N_\ell = \lfloor \alpha \cdot n \rfloor . \end{aligned}$$
Step 2: Finding the candidate planes
-
Form all unique pairs of the chosen lines. The number of line pairs is
$$\begin{aligned} N_{\lambda } = \frac{N_\ell (N_\ell - 1)}{2}. \end{aligned}$$ -
For each pair, estimate the best-fit plane for the four points that defined the lines and record the quality of that fit.
Step 3: Evaluating the planes
-
Retain the best \(N_\pi\) candidate planes based on their fit to the four defining points, where
$$\begin{aligned} N_\pi = \lfloor \beta \cdot N_{\lambda } \rfloor . \end{aligned}$$ -
Compute the number of inliers for each candidate plane using t.
-
Return the plane with the highest number of inliers.
For a numerical example, consider \(n = 100\), \(\alpha = 0.2\), and \(\beta = 0.05\). In this case, the number of chosen lines is
the number of line pairs is
and the number of candidate planes evaluated is
Thus, the total number of distance computations against the entire point cloud is \(100 + 9 = 109\) (from the 100 line models and 9 plane models).
Figures 1 and 2 illustrate how the candidate planes generated by RANSAC-LP4 perform when applied to real point clouds. The two figures display the same point cloud from different perspectives to better illustrate the distinct lines and planes identified in each scenario. In the well-fitting case shown in Fig. 1, the red lines-obtained from selecting the best candidate lines-yield a plane that closely aligns with the inlier points (displayed in green) of the ground-truth plane (associated with the wall), resulting in a high inlier count. In contrast, Fig. 2 depicts a poorly fitting plane, derived from candidate lines that included a mix of inliers and outliers to the ground-truth plane, which results in a substantially lower inlier count. This candidate plane passes through the ground, desk, and ceiling, but is not close to the ground-truth plane. In the first case, the two red lines lie within the ground-truth plane, thereby capturing many inliers and leading to the selection of a candidate plane that closely approximates the ground-truth. In the second case, the red lines lie on the ground and the ceiling, and since these lines capture fewer inliers than the well-aligned lines in the other example, the resulting plane is not selected during the RANSAC-LP4 step where distances from all points in the point cloud are computed against the candidate plane. These examples underscore the importance of our preselection strategy; by filtering candidate lines and subsequently candidate planes, RANSAC-LP4 efficiently narrows the search to models that are most likely to represent true planar regions within the data.
Experimental setup and results
In this section, we present the experimental setup and results aimed at evaluating the performance of our proposed RANSAC-LP4 algorithm in comparison with the vanilla RANSAC method. Our evaluation is conducted on three real-world datasets (Open3D, S3DIS, and an Industrial Application dataset) as well as on a synthetic dataset designed to vary the percentage of outliers. We measure performance using key metrics such as the number of inliers and running time. In addition to standard performance tables and statistical tests over the number of inliers, we provide a series of visualizations to further illustrate the comparative performance:
-
Boxplots that compare the running time of RANSAC and RANSAC-LP4 on the same datasets,
-
Graphs illustrating how the performance (running time and inliers) of both algorithms changes on a synthetic dataset when the outlier percentage is varied, and
-
Heatmaps that show the sensitivity of RANSAC-LP4’s performance to its two key parameters.
Also, some comparisons to a baseline planar method have been performed:
-
Boxplots detailing the performance of the baseline planar method in terms of running time, and
-
Table showing the mean number of planar patches found and point cloud coverage obtained for the three datasets.
Datasets
We conducted our experiments on every single point cloud of three datasets: two publicly available ones provided by other authors, and a third dataset (an industrial application dataset) compiled by us, which we have also made publicly available (Table 1). Some statistics of these datasets are available in Table 2. Figure 3 shows examples from the S3DIS dataset and the Industrial application dataset, while the point cloud in Figs. 1 and 2 is taken from the Open3D dataset.
Open3D
The Open3D library29 provides two datasets that are part of the Redwood dataset30. The Open3D repository includes 57 point clouds of living rooms and 53 of office spaces. This dataset is particularly convenient because it exhibits characteristics common to other indoor datasets, making it suitable for plane detection. Additionally, it allows experiments to be performed entirely within the Open3D ecosystem without requiring external datasets.
S3DIS
The Stanford Large-Scale 3D Indoor Spaces (S3DIS) dataset31 consists of multiple scans from six large indoor areas across three buildings used for educational and office purposes. Although the data includes RGB images and camera metadata, we focus only on the 3D point clouds for this experiment. The indoor scans cover an area of more than 6,000 \(m^2\) and contain nearly 700 million colored points. The dataset includes eleven room types: office, conference room, hallway, auditorium, open space, lobby, lounge, pantry, copy room, storage and WC. Each 3D point is semantically labeled according to thirteen classes: ceiling, floor, wall, beam, column, window, door, table, chair, sofa, bookcase, board and clutter. Although S3DIS is typically used for indoor semantic segmentation, it is also well-suited for our research due to the abundance of planar surfaces in indoor environments (e.g., walls, floors, ceilings, and tables).
Industrial application dataset
The industrial application dataset replicates a common setup in industrial robotic processes. A workpiece is fixed on a table with a certain positioning error. A robot performing an operation on the workpiece (e.g. grinding, polishing, or deburring), must first segment the scene and detect the workpiece’s pose to adjust its trajectory accordingly. RANSAC is often used as part of the segmentation step in order to separate the table plane from the rest of the point cloud.
The dataset’s point clouds were acquired using a high-accuracy structured light sensor (Zivid One) mounted on the flange of a Doosan M1509 robot arm (eye-in-hand configuration). The robot moves to randomly generated positions while ensuring that the camera is oriented toward the area of interest. The dataset is publicly available [https://github.com/jonazpiazu/lanverso-industrial-dataset-release] and consists of three scenes, each containing 40 point clouds: one scene contains only the table, the second scene includes one workpiece, and the third scene contains two workpieces. To facilitate usage, the dataset repository also provides a Python class for downloading and processing the data.
Experimental results
Comparison of RANSAC and RANSAC-LP4 performance across three databases (inlier metric)
Several parameters need to be defined to apply the RANSAC-LP4 approach. Two of these are common to most RANSAC variants: \(n\) (number of iterations) and \(t\) (threshold), while \(\alpha\) (fraction of lines) and \(\beta\) (fraction of planes) are specific to our proposed method.
Given the large number of a priori reasonable combinations of these four parameters, we have, as a first approach, chosen to fix the threshold value at 0.02 m for both algorithms, and set \(\alpha = 0.2\) and \(\beta = 0.05\) for RANSAC-LP4. This configuration has been maintained across all experiments and datasets. We selected six different values for the number of RANSAC-LP4 line-fitting iterations, ranging from 100 to 600 in increments of 100. This value corresponds to the parameter \(n\) and, using the same computation as in Section “Proposed approach”, the total number of distance checks (for both lines and planes) performed on the point cloud is 109, 239, 388, 558, 747, and 957, respectively, as shown in Table 1. These six variations of RANSAC-LP4 have been compared against vanilla RANSAC using the same total number of iterations.
We applied the six different variations of RANSAC-LP4, along with their vanilla RANSAC counterparts, to all files in the previously presented datasets. Each algorithm was run ten times on each point cloud, and the mean number of inliers from the best-detected model was recorded. We have computed the mean percentage improvement of each algorithm in comparison to RANSAC-109, which serves as our baseline. Ideally, we would have tested the algorithms against a geometric ground truth. However, to the best of our knowledge, no such database exists. The S3DIS dataset provides semantic ground truth, but this is not necessarily well suited for evaluating plane detection. The semantic labeling is not directly applied to the raw point clouds as acquired by the sensors but involves some preprocessing, making it unsuitable as a geometric ground truth. The provided ground truth consists of point-wise semantic annotations, which can introduce issues, such as treating discontinuities where a window in a wall is identified as a separate entity from the wall itself, even though they may belong to the same plane. The dataset also includes additional information such as normals, depth, and relative object positions, but it does not provide plane equations.
Following the recommendations of32 for multiple comparisons across several methods, we performed the Friedman statistical test33, a non-parametric test for detecting differences between paired measurements of different procedures. When the Friedman test led to the rejection of the null hypothesis (i.e., that all algorithms perform similarly), we applied a post-hoc Shaffer test34 for paired algorithms comparisons, using the implementation published in35.
For each dataset, we present the mean and standard deviation of the percentage improvements over the RANSAC-109 baseline, the relative rank of algorithms, and the percentage of the original point cloud covered by the detected inliers. We also present the results of the Friedman and Shaffer post-hoc test regarding improvement over the baseline.
The results of the Friedman and Shaffer post-hoc test are shown in two-entry tables, where the statistical significance (\(\alpha = 0.05\)) of the test across all algorithm pairs is displayed. Green and red colors indicate cases where the Shaffer test rejects the null hypothesis that the two algorithms perform similarly. If the algorithm in the row achieves a better rank than the algorithm in the column, the corresponding cell is colored green; otherwise, it is red. A gray-colored cell indicates that the test does not provide sufficient evidence to reject the null hypothesis.
Open3D
The mean improvement of each algorithm with respect to RANSAC-109 across all point clouds in the Open3D dataset is presented in Table 3, along with their relative ranks and the proportion of the original point cloud covered by the inliers. Four RANSAC-LP4 variants (957, 747, 558 and 388) outperform the RANSAC variant with the highest number of iterations (RANSAC-957), and in general, RANSAC-LP4 performs better than RANSAC. It can also be observed that the rank differences increase as the number of iterations grows, with the RANSAC-LP4 variants for 957, 747, 558, 388 and 239 ranking ahead of even the vanilla RANSAC with more iterations.
The Friedman test statistic, computed over the means of the twelve algorithms applied to all files in the Open3D dataset yields a value of 1042.39, with a p-value of zero. The full results of the post-hoc Shaffer test are shown in Fig. 4, where it can be seen that most of the differences reported in Table 3 are statistically significant.
S3DIS
As with the Open3D dataset, the mean improvement relative to RANSAC-109 is presented in Table 4, along with the relative ranks and the proportion of the original point cloud covered by inliers. In this case, five RANSAC-LP4 variants (957, 747, 558, 388 and 239) outperform the RANSAC variant with the highest number of iterations (RANSAC-957), and in general, RANSAC-LP4 achieves better results than RANSAC, with the only exception being RANSAC-LP4-109. The rank differences become more pronounced as the number of iterations increases, with the five best-performing RANSAC-LP4 variants (957, 747, 558, 388, and 239) ranking higher than all vanilla RANSAC variants.
The Friedman test statistic, computed over the means of the twelve algorithms applied to all files in the S3DIS dataset, yields a value of 2079.73 with a p-value of zero. As in the previous dataset (Open3D), most of the differences presented in Table 4 are statistically significant, as shown in Fig. 5.
Industrial application dataset
The results presented in Table 5 show a somewhat weaker performance for RANSAC-LP4 compared to previous datasets, with RANSAC-388 performing unexpectedly well. We speculate that this is due to the relative ease of this dataset, as it contains fewer outliers compared to Open3D and S3DIS. This is evident from the fact that even the baseline algorithm (RANSAC-109) is able to find a plane covering approximately 76% of the original point cloud, whereas for Open3D this value is around 33% and for S3DIS only about 14%. Nevertheless, the two best-performing algorithms are RANSAC-LP4-957 and RANSAC-LP4-747, both of which achieve significant improvements over the other variants, as illustrated in Fig. 6. The Friedman test statistic, computed over the means of the twelve algorithms applied to all files in this dataset, yields a value of 916.77 with a p-value of zero.
Baseline planar method
Table 6 presents the performance metrics of the baseline planar method across the three datasets. The table reports the mean and standard deviation of the number of detected planar patches, as well as the mean and standard deviation of the point cloud coverage for the best patch identified. Notably, for the Open3D dataset, the results are clearly inferior to those obtained by RANSAC and RANSAC-LP4, whereas for the S3DIS and Industrial datasets, the performance is comparable to the worst-case scenarios of RANSAC and RANSAC-LP4. In the subsequent section, we analyze the computational runtime, which indicates that the baseline method is slower than the methods belonging to the RANSAC family. As previously stated, the main advantage of the planar method is its ability to simultaneously identify several candidate planes, whereas RANSAC-LP4 focuses solely on detecting the dominant plane in the scene.
Comparison of RANSAC and RANSAC-LP4 performance across databases (running time metric)
It is also of interest to evaluate the running time of RANSAC versus RANSAC-LP4. In our experiments, we used a system equipped with an NVIDIA Quadro P2000 GPU (Pascal architecture) running under NVIDIA driver version 550.144.03 with CUDA 12.4 support and compiled using nvcc release 12.3.107. The GPU provides 5 GB of GDDR5 SDRAM, and the host machine is powered by an Intel®CoreTM i7-7700 CPU at a base frequency of 3.60 GHz with 4 physical cores and 8 threads, along with 16 GB of system memory.
In addition to these two algorithms, we also evaluated a planar patches detection algorithm28 available in Open3D to provide a fair comparison. We used the GPU version of Open3D for all experiments. The boxplots (Figs. 7, 8, and 9) show the running time of RANSAC versus RANSAC-LP4 across the number of iterations tested in the previous section. On the right side of the plots, a separate boxplot displays the running time of the planar patches algorithm; note that the running time of this algorithm is shown on a different scale, as its execution time is generally much slower. Although the planar patches algorithm is suitable for detecting multiple patches simultaneously, its number of inliers is typically low, typically a fraction of what can be found with RANSAC or RANSAC-LP4. If the goal is to quickly find a plane with a high inlier count, our algorithm is competitive, whereas the planar patches algorithm might be preferred when precision is less critical.
It should be noted that while we focus on the number of iterations, iterations in RANSAC-LP4 are not directly comparable to those in vanilla RANSAC when distances to lines are involved. The computation of distances to lines requires a cross-product operation, which may be slower than checking distances to a plane. However, our experiments using the GPU in a parallel setting indicate that this overhead is not significant.
Figure 7 shows the running time results for the Open3D dataset, where RANSAC-LP4 consistently outperforms vanilla RANSAC. A similar trend, with even larger gains, is observed in Figure 8 for the S3DIS dataset. Conversely, in the case of the Industrial Application dataset (Fig. 9), RANSAC-LP4 is slower for the same number of iterations.
To investigate why RANSAC-LP4 is slower than vanilla RANSAC on the Industrial dataset, we hypothesize that the low number of outliers in this dataset is the main factor. With fewer outliers, it is easier for vanilla RANSAC to find sets of three points that belong to the dominant plane. In contrast, RANSAC-LP4, which only requires two inlier points to form a line, does not gain as much of an advantage when outliers are sparse.
Synthetic experiment: outlier variation
We designed another experiment using a synthetic point cloud. In this dataset, a ground-truth plane is defined as \(Z = 0\), and 100,000 random points (the inliers) are generated within the square delimited by \(X \in [-1, 1]\) and \(Y \in [-1, 1]\). These inlier points are then perturbed by adding Gaussian noise in the \(Z\)-direction with mean \(0\) and standard deviation \(0.01\). Outliers are sampled uniformly from a cube defined by \(X \in [-2, 2]\), \(Y \in [-2, 2]\), and \(Z \in [-2, 2]\). We test the behavior of both RANSAC and RANSAC-LP4, with the parameters of the previous section and a number of iterations of 957, as the proportion of outliers relative to inliers is varied from 0% to 500%. The plots in Fig. 10 show the running time and the number of inliers detected as the outlier proportion changes.
It can be observed that the performance of RANSAC-LP4 is much more stable. Although it initially yields worse results for small outlier/inlier ratios, RANSAC-LP4 outperforms vanilla RANSAC in both running time and in the number of inliers detected once the ratio exceeds 1.5-a scenario that is not uncommon in real data, particularly in unstructured environments.
Heatmaps illustrating the impact of varying the line and plane percentages on segmentation performance. Left: Mean segmentation time (seconds) for both RANSAC and RANSAC-LP4 methods. Right: Mean number of inliers detected. Increased parameter values lead to longer segmentation times and higher inlier counts.
We have also conducted another experiment to assess the importance of the values for the fraction of lines and the fraction of planes. Using the synthetic point cloud defined earlier-with 10,000 points and an outlier ratio of 500%-we created two heatmaps by varying the percentage of lines from 0.05 to 0.3 and the percentage of planes from 0.01 to 0.1. The results are shown in Fig. 11. As expected, the running time increases when these parameters are larger, and the inlier count is also higher. However, it appears that one parameter can be adjusted as a function of the other while still detecting approximately the same number of inliers.
Scaling to very big pointclouds
In the previous section, we demonstrated that our implementation outperforms the RANSAC implementation provided by Open3D. However, this improved performance comes at the cost of increased GPU memory usage. Despite this, our method scales well to very large point clouds on a reasonably equipped GPU.
We obtained a point cloud from OpenTopography [https://opentopography.org/] containing more than 235 million points (exactly 235,003,324). This dataset was extracted from an area in Waikato, New Zealand, in 2024. The coordinates defining the data selection are as follows:
When running RANSAC against RANSAC-LP4, both configured with a threshold of 0.5 and 558 iterations, RANSAC-LP4 completed in 21.43 seconds, while Open3D’s RANSAC took 55.68 seconds. Both tests were performed using CUDA on an NVIDIA GeForce RTX 3080 with 10 GB of memory. Notably, RANSAC-LP4 identified a greater number of inliers, with 3,726,666 points compared to 3,706,177 points found by the standard RANSAC implementation.
This example illustrates how our implementation can effectively handle large-scale data. While more analysis is certainly needed, these initial results are promising and suggest that further exploration is worthwhile.
Conclusion
This paper presents a novel approach for plane detection in point clouds by introducing RANSAC-LP4, an improved variant of the traditional RANSAC algorithm. RANSAC-LP4 leverages line sampling to generate candidate planes more efficiently, thereby reducing the number of iterations required while achieving competitive or superior performance. Experimental results on both public datasets and real industrial scenarios demonstrate that RANSAC-LP4 outperforms the standard RANSAC method, particularly in cases where the proportion of inliers is low. When the inlier percentage is high, the advantage of RANSAC-LP4 is less pronounced since traditional RANSAC already detects planes with high accuracy.
One limitation of our approach is that its current CUDA implementation demands more GPU memory than the Open3D version. We believe this discrepancy is due to implementation details rather than any inherent theoretical limitations. Consequently, we plan to further optimize our code to reduce memory usage and improve overall performance.
Future work will focus on systematically optimizing the RANSAC-LP4 parameters to identify the best configuration for various applications, as the current study employed fixed, heuristic values. Given the promising results obtained with this preliminary parameter setting, we are confident that further refinements can lead to even greater improvements in performance.
Data availability
Two of the two datasets (S3DIS and Open3D) are publicly available from third parties. The code has been uploaded to a GitHub repository (https://github.com/jmartinezot/ransaclp).
References
Xiao, X., Liu, B., Warnell, G. & Stone, P. Motion planning and control for mobile robot navigation using machine learning: A survey. Auton. Robot. 46, 569–597 (2022).
Owotogbe, J., Ibiyemi, T. & Adu, B. Edge detection techniques on digital images—a review. Int. J. Innov. Sci. Res. Technol 4, 329–332 (2019).
Illingworth, J. & Kittler, J. A survey of the Hough transform. Comput. Vision, Graphics, Image Process. 44, 87–116 (1988).
Minaee, S. et al. Image segmentation using deep learning: A survey. IEEE Trans. Pattern Anal. Mach. Intell. 44, 3523–3542 (2021).
Guo, Y. et al. Deep learning for 3D point clouds: A survey. IEEE Trans. Pattern Anal. Mach. Intell. 43, 4338–4364 (2020).
Fischler, M. A. & Bolles, R. C. Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography. Commun. ACM 24, 381–395 (1981).
Martínez-Otzeta, J. M., Rodríguez-Moreno, I., Mendialdua, I. & Sierra, B. RANSAC for robotic applications: A survey. Sensors 23, 327 (2022).
Canaz Sevgen, S. & Karsli, F. An improved RANSAC algorithm for extracting roof planes from airborne lidar data. Photogramm. Rec. 35, 40–57 (2020).
Capocchiano, F. & Ravanelli, R. An original algorithm for BIM generation from indoor survey point clouds. Int. Arch. Photogrammet. Remote Sens. Spatial Inf. Sci. 42, 769–776 (2019).
Martínez-Otzeta, J. M., Mendialdua, I., Rodríguez-Moreno, I., Rodriguez, I. R. & Sierra, B. An open-source library for processing of 3d data from indoor scenes, 610–615 (2022).
Mufti, F., Mahony, R. & Heinzmann, J. Robust estimation of planar surfaces using spatio-temporal RANSAC for applications in autonomous vehicle navigation. Robot. Auton. Syst. 60, 16–28 (2012).
Gallo, O., Manduchi, R. & Rafii, A. Cc-RANSAC: Fitting planes in the presence of multiple surfaces in range data. Pattern Recognit. Lett. 32, 403–410 (2011).
Xu, D., Li, F. & Wei, H. 3D point cloud plane segmentation method based on RANSAC And Support Vector Machine, 943–948 (IEEE, 2019).
Cortes, C. & Vapnik, V. Support-vector networks. Mach. Learn. 20, 273–297 (1995).
Chen, H., Chen, W., Wu, R. & Huang, Y. Plane segmentation for a building roof combining deep learning and the RANSAC method from a 3D point cloud. J. Electron. Imaging 30, 053022–053022 (2021).
Qi, C. R., Su, H., Mo, K. & Guibas, L. J. PointNet: Deep learning on point sets for 3D classification and segmentation, 652–660 (2017).
Yang, L., Li, Y., Li, X., Meng, Z. & Luo, H. Efficient plane extraction using normal estimation and RANSAC from 3D point cloud. Comput. Stand. Interfaces 82, 103608 (2022).
Monica, R. & Aleotti, J. Point cloud projective analysis for part-based grasp planning. IEEE Robot. Autom. Lett. 5, 4695–4702 (2020).
Møller, P. L., Jami, M., Hansen, K. D. & Chrysostomou, D. Adaptive perception and manipulation for autonomous robotic kitting in dynamic warehouse environments, (IEEE, 2023).
Zhang, L. et al. Point cloud based three-dimensional reconstruction and identification of initial welding position, 61–77 (Springer, 2018).
Chum, O., Matas, J. & Kittler, J. Locally optimized RANSAC, 236–243 (Springer, 2003).
Torr, P. H., Nasuto, S. J. & Bishop, J. M. NAPSAC: High noise, high dimensional robust estimation-it’s in the bag, Vol. 2, 3 (2002).
Brachmann, E. & Rother, C. Neural-guided RANSAC: Learning where to sample model hypotheses, 4322–4331 (2019).
Chum, O. & Matas, J. Optimal randomized RANSAC. IEEE Trans. Pattern Anal. Mach. Intell. 30, 1472–1482 (2008).
Tian, Y. et al. Fast planar detection system using a GPU-based 3D Hough transform for LiDAR point clouds. Appl. Sci. 10, 1744 (2020).
Liu, C., Kim, K., Gu, J., Furukawa, Y. & Kautz, J. PlaneRCNN: 3D plane detection and reconstruction from a single image, 4450–4459 (2019).
He, K., Gkioxari, G., Dollár, P. & Girshick, R. Mask R-CNN, 2961–2969 (2017).
Araújo, A. M. & Oliveira, M. M. A robust statistics approach for plane detection in unorganized point clouds. Pattern Recognit. 100, 107115 (2020).
Zhou, Q.-Y., Park, J. & Koltun, V. Open3D: A modern library for 3D data processing. arXiv preprint arXiv:1801.09847 (2018).
Choi, S., Zhou, Q.-Y., Miller, S. & Koltun, V. A large dataset of object scans. arXiv:1602.02481 (2016).
Armeni, I., Sax, A., Zamir, A. R. & Savarese, S. Joint 2D-3D-semantic data for indoor scene understanding. ArXiv e-prints (2017).
Derrac, J., García, S., Molina, D. & Herrera, F. A practical tutorial on the use of nonparametric statistical tests as a methodology for comparing evolutionary and swarm intelligence algorithms. Swarm Evol. Comput. 1, 3–18 (2011).
Friedman, M. A comparison of alternative tests of significance for the problem of m rankings. Ann. Math. Stat. 11, 86–92 (1940).
Shaffer, J. P. Modified sequentially rejective multiple test procedures. J. Am. Stat. Assoc. 81, 826–831 (1986).
Calvo, B. & Santafé, G. Scmamp: Statistical comparison of multiple algorithms in multiple problems. R J. 8, 248–256. https://doi.org/10.32614/RJ-2016-017 (2016).
Acknowledgements
This work has been partially funded by the Basque Government, Spain, under Research Teams Grant number IT1427-22 and under ELKARTEK LANVERSO Grant number KK-2022/00065; and the Spanish Ministry of Science (MCIU), the State Research Agency (AEI), the European Regional Development Fund (FEDER), under Grant number PID2021-122402OB-C21 (MCIU/AEI/FEDER, UE).
Author information
Authors and Affiliations
Contributions
Conceived, designed and performed the experiment: J.M.M.O. and J. A. Wrote the paper: J.M.M.O. Provided the industrial dataset: J. A. Corrected the paper: J.A., I.M. and B.S. Managed the project and secured the funding: I.M. and B.S. All authors reviewed the manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Martínez-Otzeta, J.M., Azpiazu, J., Mendialdua, I. et al. Optimizing plane detection in point clouds through line sampling. Sci Rep 15, 30903 (2025). https://doi.org/10.1038/s41598-025-12660-w
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598-025-12660-w