title: OCR algorithm improvement
body: <p>I'm creating an OCR based on Java. My objective is to extract text from a video file (post-processing). </p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p><strong>What I've done so far:</strong></p>
  
  <p><em>(All image processing done using Java bindings for openCV)</em></p>
  
  <ol>
  <li><p>I've extracted features for training my classifier using:</p>
  
  <p>A. Pixel intensities, after down-sampling the character image to 12 X 12 resolution. (144 feature vectors)</p>
  
  <p>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)</p></li>
  </ol>
  
  <p>A+B gives me the feature vector of the images. (Total 152 feature vectors)</p>
  
  <p>I've 62 classes for classification, viz. 0,1,2...9 | a,b,c,d...y,z | A,B,C,D...Y,Z</p>
  
  <p>I train the classifier using 20 x 62 samples (20 for each class).</p>
  
  <ol start="2">
  <li><p>For classification, I've used the following two approach:</p>
  
  <p>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.</p>
  
  <p>B. kNN classification for the entire 152 dimensions.</p></li>
  </ol>
  
  <p><strong>Where I stand:</strong></p>
  
  <p>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:
  <img src="https://i.stack.imgur.com/AN1TG.png" alt="6"> OR <img src="https://i.stack.imgur.com/WdOjx.png" alt="m">. </p>
  
  <p>Moreover, it is classifying <img src="https://i.stack.imgur.com/ygXed.png" alt="2"> as Z... to name few of the anomalies. </p>
  
  <p><strong>What I'm looking for:</strong></p>
  
  <p>I want to find out the following:</p>
  
  <ol>
  <li><p>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?</p></li>
  <li><p>What other feature vectors can I use for making the OCR more robust? </p></li>
  </ol>
  
  <p>Any other suggestions for performance optimization are welcome.</p>