jansenfelipe/omr
Composer 安装命令:
composer require jansenfelipe/omr
包简介
Optical Mark Recognition from PHP
README 文档
README
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
Instantiate the Scanner 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 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
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 https://github.com/jansenfelipe/omr/blob/master/src/Scanners/ImagickScanner.php
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
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 :)
- Clone this repo:
$ git clone https://github.com/jansenfelipe/omr.git
$ cd omr/
- Install dependencies:
$ docker-compose run php composer install
- Process example image:
$ docker-compose run php bin/omr scan example/response.png example/map.json
License
The MIT License (MIT)
jansenfelipe/omr 适用场景与选型建议
jansenfelipe/omr 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.29k 次下载、GitHub Stars 达 189, 最近一次更新时间为 2015 年 12 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「survey」 「omr」 「optical mark recognition」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jansenfelipe/omr 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jansenfelipe/omr 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jansenfelipe/omr 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A wrapper for the Tesseract OCR engine
Laravel wrapper for surveyjs library
Package for create surveys in laravel
Convenient package to create polls (questionnaires) from pure text minimally organized in lines.
Survloop is an open data engine for designing a database and creating a mobile-friendly user interfaces to fill it.
Survey management bundle
统计信息
- 总下载量: 3.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 189
- 点击次数: 8
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-22
