Adaptive Similarity Measures for Material Identification in Hyperspectral Imagery