https://github.com/reality361/opencv-image-correction
📄 OpenCV Image Correction for Documents
https://github.com/reality361/opencv-image-correction
cpp opencv
Last synced: 2 months ago
JSON representation
📄 OpenCV Image Correction for Documents
- Host: GitHub
- URL: https://github.com/reality361/opencv-image-correction
- Owner: Reality361
- Created: 2025-03-13T19:39:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-13T19:44:22.000Z (over 1 year ago)
- Last Synced: 2025-03-13T20:35:46.369Z (over 1 year ago)
- Topics: cpp, opencv
- Language: C++
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📄 OpenCV Image Correction for Documents
## ✨ Overview
**OpenCV Image Correction** is a C++ project designed to automatically detect and correct skewed or distorted document images. This project leverages OpenCV to detect quadrilateral regions (such as documents) and warp them into a properly aligned view.
## 🚀 Features
✅ **Automatic Document Detection** - Detects quadrilateral shapes in an image and corrects perspective.
✅ **Edge Detection** - Uses OpenCV to detect edges and find the document boundaries.
✅ **Camera & Image Input Support** - Works with both pre-captured images and live camera feed.
✅ **Real-Time Processing** - Processes and displays corrected document images in real time.
## 🏗️ Project Structure
```
📂 opencv-image-correction
├── 📄 main.cpp # Main entry point of the project
├── 📄 QuadDetector.hpp # Header file for quadrilateral detection and processing
├── 📄 README.md # Project documentation
```
## 🔧 Installation & Setup
### Prerequisites
Make sure you have the following installed on your system:
- **C++ Compiler (g++)**
- **OpenCV (>=4.0.0)**
- **CMake**
### Build Instructions
1. Clone this repository:
```sh
git clone https://github.com/Reality361/opencv-image-correction.git
cd opencv-image-correction
```
2. Create a build directory and compile the project:
```sh
mkdir build && cd build
cmake ..
make
```
3. Run the application:
```sh
./DocumentImageCorrection
```
OR
```sh
./DocumentImageCorrection # Runs in camera mode
```
## 📸 Usage
- If you provide an **image file path**, the program will detect and correct the document in that image.
- If **no arguments** are given, the program will open the default camera and process document images in real time.
- Press `q` or `ESC` to exit in camera mode.
## 🖼️ Example Output
Original Image / Corrected Image
---

## 🛠️ Technologies Used
- **C++** - Core language
- **OpenCV** - Image processing
- **CMake** - Build system
## 👥 Contributors
- **Reality361** - [GitHub](https://github.com/Reality361)
- Contributions welcome! Feel free to submit pull requests.
## 📜 License
This project is licensed under the **MIT License**.
---
Give this repository a ⭐ if you found it helpful!