I assume this is a simple task, yet I could not find any documentation or question treating this problem:
Let's say we have a simple binary data set, in this case defining a shape of a circle
data = Flatten[Table[{x, y, If[x^2 + y^2 < 1, 1, 0]}, {x, -2, 2, 0.1}, {y, -2, 2, 0.1}], 1];
ListDensityPlot[data, InterpolationOrder -> 0]
Now I want to have the points forming the boundary of this object, in coordinates {{x1,y1},{x2,y2},...}
.
It seems to be exactly what EdgeDetect
is doing, but that function does not accept data points, only images. Is there a similar function for data points?
These posts are related, but not the same in my opinion:
- Finding edges of a parametrized function
- Finding the edge of the plot area
- Finding the edge of data set
The last question (3) is probably the same but the input data format seems to be different than here and the data is not available anymore.
ConvexHullMesh
if convex. $\endgroup$