🟠 RANSAC Fitting
Function Description
This operator uses the RANSAC algorithm to perform geometric model fitting on input point cloud data, capable of fitting basic geometric shapes such as planes, lines, spheres, and 3D circles.
RANSAC is an iterative algorithm that can identify "inliers" (points conforming to the model) and "outliers" (noise or points not conforming to the model) in input data, estimating accurate model fitting parameters.
Usage Scenarios
-
Geometric object detection: When specific geometric shapes of objects (such as tabletops, pipes, spherical objects, circular holes) need to be detected and located in complex 3D scenes.
-
Point cloud segmentation: Segment point clouds into different parts based on whether they conform to a certain geometric model. For example, extract all flat surfaces from a scene.
-
Noise filtering: By identifying main geometric structures, noise points that don’t conform to that structure can be identified as outliers and separated.
-
Parameter estimation: Extract precise parameters of specific geometric shapes from point cloud data, such as plane equations, sphere centers and radii, etc.
Input Output
Input |
Point Cloud: Input point cloud data to be fitted, can be a single point cloud or point cloud list. |
Output |
Fitted Interior Point Cloud: Point cloud of the fitting model (inliers). Fitted Exterior Point Cloud: Point cloud that doesn’t belong to the fitting model (outliers). Equation Parameters: List of equation parameters of the fitted shape.
Result Direction: List of main direction vectors of fitting results.
|
Parameter Description
|
This operator has two versions:
Both have identical core functions and parameters, differing only in the type of point cloud data processed. |
Minimum Fit Points
Parameter Description |
Minimum number of point cloud points that each iteration candidate model must contain to be considered valid. |
Parameter Adjustment |
|
Parameter Range |
[1,10000000], Default: 100 |
Maximum Fit Points
Parameter Description |
Maximum number of point cloud points that each iteration candidate model can contain. |
Parameter Adjustment |
This parameter is usually used to prevent a very large structure that conforms to the model (such as a huge plane background) from consuming all points, making it impossible to detect other smaller structures on it. If the main goal is to detect the largest structure conforming to the model in the scene, this value can be set very large. |
Parameter Range |
[1,4000000], Default: 4000000 |
Repeat Count
Parameter Description |
Refers to the number of times the RANSAC fitting process is repeated for each input point cloud data. Each repetition may find a new, different model instance. Generally, this value corresponds to the number of output result groups. If set to k, it will generally output k groups of data, unless after multiple fittings still cannot fit k results, then the output will be less than k. |
Parameter Adjustment |
Note: Increasing this value will significantly increase computation time. |
Parameter Range |
[0,5000], Default: 1 |
Maximum Iterations
Parameter Description |
In a single RANSAC fitting process (one attempt controlled by "Repeat Count"), the maximum number of iteration rounds the algorithm performs for random sampling and model validation. |
Parameter Adjustment |
|
Parameter Range |
[0,100000], Default: 100 |
Loss Function Threshold
Parameter Description |
Defines a distance threshold. If a point’s distance to the current candidate model is less than or equal to this threshold, the point is considered an "inlier" of this model. |
Parameter Adjustment |
It’s recommended to carefully adjust this parameter based on point cloud density, noise level, and model accuracy requirements. You can start with a moderate value, observe fitting results, and then gradually adjust. |
Parameter Range |
[0,1000000], Default: 8 |
Fit Model
Parameter Description |
Choose the type of geometric model you want to fit from the point cloud. |
Parameter Adjustment |
Choose based on the shape of objects you need to detect in the point cloud. For example, if you want to detect tabletops, choose "Plane"; if you want to detect pipes (part of them), you can try "Line" (axial) or "Circle" in subsequent "RANSAC Fitting (With Normals)". |
Parameter Range |
Options: Plane, Line, Sphere, 3D Circle |
Model Direction
Parameter Description |
Sets the expected main direction of the model. This parameter only takes effect when "Plane", "Line", or "3D Circle" models are selected. For "Plane" model, this is the plane normal vector; for "Line" model, this is the line direction; for "3D Circle" model, this is the normal vector of the plane where the circle lies. |
Parameter Adjustment |
Provides a rough reference direction. For example, if you need to detect a roughly vertical plane, you can set this parameter to [0,0,1] or [0,0,-1] (assuming Z-axis points up). The algorithm will search for the best match within this reference direction and the allowed "Axial Float Range" (angleEps). If the direction is completely unknown, the constraining effect of this parameter will weaken, and you can increase the "Axial Float Range". |
Parameter Range |
[0,0,1] |
Axial Float Range
Parameter Description |
Sets the maximum angular deviation allowed between the fitted model’s main direction and the direction specified by the "Model Direction" parameter. Only takes effect when "Plane", "Line", or "3D Circle" models are selected. |
Parameter Adjustment |
|
Parameter Range |
[0,300], Default: 30, Unit: ° |
Radius Size
Parameter Description |
Sets the expected radius size for fitting "Sphere" or "3D Circle". Only takes effect when "Sphere" or "3D Circle" models are selected. |
Parameter Adjustment |
Provides an estimate of the expected radius. The algorithm will combine "Radius Float Range" (radiusEps) to find the best match near this estimate. |
Parameter Range |
[0,10000], Default: 10, Unit: mm |
Radius Float Range
Parameter Description |
Sets the maximum deviation allowed between the fitted "Sphere" or "3D Circle" radius and the radius specified by the "Radius Size" (radius) parameter. Unit is mm. This parameter only takes effect when "Sphere" or "3D Circle" models are selected. |
Parameter Adjustment |
|
Parameter Range |
[0,300], Default: 5, Unit: mm |