Comments (10)
有调用分割的API么,https://github.com/mohuishou/ImageOCR#%E5%88%86%E5%89%B2
from imageocr.
给出的代码不全没有办法判断具体的错误
from imageocr.
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(25); // 130
$this->image_ocr->setStandardWidth(65);
$this->image_ocr->setStandardHeight(25);
}
public function standard()
{
//避免重复调用
if (!empty($this->standard_data)) {
return $this->standard_data;
}
try {
//第一步灰度化
$this->image_ocr->grey();
//第二步二值化
$this->image_ocr->hashByBackground(ImageOCR::MAX_MODEL);
//下一步会用到连通域分割法,先初始化
$this->image_ocr->setImageConnect();
//第三部除噪&第四步分割
$this->image_ocr->splitByConnect();
//第五步标准化
return $this->image_ocr->standard();
} catch (\Exception $e) {
echo $e->getMessage();
}
return false;
}
所有代码用的是实例的 ,我只改了二值化和宽高。
from imageocr.
我直接运行修改docker
容器中的参数, 和你一致之后还是ok的,没有复现你的这个问题, 你有修改其他地方么。
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(25);
$this->image_ocr->setStandardWidth(65);
$this->image_ocr->setStandardHeight(25);
}
from imageocr.
没有改其它的地方,我提供验证码给您,您方便测试一下:http://prw4hcq80.bkt.clouddn.com/1.png
这个地址 有 1-8个验证码。 http://prw4hcq80.bkt.clouddn.com/1...8.png
from imageocr.
晚上帮你看下,现在有点忙
from imageocr.
好的,谢谢!~
from imageocr.
我在index.php
注释掉了生成图片的代码
// $captch->create();
$img_path=__DIR__."/img/1.png";
// $captch->save($img_path,1);
$img=new \Mohuishou\ImageOCR\Example\OCR($img_path);
from imageocr.
我测试的情况,当识别结果差不多正确的时候 就会报错,如果结果是错误的就能正常。
from imageocr.
那只能怀疑是参数问题,除噪分割之后标准化之后没有数据了,这个建议你打断点debug一下,或者每一步都都把结果打印一下
from imageocr.
Related Issues (20)
- 出现"请先获取分割之后的图片" 的问题 HOT 3
- example/index.php HOT 2
- 运行example结果始终为0000 HOT 2
- 建议 HOT 2
- 滴水算法/粘连字符串分割测试
- 错误:请先获取分割后的图片 HOT 5
- how use setup.php? HOT 8
- 能识别那种数学计算的验证码吗 HOT 3
- 运行测试实例,出现这个问题
- 可以识别那种以数学计算公式来验证的吗? HOT 2
- 无法安装,请求帮助 HOT 3
- composer 安装不了 HOT 2
- 运行时出现这个问题 HOT 2
- 运行时CaptchaBuilder类找不到 HOT 2
- 识别不了数字7 HOT 1
- Uncaught Error: Class 'Minho\Captcha\CaptchaBuilder' not found in D:\xampp\htdocs\captcha\index.php:8 HOT 2
- 写了一个验证码用这个识别试了试
- 写了个自动训练脚本训练了一晚上之后变成这样了 HOT 6
- 使用例子识别验证码访问提示 请先获取分割之后的图片
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imageocr.