Find an outline of a 2D unorganized pointcloud

I have a set of two-dimensional points, disorganized, and I want to find the "outline" of this set (and not the convex hull). I cannot use alpha forms because I have a speed target (less than 10 ms on an average computer). My first approach was to calculate the grid and find the squares (squares of squares that have an empty square, like a neighbor). Therefore, I believe that I have effectively reduced the number of points (from 22,000 to 3,000). But I still need to refine this new set.

The outline points are in green

My question is: how to find real outlines of points among my green points?

+7
source share
2 answers

After a weekend full of reflections, I found a convenient solution.

So, we need a grid, we need to fill it with our own points, without difficulty.

We must decide which squares are considered the "outline". Our criteria: at least one empty neighbor and at least 3 non-empty neighbors.

We are missing connection information. Thus, we select the โ€œContourโ€ square, which as 2 โ€œContourโ€ neighbors or less. Then we select one of the neighbors. From this, decomposition can begin. We simply go around the current square to find the next Contour square, knowing the previous Contour squares. Our contour criteria do not allow us to reach a dead end.

Now we have vectors of connected squares, and usually, if our form does not have a hole, only one vector of connected squares!

Now for each square we need to find the best point for the path. Choose the one that is further from the barycenter of our aircraft. It works for most forms. Another method is to calculate the barycenter of the empty neighbors of the selected square and select the nearest point.

Contour

Red dots are the outline of green. The equipment used is a flat barycenter.

For a set of 28,000 points, these methods take 8 ms. CGAL Alpha forms occupy an average of 125 ms at 28,000 points.

PS: I hope I realized that English is not my native language: s

+1
source

You really need to use alpha forms. It is possible to use only green dots as inputs of the alpha-alpha algorithm.

0
source

All Articles