Learning Dictionary of Discriminative Part Detectors for Image Categorization and Cosegmentation