How roshenisr/s3231-mcq-sheet-reader works
S3231 MCQ answer-sheet reader is a CPU-only computer-vision application that turns a scan or photo into student-number and answer predictions in JSON. Its runtime path is CLI input, page registration, bubble scoring and thresholded decoding, then JSON output; an optional debug image annotates the registered page. The README also describes a separate training-time layout-learning stage. Registration details are shown in sampled source, but the robust registrar, layout learning and data loader were not excerpted, so their internal call relationships are not asserted.
Main entry points: predict.py Prediction CLI · robust.py Robust registration · register.py SIFT registrar · bubbles.py Bubble scoring
Components 12
Input and output
- Prediction CLI
predict.py - Input image
- Prediction JSON
Page registration
- Robust registration
src/robust.py - SIFT registrar
src/register.py - Contour warp
src/align.py
Bubble reading
- Bubble scoring
src/bubbles.py - Thresholded decoding
src/bubbles.py - Debug annotation
src/bubbles.py
Layout preparation
- Learned layout
src/grid.py - Training data loader
src/s3231_data.py
Other components
- Operator
Connections 13
- Operator → Prediction CLI: runs
README.md - Operator → Input image: provides
README.md - Prediction CLI → Input image: reads
predict.py - Prediction CLI → Robust registration: registers with
predict.py - Robust registration → SIFT registrar: uses retries
README.md - Robust registration → Contour warp: falls back
README.md - SIFT registrar → Contour warp: falls back
src/register.py - Prediction CLI → Bubble scoring: scores bubbles
predict.py - Bubble scoring → Learned layout: uses layout
README.md - Prediction CLI → Thresholded decoding: decodes scores
predict.py - Prediction CLI → Prediction JSON: writes
predict.py - Prediction CLI → Debug annotation: optionally annotates
predict.py - Training data loader → Learned layout: supplies training pages