0

I was asked to calculate area from noisy points of given function (the function can represent any closed abstract shape).

im getting function and take something like 1000 noisy points from that function (randomly given by samples).

I've tried to use sklearn.cluster.kmeans to find 'x' centers points and on them im doing the shoelace formula, but I still dont get the accuracy that i want.

Does someone know if I need to have attention to something in the way I was representing? Or is there much better other way to do that?

*Im using python 3

Thanks for the help.

  • Not sure why you're clustering the points, wouldn't that give you points that are not on the boundary? I would think you should find the boundary points, sort the points in one plane, then apply the shoelace formula? – sleepystar96 Jan 12 '22 at 22:30
  • Also.. it might help to test that your implementation of shoelace formula is correct using a triangle or simple polygon shapes. – sleepystar96 Jan 12 '22 at 22:31
  • I test my shoelace formula and it give the right area for simple problems, so i think the problem is really in the points that i take for the formula. Is there any library or function that can do what you seggest ? @sleepystar96 – Shalev Levi Sagzan Jan 13 '22 at 12:21
  • You likely want concave hull: https://stackoverflow.com/a/50714300/9824103 and https://stackoverflow.com/a/65676336/9824103 – sleepystar96 Jan 13 '22 at 13:06
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jan 21 '22 at 17:04

0 Answers0