Smart document skew detection and correction tool using multiple algorithms with voting system, based on academic research paper.
This project implements document image skew detection algorithms based on the research paper:
Boiangiu, C.-A., Dinu, O.-A., Popescu, C., Constantin, N., & Petrescu, C. (2020).
Voting-Based Document Image Skew Detection.
Applied Sciences, 10(7), 2236.
The implementation combines three detection methods:
- FFT (Fast Fourier Transform): Frequency domain analysis with Hough line detection
- Projection Profiling: Connected components analysis with variance optimization
- Hough Transform: Spatial domain line detection with parallel grouping
Results are combined using a confidence-based voting system to select the most reliable skew angle.
document-skew-corrector/
├── notebooks/ # Original Jupyter implementations
│ ├── PCD-Voting-Based-Documents.ipynb
│ └── project_digital_image_processing.ipynb
├── sample_images/ # Test dataset (95+ documents)
├── streamlit_app.py # Web application interface
├── skew_detector.py # Command-line version
├── requirements.txt # Python dependencies
├── README.md # Project documentation
└── LICENSE # MIT license
streamlit run streamlit_app.py- Upload document images (JPG, PNG)
- Real-time skew detection and correction
- Visual comparison of results
- Download corrected images
python skew_detector.py path/to/image.jpgOutput displays detection results from all three methods and final voting decision.
git clone https://github.com/arezyhs/document-skew-corrector.git
cd document-skew-corrector
pip install -r requirements.txt- Core: numpy, scipy, matplotlib, scikit-image, opencv-python, Pillow
- Web App: streamlit
- Notebooks: jupyter
Boiangiu, C.-A., Dinu, O.-A., Popescu, C., Constantin, N., & Petrescu, C. (2020). Voting-Based Document Image Skew Detection. Applied Sciences, 10(7), 2236. https://doi.org/10.3390/app10072236
This project is licensed under the MIT License - see the LICENSE file for details.