bicycle/tesseract-bridge
Composer 安装命令:
composer require bicycle/tesseract-bridge
包简介
Integration of tesseract bridge via FFI and CLI
README 文档
README
A wrapper to work with Tesseract OCR inside PHP via CLI and/or FFI interfaces.
‼️ Tested only on FreeBSD, Debian and Ubuntu platforms with Tesseract OCR version 3 and 4 (see build logs).
Installation
Via Composer:
$ composer require bicycle/tesseract-bridge
Usage
Basic usage
-
CLI ```php use Bicycle\Tesseract\Bridge as TesseractBridge;
$configuration = TesseractBridge\Configuration(['binary_path' => 'tesseract']); $bridge = new TesseractBridge\CLI($configuration); echo $bridge->testGetVersion(); print_r($bridge->getAvailableLanguages()); echo $bridge->recognizeFromFile('eurotext.png'); // Set proper path here ``` -
FFI ```php use Bicycle\Tesseract\Bridge as TesseractBridge;
$configuration = TesseractBridge\Configuration(['binary_path' => 'tesseract']); $bridge = new TesseractBridge\FFI($configuration); echo $bridge->testGetVersion(); print_r($bridge->getAvailableLanguages()); echo $bridge->recognizeFromFile('eurotext.png'); // Set proper path here ```
With languages
-
CLI ```php use Bicycle\Tesseract\Bridge as TesseractBridge;
$configuration = TesseractBridge\Configuration(['binary_path' => 'tesseract']); $bridge = new TesseractBridge\CLI($configuration); echo $bridge->testGetVersion(); print_r($bridge->getAvailableLanguages()); echo $bridge->recognizeFromFile('eurotext.png', ['deu']); // Set proper path here ``` -
FFI ```php use Bicycle\Tesseract\Bridge as TesseractBridge;
$configuration = TesseractBridge\Configuration(['binary_path' => 'tesseract']); $bridge = new TesseractBridge\FFI($configuration); echo $bridge->testGetVersion(); print_r($bridge->getAvailableLanguages()); echo $bridge->recognizeFromFile('eurotext.png', ['deu']); // Set proper path here ```
How to contribute
You can contribute to this project by:
- Opening an Issue if you found a bug or wish to propose a new feature;
- Opening PR if you want to improve/create/fix something
Additional
Please check our FAQ
License
tesseract-bridge is released under the MIT License.
统计信息
- 总下载量: 274
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-15
