Coder Social home page Coder Social logo

Comments (12)

thiagoalessio avatar thiagoalessio commented on August 14, 2024

Hi, did you make sure that the user who runs PHP has tesseract (and convert) on its PATH ?
Please take a look on the README on the important section, there are instructions to solve this issue with http://php.net/putenv
Let me know if it works for you ;D

from tesseract-ocr-for-php.

swufewyd avatar swufewyd commented on August 14, 2024

Thanks for your reply~

Finally strace tells me where goes wrong, the apache user use /opt/lampp/lib/libstdc++.so.6 which dosen't work instead of /usr/lib64/libstdc++.so.6 ,after substitution it works.
But, I am in another puzzle now, some pictures that contain regular letters don't return anything in the txt file. I have searched for the basic requirements for the picture to be recognized, but still haven't find out the reason...

If you have met the same situation at one time, please give some directions.
sincere thanks~

from tesseract-ocr-for-php.

thiagoalessio avatar thiagoalessio commented on August 14, 2024

hum, could you post me an example of picture having this issue, so that i can take a closer look ;D

from tesseract-ocr-for-php.

swufewyd avatar swufewyd commented on August 14, 2024

here comes the picture~

------------------ 原始邮件 ------------------
发件人: "Thiago Alessio";[email protected];
发送时间: 2014年3月17日(星期一) 上午7:50
收件人: "thiagoalessio/tesseract-ocr-for-php"[email protected];
抄送: "东来东往"[email protected];
主题: Re: [tesseract-ocr-for-php] exec takes no effect on tesseract (#4)

hum, could you post me an example of picture having this issue, so that i can take a closer look ;D


Reply to this email directly or view it on GitHub.

from tesseract-ocr-for-php.

thiagoalessio avatar thiagoalessio commented on August 14, 2024

didn't manage to see the picture :( but saw some kanji on your message. The image you are trying to use contains non roman characters ? (don't know if this is the right term for it)

Anyways, the current implementation of my library is very limited, it doesn't allow to set the language. I'll code a quick update and will get back to you here ;D

from tesseract-ocr-for-php.

thiagoalessio avatar thiagoalessio commented on August 14, 2024

Hey @swufewyd ! I made huge changes on the code, please try the new version (0.2.0) and let me know if it works for you.

from tesseract-ocr-for-php.

swufewyd avatar swufewyd commented on August 14, 2024

Great improve of the code! But my problem seems in relation to the core library that php invokes.
I just try to recognize my picture which I have sent you on linux, but returns a empty txt file.
I still can't find out what goes wrong with my picture

from tesseract-ocr-for-php.

thiagoalessio avatar thiagoalessio commented on August 14, 2024

Hey thanks ;D

Hum, tricky problem this one you described ... let's try to find out what is going on ... i have 3 questions for you:

1 - I couldn't get your image, in which format is it? (JPG, PNG, TIF, etc ...)

2 - Did you double check if you have training data packages installed? (I think eng comes by default, but just to make sure.

vagrant@precise32:/vagrant$ dpkg -l | grep tesseract
ii  libtesseract3                    3.02.01-2                           Command line OCR tool
ii  tesseract-ocr                    3.02.01-2                           Command line OCR tool
ii  tesseract-ocr-deu                3.02-2                              tesseract-ocr language files for German
ii  tesseract-ocr-eng                3.02-2                              tesseract-ocr language files for English
ii  tesseract-ocr-equ                3.02-2                              tesseract-ocr language files for equations
ii  tesseract-ocr-jpn                3.02-2                              tesseract-ocr language files for Japanese
ii  tesseract-ocr-osd                3.02-2                              tesseract-ocr language files for script and orientation
vagrant@precise32:/vagrant$ 

3 - What happens when you run the unit tests of this library?

from tesseract-ocr-for-php.

thiagoalessio avatar thiagoalessio commented on August 14, 2024

hum :( that's bad ... could you send me the picture ? (or a similar one that provoke the same error)
i didn't get how you managed to install tesseract, was it from source ? i'd suggest to try via homebrew as well and check if you still get the issue.

apart from tesseract itself, which training data languages did you install ?

best,
thiago

On 16 Apr, 2014,at 09:26 AM, nicoferr [email protected] wrote:

Hi, I have also this problem.
I'm on Mac OSX 8.5 Mountain Lion. I try to read a PNG image. The "exec($this->buildTesseractCommand)" doesn't seem to work for me. I added an array to get the result of the "exec" command, but the array is empty... I installed tessecract using this website : http://www.9code.in/read-image-text-using-php-tesseract-ocr-reader/ . Only the last line "sudo ldconfig" didn't work but someone said to use "update_dyld_shared_cache" instead, but I don't know if it worked. Do you know why it doesn't work ?
Thanks in advance for your help :)

Reply to this email directly or view it on GitHub.

from tesseract-ocr-for-php.

thiagoalessio avatar thiagoalessio commented on August 14, 2024

closing this issue, didn't receive any further feedback and all the tests i performed against windows, osx and linux worked fine. Please send me a message if we need to re-open this issue.

from tesseract-ocr-for-php.

ammadanwer avatar ammadanwer commented on August 14, 2024

i had the same problem as that of @swufewyd .
seemed like lamps ibstdc++.so.6 had some issue. so I copied the file from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 and pasted it to /opt/lampp/lib/libstdc++.so.6 and it worked like a charm.

from tesseract-ocr-for-php.

EuphoriaCelestial avatar EuphoriaCelestial commented on August 14, 2024

hi, am new to php and trying to set up a server to receive images, read text, then send back the result. I've installed Tesseract on Windows and it works perfectly with CMD commands. So am trying to use this:
$output = shell_exec("tesseract test_image.png output");
to execute the CMD command and create a output.txt file on server side, but it not working, nothing created, "echo $output" print out:
'tesseract' is not recognized as an internal or external command, operable program or batch file
but i've setup environment variable

from tesseract-ocr-for-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.