Home » Php » Read text from an image with PHP

Read text from an image with PHP

Posted by: admin November 30, 2017 Leave a comment

Questions:

I would like to try to read some of text from an image with PHP.

So if I have an image like this:

enter image description here

How can I extract the text “Some text” into a string.

All help and suggestions are appreciated.

Answers:

The process you are looking for is called Optical Character Recognition.

http://en.wikipedia.org/wiki/Optical_character_recognition

There is a package available, called phpOCR, that does exactly what you need.

http://sourceforge.net/projects/phpocr/

Questions:
Answers:

phpOCR ist not the best choice, I would recommend TesseractOCR for PHP “A wrapper to work with TesseractOCR inside your PHP scripts.”
https://github.com/thiagoalessio/tesseract-ocr-for-php

Questions:
Answers:

That’s called OCR. (See http://en.wikipedia.org/wiki/Optical_character_recognition ).

It’s not a trival task (that’s why captcha’s work as good as they do).

You’d be better of googling ‘OCR PHP’ if you want to find solutions.