Algorithm Search⌘K

Problemcore

Segmentation into surface primitives

Also called point cloud primitive segmentation.

Partition a point cloud or mesh into regions each well fit by a plane, sphere, cylinder, cone, torus or free-form patch, the first step of scan-to-CAD.

Segmentation into surface primitives is the problem of dividing a scanned point cloud or mesh into regions so that each region is fitted well by one simple surface: a plane, a sphere, a circular cylinder, a cone, a torus, or, where nothing simple fits, a free-form patch. It is the step of reverse engineering between the measured points and the surface model. A segmentation must decide two things at once: which points belong together, and which surface each group follows. Neither can be done first: the fit needs the region, and the region needs the fit. Várady, Martin and Cox (1997) describe the two classic approaches: edge-based methods, which find sharp edges and regions of high curvature first and take the parts between them, and face-based methods, which grow regions of points that fit one surface. No single objective is standard; the methods differ in the error they allow, how they count regions, and how they treat points near edges.

In plain words

A scanner gives a cloud of points on the outside of a part, with no structure. A designer thinks of the same part as a set of faces: this flat face, that hole, this rounded edge. Segmentation finds those faces in the points.

Each point gets a label that says which face it is on, and each face gets a shape, such as a plane or a cylinder, that the points of the face follow closely. Some points, such as noise or points on tiny details, may get no label. The hard parts are the points near an edge, where two faces meet, and the faces that are almost flat or almost round, where more than one shape fits well enough.

Definition

Input. Points p1,…,pmp_1, \dots, p_m in R3\mathbb{R}^3, usually with unit normals nin_i and a neighbor graph GG (the mesh edges, or the kk nearest neighbors); a list of surface types, for example plane, sphere, cylinder, cone and torus; a distance tolerance ε\varepsilon, an angle tolerance α\alpha, and a minimum region size ss.

Output. A number KK, labels ℓ:{1,…,m}→{0,1,…,K}\ell : \{1, \dots, m\} \to \{0, 1, \dots, K\}, and a surface SjS_j of one of the types for each j≥1j \ge 1, such that, for the region Rj={i:ℓ(i)=j}R_j = \{ i : \ell(i) = j \}:

  • every i∈Rji \in R_j has dist⁡(pi,Sj)≤ε\operatorname{dist}(p_i, S_j) \le \varepsilon, and the angle between nin_i and the normal of SjS_j at the nearest point is at most α\alpha;
  • RjR_j is connected in GG and has at least ss points.

Label 00 marks points left out. Among the valid segmentations the goal is a good one, and the measure differs between formulations: few regions and few points left out; a small total of squared distances plus a cost per region, as in minimum description length or information criteria; or an energy that also charges neighbor pairs with different labels.

Variants

  • Fixed types or free-form. Some methods allow only the primitive types; others also allow polynomial or B-spline patches for the regions that no primitive fits.
  • Exact cover or energy. The cover form asks for few regions within the tolerance. The energy form, as in Isack and Boykov (2012), minimizes ∑idist⁡(pi,Sℓ(i))2+λ∑(i,i′)∈G[ℓ(i)≠ℓ(i′)]+hK\sum_i \operatorname{dist}(p_i, S_{\ell(i)})^2 + \lambda \sum_{(i, i') \in G} [\ell(i) \ne \ell(i')] + h K, a fitting term, a Potts smoothness term and a cost per model.
  • Input type. Range images, with a grid as the neighbor graph, as in Besl and Jain (1988); meshes, where the triangles are labeled, as in mesh segmentation; or unordered point clouds.
  • Planar curves. The same problem in the plane, with lines, circles and free-form curves, segments 2D profiles and sections.
  • With or without edges and blends. Some methods also label the thin strips of fillets and rounds between the main faces, or the sharp edges themselves.
  • Supervised. Learned methods predict the labels and the types from examples; the ABC dataset of CAD models with exact faces (Koch et al., 2019) is a common source of training and test data, and Thingi10K (Zhou and Jacobson, 2016) is a collection of real-world meshes used for tests.

Examples

A box. A scan of a rectangular block has six regions, each a plane. Points within ε\varepsilon of two faces, along an edge, can go to either; a good method gives each to the face with the closer fit or leaves it out.

Plane or cylinder. Points on a cylinder of radius R=100R = 100 mm across a strip of width L=20L = 20 mm deviate from the chord plane by at most the sagitta

R−R2−(L/2)2=100−9900≈0.501 mm.R - \sqrt{R^2 - (L/2)^2} = 100 - \sqrt{9900} \approx 0.501 \text{ mm} .

With ε=1\varepsilon = 1 mm both a plane and a cylinder are valid, and the cover form prefers neither. A cost per parameter (a plane has 33, a cylinder 55) favors the plane, while the sum of squared distances favors the cylinder; the formulation decides.

An L shape in the plane. The points (k,0)(k, 0) and (0,k)(0, k) for k=0,…,4k = 0, \dots, 4 are covered by two lines with ε=0\varepsilon = 0. The point (0,0)(0, 0) lies on both, so the labels are not unique even when the surfaces are.

Known algorithms

  • Region growing. Start from a seed with low curvature and add neighbors that fit the current surface, refitting as the region grows; region growing on normals and curvature, with curvature from curvature tensor estimation.
  • Variable-order fitting. Besl and Jain label points by the signs of the mean and Gaussian curvature and grow regions with polynomial surfaces of increasing order.
  • RANSAC. RANSAC samples minimal sets, fits candidates, keeps the one with the largest connected set of inliers, removes those points and repeats. Efficient RANSAC does this for planes, spheres, cylinders, cones and tori with local sampling and an octree.
  • Hough transform. The Hough transform votes in the parameter space of one type, which works well for planes and less well for types with many parameters.
  • Slippage. Slippage analysis classifies local patches by their slippable motions and merges regions that share them.
  • Multi-model fitting. J-linkage clusters points by the sets of candidate models they agree with; PEaRL minimizes the energy form by alpha-expansion, alternating with refits.
  • Clustering of normals and curvature. Mean shift or DBSCAN on normals, positions and curvature give regions, which are then fitted.

After any of these, each region goes to geometric primitive fitting, and often the whole model to constrained primitive fitting.

AlgorithmTimeSpacePropertiesCode
Variable-order surface fitting segmentationΘ(N w² + s N r + s (g + 4) N q²) worstΘ(N + w² + N q) extradeterministicnot exactiterative1 language

Bounds

Every algorithm must read all mm points, so Ω(m)\Omega(m) time is needed. For the cover form the problem is hard in general: the planar variant with lines only, ε=0\varepsilon = 0, no connectivity condition and the goal of the fewest regions is exactly the problem of covering points by the fewest lines, which Megiddo and Tamir (1982) showed to be NP-complete. So no polynomial algorithm is known for the exact cover form, and practical methods are heuristics with no guarantee on the number of regions. The energy form with a fixed set of candidate models contains the minimization of a Potts energy with three or more labels, which is NP-hard as well; this is why PEaRL uses alpha-expansion, an approximation with a bounded factor for the Potts term.

Reductions

  • To set cover. With a finite set of candidate surfaces, each covering the points within the tolerance, the cover form is a set cover problem; the greedy rule of taking the candidate with the most uncovered points, which sequential RANSAC follows with random candidates, has the logarithmic factor of greedy set cover when all candidates are tried.
  • To labeling. The energy form is a labeling problem with label costs, a Potts model over the neighbor graph.
  • From line cover. As above, minimum line cover in the plane is the special case that makes the cover form NP-hard.
  • To primitive fitting. Once the regions are fixed, the remaining problem is a separate least-squares fit per region.

Applications

  • Scan-to-CAD. Segmentation is the first modeling step of reverse engineering; the regions and their surfaces become the faces of a B-rep reconstruction.
  • Inspection. Measured points of a manufactured part are split into the features of the design before each feature is compared with its tolerance.
  • Buildings and plants. Laser scans of buildings, pipes and plants are segmented into planes and cylinders for models of existing structures.
  • Robotics. Planes and cylinders found in depth images serve for grasping, for placing objects on tables, and for registration with few features.

References

  1. Tamás Várady, Ralph R. Martin and Jordan Cox, Reverse engineering of geometric models, an introduction, Computer-Aided Design 29(4), 1997, 255 to 268, the section on segmentation and surface fitting, with edge-based and face-based segmentation and the classification of points and regions into surface types
  2. Paul J. Besl and Ramesh C. Jain, Segmentation through variable-order surface fitting, IEEE Transactions on Pattern Analysis and Machine Intelligence 10(2), 1988, 167 to 192, the segmentation of range images into regions of the eight surface types of the signs of mean and Gaussian curvature, and the region growing by surface fits of increasing order
  3. Ruwen Schnabel, Roland Wahl and Reinhard Klein, Efficient RANSAC for point-cloud shape detection, Computer Graphics Forum 26(2), 2007, 214 to 226, the detection of planes, spheres, cylinders, cones and tori by RANSAC with local sampling, the score with distance and normal tolerances and connected components, and the extraction loop
  4. Hossam Isack and Yuri Boykov, Energy-based geometric multi-model fitting, International Journal of Computer Vision 97(2), 2012, 123 to 147, multi-model fitting as a labeling problem with a geometric error term, a smoothness term on neighbors and a cost per model, minimized by alternating alpha-expansion and refitting (PEaRL)
  5. Nimrod Megiddo and Arie Tamir, On the complexity of locating linear facilities in the plane, Operations Research Letters 1(5), 1982, 194 to 197, the NP-completeness of covering given points in the plane by a minimum number of lines
  6. Sebastian Koch, Albert Matveev, Zhongshi Jiang, Francis Williams, Alexey Artemov, Evgeny Burnaev, Marc Alexa, Denis Zorin and Daniele Panozzo, ABC, a big CAD model dataset for geometric deep learning, CVPR 2019, the collection of one million CAD models with their exact B-rep geometry and the benchmarks built from it
  7. Qingnan Zhou and Alec Jacobson, Thingi10K, a dataset of 10,000 3D-printing models, 2016, the collection of meshes from Thingiverse and their geometric and topological statistics

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a contract.yaml