Recognition using electronic means using sequential comparisons of the image signals with a plurality of references the selection of the next reference depending on the result of the preceding comparison