【问题标题】:tesseract-ocr-for-php not reading imagetesseract-ocr-for-php 不读取图像
【发布时间】: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


    【解决方案1】:

    请使用这个:

    var_dump ((new TesseractOCR('var/www/html/ocr-tesseract/src/text.png'))->run());

    【讨论】:

    • tvar 不是我的文件夹路径
    • 对不起,错误地添加了't'。
    • 是的,我看到了,但是你写这句话是错误的。请检查你的句子和我的句子。
    猜你喜欢
    • 1970-01-01
    • 2012-11-10
    • 1970-01-01
    • 2015-09-16
    • 1970-01-01
    • 1970-01-01
    • 2017-09-01
    • 2018-08-16
    • 2013-08-31
    相关资源
    最近更新 更多