20100520-20100523
An OCR (Optical Character Recognition) Program for the screen. It differs from the optical character recognition (OCR) Program for printed and handwritten input in that the screen OCR is a precise recognition program with fast recognition speed and simple algorithms, however, it can only recognize text on the screen (or lossless BMP ,.
The default font library of this program adopts the index + hash table organization, and the file size is 1.48 MB (not compressed ), contains 2580 characters (2500 Chinese characters + 10 numbers + 52 letters + 18 punctuation marks), 5 fonts, 15 font sizes, and 2 styles, totaling 387000 fonts.
It was tested that it took about 3 s to identify 100 characters on the 22nd and 100 words on the 2nd, with a general recognition rate. If the font library uses a pure hash table, the file size will be increased to 32 MB, and the recognition speed can be increased by up to 6 times. In addition, since I have not figured out the algorithm for generating TrueType fonts, I cannot increase the recognition speed for the moment.
I also have some ideas about optical character recognition (OCR. The segmentation algorithm of the section is basically the same as that of the screen OCR. Next we will only discuss the recognition algorithm of single words.
First, scale the height of the target word to the size of the standard word (the height of the target word has been obtained from the row height in the section separation), and the width of the target word is scaled Based on the aspect ratio of the aspect ratio.
Then, the path Finding Algorithm traverses the strokes of the target word to obtain a standard stroke width (that is, width. Obviously, this step is difficult.
Final fuzzy match: Align the target word with the standard word in the upper left corner, and view the square centered on each pixel of the target word (the side length is small) indicates whether a pixel contains a standard word. If yes, the similarity is + 1. According to this method, the similarity of all standard words is calculated cyclically. The words with the highest similarity are used as recognition words.
The last step is time-consuming. The optimization method is to store the standard words from high to low according to the usage frequency. If the similarity is found to be greater than a certain value during the matching process, the recognition words are found and the loop is aborted.
We can see that this is not a good algorithm. Matching Based on the stroke vector or font contour may be much easier, of course.
Finally, let's talk about the recognition of handwritten input, which is different from the first two OCR methods. Because it can obtain the order and direction of strokes in the user's handwriting process (if the user writes down the pen, the recognition accuracy will be reduced), it is easier to identify from this point. However, in general, the word written by a user is significantly different from the standard word, and the algorithm mentioned above will become invalid.