Projectively invariant decomposition of planar shapes