An open API service indexing awesome lists of open source software.

https://github.com/nafisarkar/iot_omr_scanner

The IOT_OMR_SCANNER is an IoT-based project designed to automate the evaluation of OMR (Optical Mark Recognition) sheets
https://github.com/nafisarkar/iot_omr_scanner

esp32-cam image image-processing iot ocr-recognition omr-sheet

Last synced: 4 months ago
JSON representation

The IOT_OMR_SCANNER is an IoT-based project designed to automate the evaluation of OMR (Optical Mark Recognition) sheets

Awesome Lists containing this project

README

          

# ๐Ÿ” IoT OMR Scanner

**Automated Optical Mark Recognition System with ESP32-CAM**

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python](https://img.shields.io/badge/Python-3.7+-blue.svg)](https://www.python.org/downloads/)
[![OpenCV](https://img.shields.io/badge/OpenCV-4.x-green.svg)](https://opencv.org/)
[![ESP32](https://img.shields.io/badge/ESP32-CAM-red.svg)](https://www.espressif.com/)

[Features](#-features) โ€ข [Installation](#-installation) โ€ข [Usage](#-usage) โ€ข [Hardware](#-hardware-requirements) โ€ข [Contributing](#-contributing)

---

## ๐Ÿ“– About

The **IoT OMR Scanner** is an innovative IoT-based solution that automates the evaluation of OMR (Optical Mark Recognition) sheets. Combining the power of ESP32-CAM for image capture with advanced OpenCV algorithms, this system provides accurate, real-time processing for educational institutions and examination centers.

## โœจ Features

### ๐Ÿ“ท Smart Image Capture

- **High-resolution imaging** with ESP32-CAM module
- **Cost-effective** and compact hardware solution
- **Wireless connectivity** for remote operation

### ๐Ÿง  Advanced Computer Vision

- **Intelligent preprocessing** with grayscale conversion and Gaussian blur
- **Precise edge detection** using Canny Edge Detector
- **Accurate circle detection** via Hough Circle Transform

### โœ… Automated Answer Validation

- **Smart positioning** algorithm (top-to-bottom, left-to-right sorting)
- **Real-time comparison** with predefined answer keys
- **Visual feedback** with color-coded results:
- ๐Ÿ”ด **Red circles**: Correct answers
- ๐ŸŸข **Green circles**: Incorrect answers

### โšก Real-Time Processing

- **Fast evaluation** suitable for high-volume environments
- **Instant results** with detailed analytics
- **Educational-grade accuracy** for reliable assessments

## ๐Ÿš€ Installation

### Prerequisites

- Python 3.7 or higher
- ESP32-CAM module with firmware

### Quick Start

1. **Clone the repository**

```bash
git clone https://github.com/Nafisarkar/IOT_OMR_SCANNER.git
cd IOT_OMR_SCANNER
```

2. **Install dependencies**

```bash
pip install -r requirements.txt
```

Or install manually:

```bash
pip install opencv-python numpy imutils
```

3. **Configure ESP32-CAM**

- Flash the ESP32-CAM with the provided firmware
- Set up wireless connection parameters

4. **Setup paths**
- Update image paths in the configuration file
- Ensure proper directory structure

## ๐Ÿ“ฑ Usage

### Step-by-Step Process

1. **๐Ÿ“ธ Capture Image**

```
Use ESP32-CAM to capture OMR sheet โ†’ Save to img/ folder
```

2. **๐Ÿ”ง Run Scanner**

```bash
python main.py
```

3. **๐Ÿ“Š View Results**
- Processed image with highlighted answers
- Console output with detection statistics
- Accuracy metrics and analysis

### Expected Output

```
Total circles detected: 40
Correct answers: 35
Accuracy: 87.5%
```

### Core Components

| Component | Technology | Purpose |
| ----------------------- | ---------------- | ------------------------------------- |
| **Image Preprocessing** | OpenCV | Noise reduction, grayscale conversion |
| **Edge Detection** | Canny Algorithm | Boundary identification |
| **Circle Detection** | Hough Transform | Mark recognition |
| **Validation Engine** | Custom Algorithm | Answer comparison |

## ๐Ÿ“‹ Hardware Requirements

### Essential Components

- ๐Ÿ”ง **ESP32-CAM Module**
- ๐Ÿ”ง **ESP32 Development Board**
- ๐Ÿ”Œ **Power Supply** (USB Cable or external)
- ๐Ÿ“„ **OMR Sheets** (standard format)

### Optional Enhancements

- ๐Ÿ’ก **LED Lighting** for better image quality
- ๐Ÿ“ฆ **Enclosure** for portable operation
- ๐Ÿ”‹ **Battery Pack** for mobile use

## ๐Ÿ’ป Software Stack

| Technology | Version | Purpose |
| ----------- | ------- | -------------------- |
| **Python** | 3.7+ | Core processing |
| **OpenCV** | 4.x | Computer vision |
| **NumPy** | Latest | Numerical operations |
| **Imutils** | Latest | Image utilities |

## ๐ŸŽฏ Example Results

### Before Processing

![Input OMR Sheet](img/image.png)

### After Processing

- โœ… **Correct answers**: Highlighted in red
- โŒ **Incorrect answers**: Highlighted in green
- ๐Ÿ“Š **Statistics**: Displayed in terminal

## ๐Ÿค Contributing

We welcome contributions! Here's how you can help:

1. **๐Ÿด Fork** the repository
2. **๐ŸŒŸ Create** a feature branch (`git checkout -b feature/AmazingFeature`)
3. **๐Ÿ’พ Commit** your changes (`git commit -m 'Add some AmazingFeature'`)
4. **๐Ÿ“ค Push** to the branch (`git push origin feature/AmazingFeature`)
5. **๐Ÿ”€ Open** a Pull Request

### Areas for Contribution

- ๐Ÿ› Bug fixes and improvements
- ๐Ÿ“š Documentation enhancements
- โœจ New features and algorithms
- ๐Ÿงช Test coverage expansion

## ๐Ÿ“„ License

This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ™ Acknowledgments

- **OpenCV Community** - For providing powerful computer vision tools
- **ESP32 Community** - For comprehensive documentation and support
- **Contributors** - For making this project better

## ๐Ÿ“ฌ Contact & Support

- **Author**: Shaon An Nafi
- **Issues**: [GitHub Issues](https://github.com/Nafisarkar/IOT_OMR_SCANNER/issues)
- **Discussions**: [GitHub Discussions](https://github.com/Nafisarkar/IOT_OMR_SCANNER/discussions)

---

**โญ Star this repository if you found it helpful!**

[๐Ÿ” Back to top](#-iot-omr-scanner)