Detecting numbers is a form of OCR which is a non-trivial task. If you want a solution that works out of the box, you will have to purchase specialized software for it.
If you just want to find the boundries, you can get creative with the convhull function to find insides and outsides.