#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    63
    Rep Power
    7

    System command not working. Anything wrong?


    Hi guys,

    I've a perl script where in i've system command used to run a tesseract.exe application. This perl script is run from Red hat linux OS.

    System command provided is as below:
    system("$te_dir/tesseract $dir/$file $dir/$fle1") == 0 or die "Tesseract failed: $!";

    And i get a message as below:
    Tesseract failed: No such file or directory at boot.pl line 743.

    Can i know what is the problem here?

    Thanks,
    Ramki
  2. #2
  3. !~ /m$/
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    May 2004
    Location
    Reno, NV
    Posts
    4,264
    Rep Power
    1810
    Code:
    "$te_dir/tesseract $dir/$file $dir/$fle1"
    There's a lot of variables in that string, so you should print that before you issue the system command and see if the string contains the command you are expecting.

    If it looks correct to you, try running that same statement directly from the command line.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    63
    Rep Power
    7
    Thanks keath. I did print using "print" command. Below is the print output.

    /projects/bsrootfs/androind_nightly_build/BX/Android/tessract_Win/tesseract /projects/bsrootfs/androind_nightly_build/BX/Android/caffeine.png /projects/bsrootfs/androind_nightly_build/BX/Android/caffeine

    I did ran tesseract.exe from "cmd" window in Windows 7 OS and it works fine. But when i ran from RedHat Linux OS i'm getting the following error:
    bash: /projects/bse_blr_rootfs/androind_nightly_build/BX/Android/tessract_Win/tesseract: No such file or directory

    If i give app name as "tesseract.exe" instead of "tesseract", below is the message:
    bash: /projects/bse_blr_rootfs/androind_nightly_build/BX/Android/tessract_Win/tesseract.exe: cannot execute binary file

    Thanks,
    Ramki
  6. #4
  7. !~ /m$/
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    May 2004
    Location
    Reno, NV
    Posts
    4,264
    Rep Power
    1810
    I do not have the tesseract program installed; but yes, an .exe file usually indicates a Windows only binary.

    Tesseract is available for Linux though also:

    http://code.google.com/p/tesseract-ocr/wiki/ReadMe

    but you will have to install it and it will not be in the same location as the Windows version. You can not just copy the utility over from a Windows machine.

    If the Linux install location is in your system's PATH, you won't have to provide the full directory. You could just issue the 'tesseract' command directly.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    63
    Rep Power
    7
    Thanks. Although this is now not related to perl, i will go ahead and post the results of compilation from linux.
    I did compile tesseract.tar.gz file. But i did not find tesseract.exe or just tesseract app in ../bin directory where all other apps were created. What could be the issue?
  10. #6
  11. !~ /m$/
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    May 2004
    Location
    Reno, NV
    Posts
    4,264
    Rep Power
    1810
    Did you follow the compile instructions on this page?

    http://code.google.com/p/tesseract-ocr/wiki/Compiling

    Easiest to use the package installer for you Linux distribution. But if you did the manual compile, you could have specified where to install.

    One thing to try would be to run the command

    which tesseract
    on the command line and see if it finds for you. If it does, you won't have to specify the path yourself since the system already knows where it is.

IMN logo majestic logo threadwatch logo seochat tools logo