質問

I have a set of points in 2D ( coordinates for x and y ), now I need to discard all the points that are not meaningful to me, and what I mean by that is that I'm only interested in the area that this points are tracing.

In short, this

enter image description here

it's supposed to produce this

enter image description here

question: what algorithm can do this kind of filtering on this points ?

役に立ちましたか?

解決

You can use Graham Scan to compute Convex hull of the given points. Once you have all the points on the convex hull you can eliminate the others.

There are other algorithms as well for computing convex hull, but Graham scan is easy to implement and is O(n logn).

他のヒント

I believe you are looking for a convex hull algorithm. I personally use Graham Scan algorithm to implement convex hull as it has very good complexity O(n*log(n)) and is relatively easy to implement.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top