I'm creating an OCR based on Java. My objective is to extract text from a video file (post-processing).
It has been a difficult search, trying to find free, open-source OCR that works purely on Java. I found Tess4J to be the only popular option, but given the need for the native interface, I somehow felt inclined towards developing the algorithm from scratch.
I need to create a dependable OCR that properly identifies English alphabets (computerized typefaces only, not handwritten text) with reasonable accuracy, given that the region in which the text lies in the video frame is pre-defined. We can also assume that the color of the text is given.
What I've done so far:
(All image processing done using Java bindings for openCV)
I've extracted features for training my classifier using:
A. Pixel intensities, after down-sampling the character image to 12 X 12 resolution. (144 feature vectors)
B. Gabor wavelet transform across 8 different angles (0, 11.25, 22.5 ...etc) and the computed energy using mean squared value of the signal for all these angles. (8 feature vectors)
A+B gives me the feature vector of the images. (Total 152 feature vectors)
I've 62 classes for classification, viz. 0,1,2...9 | a,b,c,d...y,z | A,B,C,D...Y,Z
I train the classifier using 20 x 62 samples (20 for each class).
For classification, I've used the following two approach:
A. ANN with 1 hidden layer (of 120 nodes). Input layer has 152 nodes and output has 62. Hidden and output layer have sigmoid activation function and the network is trained using Resilient Back Propagation.
B. kNN classification for the entire 152 dimensions.
Where I stand:
k-Nearest Neighbor search is turning out to be a better classifier than neural network (so far). However, even with kNN, I'm finding it difficult to classify letters like: OR .
Moreover, it is classifying as Z... to name few of the anomalies.
What I'm looking for:
I want to find out the following:
Why is ANN under-performing? What configuration of network should I use to push the performance higher? Can we fine-tune ANN to perform better than kNN search?
What other feature vectors can I use for making the OCR more robust?
Any other suggestions for performance optimization are welcome.