Online Handwritten uppercase English letter recognition

Source: Internet
Author: User
Tags svm uppercase letter

Online Handwriting with upper letter

I just try to make use of the letter stroke num & the track of the stroke to classify the letter.
The result is pretty good. I finish it base opencv 1.0, with vc2005 at XP.

1. Traning Process
Recording the mouse track => disperse the track => got 50 points => get Max square width
=> Make them into same size (ignore the letter size) => calculate FFT from X, Y, and got the first 5 num
=> Write data.txt

2. Recognizing part
Load the data => use the random trees to classify => Get feature data => predict the letter.

3. The format of feature data
Letter + stroke num + stroke N x 5fft + stroke n y 5fft (n = 0, 1, 2)
A 3 .....
If the letter has no more strokes, just write 0 data.

4. How to write the letter

Online upper letter rule
1. c j l o s u v w z finish in one stroke
2. B d G K m N P Q T x y finish in two stroke
3. a e f h I r finish in three stroke

You 'd better follow the rule from attach video.

5. Restore age
Although the training data is not enough, maybe need more training.
Sometime the letter K will be as p.
Can not rotate the letter.

6. need improve
Can not classify lower letter, because the lower letter "c o x v s z p" looks same with the upper ones.
Maybe need add hmm later.
Maybe classify the Arabic numerals later.

7. How to Use
1. there two state (recognizing and training) for the app, in recognizing mode, use your mouse write upper letter on 'win' window, after 1 second, then will get result on win2.
2. You can press 'M' key to change mode from recognizing to training or back.
3. In training mode, change the value of letter, then you can write upper letter on 'win' window, and app will write data into data.txt ."
4. You can retrain the training data by pressing 't'without restart program.
5. You can modify the training data 'data.txt 'by hand if you want or any error input.

Online Handwritten uppercase English letter recognition demonstration

The number of Online Handwritten strokes and the stroke trajectory are used as the feature quantity for recognition. The training test is close to 100%. The actual recognition is also accurate.

1. Training
Record the mouse track => discretize the track => extract 50 points on each track at an equal distance => obtain the maximum outer square width of the track
=> Sort out the unified data size (so that the feature data does not rely on the size of the writing) => extract the five main harmonic A0-A4 from the Fourier Transform of X and Y respectively
=> Write data

2. Identification
Load training data => use random trees classification => Get feature data => Prediction

3. feature data format

Class + trajectory quantity + Fourier transformation of trajectory N x component + Fourier transformation of trajectory n y component (n = 0, 1, 2)
A 3 ..........

If there is no track, add 0.

4. Rules for writing uppercase letters

26 letters must be written in the order of strokes. The writing rules are as follows:
Online uppercase letter writing rules
1. c j l o s u v w z strokes are completed
2. B d G K m N P Q T x y two strokes are completed
3. a e f h I r three strokes are completed

For detailed writing methods, see the video. You must strictly follow the writing strokes in the video.

5. Disadvantages
Because of the data size, the training test is close to 100%. Do you need to add more data?
The user needs to write in standard upper case, sometimes K letters are a bit problematic.
Angle-based writing is not supported.
At present, feature data has not been normalized, because the recognition results can be left blank.
Currently, only random trees has been tried, and the parameters have not been adjusted.
Is SVM training required? (The training result of SVM is incorrect in the current version ).

6. Improvement
This is only a demo. Currently, it cannot recognize lower-case letters, because some lower-case letters, such as c o x v s z p, are basically the same as those of upper-case letters.
We have not fully utilized the stroke time and stroke features to add hmm prediction (word ?).
Also add Arabic digit recognition.

7. Usage
1. The program has two states: recognition and training. The default state is recognition. You can use the mouse to write uppercase letters in the Win window. After the mouse leaves for one second, the win2 window displays the training result.
2. Use m to switch the status
3.adjust the lettercontrol bar in the training State, and display the training progress. Then, write the master letter in the winwindow, and write the data to data.txt.
4. You can press the T key to re-train the model.
5.If the program is incorrect, you can manually edit data.txt

Download)

Opencv_share@163.com download

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.