You are here

Optical Character Recognition with JavaScript

The HTML5 (touch device enabled) Javascript application that you see below implements basic Optical Character Recognition using simple Euclidean Distance comparisons. To make use of this example draw a digit in the large rectangle below. Click the "Recognize" button and the program will attempt to guess what digit you drew. The accuracy is not perfect, but it does do a reasonably good job.

The program is already trained with the digits. You can remove any of these digit entries, or create your own. To train the OCR for a new character simply draw that character and click the "Teach" button. This will add the character to the list of characters known by the program.

You will notice that anything that you draw is first cropped, and then downsampled. The high resolution characters that you draw are downsampled onto a 5x8 grid. This downsampled grid is then compared to similarly downsampled grids for each of the digits. To see the grids that the program was trained with click the character in the list that you would like to see.

This example shows how Javascript can be used to perform basic Optical Character Recognition. The algorithm that I am making use of for this example is Euclidean Distance. The simple Euclidean Distance solution, using downsampled images, has comparable performance to downsample based solutions using neural networks, a Self Organizing Map or even a Support Vector Machine.

Comments

phrairin's picture

I have download the example of your recognition app using kohonen network, I wanna your help, can I ask for the source code using this euclidian distance?

amalmami's picture

i wante to now about the handwriting recognize using the rétro-propagation

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer