我希望使用Tesseract将大量图像文件转换为文本。
我已经查看了他们的文档,但不知道它如何与PHP相关,以及我的php脚本将如何与tesseract ocr交互。我在其他问题上看到建议使用php exec()。
$img = myimage.png;
$text = exec($img,'tesseract');
我已经下载并安装了Tesseract。使用的是安装有最新版本xampp的Windows 7。我对PHP有初级到中级的了解。我还需要掌握哪些知识?
更新 我现在已经在PowerShell和CMD中成功运行了它。
tesseract.exe D:\Documents\Web_Development\Sandbox\php\images\23.png D:\Documents\Web_Development\Sandbox\php\images\23
但是当我尝试通过exec运行它时,就像这样:
<?php
exec('tesseract.exe D:\Documents\Web_Development\Sandbox\images\23.png D:\Documents\Web_Development\Sandbox\images\23');
?>
我收到了来自Windows的弹窗,提示tesseract.exe已停止工作。以下是错误详细信息,如果有人能理解,请告知。 ```html
我收到了来自Windows的弹窗,提示tesseract.exe已停止工作。以下是错误详细信息,如果有人能理解,请告知。
```Problem signature:
Problem Event Name: BEX
Application Name: tesseract.exe
Application Version: 0.0.0.0
Application Timestamp: 4ca507b3
Fault Module Name: MSVCR90.dll
Fault Module Version: 9.0.30729.4926
Fault Module Timestamp: 4a1743c1
Exception Offset: 0002f93e
Exception Code: c0000417
Exception Data: 00000000
OS Version: 6.1.7600.2.0.0.768.3
Locale ID: 1033
Additional Information 1: e958
Additional Information 2: e95831f9d00a16a326250da660e931c5
Additional Information 3: 040a
Additional Information 4: 040a259d27c5ccf749ee18722d5fbec0