Affine invariant curve matching