Local selection of features and its applications to image search and annotation