How to install and run tesseract-ocr using PHP

I am looking for an OCR component that converts images of text to characters using php.

I got the script tesseract-ocr from google code . How can I install and run tesseract-ocr via php?

Since I am new to PHP, I cannot think of the documentation they provided. Do I need a few easy steps to get it up and running? thanks in advance.

+2


source to share


2 answers


Wow, this answer is the hard way. I am a PHP programmer and the website linked for porting C ++ from PHP is making my brain ache.



The best way for anyone new to PHP is to use the exec () function in PHP to invoke the tesseract binary command line. Then you can work out of the exec call in PHP, or send the output to a file and work on the file in PHP.

+2


source


You will need to configure tesseract according to the provided documentation.

Then, once tesseract works correctly from the command line, you can make the extension available to tesseract from PHP.



An excellent guide on wrapping C ++ classes in a PHP extension can be found here

+1


source







All Articles