title: Calculating the poly vertices based on the result of Connected Component Labeling
body: <p>I am making a tile based game.</p>
  
  <p>And now I can find all the connected area using the Connected Component Labeling algorithm.</p>
  
  <p>But now the problem I am having is how to calculate the poly vertices of each connected area.</p>
  
  <p>For example:
  <a href="https://i.stack.imgur.com/yadbD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yadbD.png" alt="enter image description here"></a></p>
  
  <p>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.</p>
  
  <p>And now I want is the generate a poly vertices array for the YELLOW AREA POLY (clockwise).</p>
  
  <p><a href="https://i.stack.imgur.com/3fqre.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3fqre.png" alt="enter image description here"></a></p>
  
  <p>Is there any good algorithm for this ?</p>
  
  <p>Any suggestion will be appreciated, thanks :)</p>