1

I am trying to detect digits located inside a grid and to tell their positions in an image and don't know where to start. So any help is welcome. So far I have used GT Text software but it didn't solve the purpose. Any helper function, libraries, tutorials, links or anything is welcome.

3
  • Is this what you are looking for stackoverflow.com/questions/9413216/… ? Commented Nov 27, 2015 at 12:51
  • Can digits be detected without the training set ? Because in the question which I have to solve conditions allow only one image to be input and that too the experimental one. Commented Nov 27, 2015 at 14:19
  • I don't know. I would try to ask people who work with OpenCV: irc.freenode.net at #opencv Commented Nov 27, 2015 at 14:27

1 Answer 1

1

You should check out the pytesseract module:

https://pypi.python.org/pypi/pytesseract/0.1

It has a one-liner for what you're trying to do:

try:
    import Image
except ImportError:
    from PIL import Image
import pytesseract as tes

results = tes.image_to_string(Image.open('test.png'),boxes=True)

This will give you results, which has each digit and the image coordinates of its bounding box.

You will need to install PIL (python image library, pip install PIL) and the tesseract c library (brew install tesseract if you have homebrew..) so it's not super trivial but once you have it working, this is the most straight forward OCR in python, and requires no training whatsoever.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.