As part of KaggleX BIPOC Mentorship Program-Cohort2 (Dec 2022 - Mar 2023), I created a Receipt OCR Web App called WeSplit. This app utilizes Tesseract OCR engine, an open source library, and custom preprocessing steps that I designed to improve the quality of the input image. The subset of the code is shared here to demonstrate the preprocessing steps and its positive impact to the OCR output.
- Author: Jaelin Lee
- Date: Mar 18, 2023
- Download this repository to your local machine
- Open the project directory
- In Terminal, run automated script to install packages
- chmod +x install_packages.sh
- sh install_packages.sh
- Create folders under the project directory
raw
preprocessed
output
- Add a scanned receipt (i.e. .JPG, .PNG) to
raw
folder
- python3 run.py
- Enhanced receipt (
enhanced.jpg
) is saved inpreprocessed
folder - OCR text ourput (
enhanced.txt
) is saved inoutput
folder
Enjoy!
Faded Receipt:
Rotated / Crumbled Receipt:
Torn Receipt:
- For a detailed explanation of the preprocessing steps used in this project (https://medium.com/@jaelin_75015/faded-torn-rotated-receipt-ocr-with-image-preprocessing-1fb03c036504)
- For a quick sample run of this project in Kaggle notebook (https://www.kaggle.com/jaelin215/faded-receipt-ocr-tesseract-preprocessing)
- MIT License
- I would appreciate if you quote my name and the link to this GitHub repo if you reference this code. Thanks!