OMRChecker

Udayraj123MIT活跃维护

用扫描仪或手机拍照快速、准确地批改 OMR 答题卡,自动识别选择题填涂并评分,适合考试阅卷场景。

Evaluate OMR sheets fast and accurately using a scanner 🖨 or your phone 🤳.

v1.1.0发布于 2024-04-13 15:54 UTC1,190star540fork同步于 2026-11-07 07:33 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/Udayraj123/OMRChecker
cd OMRChecker/
python3 -m pip install --user -r requirements.txt
python3 main.py
硬件要求按 README 说明

README 未说明 GPU 或显存要求;依赖 OpenCV 与 Python 3.5+,可在 OSX、Linux、Windows 上运行,最低图像分辨率 640x480。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用扫描仪或手机照片快速准确地识别并评分 OMR 答题卡的开源工具

用扫描仪或手机拍照快速、准确地批改 OMR 答题卡,自动识别选择题填涂并评分,适合考试阅卷场景。

核心能力

  • 支持任意角度、任意颜色扫描的答题卡识别
  • 按 template.json 配置自定义 OMR 版式与调参
  • 输出含检测结果与评分的 CSV 表格
  • 原生支持 PDF 输入,可配置渲染 DPI 与页码
  • 生成逐步处理可视化图便于调试配置

容易踩的坑

需先安装 opencv-python 与 opencv-contrib-python,Linux 上还可能缺系统库需用 apt 补装;运行前要把 samples/sample1 复制到 inputs/ 或显式指定 --inputDir;自定义版式需先写好 template.json 并用 --setLayout 调试。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

2 个版本v1.1.0
  1. v1.1.0V1.1.0 Release 2023 最新正式版2024-04-13 · 2024-04-13 15:54 UTC

    Releasing 2023 code to make way for new code

    • Freezing current master code as a release of the code upto 2023
    • Making way for the changes from Upgrade branch: feature/upgrade-crop-on-markers-colored-outputs

    Next release to be done after merging https://github.com/Udayraj123/OMRChecker/pull/178

  2. v1.0.0v1.0.0 Initial Release2020-11-24 · 2020-11-24 14:22 UTC
    查看更新说明

    While anticipating major changes in coming months, this release marks a perfectly working, stable code that has been tested at scale.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    OMR Checker

    Read OMR sheets fast and accurately using a scanner 🖨 or your phone 🤳.

    What is OMR?

    OMR stands for Optical Mark Recognition, used to detect and interpret human-marked data on documents. OMR refers to the process of reading and evaluating OMR sheets, commonly used in exams, surveys, and other forms.

    Quick Links

    PRs Welcome GitHub pull-requests closed GitHub issues-closed Ask me

    GitHub stars Join

    🎯 Features

    A full-fledged OMR checking software that can read and evaluate OMR sheets scanned at any angle and having any color.

    Specs Current_Speed Min Resolution
    💯 AccurateCurrently nearly 100% accurate on good quality document scans; and about 90% accurate on mobile images.
    💪🏿 RobustSupports low resolution, xeroxed sheets. See Robustness for more.
    ⏩ FastCurrent processing speed without any optimization is 200 OMRs/minute.
    ✅ CustomizableEasily apply to custom OMR layouts, surveys, etc.
    📊 Visually RichGet insights to configure and debug easily.
    🎈 LightweightVery minimal core code size.
    🏫 Large ScaleTested on a large scale at Technothlon.
    👩🏿‍💻 Dev FriendlyPylinted and Black formatted code. Also has a developer community on discord.

    Note: For solving interesting challenges, developers can check out TODOs.

    See the complete guide and details at Project Wiki.

    💡 What can OMRChecker do for me?

    Once you configure the OMR layout, just throw images of the sheets at the software; and you'll get back the marked responses in an excel sheet!

    Images can be taken from various angles as shown below-

    Code in action on images taken by scanner:

    Code in action on images taken by a mobile phone:

    Visuals

    Processing steps

    See step-by-step processing of any OMR sheet:

    Output

    Get a CSV sheet containing the detected responses and evaluated scores:

    We now support colored outputs as well. Here's a sample output on another image -

    There are many more visuals in the wiki. Check them out here!

    Getting started

    Setup Time

    Operating system: OSX or Linux is recommended although Windows is also supported.

    1. Install global dependencies

    opencv 4.0.0 python 3.5+

    To check if python3 and pip is already installed:

    python3 --version
    python3 -m pip --version
    

    To install python3 follow instructions here

    To install pip - follow instructions here

    Any installation method is fine.

    Recommended:

    python3 -m pip install --user --upgrade pip
    python3 -m pip install --user opencv-python
    python3 -m pip install --user opencv-contrib-python
    

    More details on pip install openCV here.

    Installing missing libraries(if any):

    On a fresh computer, some of the libraries may get missing in event after a successful pip install. Install them using following commands(ref):

    sudo apt-get install -y build-essential cmake unzip pkg-config
    sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev
    sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
    sudo apt-get install -y libatlas-base-dev gfortran
    

    2. Install project dependencies

    Clone the repo

    git clone https://github.com/Udayraj123/OMRChecker
    cd OMRChecker/
    

    Install pip requirements

    python3 -m pip install --user -r requirements.txt
    

    Note: If you face a distutils error in pip, use --ignore-installed flag in above command.

    3. Run the code

    1. First copy and examine the sample data to know how to structure your inputs:
      cp -r ./samples/sample1 inputs/
      # Note: you may remove previous inputs (if any) with `mv inputs/* ~/.trash`
      # Change the number N in sampleN to see more examples
      
    2. Run OMRChecker:
      python3 main.py
      

    Alternatively you can also use python3 main.py -i ./samples/sample1.

    Each example in the samples folder demonstrates different ways in which OMRChecker can be used.

    Common Issues

    OMRChecker for custom OMR Sheets

    1. First, create your own template.json.
    2. Configure the tuning parameters.
    3. Run OMRChecker with appropriate arguments (See full usage).

    Full Usage

    python3 main.py [--setLayout] [--inputDir dir1] [--outputDir dir1]
    

    Explanation for the arguments:

    --setLayout: Set up OMR template layout - modify your json file and run again until the template is set.

    --inputDir: Specify an input directory.

    --outputDir: Specify an output directory.

    PDF files (.pdf) are supported natively via PyMuPDF. Configure pdf_params in template.json:

    • pdf_dpi: Rendering DPI (default "auto", or integer 72–600)
    • pdf_page: Pages to process — 1, null (all), "1-5", "3-", [1, "3-5"]

    See samples/sample2 for an example.

    • The old --noCropping flag has been replaced with the 'CropPage' plugin in "preProcessors" of the template.json(see samples).
    • The --autoAlign flag is deprecated due to low performance on a generic OMR sheet
    • The --template flag is deprecated and instead it's recommended to keep the template file at the parent folder containing folders of different images

    FAQ

    This project was born out of a student-led organization called as Technothlon. It is a logic-based international school championship organized by students of IIT Guwahati. Being a non-profit organization, and after seeing it work fabulously at such a large scale we decided to share this tool with the world. The OMR checking processes still involves so much tediousness which we aim to reduce dramatically.

    We believe in the power of open source! Currently, OMRChecker is in an intermediate stage where only developers can use it. We hope to see it become more user-friendly as well as robust from exposure to different inputs from you all!

    Open Source

    OMRChecker can be forked and modified. You are encouraged to play with it and we would love to see your own projects in action!

    It is published under the MIT license.

    • Join the developer community on Discord to fix issues with OMRChecker.

    • If this project saved you large costs on OMR Software licenses, or saved efforts to make one. Consider donating an amount of your choice(donate section).

    Credits

    A Huge thanks to: Adrian Rosebrock for his exemplary blog: https://pyimagesearch.com

    Harrison Kinsley aka sentdex for his video tutorials and many other resources.

    Satya Mallic for his resourceful blog: https://www.learnopencv.com

    And to other amazing people from all over the globe who've made significant improvements in this project.

    Thank you!

    Related Projects

    Here's a snapshot of the Android OMR Helper App (archived):

    Stargazers over time

    Stargazers over time



    License

    GitHub license

    For more details see LICENSE.

    Donate

    paypal

    Find OMRChecker on Product Hunt | Reddit | Discord | Linkedin | goodfirstissue.dev | codepeak.tech | fossoverflow.dev | Interview on Console by CodeSee | Open Source Hub