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

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

smartdog23/omr
==============

Optical Mark Recognition from PHP

2.0(6y ago)08MITPHP

Since Jul 5Pushed 4y agoCompare

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

READMEChangelogDependencies (2)Versions (4)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

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

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

2439d ago

Major Versions

1.0.0 → 2.02019-09-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/836de007641ccd0805166235326652b57e9a53d329792738c3e58726ff519208?d=identicon)[valdirpl](/maintainers/valdirpl)

---

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

surveyomroptical mark recognition

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[jansenfelipe/omr

Optical Mark Recognition from PHP

1903.3k1](/packages/jansenfelipe-omr)[matt-daneshvar/laravel-survey

Create surveys inside your Laravel app

28770.3k](/packages/matt-daneshvar-laravel-survey)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[tapp/filament-survey

Filament Laravel Survey plugin.

3119.2k](/packages/tapp-filament-survey)[codefog/contao-polls

polls extension for Contao Open Source CMS

152.6k](/packages/codefog-contao-polls)

PHPackages © 2026

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