[0045] It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.
[0046] The present invention provides a character recognition method, with reference to figure 1 In an embodiment, the character recognition method includes:
[0047] Step S101, acquiring handwriting data of the stylus when writing;
[0048] In this embodiment, the stylus has a built-in acceleration sensor. The acceleration sensor can be, for example, a three-axis gyroscope. When the stylus is writing, the acceleration sensor can sense its acceleration in the three-axis direction. The acceleration value can be analyzed to obtain the movement track of the pen tip of the stylus when writing, and record the movement track of the pen tip, and use the movement track of the pen tip as the writing handwriting data of this embodiment.
[0049] Step S102, extracting digital feature information of each character according to the handwriting data;
[0050] In this embodiment, the handwriting data cannot accurately reflect the characters when the user is writing. Therefore, it is necessary to perform corresponding image processing on the handwriting data: Binarize the handwriting data to obtain only black and white. Gray-scale binarized image, and then discretize the binarized image. After the discretization process, the digital feature information of each character in the matrix data is obtained. In this way, the number of characters written by the user is obtained. After the feature information, the digital feature information can be recognized, and the characters written by the user can be obtained more accurately.
[0051] In this embodiment, during the corresponding image processing of the handwriting data, corresponding additional processing can be done. For example, the handwriting data can be denoised first to remove obvious interference factors to improve the extraction. The accuracy of the numerical characteristics of the characters.
[0052] In addition, this embodiment is not limited to the above-mentioned method of performing corresponding image processing on the handwriting data, and other image processing methods capable of extracting the digital feature information of each character in the handwriting data are within the protection scope of this embodiment.
[0053] Step S103: Obtain the standard feature information of the prestored characters, and identify the character corresponding to the extracted digital feature information of each character according to the standard feature information.
[0054] In this embodiment, the standard feature information of the prestored characters is obtained, the standard feature information is compared with the extracted digital feature information of each character, and the similarity between the two is calculated, and the character corresponding to the standard feature information with the greatest similarity is taken as The character finally recognized in this embodiment is the character written by the user, and the character finally recognized is the character of the electronic file.
[0055] In this embodiment, the recognized characters may be Chinese characters or other characters, such as English characters or French characters.
[0056] In this embodiment, after the characters are finally recognized, natural language can be further used for connection processing according to the context, so as to recognize and obtain more accurate characters.
[0057] The character recognition method based on the stylus in this embodiment can be applied in many scenarios:
[0058] 1. The reporter records the key points of the spokesperson’s answers. During the writing process, this embodiment uses a stylus to record, the recorded content can be converted into an electronic document in time, and a news release can be issued after a slight modification to the electronic document. Real-time news, no need to enter according to documents;
[0059] 2. Students use a stylus to take notes in class, and they can synchronize their notes to mobile phones and other terminals, so that they can view their notes at any time. They don't need to carry a special notebook, and they have obvious advantages in querying and organizing notes;
[0060] 3. The staff use a stylus to make meeting minutes, which can be uploaded to the computer simultaneously, eliminating the need for staff to manually organize the operation after the meeting;
[0061] 4. Using a stylus to write travel notes when going out can save you the trouble of carrying larger electronic devices such as computers, while the input efficiency of small electronic devices such as mobile phones is low.
[0062] Compared with the prior art, this embodiment has built-in related sensing devices in the stylus to sense the handwriting data of the stylus when writing, and extract the digital feature information of each character from the handwriting data during the writing process. , And perform character recognition, which can realize the electronicization of paper documents, which is conducive to the long-term preservation of written content and is convenient for subsequent queries; there is no need to manually enter the written content into computers and other intelligent terminals, which greatly reduces the input work the amount.
[0063] In a preferred embodiment, such as figure 2 Shown in the above figure 1 On the basis of the embodiment, the above step S102 includes:
[0064] Step S1021: Binarize the handwriting data, and discretize the image data obtained after the binarization process to obtain matrix data;
[0065] Step S1022: Perform trajectory segmentation processing on the matrix data;
[0066] Step S1023: Extract the digital feature information of each character in the matrix data after the segmentation process.
[0067] In this embodiment, after acquiring the writing handwriting data of the stylus while writing, noise reduction processing may be performed on the writing handwriting data to remove obvious interference factors. Then use the binarization process to convert the handwriting data into a binarized image with only black (1) and white (0) gray levels. After discretizing the binarized image, it becomes a matrix data of 0 and 1 .
[0068] In this embodiment, an interpolation method can be used to normalize the discretized matrix data, and then the normalized matrix data can be subjected to trajectory segmentation to divide the matrix number corresponding to a single character, using the Gaussian-Hermite equation Perform feature extraction of matrix data, thereby extracting the digital feature information of each character.
[0069] In a preferred embodiment, such as image 3 Shown in the above figure 1 On the basis of the embodiment, the above step S103 includes:
[0070] Step S1031: Obtain the standard feature information of the prestored characters, and calculate the similarity between the digital feature information of each character and the standard feature information;
[0071] Step S1032: Obtain the character corresponding to the standard feature information whose similarity reaches the preset threshold as the character corresponding to the digital feature information of each character.
[0072] In this embodiment, the standard feature information of the pre-stored characters is acquired, the digital feature information of a single character is compared with the standard feature information of the pre-stored characters through the template matching method, and the digital feature information of each character is calculated with the pre-stored character For the similarity of the standard feature information, the character corresponding to the standard feature information whose similarity reaches a preset threshold is taken as the character corresponding to the digital feature information of each character, that is, the written character is recognized.
[0073] In this embodiment, after the characters are finally recognized, natural language may be further used for connection processing according to the context relationship, so as to recognize and obtain more accurate characters.
[0074] In a preferred embodiment, in the above figure 1 On the basis of the embodiment, after step S103, the method further includes: storing the recognized character; and sending the stored character to the terminal.
[0075] In this embodiment, the built-in memory in the stylus can store the recognized characters in the memory, which is beneficial to the long-term storage of the recorded content.
[0076] In addition, the stylus can also have a built-in wireless communication device, such as a built-in Bluetooth module or a near field communication module. When the stylus turns on the communication function, the stored content can be sent to other terminals, and other terminals can display or store for a long time.
[0077] In a preferred embodiment, in the above figure 1 On the basis of the embodiment, before the above step S101, the method further includes: obtaining the pressure value received by the stylus; determining whether the pressure value reaches a preset threshold; when the pressure value reaches the preset threshold, sensing the Acceleration data when the stylus moves in three-axis directions; the handwriting data is generated according to the acceleration data.
[0078] In this embodiment, a pressure sensor, a processor, and an acceleration sensor can be built into the stylus. The acceleration sensor is preferably a three-axis gyroscope, which can collect acceleration data of the stylus in three-axis directions. The pressure value received by the stylus is acquired through the pressure sensor, and the pressure value is sent to the processor. The processor determines whether the pressure value reaches the preset threshold value. If it does not reach the preset threshold value, it determines that the stylus pen is not currently in the writing state. The preset threshold value is used to determine that the stylus is currently in the writing state. When the writing pen is currently in the writing state, the processor sends a signal corresponding to the state to the acceleration sensor to activate the acceleration sensor to collect relevant acceleration data, and then generate handwriting data according to the acceleration data.
[0079] The invention also provides a stylus, such as Figure 4 As shown, in an embodiment, the stylus includes a character recognition module 10, and the character recognition module 10 includes:
[0080] The acquiring unit 101 is configured to acquire handwriting data of the stylus when writing;
[0081] In this embodiment, the stylus has a built-in acceleration sensor. The acceleration sensor can be, for example, a three-axis gyroscope. When the stylus is writing, the acceleration sensor can sense its acceleration in the three-axis direction. The acceleration value can be analyzed to obtain the movement trajectory of the pen tip of the stylus when writing, and the movement trajectory of the pen tip is recorded, and the movement trajectory of the pen tip is used as the writing handwriting data of this embodiment.
[0082] The extraction unit 102 is configured to extract the digital feature information of each character according to the handwriting data;
[0083] In this embodiment, the handwriting data cannot accurately reflect the characters when the user is writing. Therefore, it is necessary to perform corresponding image processing on the handwriting data: Binarize the handwriting data to obtain only black and white. Gray-scale binarized image, and then discretize the binarized image. After the discretization is extracted, the digital feature information of each character in the matrix data is obtained. In this way, the number of characters written by the user is obtained. After the feature information, the digital feature information can be recognized, and the characters written by the user can be obtained more accurately.
[0084] In this embodiment, during the corresponding image processing of the handwriting data, corresponding additional processing can be done. For example, the handwriting data can be denoised first to remove obvious interference factors to improve the extraction. The accuracy of the character’s numerical feature information.
[0085] In addition, this embodiment is not limited to the above-mentioned method of performing corresponding image processing on the handwriting data, and other image processing methods capable of extracting the digital feature information of each character in the handwriting data are all within the protection scope of this embodiment.
[0086] The recognition unit 103 is configured to obtain the standard feature information of the pre-stored characters, and identify the character corresponding to the extracted digital feature information of each character according to the standard feature information.
[0087] In this embodiment, the standard feature information of the pre-stored characters is obtained, the standard feature information is compared with the extracted digital feature information of each character, and the similarity between the two is calculated, and the character corresponding to the standard feature information with the largest similarity is taken as The characters finally recognized in this embodiment are the characters written by the user, and the characters finally recognized are the characters of the electronic file.
[0088] In this embodiment, the recognized characters may be Chinese characters or other characters, such as English characters or French characters.
[0089] In this embodiment, after the characters are finally recognized, natural language may be further used for connection processing according to the context relationship, so as to recognize and obtain more accurate characters.
[0090] The character recognition method based on the stylus pen in this embodiment can be applied in many scenarios:
[0091] 1. The reporter records the key points of the spokesperson’s answers. During the writing process, this embodiment uses a stylus to record, the recorded content can be converted into an electronic document in time, and a press release can be issued after a slight modification to the electronic document. Real-time news, no need to enter according to documents;
[0092] 2. Students use a stylus to take notes in class, and they can synchronize their notes to mobile phones and other terminals, so that they can view their notes at any time. They do not need to carry a special notebook, and they have obvious advantages in querying and organizing notes;
[0093] 3. The staff uses a stylus to make meeting minutes, which can be uploaded to the computer simultaneously, eliminating the need for staff to manually organize the operation after the meeting;
[0094] 4. Using a stylus to write travel notes when going out can save you the trouble of carrying larger electronic devices such as computers, while the input efficiency of small electronic devices such as mobile phones is low.
[0095] Compared with the prior art, this embodiment has built-in related sensing devices in the stylus to sense the handwriting data of the stylus when writing, and extract the digital feature information of each character from the handwriting data during the writing process. , And perform character recognition, which can realize the electronicization of paper documents, which is conducive to the long-term preservation of written content and is convenient for subsequent queries; there is no need to manually enter the written content into computers and other intelligent terminals, which greatly reduces the input work the amount.
[0096] In a preferred embodiment, in the above Figure 4 On the basis of the embodiment, the extraction unit 102 is specifically configured to binarize the writing handwriting data, and discretize the image data obtained after the binarization process to obtain matrix data; Trajectory segmentation processing; extract the digital feature information of each character in the matrix data after segmentation processing.
[0097] In this embodiment, after acquiring the writing handwriting data of the stylus while writing, noise reduction processing may be performed on the writing handwriting data to remove obvious interference factors. Then use the binarization process to convert the handwriting data into a binarized image with only black (1) and white (0) gray levels. After discretizing the binarized image, it becomes a matrix data of 0 and 1 .
[0098] In this embodiment, an interpolation method can be used to normalize the discretized matrix data, and then the normalized matrix data can be subjected to trajectory segmentation to divide the matrix number corresponding to a single character, using the Gaussian-Hermite equation Perform feature extraction of matrix data, thereby extracting the digital feature information of each character.
[0099] In a preferred embodiment, in the above Figure 4 On the basis of the embodiment, the recognition unit 103 is specifically configured to obtain the standard feature information of the pre-stored characters, calculate the similarity between the digital feature information of each character and the standard feature information; to obtain the similarity that reaches the preset threshold The character corresponding to the standard feature information is used as the character corresponding to the digital feature information of each character.
[0100] In this embodiment, the standard feature information of the pre-stored characters is acquired, the digital feature information of a single character is compared with the standard feature information of the pre-stored characters through the template matching method, and the digital feature information of each character is calculated with the pre-stored character For the similarity of the standard feature information, the character corresponding to the standard feature information whose similarity reaches a preset threshold is taken as the character corresponding to the digital feature information of each character, that is, the written character is recognized.
[0101] In this embodiment, after the characters are finally recognized, natural language can be further used for connection processing according to the context, so as to recognize and obtain more accurate characters.
[0102] In a preferred embodiment, such as Figure 5 Shown in the above Figure 4 On the basis of the embodiment, the stylus further includes:
[0103] The storage module 20 is used to store the recognized characters;
[0104] The sending module 30 is used to send the stored characters to the terminal.
[0105] In this embodiment, the built-in storage module 20 in the stylus can store the recognized characters in the memory, which is beneficial to the long-term storage of the recorded content.
[0106] In addition, the stylus can also have a built-in wireless communication device, such as a built-in Bluetooth module or a near field communication module. When the stylus turns on the communication function, the sending module 30 can send the stored content to other terminals, and other terminals can display or long-term storage.
[0107] In a preferred embodiment, such as Image 6 Shown in the above Figure 4 On the basis of the embodiment, the stylus further includes:
[0108] The pressure sensing module 01 is used to obtain the pressure value received by the stylus;
[0109] The processing module 02 is used to determine whether the pressure value reaches a preset threshold;
[0110] The acceleration sensing module 03 is used for sensing acceleration data when the stylus moves in the three-axis direction, if so;
[0111] The generating module 04 is configured to generate the handwriting data according to the acceleration data.
[0112] In this embodiment, the acceleration sensing module 03 is preferably a three-axis gyroscope, which can collect acceleration data of the stylus in the three-axis directions. The pressure value received by the stylus is acquired through the pressure sensing module 01, and the pressure value is sent to the processing module 02. The processing module 02 determines whether the pressure value reaches the preset threshold value. If it does not reach the preset threshold value, it determines whether the stylus pen is currently In the writing state, if the preset threshold is reached, it is determined that the stylus is currently in the writing state. When the writing pen is currently in the writing state, the processing module 02 sends a signal corresponding to the state to the acceleration sensor module 03 to activate the acceleration sensor module 03 to collect relevant acceleration data, and then generate handwriting data based on the acceleration data.
[0113] The above are only the preferred embodiments of the present invention, and do not limit the scope of the present invention. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of the present invention, or directly or indirectly applied to other related technical fields , The same reason is included in the scope of patent protection of the present invention.