This Python script automates the process of extracting important information from a scanned or photographed cheque using Azure OCR. It takes an image of a cheque as input and generates a CSV file containing the following segmented parameters: account number, date, cheque number, amount, payee, and IFSC code.
Before running the script, make sure you have the following prerequisites:
- Python 3.x installed on your system.
- Azure OCR API credentials (subscription key and endpoint). You can obtain these by signing up for Azure OCR services.
- Required Python libraries mentioned in the
requirements.txt
file. You can install them using pip.
To run the script, follow these steps:
- Clone or download this repository.
git clone https://github.com/your-username/BOB-cheque-segmentation-ocr.git
cd BOB-cheque-segmentation-ocr
- Open
module.py
and set your Azure OCR API credentials in theazure_ocr_config
section.
subscription_key = "ADD_API_KEY OVER_HERE."
endpoint = "https://computervisionbankofbaroda.cognitiveservices.azure.com/"
- Run the script using the following command:
python main.py
-
Provide the path to the cheque image when prompted.
-
The script will process the image, extract the required information, and generate a CSV file named
cheque_data.csv
containing the segmented parameters.
Please note that this script does not currently include signature verification. A future version (version_2) will include this feature.
Contributions to this repository are welcome. If you'd like to contribute, please follow these rules:
- Fork the repository and create a feature branch for your contribution.
- Make your changes and ensure the code remains well-documented and adheres to PEP 8 coding standards.
- Create a pull request describing your changes and their purpose.