This is an open source library written in PHP for recognition markings on questionnaires scans
See: https://en.wikipedia.org/wiki/Optical_mark_recognition
Add library:
$ composer require jansenfelipe/omr
This library needs PHP ImageMagick extension to make images of reading
http://php.net/manual/en/imagick.setup.php
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
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"
}
]
}
The MIT License (MIT)