1

I'm trying to implement a simple and straightforward concave polygon creator that extract the outline of a polygon from a sprite image.

So my base image is a transparent png where the 'solid' pixel describe the shape of the polygon I'm trying to find.

I've coded some stuff to find the first non-transparent pixel and then walk all around the 'solid' pixel shape to extract relevant polygon points.

For now I create a polygon where all outline pixels are points, and then I (try to) simplify these polygon points to a relevant polygon where all lines are expressed by only 2 points.

Actually the code I have is quite 'working' but I'm interested if there is a well known algorithm for this kind of stuff.

I'm only interested by the external shape (no matters whether or not it is a weakly simple polygon)

John-Philip
  • 3,392
  • 2
  • 23
  • 52
  • Although it's about GISs, http://stackoverflow.com/questions/1849928/how-to-intelligently-degrade-or-smooth-gis-data-simplifying-polygons, could easily be applicable. – dandan78 Dec 23 '14 at 13:35
  • is it a learning thing, because I see graphics libraries like opengl or directx do that and you don't need to write your own algorithm – niceman Dec 23 '14 at 14:43

0 Answers0