Optical character recognition using reference images of numbers
Input image (included in the project above) :
Would result with the integer : 6240
Same logic with a few adjustments can be used to OCR everything as long as a character references can be provided in advance.