The code detects handwritten digits and recognizes them Using OpenCV and Tensorflow Python module.
The project detects and recognizes handwritten digits in a given image using OpenCV and Tensorflow Python module.
Firstly we will load the dataset. Here the mnist dataset of keras.datasets is used.
The data is stored as follows:
1. train
2. test
The dataset consists of handwritten digits and the labels consist of their numerical value.
This project is implemented on Jupyter notebook of Anaconda. The values for digit detection using openCV depends on the input image.
The Python libraries used are :
1. NumPy
3. Tensorflow
4. OpenCV
Input Image on which we will be predicted is a handwritten set of digits:
The image has to be processed using OpenCV. The image needs to be converted to grayscale,blurred, and then we need to use threshold to detect the digits. The image after all the processing is as follows:
This code has a training accuracy of 99.22% and validation accuracy of 99.39% . The Output looks as follows:
Here all the 9 digits are recognized . 7 out of 9 digits are recognized correctly.
Submitted by Shreoshree Adhikari (sashreoshreeadhikari)
Download packets of source code on Coders Packet
Comments