Generalization of a recognition algorithm based on Karhunen-Loève transform