【发布时间】:2016-06-22 07:05:32
【问题描述】:
我正在使用tesseract-ocr-for-php。我已将它安装在我的 AWS EC2 Ubuntu 机器上,没有任何错误。我创建了名为 test.php 的文件来测试功能。下面是代码
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
include 'TesseractOCR.php';
//$obj = new TesseractOCR('var/www/html/ocr-tesseract/src/text.png');
//var_dump($obj->run());
var_dump (new TesseractOCR('var/www/html/ocr-tesseract/src/text.png'))->run();
//echo dirname(__FILE__);
die('dafs');
输出是
object(TesseractOCR)#1 (8) { ["image":"TesseractOCR":private]=> 字符串(39)“var/www/html/ocr-tesseract/src/text.png” [“可执行”:“TesseractOCR”:私有]=>字符串(9)“tesseract” ["tessdataDir":"TesseractOCR":private]=> NULL ["userWords":"TesseractOCR":private]=> NULL ["userPatterns":"TesseractOCR":private]=> NULL [“语言”:“TesseractOCR”:私有]=>数组(0){} ["psm":"TesseractOCR":private]=> NULL ["configs":"TesseractOCR":private]=> array(0) { } } 致命错误:调用 到 null in 上的成员函数 run() /var/www/html/ocr-tesseract/src/test.php 在第 13 行
我做错了什么?
我也尝试使用this 链接。但还是一样。
【问题讨论】:
标签: php amazon-web-services amazon-ec2 ocr tesseract