mohuishou / imageocr Goto Github PK
View Code? Open in Web Editor NEWPHP验证码识别[PHP CAPTCHA Recognition]
License: MIT License
PHP验证码识别[PHP CAPTCHA Recognition]
License: MIT License
这种配置基本上都能识别出来,可就是报错
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()
运行时提示这个类找不到“Class 'Minho\Captcha\CaptchaBuilder' not found”
Warning: require_once(vendor/autoload.php): failed to open stream: No such file or directory 。
下载安装后没有这个文件啊
把示例代码改成我自己的图片以后出现错误提示“请先获取分割后的图片”,我看以前的Issues说设置灰度阈值,但是.........求作者加一个能够实时显示图像的函数啊,我改了灰度以后没法看到图片,不知道效果如何
将竖直分割改为基于连通域分割并且结合滴水算法,对粘连字符进行分割
运行example结果始终为0000,draw函数在页面上画出图像了,由一个个小点构成的数字,但是输出ocr的结果为0000
使用例子识别验证码访问提示 请先获取分割之后的图片,请问怎么解决?
Uncaught Error: Class 'Minho\Captcha\CaptchaBuilder' not found in D:\xampp\htdocs\captcha\index.php:8
Fatal error: Class 'Mohuishou\ImageOCR\Example\OCR' not found
我最近也需要一个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;`
Call to undefined function Mohuishou\ImageOCR\exif_imagetype() in D:\phpStudy\WWW\ImageOCR\src\Image.php on line 65
Loading composer repositories with package information
Updating dependencies (including require-dev)
写了一个验证码用这个识别试了试,一个都识别不出来
===================================================
按照上述指示,我在服务器上完成了
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
麻烦了
去噪算法从孤立点去噪改为基于连通域去噪
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
您好,请问!db数据库做哪里下呢? 运行setup.php 也不行,这个链接http://www.169ol.com/Stream/Code/getCode也打不开呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.