<p>A reasonable approach is a continuous sample consensus method. The hough transform can be though of as a discrete sample consensus method, and so becomes intractable for some problems. Sample consensus is nice, because we can impose arbitrary constraints, and handle even the most horrific noise.</p>

<h1>Getting Planes: Sample Consensus</h1>

<p>The idea is determine the minimum number of observations needed to form a hypothesis, and then check how many observations agree with that hypothesis. We'll call those observations "inliers".</p>

<ol>
<li><p>Three point determine a plane. Select three points (deterministically, at random, whatever) from your dataset, fit a plane to them.</p></li>
<li><p>Check how many points in your point cloud "support" the plane. Meaning that the plane existing in the world could explain what the sensor saw; the observations "support" the conclusion that the plane exists. For your case, a reasonable metric for "support" would be perpendicular distance to the plane.</p></li>
<li><p>In postprocessing, you might cull planes that don't have sufficient width.</p></li>
</ol>

<h1>Extracting Parallel Planes: Normal Binning</h1>

<p>If you don't have a prior on the structure of your data other than "has parallel planes", then you're likely trapped trying to discover as many planes as possible and then filtering for parallel ones.</p>

<p>One might consider a "binning" approach</p>

<ol>
<li>Start with the first plane, and say its normal belongs to $bin_0$</li>
<li>For each discovered plane, check the angle it makes with every existing bin</li>
<li>If the angle is less than $\epsilon$, add that plane to $bin_n$</li>
<li>If the angle is greater than (or equal, for completeness) to $\epsilon$, create a new bin, $bin_{n+1}$</li>
</ol>

<p>Presumably the largest bin is the thing you want if you have culled small planes.</p>

<h1>Other Notes</h1>

<p>Sample consensus will generally perform better if, after fitting to data and finding points that agree, you run a quick optimization to fit a plane to <em>all</em> of the inlier points. Then recompute inliers, and re-run the optimization. After all, it's quite unlikely that the three points you happened to choose were exactly the true plane. Much more likely is that varying plane parameters to minimize point-to-plane error over all of the inlier observations will yield a nice plane, with the noise averaged out.</p>

CC BY-SA 3.0
2017-06-05T03:40:45.830Z
2017-06-05T03:40:45.830Z
Jacob Panikulam
<p>If I have some 3d points, how can I discover parallel planes within them (not just arbitrary planes).</p>

<p>I want to know how many "levels" or "floors" something can travel within, after it has done so, so I want to cluster the positions into planes.</p>

<p>Some of them might not be in a plane, most of them are noisy (not perfectly planar), and I have no knowledge of the world orientation, so the planes aren't necessarily orthogonal to some known axis.</p>

<p>I know one way is a 3d-hough transform, but is there something better?</p>

CC BY-SA 3.0
2017-05-20T13:03:04.303Z
Do you know anything more about the structure? E.g. are there just a handful of planes, or are there many planes but just a few points per plane? Are the planes equidistant? Are the points within a plane closer to eachother than to the points of the other planes?
flawr
CC BY-SA 3.0
2017-05-20T14:53:16.570Z
Also do you have an upper bound of the number of planes?
flawr
CC BY-SA 3.0
2017-06-05T12:08:48.423Z
If the points are noisy and some are not in a plane, could you clarify how much deviation from a plane due to noise is permitted, before a point is no longer regarded as being in that plane? For an approximate solution you would need to explain what your priorities are.
trichoplax is on Codidact now
<3d><mathematics><geometry>
Best way to group 3d points into planes, if any
ginsunuva
# Best way to group 3d points into planes, if any

(Asked by: username_0 on 2017-05-15)

If I have some 3d points, how can I discover parallel planes within them (not just arbitrary planes).

I want to know how many "levels" or "floors" something can travel within, after it has done so, so I want to cluster the positions into planes.

Some of them might not be in a plane, most of them are noisy (not perfectly planar), and I have no knowledge of the world orientation, so the planes aren't necessarily orthogonal to some known axis.

I know one way is a 3d-hough transform, but is there something better?

**Tags:** 3d, mathematics, geometry

> **Comments:**
> **username_1**: Do you know anything more about the structure? E.g. are there just a handful of planes, or are there many planes but just a few points per plane? Are the planes equidistant? Are the points within a plane closer to eachother than to the points of the other planes?  
> **username_1**: Also do you have an upper bound of the number of planes?  
> **username_2**: If the points are noisy and some are not in a plane, could you clarify how much deviation from a plane due to noise is permitted, before a point is no longer regarded as being in that plane? For an approximate solution you would need to explain what your priorities are.  

---

## 1 answers

### Answer by username_3 on 2017-06-05. Score: 3

A reasonable approach is a continuous sample consensus method. The hough transform can be though of as a discrete sample consensus method, and so becomes intractable for some problems. Sample consensus is nice, because we can impose arbitrary constraints, and handle even the most horrific noise.

# Getting Planes: Sample Consensus

The idea is determine the minimum number of observations needed to form a hypothesis, and then check how many observations agree with that hypothesis. We'll call those observations "inliers".

1. Three point determine a plane. Select three points (deterministically, at random, whatever) from your dataset, fit a plane to them.
2. Check how many points in your point cloud "support" the plane. Meaning that the plane existing in the world could explain what the sensor saw; the observations "support" the conclusion that the plane exists. For your case, a reasonable metric for "support" would be perpendicular distance to the plane.
3. In postprocessing, you might cull planes that don't have sufficient width.

# Extracting Parallel Planes: Normal Binning

If you don't have a prior on the structure of your data other than "has parallel planes", then you're likely trapped trying to discover as many planes as possible and then filtering for parallel ones.

One might consider a "binning" approach

1. Start with the first plane, and say its normal belongs to $bin\_0$
2. For each discovered plane, check the angle it makes with every existing bin
3. If the angle is less than $\epsilon$, add that plane to $bin\_n$
4. If the angle is greater than (or equal, for completeness) to $\epsilon$, create a new bin, $bin\_{n+1}$

Presumably the largest bin is the thing you want if you have culled small planes.

# Other Notes

Sample consensus will generally perform better if, after fitting to data and finding points that agree, you run a quick optimization to fit a plane to *all* of the inlier points. Then recompute inliers, and re-run the optimization. After all, it's quite unlikely that the three points you happened to choose were exactly the true plane. Much more likely is that varying plane parameters to minimize point-to-plane error over all of the inlier observations will yield a nice plane, with the noise averaged out.


---

