{"id":18370961,"url":"https://github.com/jansenfelipe/omr","last_synced_at":"2025-04-04T22:06:37.849Z","repository":{"id":3103160,"uuid":"48448309","full_name":"jansenfelipe/omr","owner":"jansenfelipe","description":"Optical Mark Recognition with PHP","archived":false,"fork":false,"pushed_at":"2024-01-10T12:28:57.000Z","size":412,"stargazers_count":185,"open_issues_count":11,"forks_count":74,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-28T21:05:14.823Z","etag":null,"topics":["hacktoberfest","omr","optical-mark-recognition","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jansenfelipe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-22T18:47:23.000Z","updated_at":"2024-12-03T06:25:11.000Z","dependencies_parsed_at":"2024-06-21T14:27:39.786Z","dependency_job_id":"3aef81b6-75f5-4501-83eb-36606a5ab777","html_url":"https://github.com/jansenfelipe/omr","commit_stats":{"total_commits":59,"total_committers":4,"mean_commits":14.75,"dds":"0.13559322033898302","last_synced_commit":"fa69d8300cdb734a261dc661ca6fffe7fa97bba8"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jansenfelipe%2Fomr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jansenfelipe%2Fomr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jansenfelipe%2Fomr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jansenfelipe%2Fomr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jansenfelipe","download_url":"https://codeload.github.com/jansenfelipe/omr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256112,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","omr","optical-mark-recognition","php"],"created_at":"2024-11-05T23:42:29.249Z","updated_at":"2025-04-04T22:06:37.830Z","avatar_url":"https://github.com/jansenfelipe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Optical Mark Recognition with PHP\n\n[![Latest Stable Version](https://poser.pugx.org/jansenfelipe/omr/v/stable.svg)](https://packagist.org/packages/jansenfelipe/omr) \n[![Total Downloads](https://poser.pugx.org/jansenfelipe/omr/downloads.svg)](https://packagist.org/packages/jansenfelipe/omr) \n[![Latest Unstable Version](https://poser.pugx.org/jansenfelipe/omr/v/unstable.svg)](https://packagist.org/packages/jansenfelipe/omr)\n[![MIT license](https://poser.pugx.org/jansenfelipe/omr/license.svg)](http://opensource.org/licenses/MIT)\n[![Build Status](https://travis-ci.org/jansenfelipe/omr.svg?branch=master)](https://travis-ci.org/jansenfelipe/omr)\n\nThis is an open source library written in PHP for recognition markings on questionnaires scans\n\nSee: [https://en.wikipedia.org/wiki/Optical_mark_recognition](https://en.wikipedia.org/wiki/Optical_mark_recognition)\n\n\u003cimg src=\"https://github.com/jansenfelipe/omr/blob/develop/example/screenshots/exec_command.png?raw=true\" /\u003e\n\n# How to use\n\nAdd library:\n\n```sh\n$ composer require jansenfelipe/omr\n```\n\nInstantiate the \u003ca href=\"#scanners\"\u003eScanner\u003c/a\u003e class responsible for reading the image and enter its path\n\n```php\n/*\n * Setup scanner\n */\n$scanner = new ImagickScanner();\n$scanner-\u003esetImagePath($imagePath);\n```\n\nYou will need to scan a blank form and create the \u003ca href=\"#target-mapping-file\"\u003eTarget Mapping File\u003c/a\u003e to be able to use the library.\n\nAfter creating the `map.json` file, enter its path:\n\n```php\n/*\n * Setup map\n */\n$map = MapJson::create($mapJsonPath);\n```\n\nNow you can scan and get the result\n\n```php\n$result = $scanner-\u003escan($map);\n```\n\n# Scanners\n\nThis library currently has only one scanner class using `Imagemagick 6`. It has been tested using the following configurations:\n\n* PHP 7.3\n* imagemagick6\n* Extension imagick-3.4.4 \n\nSee https://github.com/jansenfelipe/omr/blob/master/src/Scanners/ImagickScanner.php\n\n# Target Mapping File\n\nIt 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:\n\n```json\n{\n    \"width\": 600,\n    \"height\": 800,\n    \"targets\": [\n      {\n        \"x1\": 50,\n        \"y1\": 43,\n        \"x2\": 65,\n        \"y2\": 57,\n        \"id\": \"Foo\",\n        \"type\": \"rectangle\",\n        \"tolerance\": 60\n      }\n    ] \n}\n```\n\n# Example\n\nIn 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.\n\nTo 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.\n\nThat way you can install the dependencies and run the command to process the image without headaches :)\n\n1) Clone this repo:\n\n```ssh\n$ git clone https://github.com/jansenfelipe/omr.git\n$ cd omr/\n```\n\n2) Install dependencies:\n\n```ssh\n$ docker-compose run php composer install\n```\n\n2) Process example image:\n\n```ssh\n$ docker-compose run php bin/omr scan example/response.png example/map.json\n```\n\n# License\n\nThe MIT License (MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjansenfelipe%2Fomr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjansenfelipe%2Fomr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjansenfelipe%2Fomr/lists"}