I'm trying to generate polygons from a preprocessed world map, What i have done so far is:
1: Generated a contour map for each of the countries, it looks like this:
- From here i filled each of these countries with an random color like this:
So far ive tried to just select a random pixel in the countour image and followed the line around until i hit the start point. This did give me a relatively good result, without about 90% accuracy on the polygons, However some countries dissapeared totally.
So what i wish to do is to have a array of coordinates for each of the countries in this map in a sorted manner so it can be represented as a Polygon. Do anyone know how to achieve this?
I have not found any algorithms suited for my problem.
Thanks!