There are many libraries available for extracting text from images. You can check my answer
For restricting OCR to provide numbers only Tesseract SDK provides method as blacklist and whitelist characters
_tesseract->SetVariable("tessedit_char_whitelist", "0123456789");
Using this method you can restrict only numbers to be recognized.
Hope it helps.