Contour based shape representation for image compression and analysis