Approximate matching of polygonal shapes