This code written in python is made by using tensorflow, numpy, cv2 libraries.
It recognizes the number written in a 28x28 png photo with black background and the number written in white.
I have provided few sample images with this.