Optical Mark Recognition with PHP
Switch branches/tags
Nothing to show
Clone or download
Latest commit 7b12628 Jul 6, 2017
Permalink
Failed to load latest commit information.
bin Update bin/omr Dec 23, 2015
src Keep origin Feb 24, 2016
tests First Commit Dec 22, 2015
.gitignore First Commit Dec 22, 2015
README.md Update README.md Jul 5, 2017
composer.json Generate branch Jul 5, 2017
phpunit.xml First Commit Dec 22, 2015

README.md

Optical Mark Recognition from PHP

Latest Stable Version Total Downloads Latest Unstable Version MIT license

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

See: https://en.wikipedia.org/wiki/Optical_mark_recognition

How to use

Add library:

$ composer require jansenfelipe/omr

Scanners

This library needs PHP ImageMagick extension to make images of reading

http://php.net/manual/en/imagick.setup.php

Console

Run the following command through the image and mapping:

$ php vendor/bin/omr scan <imageJPG> <mapJSON>

Example:

$ php vendor/bin/omr scan questionarie.jpg map.json

Map JSON

The map is a JSON file with image information and the positions (targets) to be recognized.

Example:

{
  "dpi": 300,
  "width": 2480,
  "height": 3508,
  "limits": {
    "topRight": {
      "x": 2345,
      "y": 140
    },
    "bottomLeft": {
      "x": 115,
      "y": 3338
    }
  },
  "targets": [
    {
      "y1": 430,
      "y2": 470,
      "x1": 770,
      "x2": 810,
      "id": "a1",
      "type": "rectangle"
    },
    {
      "y1": 430,
      "y2": 470,
      "x1": 860,
      "x2": 900,
      "id": "a2",
      "type": "rectangle"
    }
  ]
}

License

The MIT License (MIT)