A Discriminative Framework for Object Recognition