Q: Calculating the poly vertices based on the result of Connected Component Labeling I am making a tile based game.
And now I can find all the connected area using the Connected Component Labeling algorithm.
But now the problem I am having is how to calculate the poly vertices of each connected area.
For example:

As you can see all the YELLOW tiles are of the same AREA and with the help of Connected Component Labeling algorithm I know all the (x, y) info of each tile.
And now I want is the generate a poly vertices array for the YELLOW AREA POLY (clockwise).

Is there any good algorithm for this ?
Any suggestion will be appreciated, thanks :)

A: After doing some more research I finally find a solution based on this post: java-merge-adiacent-rectangles-into-a-polygon
Here is my solution process sequence in general:


*

*Extract all edges from the tiles into a EdgeArray

*Remove all the edges that has a duplicated one in the EdgeArray
this will leaving only the Edges of the merged poly contour I want

*Connect all edges from head to tail , head to tail ...

*Pick up all the vertices point from the edges


and that's the finally clockwise PolyVerticesArray I want.

