This project is a comprehensive solution for recognizing handwritten digits and text from images, with functionalities for training, testing, and usage, making it suitable for tasks like cheque amount verification and other handwritten text recognition applications.
This project provides solution for extracting the letters and then predicting the sentence. For this, few assumptions are made:
- The handwriting is not cursive.
- The text is in english language only.
- Written text is human-readable.
- Training model for digit and character prediction using EMNIST and MNIST dataset available on Kaggle.
- Histogram based segmentation to find out the characters and space between characters and words.
- Prediction to decode the sentence
- The original image is converted into binary image.
- Column wise sum is calculated to figure out the coordinates where the main contents are present and where space is present.
- Two type of spaces are detected: space between subsequent letters and space between words. These are termed as local space and global space respectively. A threshold value is set to distinguish between local and global space.
- Row wise sum is calculated to remove any top or bottom space available.
- The extracted contents are resized for prediction.
- Model prediction is performed.
-
Binary Image
-
Column wise sum - Histogram: frequency vs total number of columns
-
Extracted Characters
-
Row wise content extraction
-
Image resizing
-
Prediction
Predicted Sentence: ONE CAXM FOATY THOOIANO TNENTY SIX
Actual Text: ONE LAKH FORTY THOUSAND TWENTY SIX
Note: The accuracy of prediction can be increased by increasing accuracy of trained model.
Decoding amount from extracted text