Hi Michael Moore,

Thanks for your solution, it works now, thanks a lot~

On Mar 6, 12:23 pm, Michael Moore <[email protected]> wrote:
> > Hi,did anyone tried before by using php to call tesseract/use
> > tesseract under php language?
> > Does tesseract can be use by php?
> > Thanks~
>
> Sure,
>
> I use command-line tesseract from PHP on a Linux server. Just make
> sure that tesseract is in your PATH or give the full path to the
> executable.
>
> In my case, I use imagemagick to convert the user's graphic to a black
> and white TIFF file, then run it through tesseract. I read the
> results, store them in a database and trash the tmp files.
>
> system("convert -monochrome +compress -normalize
> $contentbase/orig/$md5 $contentbase/tmp/$md5.tif");
> system("$exe_path/code/progs/bin/tesseract $contentbase/tmp/$md5.tif
> $contentbase/tmp/$md5");
>
> if($ocrtext = file_get_contents("$contentbase/tmp/$md5.txt")){
>      // update DB with $ocrtext}else{
>
>     // error handling here
>
> }
>
> Good luck,
> --
> Michael Moore
> -------------------------
> Share your families' genealogy and family history books. It's easy and
> free :http://bookscanned.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tesseract-ocr?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to