PHPackages                             jansenfelipe/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. jansenfelipe/omr

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

jansenfelipe/omr
================

Optical Mark Recognition from PHP

2.0(6y ago)1903.3k78[8 issues](https://github.com/jansenfelipe/omr/issues)[4 PRs](https://github.com/jansenfelipe/omr/pulls)1MITPHPCI failing

Since Jul 5Pushed 2y ago19 watchersCompare

[ Source](https://github.com/jansenfelipe/omr)[ Packagist](https://packagist.org/packages/jansenfelipe/omr)[ RSS](/packages/jansenfelipe-omr/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (4)Used By (1)

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

40

—

FairBetter than 86% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~798 days

Total

2

Last Release

2478d ago

Major Versions

1.0.0 → 2.02019-09-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3134214?v=4)[Jansen Felipe](/maintainers/jansenfelipe)[@jansenfelipe](https://github.com/jansenfelipe)

---

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)")

---

Tags

hacktoberfestomroptical-mark-recognitionphpsurveyomroptical mark recognition

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[php-soap/wsdl

Deals with WSDLs

183.8M18](/packages/php-soap-wsdl)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

5155.1k17](/packages/phel-lang-phel-lang)

PHPackages © 2026

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