title: Algorithm to merge adjacent rectangles into polygon
body: <p>I guess that my problem is related to "convex hull", but no the same. All shapes in the drawing are rectangles with same width and height. Many are adjacent to each other. I want to combine those adjacent rectangles into polygons. Unlike "convex hull", the resuled polygons could be "hollow" inside. </p>
  
  <p>Is there any open source algorithm available?</p>