Coder Social home page Coder Social logo

imageocr's Issues

识别报错!

这种配置基本上都能识别出来,可就是报错
public function __construct($path)
{
$image=new Image($path);
$this->image_ocr=new ImageOCR($image);

    //开启的debug模式
    $this->image_ocr->setDebug(true);
    //初始化
    $this->image_ocr->setMaxGrey(90);
    $this->image_ocr->setMinGrey(130); // 130  
    $this->image_ocr->setStandardWidth(130);
    $this->image_ocr->setStandardHeight(50);
}

错误如下:

请先获取分割之后的图片
[2] ErrorException in OCR.php line 128
Invalid argument supplied for foreach()

运行时出现这个问题

Warning: require_once(vendor/autoload.php): failed to open stream: No such file or directory 。
下载安装后没有这个文件啊

错误:请先获取分割后的图片

把示例代码改成我自己的图片以后出现错误提示“请先获取分割后的图片”,我看以前的Issues说设置灰度阈值,但是.........求作者加一个能够实时显示图像的函数啊,我改了灰度以后没法看到图片,不知道效果如何

字符分割算法优化

将竖直分割改为基于连通域分割并且结合滴水算法,对粘连字符进行分割

运行example结果始终为0000

运行example结果始终为0000,draw函数在页面上画出图像了,由一个个小点构成的数字,但是输出ocr的结果为0000

建议

我最近也需要一个php的验证码识别项目,我现在在测试您的代码,我发现Image的rgb2grey方法并不能达到转灰度图的效果,是我测试代码问题吗?建议在工具类中添加一个show方法,可以直接显示出某一步操作之后的图像,比如ImageTool::show($image->rgb2grey())这样可以直接显示出灰度图,另外,我测试时用于显示图像的代码
` //计算图片的宽度与高度
$img_w=count($array_data[0]);
$img_h=count($array_data);

    //图像初始化
    $img = imagecreatetruecolor($img_w,$img_h);//创建一幅真彩色图像
    $white=imagecolorallocate($img, 255, 255, 255);//白色
    $black=imagecolorallocate($img, 0, 0, 0);//黑色

    //背景填充为白色
    imagefill($img, 0,0, $white);

    //进行画图
    for($h=0;$h<$img_h;$h++){
        for($w=0;$w<$img_w;$w++){
            imagesetpixel($img, $w,$h, $array_data[$h][$w]);
        }
    }

    return $img;`

composer 安装不了

Loading composer repositories with package information
Updating dependencies (including require-dev)

无法安装,请求帮助

不太清楚tp5的逻辑,你可以先git clone项目到本地,然后composer install,然后试试进入本地文件夹运行php -S localhost:8080,看看示例能不能运行,然后具体使用的时候可以参考example来写,因为每个验证码识别的参数和步骤都要进行一定的调整,所以具体逻辑需要自己完善

===================================================

按照上述指示,我在服务器上完成了
git clone https://github.com/mohuishou/ImageOCR.git
然后
cd ImageOCR/
然后
composer install
以上操作都能正常完成
然后
php -S localhost:8080
提示已经监听
Listening on http://localhost:8080
Document root is /var/www/html/ocr/ImageOCR

然后
wget http://localhost:8080
提示
404 Not Found

然后
wget http://localhost:8080/example
提示
500 Internal Server Error

麻烦了

PHP Warning: exif_imagetype(): stream does not support seeking in

what wrong with is? Is some extension problem?
➜ image-ocr php study.php
PHP Warning: exif_imagetype(): stream does not support seeking in /Users/dynamo/PhpstormProjects/hack/vendor/mohuishou/image-ocr/Image.php on line 40

Warning: exif_imagetype(): stream does not support seeking in /Users/dynamo/PhpstormProjects/hack/vendor/mohuishou/image-ocr/Image.php on line 40

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.