To do so we used a set of training images as basis. For each number, we made five samples thus resulting in 50 control images.
We used Euclidean Distance Formula:
This formula is used on the training data images and on the input image. The lower the result, the closest it is to the input image.