PHPackages                             zcastle/gocr-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. zcastle/gocr-php

ActiveLibrary

zcastle/gocr-php
================

Gocr for PHP

032PHP

Since Sep 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/zcastle/gocr-php)[ Packagist](https://packagist.org/packages/zcastle/gocr-php)[ RSS](/packages/zcastle-gocr-php/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

ATENCION ESTE PROYECTO ES UN FORK DE  SE ACTUALIZO EL CODIGO PARA QUE SOPORTE VERSIONES SUPERIORES DE PHP 5.6
----------------------------------------------------------------------------------------------------------------------------------------------------------

[](#atencion-este-proyecto-es-un-fork-de-httpsgithubcomstephane-monnotgocr-php-se-actualizo-el-codigo-para-que-soporte-versiones-superiores-de-php-56)

Agradecemos a stephane-monnot por el proyecto original
------------------------------------------------------

[](#agradecemos-a-stephane-monnot-por-el-proyecto-original)

GOCR for PHP
============

[](#gocr-for-php)

A wrapper to work with Gocr inside PHP scripts.

Why?
----

[](#why)

This project makes easier the use of the OCR software named GOCR.

Dependencies
------------

[](#dependencies)

- [gocr](http://jocr.sourceforge.net/)

Installation
------------

[](#installation)

```
$ composer require zcastle/gocr-php
```

Usage
-----

[](#usage)

#### Instantiate the Gocr object with the image path:

[](#instantiate-the-gocr-object-with-the-image-path)

```
$gocr = new Gocr('testData/images/welcome.png');
```

#### Recognize and get text content:

[](#recognize-and-get-text-content)

```
$textContent = $gocr->recognize();
```

#### Set spacewidth between words in units of dots (default: 0 for autodetect):

[](#set-spacewidth-between-words-in-units-of-dots-default-0-for-autodetect)

Wider widths are interpreted as word spaces, smaller as character spaces.

```
$gocr->setSpaceWidthParam(20);
```

#### Set Operational mode; mode is a bitfield (default: 0):

[](#set-operational-mode-mode-is-a-bitfield-default-0)

```
$gocr->setModeParam(258);
```

#### Set value for certainty of recognition (0..100; default: 95):

[](#set-value-for-certainty-of-recognition-0100-default-95)

Characters with a higher certainty are accepted, characters with a lower certainty are treated as unknown (not recognized); set higher values, if you want to have only more certain recognized characters.

```
$gocr->setValueForCertaintyOfRecognitionParam(100);
```

#### Set database path, a final slash must be included, default is ./db/:

[](#set-database-path-a-final-slash-must-be-included-default-is-db)

This path will be populated with images of learned characters.

```
$gocr->setDatabasePathParam('testData/db/');
```

Contributing
------------

[](#contributing)

See the [CONTRIBUTING](CONTRIBUTING.md) file.

License
-------

[](#license)

The project is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b52269ed92e886319d607807da41e42da2fe9b0daf69221cab42a1a6a48588e?d=identicon)[zcastle](/maintainers/zcastle)

---

Top Contributors

[![stephane-monnot](https://avatars.githubusercontent.com/u/6066368?v=4)](https://github.com/stephane-monnot "stephane-monnot (13 commits)")[![zcastle](https://avatars.githubusercontent.com/u/3077431?v=4)](https://github.com/zcastle "zcastle (5 commits)")

### Embed Badge

![Health badge](/badges/zcastle-gocr-php/health.svg)

```
[![Health](https://phpackages.com/badges/zcastle-gocr-php/health.svg)](https://phpackages.com/packages/zcastle-gocr-php)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
