Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ddeboer/tesseract
A PHP wrapper for the Tesseract OCR engine
https://github.com/ddeboer/tesseract
ocr php tesseract
Last synced: 3 months ago
JSON representation
A PHP wrapper for the Tesseract OCR engine
- Host: GitHub
- URL: https://github.com/ddeboer/tesseract
- Owner: ddeboer
- License: mit
- Created: 2013-04-10T20:07:37.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-10-16T19:24:14.000Z (over 7 years ago)
- Last Synced: 2024-10-12T04:31:40.291Z (4 months ago)
- Topics: ocr, php, tesseract
- Language: PHP
- Homepage:
- Size: 353 KB
- Stars: 21
- Watchers: 7
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/ddeboer/tesseract.png?branch=master)](https://travis-ci.org/ddeboer/tesseract)
Tesseract: a wrapper for the Tesseract OCR engine
================================================A small PHP >=5.3 library that makes working with the open source [Tesseract OCR engine](https://github.com/tesseract-ocr)
easier.Installation
------------You need a working Tesseract installation. For more information about
installation and adding language support, see Tesseract’s [README](https://github.com/tesseract-ocr/tesseract/blob/master/README.md).Then install this library, which is available on [Packagist](http://packagist.org/packages/ddeboer/tesseract),
through [Composer](http://getcomposer.org/):$ composer require ddeboer/tesseract:1.0
Usage
-----If the `tesseract` binary is in your path, just do:
```php
use Ddeboer\Tesseract\Tesseract;$tesseract = new Tesseract();
```Otherwise, construct Tesseract with the path to the binary:
```php
$tesseract = new Tesseract('/usr/local/bin/tesseract');
```Get version and supported languages information:
```php
$version = $tesseract->getVersion();$languages = $tesseract->getSupportedLanguages();
```Perform OCR on an image file:
```php
$text = $tesseract->recognize('myfile.tif');
```Optionally, specify the language(s) as second argument:
```php
$text = $tesseract->recognize('myfile.tif', array('nld', 'eng'));
```And specify Tesseract’s page seg mode as third argument:
```php
$text = $tesseract->recognize('myfile.tif', null, Tesseract::PAGE_SEG_MODE_AUTOMATIC_OSD);
```