RANSAC shape detection
Finds planes, and optionally spheres and cylinders, one after another in the cloud; writes a shape number to the points, lists the shapes and can assign the shape points to a class.
In the app: Processing › Segmentation › RANSAC shape detection…
What does it do?
A point belongs to a shape if its distance to the shape is less than ε and its normal agrees with the shape within the angle threshold. The shape points are split into parts farther apart than the clustering spacing, the largest part is kept, and the shape is refined by least squares; spheres and cylinders are searched within the given radius range.
The result is the RANSAC shape scalar field (shape number; no value for points outside any shape) and the RANSAC — result list: type, point count, RMS and parameters (plane slope / slope direction, sphere center / radius, cylinder axis / radius). If the scope holds more than the maximum number of points to process, it is randomly thinned and the remaining points get no value.
How to use it
- 1If needed, select the region with Tools → Area selection; open Processing → Segmentation → RANSAC shape detection….
- 2Choose the cloud, scope and classes; check the shapes to search for.
- 3Enter the thresholds and limits; optionally set the target class, then click Detect.
- 4Review the result list (Copy); the shape numbers appear colored in Scalar mode.
Parameters
| Setting | What it does | Default |
|---|---|---|
| Cloud | A single cloud is selected. | First cloud |
| Whole cloud / Selected area | Scope; Selected area is disabled when there is no selection. | Selected area if there is a selection |
| Classes to use: | Class filter. | All classes |
| Plane, Sphere, Cylinder | Shapes to search for; at least one. | Plane |
| Distance threshold (ε): | Maximum distance to count as part of a shape; 0.001–10.000 m. | 0.050 m |
| Normal angle threshold: | 1–90 °. | 20 ° |
| Minimum points / shape: | 10–100 000 000. | 500 |
| Maximum shapes: | 1–500. | 30 |
| Clustering spacing: | 0–100.00 m; 0 = no splitting. | 0.50 m |
| Sphere / cylinder radius: | Minimum 0.001–1000 m, maximum 0.01–10000 m. | 0.050 – 20.00 m |
| Maximum points to process: | Extra points are randomly thinned (speed); 10 000–200 000 000. | 5 000 000 |
| Assign shape points to a class: | Target class 0–255 (Ctrl+Z undoes). | Off, 6 |
| When finished, show the 'RANSAC shape' field as color | With the Rainbow scale. | On |
Outputs
- RANSAC shape scalar field (shape number)
- Shape list: type, point count, RMS, parameters
- Optional class assignment (Ctrl+Z / Ctrl+S)
Tips
- For roof planes, leave ground and vegetation out of scope.
- If no shape is found, loosen the thresholds or lower the minimum point count.
- Keep ε slightly above the measurement noise: a small ε breaks planes apart, a large ε merges neighboring surfaces.