(ONLY WORKS ON NUMBERS 0 - 9) This tool is a demonstration of a technique for handwriting recognition. HOW IT WORKS First, I must format the number you wrote into an efficient data set: 1. As you write, every (x, y) coordinate that you crossed over is saved into a large list. 2. A representative set of only 10 coordinates are taken from the hundreds you generated in the previous step. I try to even them out to the best of my ability. 3. The drawing could be of various sizes, so the points are "normalized," meaning the x and y coordinates will be fixed to a range from 0 to 1, so that there is consistency no matter the size of the drawing. 4. The angle changes between these 10 coordinates are calculated, and are stored along with the coordinates themselves. There are 8 data points for angle changes. These give me a total of only 28 numbers that thoroughly describe the number you wrote. LEARNING: A large list holds all the information the program has learned. Each number, 0-9, is given 29 spots on the list: number of entries made for this number 10 x coordinates 10 y coordinates 8 angle changes Each time the user teaches the program, it takes the average of what it has stored in the past and the data that was just given. When averaging, previously stored data is potentially weighted more heavily by using the "number of entries made for this number" data point. TESTING: The program will compare your entry to the learned information you had just taught it. 1. A score is kept for each comparison. For example, if the user draws a 2, the 10 coordinates generated by the user's drawing will be compared one by one, first to the 10 stored coordinates for 0, then 1, then 2, etc.. The distance formula is used: sqrt((x2-x1)^2 + (y2-y1)^2). The goal is that since the user drew a 2, the coordinates stored for 2 should be the closest to the coordinates the user drew. 2. The score will also include the angle changes. 3. The program picks the comparison with the lowest score and presents its "guess."
I used my own text engine (penChar): https://scratch.mit.edu/projects/113762333/ Published: 7/10/16 Changed color scheme: 7/13/16 Updated accuracy by calculating angle changes: 7/13/16