3D visionGuide

Segment planes and cylinders in a point cloud

Segment planes and cylinders in a point cloud, merge fragmented curved patches, and check boundaries before planning surface-following paths.

LumaSpec Vision11 min read Share on LinkedIn

On this page 11 sections
  1. 011. Define the segmentation output before choosing an algorithm
  2. 022. Prepare the cloud without erasing its edges
  3. 033. Fit plane and cylinder candidates using comparable evidence
  4. 044. Merge cylinder patches by geometry, not color
  5. 055. Extract observed boundaries before calculating intersections
  6. 066. Work through a plane-and-cylinder example
  7. 077. Convert accepted regions into candidate surface paths
  8. 088. Select acquisition hardware around the missing evidence
  9. 099. Recognize when planes and cylinders are the wrong answer
  10. 1010. Check acceptance criteria and plan the next test
  11. 11Questions

A cylinder often appears as many colored patches because its surface normals change continuously around the circumference. That does not necessarily mean the scan contains several separate objects. For inspection and surface-following path planning, you need geometric models, connected surface regions, and trustworthy boundaries—not just clusters with similar normals. The workflow below separates planes from cylinders, joins compatible curved patches, and identifies where the scan does not support a reliable path.

1. Define the segmentation output before choosing an algorithm

Use geometric model fitting to identify the underlying surfaces, then use connectivity to separate their physical instances. A plane or cylinder equation describes an unlimited surface; your scanned part occupies only a bounded portion of it.

Keep these outputs for each accepted region:

  • A model type and fitted parameters.
  • The original point indices belonging to the region.
  • Residual statistics and spatial coverage.
  • Connected components and observed boundaries.
  • Uncertain points, missing areas, and neighboring regions.

For a plane, store its normal and offset. For a cylinder, store its axis direction, an axis reference point, radius, observed axial range, and angular coverage. An axis reference point is not automatically the physical center of the complete object.

Do not require every point to belong to a primitive. An explicit unknown class is more useful than assigning a fillet, reflection artifact, or unsupported edge to the nearest convenient cylinder.

Approach What it groups Useful role Main limitation
Normal-based region growing Nearby points with similar local orientation Initial planar patches and boundary hints Often splits a cylinder into narrow strips
Plane model fitting Points close to a common plane Flat faces and support surfaces Does not establish a rectangular footprint
Cylinder model fitting Points consistent with a common axis and radius Curved walls and cylindrical sections Small visible arcs can give unstable parameters
Connectivity analysis Neighboring points within an accepted model Separating disconnected objects Cannot identify the geometric shape by itself

2. Prepare the cloud without erasing its edges

Confirm units, coordinate conventions, invalid-point handling, and normal orientation before fitting anything. A unit mistake changes every distance threshold. A coordinate mistake can produce a plausible segmentation in the wrong frame; the guide to transforming depth clouds between optical and camera frames explains that distinction.

Remove invalid coordinates and obvious isolated outliers. Crop the working region so background structures do not dominate the first model. Preserve the original cloud and maintain an index mapping through every filtering stage.

Downsampling can reduce fitting time, but fit parameters should later be checked against original-resolution points. The article on point-cloud downsampling distortion explains why representative points can shift measured surfaces.

Estimate normals over a neighborhood large enough to suppress noise but small enough to avoid mixing adjacent faces. As an illustrative starting point, a cloud with approximately 0.5 mm point spacing might use a 2 mm neighborhood radius. This is a trial setting, not a universal ratio.

Check normal stability at several neighborhood sizes. Near a junction, a neighborhood can include both the plane and cylinder, producing a direction that represents neither surface. Mark these locations as uncertain rather than forcing them into the normal-consistency test.

3. Fit plane and cylinder candidates using comparable evidence

RANSAC repeatedly proposes a model from sampled points and counts supporting observations. It is useful when a cloud contains outliers and several different shapes, but the largest consensus is not automatically the correct physical interpretation.

For a plane, use a unit normal and a signed offset. For a cylinder, use a unit axis direction, an axis reference point, and a positive radius.

Plane distance: e_plane = abs(n · p + d), with ||n|| = 1 Cylinder radial distance: v = p - c q = v - u(u · v), with ||u|| = 1 e_cylinder = abs(||q|| - r)

Here, p is a measured point, n is the plane normal, and d is its offset. The cylinder uses axis direction u, axis point c, and radius r. These expressions measure distance to ideal infinite surfaces; they do not identify finite boundaries.

Test normal consistency as well as distance. A plane normal should align with the measured surface normal, allowing sign reversal when normals are unoriented. A cylinder normal should align with the radial direction and be perpendicular to the axis.

Set plausible radius limits from the application when that information is genuinely known. Otherwise, a very large cylinder can imitate a plane over a narrow patch.

Compare candidates using support count, residual distribution, coverage, connectivity, and model complexity. Do not compare a tightly constrained plane against a cylinder allowed a much larger distance threshold and then trust the larger support count.

For standard independent RANSAC sampling, an iteration estimate is:

N >= log(1 - p_success) / log(1 - w^s) p_success = desired probability of an all-inlier sample w = estimated inlier fraction s = minimal sample size for the chosen estimator

A plane estimator using three noncollinear points, with an estimated inlier fraction of 0.5 and target probability of 0.99, gives log(0.01) / log(0.875) ≈ 34.5. Round upward to 35 trials. This is a sampling estimate, not a guarantee of a correct fit. Cylinder estimators have different sampling requirements; use the requirements of the actual implementation.

Refine promising models using their supporting points, then reclassify the cloud. Avoid permanently removing a large planar region before testing whether points near its boundary support another model.

4. Merge cylinder patches by geometry, not color

Normal-based segmentation commonly fragments cylinders because neighboring strips have different normal directions. Merge those strips only when they support the same finite cylindrical surface.

First, make axis signs consistent. Directions u and -u describe the same cylinder axis. Compare their orientation using the absolute dot product rather than treating opposite signs as different orientations.

Next, compare:

  • Axis angle difference.
  • Axis position at a shared reference cross-section.
  • Radius difference.
  • Axial extent and angular coverage.
  • Spatial adjacency and the evidence inside any gap.

Illustrative screening limits might be 2° for axis angle, 0.5 mm for radius difference, and 0.75 mm for axis-position difference. These are application settings to validate against measured noise and required accuracy, not default acceptance limits.

Refit a common cylinder using the combined support. Accept the merge only if each original patch remains well represented. A combined fit with a small median error can still hide one badly fitted patch, so inspect per-patch residuals and a high percentile such as the 95th percentile.

Keep disconnected components as separate region instances unless there is evidence that the application should treat them together. Two separate components can share an identical mathematical cylinder without being one continuous accessible surface.

If fragmentation comes from separately acquired scans, establish registration first. The workflow for merging multiple depth frames addresses alignment and coverage; model merging cannot repair an incorrect registration.

5. Extract observed boundaries before calculating intersections

A fitted plane is not automatically a rectangle. Project its inliers into a local two-dimensional coordinate system and estimate the observed footprint. Preserve holes and concave regions rather than replacing everything with a convex outline.

For cylinders, represent points using axial position and angle. This unwraps the observed wall into a two-dimensional map where connectivity, missing areas, and boundary curves are easier to inspect. Handle the angular seam explicitly so adjacent points are not split merely because their angles cross the chosen wrap point.

Separate three boundary types:

  1. Geometric junction: evidence supports a change between fitted surfaces.
  2. Occlusion or missing-data boundary: the sensor stopped observing the surface.
  3. Physical part edge: evidence supports the actual end of the material.

An analytical plane–cylinder intersection predicts where ideal surfaces meet. It does not prove that the corresponding edge exists on the scanned part. Require nearby observations from the relevant regions before accepting it as a measured junction.

Use repeat views to investigate gaps. The guide to missing points in a camera point cloud helps distinguish acquisition problems from actual surface features.

6. Work through a plane-and-cylinder example

Consider a hypothetical scan of a flat support and an upright cylindrical feature. The support footprint is approximately 200 mm by 150 mm. The visible cylinder has a nominal radius of 25 mm, a height of 100 mm, and about 120° of observed circumference.

Suppose the processed point spacing is 0.5 mm. Repeated stationary scans of a reference patch show approximately 0.15 mm standard deviation along the local normal. You initially test a distance threshold of 0.5 mm, which is 0.5 / 0.15 ≈ 3.3 times that measured deviation.

That ratio is a starting rationale, not an accuracy claim. Registration error, surface-dependent bias, and edge mixing may not follow the same distribution as the stationary reference measurements.

The initial cylinder segmentation produces several strips. You compare their axes and radii, refit compatible strips together, and retain only observed connected coverage. The hidden portion of the cylinder stays unknown.

Now estimate candidate sampling density on the accepted wall:

Observed arc length = radius × observed angle in radians = 25 mm × (120 × pi / 180) ≈ 52.4 mm For maximum 2 mm arc spacing: Angular intervals = ceil(52.4 / 2) = 27 Actual arc spacing ≈ 52.4 / 27 = 1.94 mm For 2 mm axial spacing over 100 mm: Axial intervals = 100 / 2 = 50

These are preliminary surface-sampling counts before trimming boundaries, removing gaps, or applying process constraints. They are not executable motion instructions.

Report the observed footprint and fitted parameters separately. A visible arc can support a radius estimate without supporting a claim that the entire circumference was inspected.

7. Convert accepted regions into candidate surface paths

For a plane, generate a grid or raster in its local coordinate system. Clip every segment against the accepted footprint, including holes. Connecting only the endpoints is insufficient: a segment can cross a missing area even when both endpoints lie inside valid regions.

For a cylinder, generate candidate tracks in axial–angular coordinates. Circumferential distance depends on radius, so specify spacing in surface-distance units rather than choosing an arbitrary angular increment.

Circumferential spacing = r × delta_theta Local cylindrical surface distance: ds^2 = dz^2 + (r × dtheta)^2

Choose track pitch from the actual process footprint, required overlap, surface curvature, and speed limits. Point spacing in the scan is not automatically the correct spacing between tool tracks.

Inset accepted boundaries by a margin accounting for the process footprint, positioning error, and measurement uncertainty. Keep those contributions separate so their assumptions can be reviewed. A single unexplained margin can conceal an unsupported accuracy budget.

Treat transitions between surfaces as a separate planning problem. Independently generated plane and cylinder tracks may produce abrupt orientation changes at their junction.

Before machine execution, validate tool orientation, reachability, collisions, approach and retreat motion, fixtures, and applicable safeguards. A geometrically valid surface path is not a safety-rated motion plan. Preserve the machine's safety functions throughout integration and testing.

8. Select acquisition hardware around the missing evidence

The segmentation method does not require a specific sensor family. It requires sufficient coverage, spatial sampling, repeatability, and reliable coordinates for the smallest relevant feature.

Use the 3D sensors category to compare acquisition approaches, then narrow candidates through the camera finder. A laser-profile workflow generally needs a known relationship between profiles and relative motion. An area-based depth acquisition workflow still requires checks for occlusion, surface response, and usable coverage.

MIS-DP3850-01P is listed as a laser profiler. Treat it as an acquisition candidate, not as evidence that the segmentation or path-planning requirements are already satisfied.

3D sensorsHikrobot MIS-DP3850-01P 3D laser profile sensorMIS-DP3850-01P
Type
Laser profiler
$12,379.00 · quotedView and quote

MV-DPS200P-02 is listed as a projected structured-light camera. Verify its documented acquisition requirements and performance against representative parts before selecting it.

3D sensorsHikrobot MV-DPS200P-02 Projected structured-light 3D cameraMV-DPS200P-02
Type
Stereo / structured light
$8,829.00 · quotedView and quote

For either approach, confirm the output format, coordinate units, calibration requirements, and handling of invalid measurements. Do not assume normals are supplied; they may need to be estimated in your processing pipeline.

The guide to camera working distance and positioning covers capture geometry that affects visible surface coverage. Choose the acquisition layout before finalizing fitting thresholds.

Cameras3D sensors

Laser profilers and stereo 3D cameras

170 models · from $699.00

9. Recognize when planes and cylinders are the wrong answer

A small cylindrical patch can look planar within measurement noise. Conversely, a slightly bowed plane can appear to support a large-radius cylinder. Compare residual patterns and parameter stability, not just the number of inliers.

Use spatially separated fitting and validation regions where practical. If the fitted radius changes substantially when one strip is removed, the observed geometry may not constrain the model adequately.

Inspect whether residuals vary systematically with position. A low overall residual can conceal calibration distortion, deformation, or an inappropriate primitive. The guide to diagnosing a bowed flat surface is useful when a supposed plane shows repeatable curvature.

Tapered walls, blended corners, threads, and freeform surfaces should not be forced into a cylinder class. Add another model only when its geometry is justified and the data can distinguish it from existing candidates.

When several interpretations remain plausible, retain the ambiguity and collect additional observations. A second viewpoint is often more valuable than increasing the number of fitting iterations.

10. Check acceptance criteria and plan the next test

Before using segmentation output downstream, complete this checklist:

  • Units and frames: verify a known distance and document the processing frame.
  • Sampling: inspect both typical spacing and sparsely observed regions.
  • Normals: check neighborhood sensitivity and uncertainty near junctions.
  • Model support: review residual distributions, coverage, and connected components.
  • Cylinder merges: refit combined support and retain per-patch error checks.
  • Boundaries: distinguish observed material edges from missing observations.
  • Repeatability: compare repeated captures without changing the physical setup.
  • Path clipping: test whole segments against footprints, holes, and margins.
  • Motion validation: complete collision, orientation, and safeguarding checks separately.

Save the raw cloud, processing settings, fitted parameters, and rejection reasons with each development run. This makes threshold changes traceable and exposes improvements that merely trade one failure mode for another.

Start with representative scans containing a clean plane, a well-observed cylinder, and a difficult junction. Define acceptance limits before adding more shapes. For acquisition planning, use the camera configuration workflow, or contact the applications team with sample clouds, feature dimensions, required coverage, and the intended process footprint.

Build the whole station

The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.

Start with the camera

Questions

Why does one cylinder appear as several segmented surfaces?

Normal-based methods group points by local orientation, which changes continuously around a curved wall. Use those patches as candidates, then test whether they share a common cylinder axis and radius. Refit their combined support and check connectivity before assigning one region label.

Can fitted planes and cylinders be used directly as machine paths?

No. A geometric fit describes an ideal surface but does not establish visible boundaries, collision clearance, tool access, or safe transitions. Clip candidate paths to supported regions, account for uncertainty and process footprint, and validate motion through the machine's normal integration and safeguarding procedures.

How should the fitting distance threshold be chosen?

Begin with repeated measurements of representative surfaces, then choose a threshold consistent with measured variation and the application's error budget. Check sensitivity across several settings. A threshold that produces a large region can still be wrong if it bridges junctions or absorbs nearby surfaces.

How much of a cylinder must be visible for a reliable fit?

A narrow arc may fit several substantially different cylinders almost equally well. Examine radius stability when subsets are removed, compare predictions against independent observations, and add another viewpoint when possible. Do not treat a low residual on a narrow strip as proof of an accurate full cylinder.

Does detecting a plane also identify a rectangular face?

Not necessarily. Plane inliers establish flatness within the selected tolerance, not the complete outline. Recover the observed footprint separately, preserving holes and concavities. Claim a rectangular physical face only when its edges are adequately observed or established by independent information.