• This repository has been archived on 09/Feb/2023
  • Stars
    star
    207
  • Rank 189,769 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created about 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Optical Mark Recognition in Python

omr

Python application

omr is a small Python 3 optical mark recognition script. It takes as input an image of an answered answer sheet and outputs which alternatives were marked. The project is generally optimized for conciseness and teachability, and the goal is to provide a reasonable starting point for learning and hopefully building more powerful applications.

Usage

$ python omr.py --help
usage: omr.py [-h] --input INPUT [--output OUTPUT] [--show]

optional arguments:
  -h, --help       show this help message and exit
  --input INPUT    Input image filename
  --output OUTPUT  Output annotated image filename
  --show           Displays annotated image

Example

$ python omr.py --input img/answered-sheet-photo.jpg  --output /tmp/results.png --show

Q1: A
Q2: C
Q3: C
Q4: E
Q5: N/A
Q6: N/A
Q7: A
Q8: N/A
Q9: N/A
Q10: N/A

In this case, we used the following image as input:

Input

And got the following output:

Output

Installation

Using pipenv with pyenv

Install pyenv

$ git clone https://github.com/rbaron/omr
$ cd omr/
$ pyenv install 3.7.5
$ pyenv local 3.7.5
$ pipenv --python 3.7.5
$ pipenv install
$ pipenv shell
$ py.test

Using virtualenv

$ git clone https://github.com/rbaron/omr
$ cd omr/
$ virtualenv --python=`which python3` venv
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt
(venv) $ python omr.py --help

Anwer Sheet

The answer sheet is available in the sheet/ directory.

Development

Run unit tests

test_omr.py contains unit tests that can be run using:

$ py.test
=========================================================== test session starts ===========================================================
platform darwin -- Python 3.7.5, pytest-5.2.4, py-1.8.0, pluggy-0.13.0
collected 1 item

test_omr.py .                                                                                                                       [100%]

============================================================ 1 passed in 0.31s ============================================================

More Repositories

1

b-parasite

ðŸŒąðŸ’§ An open source DIY soil moisture sensor
C
1,822
star
2

catprinter

ðŸąðŸ–Ļ
Python
730
star
3

awesomenes

ðŸŽŪ A NES emulator written in Go
Go
275
star
4

dict.cc.py

📘 Unofficial command line client for dict.cc
Python
156
star
5

w-parasite

ðŸŠī💧A WiFi-enabled soil moisture sensor
C++
135
star
6

elink

A daisy chain of electronic shelf labels
C
101
star
7

deskmate

A tiny MQTT-powered dashboard and control center.
C++
67
star
8

fitless

A collection of toy firmwares for the ID115 fitness tracker
C
60
star
9

eink-ha

A hacky e-ink display for Home Assistant sensors
C
56
star
10

m6-reveng

Info & tools for reverse engineering the M6 smart fitness band
C
54
star
11

HS6620D-smartwatch-reveng

51
star
12

pricetag-printer

Python script for printing to the Hanshow price-tag
Python
50
star
13

sugarboat

A digital hydrometer
C++
38
star
14

remotebox

A Rhythmbox plugin for remote control via a TCP socket
Python
20
star
15

secret

Shamir secret sharing scheme in zero-dependency C
C
15
star
16

lir2450-charger

A tiny USB C charger for LIR2450 coin cell batteries
13
star
17

parasite-scanner

A bridge for b-parasites
Go
12
star
18

ikea-macropad

Python
9
star
19

clack

Minimalist Slack bot framework for clojure
Clojure
8
star
20

pyRemoteControl

Remote control server for linux. Control your X session through a TCP socket.
Python
7
star
21

sos

the helplessly useless operating system
Assembly
6
star
22

pyS3fs

Mount Amazon's S3 storage as a filesystem
Python
4
star
23

st-peter-esp8266

The ESP8266 sketch for the Slack bot controlled AC
Eagle
3
star
24

stpeter

Clojure
3
star
25

ble-led

A minimal ESP32 Arduino BLE service that turns an LED on/off
C++
3
star
26

react-native-dform

Schema-based dynamic forms for React Native
JavaScript
3
star
27

dform-editor

dform JSON schema editor
JavaScript
2
star
28

react-dform

Schema-based dynamic forms for React
JavaScript
2
star
29

advent-of-code-2021

My solutions to adventofcode.com
Python
2
star
30

dform

Schema-based dynamic forms
JavaScript
2
star
31

stacky

A programming language with a RPN-like syntax
Python
2
star
32

advent-of-code-2023

Python
2
star
33

advent-of-code-2017

Haskell
2
star
34

advent-of-code-2022

My solutions to adventofcode.com
Python
2
star
35

pyMonitor

Periodically checks if webpages are online and display their statuses using GTK widgets.
Python
2
star
36

sicp

My solutions to SICP exercises
Scheme
2
star
37

0

Quick, dirty and RPN-ish calculations on your terminal
C
2
star
38

tinycolor

A tiny python2 and python3 module for printing in colors
Python
2
star
39

qche

Python2 filesystem-persisted cache with a dead simple interface
Python
2
star
40

advent-of-code-2020

🎅 My solutions to adventofcode.com
Python
1
star
41

advent-of-code-2019

My solutions to adventofcode.com 2019
C++
1
star
42

spellcaster

🊄 A home automation magic wand
Jupyter Notebook
1
star
43

gimme-danger

A USB-PD trigger board & controller, powered by ESPHome
1
star
44

dotfiles

Shell
1
star
45

compiler_studies

ðŸ’Ą
Python
1
star
46

scam

A toy Lisp interpreter in C
C
1
star
47

d2r-tracker-ha-custom-component

A Diablo 2 Resurrected DClone tracker custom component for Home Assistant
Python
1
star