I have an accumulation of points representing a body as you can see in the image below. From this data I want to generate a list of points or a curve, which is the envelope.

The first idea was a convex hull, but the shape of the body is not convex.

Is there a way to extract the points at the border?
Answer
One very simple basic approach is the following (I assume you already loaded the variable spiel)
With[{m = Normal@SparseArray[spiel -> 1]},
boundary = Position[m - Erosion[m, 1, Padding -> 0], 1];
ListPlot[{Position[m, 1], boundary}, PlotStyle -> {Gray, Red}]]

Comments
Post a Comment