PHPackages                             ljcgrowup/omr - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ljcgrowup/omr

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ljcgrowup/omr
=============

Optical Mark Recognition from PHP

03PHP

Since Jun 15Pushed 10mo agoCompare

[ Source](https://github.com/ljcgrowup/omr)[ Packagist](https://packagist.org/packages/ljcgrowup/omr)[ RSS](/packages/ljcgrowup-omr/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Optical Mark Recognition with PHP
=================================

[](#optical-mark-recognition-with-php)

[![Latest Stable Version](https://camo.githubusercontent.com/0eb4b8e283c307d16e1fd22932b6cfe15ed5c206606e254de6c3afc4c703ffca/68747470733a2f2f706f7365722e707567782e6f72672f6a616e73656e66656c6970652f6f6d722f762f737461626c652e737667)](https://packagist.org/packages/jansenfelipe/omr)[![Total Downloads](https://camo.githubusercontent.com/c52d5c5f1cc661a3152ff832fef9a8a9cd09629a55642c0d7462fc1137de825d/68747470733a2f2f706f7365722e707567782e6f72672f6a616e73656e66656c6970652f6f6d722f646f776e6c6f6164732e737667)](https://packagist.org/packages/jansenfelipe/omr)[![Latest Unstable Version](https://camo.githubusercontent.com/8ae7b3c45020a61b3828fe0c599bc9eb1d35b5f47a2e23e826e9518d1b8086b5/68747470733a2f2f706f7365722e707567782e6f72672f6a616e73656e66656c6970652f6f6d722f762f756e737461626c652e737667)](https://packagist.org/packages/jansenfelipe/omr)[![MIT license](https://camo.githubusercontent.com/9f747c2fda809d671d90cc92ffa4fd0c66a213a271ac47d5b429ffbc3d784c06/68747470733a2f2f706f7365722e707567782e6f72672f6a616e73656e66656c6970652f6f6d722f6c6963656e73652e737667)](http://opensource.org/licenses/MIT)[![Build Status](https://camo.githubusercontent.com/6267ac9cb228efa83f2cdea0d4a9f6080d59c7d43ff91bc3c2a477ab5b2da259/68747470733a2f2f7472617669732d63692e6f72672f6a616e73656e66656c6970652f6f6d722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jansenfelipe/omr)

This is an open source library written in PHP for recognition markings on questionnaires scans

See: [https://en.wikipedia.org/wiki/Optical\_mark\_recognition](https://en.wikipedia.org/wiki/Optical_mark_recognition)

[![](https://github.com/jansenfelipe/omr/raw/develop/example/screenshots/exec_command.png?raw=true)](https://github.com/jansenfelipe/omr/blob/develop/example/screenshots/exec_command.png?raw=true)

How to use
==========

[](#how-to-use)

Add library:

```
$ composer require jansenfelipe/omr
```

Instantiate the [Scanner](#scanners) class responsible for reading the image and enter its path

```
/*
 * Setup scanner
 */
$scanner = new ImagickScanner();
$scanner->setImagePath($imagePath);
```

You will need to scan a blank form and create the [Target Mapping File](#target-mapping-file) to be able to use the library.

After creating the `map.json` file, enter its path:

```
/*
 * Setup map
 */
$map = MapJson::create($mapJsonPath);
```

Now you can scan and get the result

```
$result = $scanner->scan($map);
```

Scanners
========

[](#scanners)

This library currently has only one scanner class using `Imagemagick 6`. It has been tested using the following configurations:

- PHP 7.3
- imagemagick6
- Extension imagick-3.4.4

See

Target Mapping File
===================

[](#target-mapping-file)

It is a .json file that describes, in addition to the image information, the coordinates of the places (targets) that the script must do the pixel analysis. This file follows the following pattern:

```
{
    "width": 600,
    "height": 800,
    "targets": [
      {
        "x1": 50,
        "y1": 43,
        "x2": 65,
        "y2": 57,
        "id": "Foo",
        "type": "rectangle",
        "tolerance": 60
      }
    ]
}
```

Example
=======

[](#example)

In the `example` directory there is an image of a completed questionnaire `response.png`. There is also a `map.json` file that gives the coordinates of the image areas that will be analyzed the pixels.

To help with setting up the environment, there is a Dockerfile in the project based on the official PHP 7.3 image that adds composer, imagemagick and the imagick extension to PHP.

That way you can install the dependencies and run the command to process the image without headaches :)

1. Clone this repo:

```
$ git clone https://github.com/jansenfelipe/omr.git
$ cd omr/

```

2. Install dependencies:

```
$ docker-compose run php composer install

```

2. Process example image:

```
$ docker-compose run php bin/omr scan example/response.png example/map.json

```

License
=======

[](#license)

The MIT License (MIT)

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 89.3% 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/168c1874f3834aa797e387ee981f765348bc31dd0c678bb6b5a2cd6db367874c?d=identicon)[ljcgrowup](/maintainers/ljcgrowup)

---

Top Contributors

[![jansenfelipe](https://avatars.githubusercontent.com/u/3134214?v=4)](https://github.com/jansenfelipe "jansenfelipe (67 commits)")[![ins0](https://avatars.githubusercontent.com/u/2622534?v=4)](https://github.com/ins0 "ins0 (4 commits)")[![CViniciusSDias](https://avatars.githubusercontent.com/u/6991415?v=4)](https://github.com/CViniciusSDias "CViniciusSDias (2 commits)")[![jgrossi](https://avatars.githubusercontent.com/u/1175275?v=4)](https://github.com/jgrossi "jgrossi (2 commits)")

### Embed Badge

![Health badge](/badges/ljcgrowup-omr/health.svg)

```
[![Health](https://phpackages.com/badges/ljcgrowup-omr/health.svg)](https://phpackages.com/packages/ljcgrowup-omr)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[breadlesscode/neos-nodetypes-folder

Folder nodetype for Neos CMS

1088.5k1](/packages/breadlesscode-neos-nodetypes-folder)

PHPackages © 2026

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