A simple count of the pixels where the binary color is matching between the image to be recognized and the images of the ten reference digits might be good enough.