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

https://github.com/lamouchi-bayrem/data-matrix-scanner

A dual-interface tool that leverages AI to **detect and decode QR codes and Data Matrix codes** from images using computer vision
https://github.com/lamouchi-bayrem/data-matrix-scanner

data datamatrix-scanner decoder flask qrcode scanner tkinter-gui webapp

Last synced: about 2 months ago
JSON representation

A dual-interface tool that leverages AI to **detect and decode QR codes and Data Matrix codes** from images using computer vision

Awesome Lists containing this project

README

          

# ๐Ÿ“ท QR & Data Matrix Decoder Application

This project provides two intuitive interfaces to **detect and decode QR codes and Data Matrix codes**:

1. ๐ŸŒ A **modern Flask-based web application**
2. ๐Ÿ–ฅ๏ธ A **desktop GUI application built with Tkinter**

---

-----
## ๐Ÿš€ Demo for the tkinter gui app
![App Demo](https://github.com/Lamouchi-Bayrem/Data-Matrix-scanner/blob/main/imgs/Capture%20d'%C3%A9cran%202025-05-07%20003024.png)

---------------
## ๐Ÿš€ Demo for the web app
![App Demo](https://github.com/Lamouchi-Bayrem/Data-Matrix-scanner/blob/main/imgs/Capture%20d'%C3%A9cran%202025-05-07%20003212.png))

## ๐Ÿš€ Features

- ๐Ÿ” Detects **QR codes** and **Data Matrix codes** in images
- ๐Ÿง  Utilizes **YOLOv8** for robust and accurate detection
- ๐Ÿ–ผ๏ธ Handles **multiple codes per image**
- ๐Ÿงฉ Displays **decoded data** with visual overlays
- ๐ŸŒ Web app supports **drag-and-drop** uploads
- ๐Ÿ–ฑ๏ธ Desktop app supports **file selection dialog**
- ๐Ÿ“‹ One-click copy of decoded content
- ๐Ÿงช Pre-packaged with sample images for testing

---

## ๐Ÿ“ฆ Installation

### โœ… Prerequisites

- Python **3.8+**
- `pip` package manager

### ๐Ÿ“ฅ Setup for Both Applications

1. **Clone the repository**:
```bash
git clone https://github.com/Lamouchi-Bayrem/Data-Matrix-scanner.git
cd Data-Matrix-scanner

2. **Install dependencies**:

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

3. **Download the YOLO model weights**:

* Place `best.pt` in the root directory.

---

## ๐ŸŒ Web Application (Flask)

### โ–ถ๏ธ Running the Web App

```bash
python app.py
```

Access it at: [http://localhost:5000](http://localhost:5000)

### ๐Ÿงญ Usage

* Open the web interface in your browser
* Drag and drop an image or click to select
* View decoded codes with bounding boxes
* Copy results to clipboard

### ๐Ÿ“ Web App Structure

```
web-app/
โ”œโ”€โ”€ app.py # Flask backend
โ”œโ”€โ”€ requirements.txt # Web dependencies
โ”œโ”€โ”€ best.pt # YOLOv8 model weights
โ”œโ”€โ”€ uploads/ # Uploaded images
โ””โ”€โ”€ templates/
โ””โ”€โ”€ index.html # Web interface
```

---

## ๐Ÿ–ฅ๏ธ Desktop Application (Tkinter)

### โ–ถ๏ธ Running the Desktop App

```bash
python tkinter_app.py
```

### ๐Ÿงญ Usage

* Launch the GUI
* Click **"Open Image"** to choose a file
* View decoded codes and visual highlights
* Save or copy results

### ๐Ÿ“ Desktop App Structure

```
desktop-app/
โ”œโ”€โ”€ tkinter_app.py # Desktop GUI
โ”œโ”€โ”€ requirements.txt # GUI dependencies
โ”œโ”€โ”€ best.pt # YOLOv8 model weights
โ””โ”€โ”€ samples/ # Example test images
```

---

## โš™๏ธ Performance Notes

* โฑ๏ธ **Average processing time**: 500โ€“1500 ms per image (depending on hardware)
* ๐Ÿ“ **Recommended image size**: 800โ€“2000px per side
* ๐Ÿ–ผ๏ธ **Supported formats**: PNG, JPG, JPEG, BMP

---

## ๐Ÿงฐ Troubleshooting

### โŒ No codes detected?

* Ensure the image has good lighting
* Try a higher resolution image
* Lower the confidence threshold if needed

### โŒ Installation errors?

* Verify Python version (3.8+)
* If using GPU, ensure CUDA is configured correctly

---

## ๐Ÿ“„ License

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