Как использовать tesseract_ocr в PHP? - PullRequest
0 голосов
/ 01 мая 2020

Я нахожу проблему с использованием tesseract_ocr в php, я следую этому уроку https://github.com/thiagoalessio/tesseract-ocr-for-php.

Я устанавливаю tesseract_ocr use composer:

$ composer require thiagoalessio/tesseract_ocr

это моя структура папок в localhost:

enter image description here

это мой код:

<!DOCTYPE html>
<html>
<body>

<h1>My first PHP page</h1>

<?php
require __DIR__ . "/vendor/autoload.php";
use thiagoalessio\TesseractOCR\TesseractOCR;
echo (new TesseractOCR('images/8055.PNG'))
    ->whitelist(range('A', 'Z'))
    ->run();
?>

</body>
</html>

это мой php версия:

enter image description here

и в браузере я получаю эту ошибку:

Fatal error: Uncaught thiagoalessio\TesseractOCR\TesseractNotFoundException: Error! The command "tesseract" was not found. Make sure you have Tesseract OCR installed on your system: https://github.com/tesseract-ocr/tesseract The current $PATH is C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_73\bin;C:\Users\frank\AppD in C:\xampp\htdocs\ocr\vendor\thiagoalessio\tesseract_ocr\src\FriendlyErrors.php on line 48

пожалуйста, кто-нибудь, помогите мне решить эту проблему.

Спасибо.

...