Affine invariants for model-based recognition