Person Re-Identification with Discriminatively Trained Viewpoint Invariant Dictionaries