Discriminative wavelet shape descriptors for recognition of 2d patterns and efficient usage of morphological 2d transforms