RANSAC Fitting With Normals

Description

This operator uses the RANSAC algorithm to fit geometric models to the 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 that fit the model) and "outliers" (noise or points that do not fit the model) in the input data, estimating accurate model fitting parameters.

Overview

Performs geometric model fitting on input point cloud data using the RANSAC algorithm, outputting basic geometric shapes such as planes, lines, spheres, and 3D toroids.

Scenarios

  • Geometric Object Detection: When specific geometric shapes (e.g., tabletops, pipes, spherical objects, circular holes) need to be detected and located in complex 3D scenes.

  • Point Cloud Segmentation: Segmenting the point cloud into different parts based on whether it fits a certain geometric model. For example, extracting all flat surfaces from a scene.

  • Noise Filtering: By identifying the main geometric structures, noise points that do not fit the structure can be identified as outliers and separated.

  • Parameter Estimation: Extracting precise parameters of specific geometric shapes from point cloud data, such as plane equations, sphere centers, and radii.

Inputs and Outputs

Inputs

Point Cloud: The input point cloud data to be fitted, which can be a point cloud or a list of point clouds.

Outputs

Inlier Point Cloud: Point cloud belonging to the fitted model (inliers).

Outlier Point Cloud: Point cloud not belonging to the fitted model (outliers).

Equation Parameters: List of equation parameters for the fitted shapes.

Result Direction: Result direction. Plane fitting returns the plane normal, line fitting returns the line direction, cylinder fitting returns the cylinder axis direction, 3D circle fitting returns the circle normal, and sphere fitting does not return a direction.

Parameters

Fitting Model

Description

Choose based on the shape of the object to be detected in the point cloud. For example, select "Plane" to detect a tabletop; try "Line" (axial) or "Circle" in subsequent "RANSAC Fitting (With Normals)" to detect (a part of) a pipe.

Parameter Range

Options: Plane, Line, Sphere, 3D Circle

Parameter Range

Values/Range:

  • Plane

  • Line

  • Sphere

  • Cylinder

  • 3D Circle

Default: Plane

Model Direction

Description

Provide a rough reference direction. For example, if the requirement is to detect a roughly vertical plane, set this parameter to [0,0,1] or [0,0,-1] (assuming Z-axis is 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 constraint of this parameter will weaken, and "Axial Float Range" can be increased.

Parameter Range

Parameter Range

Default: [0, 0, 1.0]

Allowed Axis Deviation

Description

  • Smaller value (e.g., 5-15°): Indicates strong prior knowledge of the model direction, and the fitted result’s direction will be strictly limited to near the "Model Direction". Suitable when the target direction is known and changes little.

  • Larger value (e.g., 30-90°): Indicates looser constraints on the model direction, allowing searching for directions in a larger range. Suitable when the target direction is uncertain or detecting objects within a larger angular range is desired.

Parameter Range

[0, 300], Default value: 30, Unit: °

Parameter Range

Values/Range: [0.0, 300.0]

Default: 30.0

Unit: °

Radius

Description

Provide an estimated value of the expected radius. The algorithm will combine "Radius Float Range" (radiusEps) to find the best match near this estimated value.

Parameter Range

[0, 10000], Default value: 10, Unit: mm

Parameter Range

Values/Range: [0, 10000]

Default: 10.0

Allowed Radius Deviation

Description

  • Smaller value (e.g., 1-5mm): Indicates precise estimation of the model radius, and the fitted result’s radius will be strictly limited to near "Radius Size".

  • Larger value (e.g., 10-50mm): Indicates looser constraints on the model radius, allowing fitting models with radii significantly different from the preset value. Suitable when the radius is uncertain or detecting objects within a larger radius range is desired.

Parameter Range

[0, 300], Default value: 5, Unit: mm

Parameter Range

Values/Range: [0.0, 300.0]

Default: 5.0

Unit: mm

Minimum Fitting Points

Description

  • Increase this value: Ensures the fitted model is supported by enough points, helping to avoid mistaking noise points or very small clusters for valid models. However, it may also lead to failure in detecting real objects with fewer points.

  • Decrease this value: Allows fitting models with fewer points. Makes it easier to detect small objects or incomplete parts of objects, but may also be more susceptible to noise. This value should not be less than the minimum number of points required to define the chosen geometric model (e.g., at least 3 points for a plane, at least 2 points for a line).

Parameter Range

[1, 10000000], Default value: 100

Parameter Range

Values/Range: [1, 10000000]

Default: 100

Maximum Fitting Points

Description

This parameter is usually used to prevent a very large structure fitting the model (e.g., a huge flat 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 fitting the model in the scene, this value can be set very large.

Parameter Range

[1, 4000000], Default value: 4000000

Parameter Range

Values/Range: [1, 10000000]

Default: 4000000

Repeat Count

Description

  • Set to 1: The operator will attempt to find the most prominent model instance (usually containing the most inliers).

  • Set greater than 1: The operator will attempt to find multiple model instances in the point cloud. For example, if there are multiple tabletops in the scene, increasing this value can help detect all tabletops.

Note: Increasing this value will significantly increase calculation time.

Parameter Range

[0, 5000], Default value: 1

Parameter Range

Values/Range: [0, 5000]

Default: 1

Maximum Iterations

Description

  • Increase this value: The algorithm has more opportunities to randomly sample good points from the data to build the model, thereby increasing the probability of finding the best possible model, especially when the proportion of inliers is low (more noise), but this will increase calculation time.

  • Decrease this value: Calculation speed is faster, but when there is a lot of noise or the model is not obvious, it may not be possible to find a good model.

Parameter Range

[0, 100000], Default value: 100

Parameter Range

Values/Range: [0, 100000]

Default: 100

Loss Function Threshold

Description

  • Smaller value: Requires points to be very close to the model to be accepted. This makes fitting stricter on model shape, resulting in more precise results, but more sensitive to noise and point cloud imperfections, potentially missing some valid points slightly further away.

  • Larger value: Allows points further from the model to be accepted. This makes the algorithm more tolerant of noise and shape deviations, but may also lead to incorrectly including some outliers, resulting in inaccurate model fitting.

It is recommended to carefully adjust this parameter based on point cloud density, noise level, and model accuracy requirements. Start with a moderate value, observe the fitting results, and then adjust gradually.

Parameter Range

[0, 1000000], Default value: 8

Parameter Range

Values/Range: [0, 1000000]

Default: 8.0