Optimized polygonal approximations through vertex relocations in contour neighborhoods