Handwriting recognition method, touch display device, computer device and storage medium

By resampling and preprocessing the trajectory points of the character group entered by the user by handwriting, combined with the trained handwriting recognition model, the problem of low line-form text recognition rate and large differences in the recognition rate between devices in the prior art is solved, and a high accuracy and adaptability handwriting recognition method is achieved.

CN113673432BActive Publication Date: 2025-03-04BOE TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110965551.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-23
Publication Date
2025-03-04
Estimated Expiration
2041-08-23

AI Technical Summary

Technical Problem

The existing online handwriting recognition method has a low recognition rate for text appearing in line, and the same online handwriting recognition algorithm has a large difference in recognition rates on different devices.

Method used

Preprocessing is performed by obtaining the sampling points in the writing trajectory of the character group entered by the user through the touch screen, including resampling the track points so that the track point density of each continuous track is equal to the set density value, and finally identifying it using the trained handwriting recognition model.

Benefits of technology

It realizes accurate recognition of character groups entered by the user's handwritten, which has strong operational convenience, high recognition accuracy, and is suitable for terminal devices with multiple sampling rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113673432B_ABST
    Figure CN113673432B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a handwriting recognition method, a touch display device, a computer device and a storage medium. In a specific implementation, the handwriting recognition method includes: obtaining sampling points in the writing trajectory of a character group input by handwriting of a user through a touch screen, determining the trajectory points of the character group, the parameters of the trajectory points include coordinate parameters and time parameters; preprocessing the trajectory points of the character group, including: resampling each continuous trajectory formed by the trajectory points of the character group so that the trajectory point density of each continuous trajectory is equal to a set density value; inputting the trajectory points of the preprocessed character group into a trained handwriting recognition model to identify the character group input by handwriting of the user. The handwriting recognition method of this implementation has the advantages of strong operational convenience, high recognition accuracy, and a wide range of applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of display technology, and more specifically, to a handwriting recognition method, a touch display device, a computer device, and a storage medium. Background Art

[0002] Existing handwriting recognition methods can be divided into offline handwriting recognition methods and online handwriting recognition methods. Offline handwriting recognition is based on pictures of handwritten text, and performs text recognition on picture data. It supports the recognition of handwritten Chinese, English, letters, numbers, and common characters in the entire picture text in multiple scenes and any layout, and does not rely on the standardization of stroke order. Online handwriting recognition is based on the sequence trajectory points collected by the handwriting device. The input data contains stroke order information, and the single word recognition accuracy is relatively high. However, the existing online handwriting recognition methods have a low recognition rate for text that appears in the form of lines, and the recognition rate of the same online handwriting recognition algorithm varies greatly on different devices. Summary of the invention

[0003] The object of the present invention is to provide a handwriting recognition method, a touch display device, a computer device and a storage medium to solve at least one of the problems existing in the prior art.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] A first aspect of the present invention provides a handwriting recognition method, comprising:

[0006] Acquire sampling points in the writing trajectory of the character group input by the user through the touch screen, and determine the trajectory points of the character group, wherein the parameters of the trajectory points include coordinate parameters and time parameters;

[0007] Preprocessing the trajectory points of the character group includes: resampling each continuous trajectory formed by the trajectory points of the character group so that the trajectory point density of each continuous trajectory is equal to a set density value;

[0008] The trajectory points of the preprocessed character group are input into the trained handwriting recognition model to recognize the character group input by the user's handwriting.

[0009] Optionally, the method further includes:

[0010] Acquire sampling points in the writing trajectory of multiple character group training samples, and determine the trajectory points of the character group training samples, wherein the parameters of the trajectory points include coordinate parameters and time parameters;

[0011] Preprocessing the trajectory points of the plurality of character group training samples respectively includes: resampling each continuous trajectory formed by the trajectory points of the character group training samples so that the trajectory point density of each continuous trajectory is equal to a set density value;

[0012] The handwriting recognition model is obtained by training the trajectory points of the preprocessed multiple character group training samples.

[0013] Optionally, the method further includes:

[0014] Get multiple character group training samples, including:

[0015] Establishing a character library, wherein for each character in the character library, obtaining characters inputted by handwriting by multiple persons through a touch screen;

[0016] For multiple sentences in the sentence dictionary, a character is randomly selected from characters input by handwriting of multiple people through the touch screen to form each sentence, so as to obtain multiple character group training samples.

[0017] Optionally, the preprocessing of the trajectory points of the character group further includes: before the resampling, normalizing the overall size of the trajectory points of each row of characters in the character group based on coordinate parameters.

[0018] Optionally, the normalizing the overall size of the trajectory points of each row of characters in the character group based on coordinate parameters includes: normalizing the overall size of the trajectory points of each row of characters based on coordinate parameters based on extreme values ​​of coordinate parameters of each trajectory point of each row of characters.

[0019] Optionally, the preprocessing of the trajectory points of the plurality of character group training samples further comprises: before the resampling, normalizing the overall size of the trajectory points of each row of characters in the character group training samples based on coordinate parameters.

[0020] Optionally, the normalizing the overall size of the trajectory points of each row of characters in the character group training sample based on coordinate parameters includes: normalizing the overall size of the trajectory points of each row of characters in the character group training sample based on coordinate parameters based on the extreme values ​​of the coordinate parameters of each trajectory point in each row of characters in the character group training sample.

[0021] Optionally, resampling each continuous trajectory formed by the trajectory points of the character group so that the trajectory point density of each continuous trajectory is equal to a set density value comprises:

[0022] Obtaining the number of trajectory points contained in each continuous trajectory formed by the trajectory points of the character group;

[0023] Calculating the trajectory point density of the continuous trajectory according to the length of the continuous trajectory and the number of trajectory points included;

[0024] Determine the relationship between the trajectory point density of the continuous trajectory and the set density value: if the trajectory point density of the continuous trajectory is greater than the set density value, downsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value; if the trajectory point density of the continuous trajectory is less than the set density value, upsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value.

[0025] Optionally, resampling each continuous trajectory formed by the trajectory points of the character group training sample so that the trajectory point density of each continuous trajectory is equal to a set density value comprises:

[0026] Obtaining the number of trajectory points contained in each continuous trajectory formed by the trajectory points of the character group training sample;

[0027] Calculating the trajectory point density of the continuous trajectory according to the length of the continuous trajectory and the number of trajectory points included;

[0028] Determine the relationship between the trajectory point density of the continuous trajectory and the set density value: if the trajectory point density of the continuous trajectory is greater than the set density value, downsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value; if the trajectory point density of the continuous trajectory is less than the set density value, upsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value.

[0029] Optionally, the preprocessing of the trajectory points of the character group further includes:

[0030] The trajectory points of the character group after continuous trajectory resampling are subjected to overall angle correction.

[0031] Optionally, the preprocessing of the trajectory points of the plurality of character group training samples respectively further comprises:

[0032] The trajectory points of the character group training samples after continuous trajectory resampling are subjected to overall angle correction.

[0033] Optionally, the handwriting recognition model is a handwriting recognition model based on a bidirectional long short-term memory network.

[0034] Optionally, the handwriting recognition model based on the bidirectional long short-term memory network includes a feature extraction module and a fully connected module connected in series, the feature extraction module includes a plurality of feature extraction unit modules connected in series, and the feature extraction unit includes a bidirectional long short-term memory network and a random inactivation layer connected in series.

[0035] Optionally, the feature extraction module includes four feature extraction units connected in series.

[0036] A second aspect of the present invention provides a touch display device, comprising:

[0037] An acquisition module, used to acquire sampling points in the writing trajectory of a character group input by a user through handwriting on a touch screen, determine the trajectory points of the character group and related parameters of each trajectory point, wherein the related parameters include coordinate parameters and time parameters;

[0038] A preprocessing module, used for preprocessing the trajectory points of the character group, including: resampling each continuous trajectory formed by the trajectory points of the character group so that the trajectory point density of each continuous trajectory is equal to a set density value;

[0039] The recognition module is used to input the pre-processed trajectory points into the trained handwriting recognition model to recognize the character group input by the user's handwriting.

[0040] A third aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect of the present invention when executing the program.

[0041] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect of the present invention.

[0042] The beneficial effects of the present invention are as follows:

[0043] The technical solution of the present invention determines the trajectory points including the position parameters and the time parameters according to the writing trajectory of the character group input by the user, pre-processes the trajectory points to obtain the processed trajectory point density consistent with the set density value, realizes the trajectory point density of the character group represented by the pre-processed unified trajectory point density, and recognizes the pre-processed trajectory point density using the handwriting recognition model to obtain the character group input by the user. The handwriting recognition method of the present invention can recognize the character group input by the user's handwriting, has the advantages of strong operation convenience, high recognition accuracy, and is applicable to terminal devices with multiple sampling rates, and has a wide range of application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.

[0045] Figure 1 A schematic diagram showing an exemplary application scenario of the handwriting recognition method according to an embodiment of the present invention in practical application;

[0046] Figure 2 An overall flow chart showing a handwriting recognition method according to an embodiment of the present invention;

[0047] Figure 3A flowchart showing step S210 in one embodiment of the present invention;

[0048] Figure 4 A flowchart showing step S211 in one embodiment of the present invention;

[0049] Figure 5 A schematic diagram of a character library formed by handwriting inputs from different users in a specific example of an embodiment of the present invention;

[0050] Figure 6 A schematic diagram showing a line character group handwritten by a user displayed on a smart phone according to a specific example of an embodiment of the present invention;

[0051] Figure 7 A flowchart showing step S213 in one embodiment of the present invention;

[0052] Figure 8 A flowchart showing step S2132 in one embodiment of the present invention;

[0053] Fig. 9 A structural framework diagram showing a handwriting recognition model according to an embodiment of the present invention;

[0054] Fig.10 A schematic diagram showing a specific example of an embodiment of the present invention in which a user inputs a character group by handwriting on a smart phone;

[0055] Fig.11 A flow chart showing step S23 in one embodiment of the present invention;

[0056] Fig.12 A flowchart showing step S232 in one embodiment of the present invention;

[0057] Fig.13 A schematic diagram showing a frame of a touch display device according to another embodiment of the present invention;

[0058] Fig.14 A schematic diagram showing the structure of a computer system according to another embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to explain the present invention more clearly, the present invention is further described below in conjunction with embodiments and drawings. Similar components in the drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the content specifically described below is illustrative rather than restrictive, and the protection scope of the present invention should not be limited thereto.

[0060] In the prior art, with the emergence and increasing application of mobile terminal devices such as pen computers, PDAs and mobile phones, handwriting recognition methods have received more and more attention. Compared with the common screen and keyboard input method, handwriting input technology allows users to switch input devices, input modes or input software without switching, providing a more convenient and effective way for people who do not know how to use input methods, people who are not used to using keyboards, and situations where there is no keyboard or the keyboard is very small (such as handheld mobile terminals).

[0061] The character recognition accuracy and speed of handwriting recognition methods have a great impact on pen input technology. Common handwriting recognition methods can quickly realize single-word recognition, that is, in response to user handwriting input, recognize the input of a single character, and then recognize and give candidate recognition results for the user to choose, which greatly limits the recognition method and recognition accuracy.

[0062] Furthermore, the recognition rates of the handwriting recognition methods in the prior art vary greatly when used in different terminal devices. For example, the three different online handwriting devices, namely, smart phones, handwriting tablets, and large-screen display terminals, have different touch screen sizes and are likely to use different processors. In this case, it is difficult to use the same handwriting recognition method to be compatible with the above-mentioned different devices to achieve character recognition with a higher accuracy.

[0063] The inventor believes that the main reason for the above problems in the handwriting recognition method is that different terminal devices obtain different sampling rates of the track points of the user's handwriting input, resulting in large differences in the track point data input during recognition, which results in the same handwriting recognition method being incompatible with different terminal devices and having a low recognition rate. In view of this, the inventor proposes a handwriting recognition method, a touch display device, a computer device, and a storage medium to solve at least one of the above problems.

[0064] An embodiment of the present invention provides a handwriting recognition method, comprising the following steps:

[0065] Acquire sampling points in the writing trajectory of the character group input by the user through the touch screen, and determine the trajectory points of the character group, wherein the parameters of the trajectory points include coordinate parameters and time parameters;

[0066] Preprocessing the trajectory points of the character group includes: resampling each continuous trajectory formed by the trajectory points of the character group so that the trajectory point density of each continuous trajectory is equal to a set density value;

[0067] The trajectory points of the preprocessed character group are input into the trained handwriting recognition model to recognize the character group input by the user's handwriting.

[0068] In an embodiment of the present invention, a user can input a character group by handwriting through a touch screen. The characters in the embodiment of the present invention can be understood as a single Chinese character, a single letter, a symbol, etc. written by the user, and a character group can be understood as a phrase, a word, a Chinese and English sentence with punctuation marks, etc. formed by multiple characters input by the user, wherein the character group input by the user may contain a line of characters or multiple lines of characters (if input vertically in the form of ancient Chinese, it can be understood as multiple lines of characters with one character per line). In a specific example, when a smart phone is used as a terminal device for handwriting input, when a user inputs a Chinese sentence through the touch screen of the smart phone, each Chinese character and punctuation mark is a character, and all Chinese characters form a character group, which is a character group.

[0069] Therefore, the embodiment of the present invention determines the trajectory points including the position parameters and the time parameters according to the writing trajectory of the character group input by the user, pre-processes the trajectory points to obtain the processed trajectory point density consistent with the set density value, and realizes the trajectory point density of the character group represented by the pre-processed unified trajectory point density, and recognizes the pre-processed trajectory point density using the handwriting recognition model to obtain the character group input by the user. The handwriting recognition method of the embodiment of the present invention can accurately recognize the character group input by the user's handwriting, has the advantages of strong operational convenience and high recognition accuracy, and can be applied to terminal devices of various models, touch screen sizes, and touch screen sampling rates, and has broad application prospects.

[0070] In order to facilitate understanding of the technical solution of this embodiment, Figure 1 The practical scenario of the above method provided in this embodiment is described. Figure 1 , the scenario includes a training server 110 and a terminal device 120. In this embodiment, the training server 110 first uses the character group training samples to train the neural network for identifying the character group trajectory points to obtain a trained handwriting recognition model. The terminal device 120 of any model, touch screen size, and touch screen sampling rate can use the handwriting recognition model trained by the training server 110 to perform handwriting input character group recognition and obtain recognition results of the user's handwritten input phrases, words, and sentences.

[0071] like Figure 1 As shown, the terminal device 120 may include a terminal device with a touch display function such as a smart phone, a handwriting tablet, a pen computer, and a large-screen display terminal. It should be noted that Figure 1 In actual applications, the training server 110 and the terminal device 120 may be independent devices or terminal devices integrated with model training functions and recognition functions. When they are two independent devices, the training server and the terminal device may communicate via a network, which may include various connection types, such as wired or wireless communication links or optical fiber cables.

[0072] Next, the training process of the handwritten recognition model applied to the training server and the entire process of using the trained handwritten recognition model will be described.

[0073] As Figure 2 shown, an embodiment of the present invention provides a handwritten recognition method, including the following steps:

[0074] S210. Obtain a plurality of character group training samples and train a handwritten recognition model according to the character group training samples.

[0075] In an optional embodiment, as Figure 3 shown, step S210 includes:

[0076] S211. Obtain a plurality of character group training samples.

[0077] Exemplarily, as Figure 4 shown, step S211 includes:

[0078] S2111. Establish a character library. For each character in the character library, respectively obtain the characters handwritten by multiple people through a touch screen. Among them, when multiple people handwrite characters, they can use touch screens of various types, sizes, and resolutions, such as smartphones, handwriting tablets, pen computers, and large-screen display terminals, etc.

[0079] In this step, the character library of the embodiment of the present invention includes common Chinese characters, English letters, numbers, and symbols. For example, the first-level Chinese character library, common characters in the second-level Chinese character library, common characters in the third-level Chinese character library, numbers, letters, symbols, etc. that can be used in normal life. The character library of the embodiment of the present invention includes but is not limited to the above character libraries. For users with special needs, such as traditional Chinese character users, researchers, or foreign users, etc., the characters in the character library are different. Those skilled in the art should be able to establish corresponding character libraries according to actual applications, which will not be elaborated here.

[0080] For each character in the aforementioned character library, for example, if the character library includes M characters, collect the writing characters of N users for the M characters, thereby constructing an N*M single-character character library. In a specific example, during the process of collecting single-character characters, users can be required to write the characters in the character library in different writing styles, such as regular script, running script, and cursive script, etc., to further construct a character library with different fonts and various features, realizing the diversification of the character library. In a specific example, as Figure 5 shown, users A to C respectively handwrite the same character group "one, two, three, four", thereby being able to obtain 12 different single-character character libraries.

[0081] S2112. For multiple sentences in the sentence dictionary, randomly select one character from the characters handwritten by multiple people through the touch screen for each sentence to form multiple character group training samples. It can be understood that the character group training samples can contain one line of characters or multiple lines of characters. Based on the single-character library obtained in step S2111, step S2112 can further generate a character group library of character groups using the character library.

[0082] Specifically, the association relationship between single characters can be obtained using the sentence dictionary, such as common phrases, network vocabulary, literary works, etc. composed of single characters. For example, the frequency of each character used in the sentence dictionary can be counted. When the frequency of a certain single character is relatively low, the common phrases, network vocabulary, and literary works associated with this single character can be further collected and added to the sentence dictionary as new sentences to expand the sentence dictionary until the frequency of all characters meets the set requirements. In this way, it can ensure the balanced distribution of single characters in the sentence dictionary, making the samples of single characters forming sentences sufficient, and thus achieving sufficient sentences in the sentence dictionary.

[0083] Furthermore, use the sentence dictionary to generate a line character word library. Randomly select single characters of different handwriting writers associated with each other from the single-character library, and splice these characters to obtain the sentences in the sentence dictionary, thereby obtaining a character group word library. Then, the obtained character group word library can be used as a character group training sample for training a handwriting recognition model.

[0084] Each single character in the sentence in the embodiment of the present invention is randomly selected from the aforementioned single-character library, that is, the handwriting writer of each single character may be different users or different fonts. For example, the phrase in the sentence dictionary is "one, two, three", and the character group is composed of the single character "one", the single character "two", and the single character "three". During the process of randomly splicing and selecting single characters, the first single character "one" may be handwritten by user C, the single character "two" may be handwritten by user B, and the second single character "three" may be handwritten by user A.

[0085] The main difficulty affecting the handwriting recognition method lies in the insufficient character group training samples, the lack of diversity in the samples, and the unbalanced character distribution, resulting in the difficulty for the handwriting recognition model to learn diverse character features during the training process, causing the problem of low recognition accuracy of the handwriting recognition model. However, the process of forming a single-character library, a sentence dictionary, and a character group library as training samples in the above embodiments of the present invention fully realizes the diversification of feature, combination, and balanced distribution of the training samples, effectively ensuring the recognition accuracy of the handwriting recognition model.

[0086] After obtaining multiple character group training samples, the obtained character group word library can be used as a training sample to train and generate a handwriting recognition model:

[0087] S212. Obtain sampling points in the writing trajectories of multiple character group training samples, and determine the trajectory points of the character group training samples. The parameters of the trajectory points include coordinate parameters and time parameters.

[0088] Specifically, during the process where multiple users handwrite characters or character groups for establishing a character library through their respective touchscreens, the touchscreen samples the touched trajectory in real time at a preset frequency, thereby obtaining sampling points of the writing trajectories of single-character or character-group handwritten inputs. Based on the sampling points collected during the user's handwriting process, the trajectory points of the characters written by the user relative to the touchscreen input interface can be determined. By using the coordinate parameters and time parameters of the trajectory points, the trajectories of all characters in the entire character group training sample can be determined.

[0089] As Figure 6 shown, taking the example of a user handwriting characters through a smartphone with touch display function, Figure 6 the dotted line area of the shown smartphone is the input handwriting area. When the user performs handwriting input, the user conducts handwriting input within this dotted line area. Therefore, the area where the dotted line box is located is used as the coordinate area, and the shown Figure 6 X-axis and Y-axis are used as the coordinate system. At this time, the position of the trajectory point on the input interface can be represented by two-dimensional coordinates (x, y).

[0090] The user writes a line character group "one, two, three, four" ([[]] Figure 6 In this case, the character group formed by the characters "one, two, three, four" is a single-line character group, simply referred to as a line character group) in the handwriting area of the touchscreen. Taking the single character "one" as an example, during the process from the start of handwriting to the end of input of this character, at the preset sampling frequency, multiple sampling points corresponding to this writing trajectory will be obtained. The sampling points include time parameters during the acquisition process (for example, the sampling moment, which can be represented by the absolute value of time, the relative value of time, or the time difference from the previous sampling point). For the writing trajectory of this character displayed on the touchscreen display interface, each sampling point corresponds to a trajectory point on the writing trajectory, including coordinate parameters (for example, coordinate values (x, y)). Therefore, during the process of the user handwriting the character group "one, two, three, four", the trajectory points and related parameters of each character in the entire character group can be obtained. Thus, when randomly selecting characters from the character library to form sentences in the sentence dictionary to form a character group training sample, the coordinate parameters and time parameters of the trajectory points of the entire character group training sample can be obtained based on the coordinate parameters and time parameters of the trajectory points included in each character.

[0091] S213. Preprocess the trajectory points of the multiple character group training samples respectively.

[0092] In a possible implementation manner, as Figure 7As shown, step S213 includes:

[0093] S2131. Normalize the overall size of the trajectory points of each row of characters in the character group training sample based on coordinate parameters.

[0094] Further, step S2131 includes:

[0095] Based on the extreme values ​​of the coordinate parameters of the trajectory points of each row of characters in the character group training sample, the overall size of the trajectory points of each row of characters in the character group training sample is normalized based on the coordinate parameters.

[0096] Exemplarily, according to the coordinate parameters of the trajectory points in the character group training sample obtained in step S212, the extreme values ​​of the coordinate parameters in all the trajectory points contained in each line of characters in the character group training sample can be obtained, and the extreme values ​​of the coordinate parameters corresponding to each line of characters in the character group training sample can be obtained. Based on this, the overall size of the trajectory points of each line of characters in the character group training sample is normalized. For example, the extreme values ​​of the coordinate parameters corresponding to each line of characters are the minimum and maximum values ​​in the coordinates of the Y-direction trajectory points and the minimum and maximum values ​​in the coordinates of the X-direction trajectory points of each trajectory point contained in each line of characters. Thus, the overall size of each line of characters in the character group training sample can be obtained. Further, after the overall size of each line of characters in the character group training sample is obtained, each line of characters in the character group training sample is subjected to standardization processing, that is, normalization processing based on the coordinate parameters. Specifically, the embodiment of the present invention is provided with a preset standard size of a character group training sample, for example, the preset standard size in the X direction and the Y direction is N*10 pixels and 10 pixels (10 pixels represent that the preset standard size of a single character is width (X direction—row direction)*height (Y direction—column direction) of 10*10 pixels, and N indicates the number of characters contained in the row of characters), and the overall size of a row of characters in a character group training sample obtained according to the extreme values ​​of the aforementioned coordinate parameters is 2000 pixels in the X direction and 100 pixels in the Y direction, then the overall size of the row of characters can be standardized to 200 pixels in the X direction and 10 pixels in the Y direction, thereby realizing the normalization of the overall size. In the normalization process, all coordinate parameters of all trajectory points need to be normalized to ensure the authenticity of the writing trajectory.

[0097] S2132, resample each continuous track formed by the track points of the normalized character group training sample so that the track point density of each continuous track is equal to the set density value, thereby achieving standardization or unification of the continuous tracks in the character group training sample.

[0098] For example, Figure 8 As shown, step S2132 includes:

[0099] S21321. Obtain the number of trajectory points included in each continuous trajectory formed by the trajectory points of the normalized character group training samples.

[0100] Specifically, taking the touch screen as the handwritten keyboard input area of the mobile phone as an example, the continuous trajectory in the embodiments of the present invention is defined as the trajectory formed in the input area in a state of uninterrupted time. In a specific example, as Figure 5 shown by the characters handwritten by different users in the character library, the character "one" is continuously written by user A from the start of writing to the end of writing. That is to say, at this time, the "one" is a stroke and is included in the range of the continuous trajectory.

[0101] In another specific example, as Figure 5 shown, although the character "two" is composed of two strokes "horizontal" in regular script, when user A inputs, the short horizontal and the long horizontal are continuously input. That is, during the process of the user from this time of starting to write to this time of lifting the pen and completing the writing of the character or stroke, the user is in a continuous writing state throughout the time period, and the formed trajectory is a continuous trajectory.

[0102] In another specific example, as Figure 5 shown, when user C is writing the stroke "horizontal fold " of the single-character "four", the user first forms a pause at the bend of this stroke and then forms a vertical stroke. At this time, this stroke is from "horizontal", "pause and bend" to "vertical" to complete the whole "horizontal fold ". During this process, the time at the pause is not continuous. Therefore, the "horizontal fold " written by the user in this state is two continuous trajectories.

[0103] Differently, Figure 5 the "horizontal fold " written by another user A as shown is a similar cursive writing, that is, it is continuously formed in time. There is no pause at the bend, and this stroke is directly formed. At this time, it is a continuous trajectory. Therefore, the continuous trajectory in the embodiments of the present invention is a stroke continuously formed in time, which includes but is not limited to cursive writing. Each continuous trajectory can characterize the characteristics of the user's written characters and can improve the accuracy of the handwritten recognition model. In a specific example, the embodiments of the present invention also eliminate the trajectory points located at the same coordinates in the same continuous trajectory to improve the processing speed and accuracy of the trajectory points.

[0104] S21322. Calculate the trajectory point density of the continuous trajectory according to the length of the continuous trajectory formed by the trajectory points of the normalized character group training samples and the number of trajectory points included.

[0105] In this step, the embodiment of the present invention uses the coordinate parameters of the trajectory points to obtain the length of the continuous trajectory. The length in the embodiment of the present invention is not the sum of the starting distances obtained from the coordinate parameters of the starting trajectory point and the ending trajectory point of the continuous trajectory. That is to say, the length of the continuous trajectory in the embodiment of the present invention is the sum of the distances between adjacent trajectory points in a continuous time period. Using the length of the continuous trajectory and the number of trajectory points on this length, the trajectory point density of the current continuous trajectory can be determined, and thus the relationship between the density of the current continuous trajectory and the density of the standardized continuous trajectory can be determined according to the trajectory point density.

[0106] In a specific example, as Figure 5 shown, the character "two" written by user C in the character library includes two continuous trajectories, namely "short horizontal stroke" and "long horizontal stroke". Then, the trajectory point density of each continuous trajectory is calculated respectively. For example, the length of the continuous trajectory of the "short horizontal stroke" is the length of the entire continuous trajectory from the starting point to the ending point among its trajectory points, including the arc length during handwriting. The trajectory point density is the continuous trajectory length divided by the number of trajectory points.

[0107] And as Figure 5 shown, the character "two" written by user B in the character library is an overall continuous trajectory. Therefore, the entire character "two" is a continuous trajectory. The length of this continuous trajectory includes the lengths corresponding to all the trajectories from the trajectory point at the start of the short horizontal stroke to the end point of the long horizontal stroke. That is to say, it also includes the length of the trajectory corresponding to the connecting stroke between the short horizontal stroke and the long horizontal stroke. The length of this continuous trajectory is the short horizontal stroke trajectory length + connecting stroke trajectory length + long horizontal stroke trajectory length, and the density is this length divided by the number of trajectory points corresponding to this length.

[0108] S21323. Judge the relationship between the trajectory point density of the continuous trajectory and the set density value: If the trajectory point density of the continuous trajectory is greater than the set density value, downsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value; if the trajectory point density of the continuous trajectory is less than the set density value, upsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value.

[0109] The embodiment of the present invention uses the trajectory point density determined in the foregoing step S21322 to make a judgment with the set density value, and performs standardization processing on the continuous trajectory corresponding to the trajectory point density that does not conform to the judgment principle, so as to realize the standardization and normalization of the continuous trajectory.

[0110] Specifically, taking the previously determined trajectory point density as an example, if the set density value is 30, the continuous trajectory "horizontal fold " has a trajectory point density value of 25, which is less than the set density value of 30, indicating that the trajectory points currently obtained according to the sampling points may not be able to characterize all the features of the continuous trajectory. Therefore, the embodiment of the present invention further upsamples the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value. In a specific example, upsampling includes trajectory point interpolation processing. For example, for "horizontal fold When the trajectory point density value of " is 25 and is less than the set density value of 30, 5 interpolation points need to be added. At this time, one interpolation point can be added for every 5 trajectory points to achieve a uniform distribution of interpolation points and further improve the recognition accuracy.

[0111] In another specific example, if the set density value is still 30, the trajectory point density value of the continuous trajectory "short horizontal" is 35, which is greater than the set density value 30, indicating that the trajectory points currently obtained based on the sampling points can already characterize all the features of the continuous trajectory, and the current trajectory points are already in a redundant state, which affects the recognition speed. Therefore, the embodiment of the present invention further downsamples the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value. In a specific example, downsampling can be achieved by deleting trajectory points. For example, the trajectory point density value of the continuous trajectory "short horizontal" needs to delete 5 trajectory points. One trajectory point can be deleted for every 5 or 6 trajectory points to achieve a uniform distribution of trajectory points. On the basis of ensuring the recognition accuracy, the recognition speed is further ensured.

[0112] S2133, performing overall angle correction on the trajectory points of the character group training sample after continuous trajectory resampling, so that all characters in the character group training sample are in a horizontal direction based on the coordinate system, for example, parallel to the X direction. In a specific example, the angle correction of the tilted characters in the character group training sample can be performed by Hough transform to achieve overall angle correction of the trajectory points in the entire character group training sample.

[0113] It should be noted that the key step in the preprocessing step S213 is the resampling step S2132, while the normalization step S2131 and the angle correction step S2133 are respectively preferred steps.

[0114] S214, obtaining a handwriting recognition model by training using the trajectory points of the preprocessed multiple character group training samples.

[0115] After the above steps, multiple character group training samples of the embodiment of the present invention can be obtained, and the samples have the characteristics of feature diversity, high feature accuracy and balanced feature distribution. By using the training samples of the embodiment of the present invention, a handwriting recognition model with fast recognition speed and high accuracy can be obtained.

[0116] In an optional embodiment, the handwriting recognition model is a handwriting recognition model based on a bidirectional long short-term memory network.

[0117] Long-Short Term Memory (LSTM) is a time recursive neural network suitable for processing and predicting important events with very long intervals and delays in time series. Bi-LSTM (BiLong-Short Term Memory) is a network that implements bidirectional memory based on LSTM. The handwriting recognition model established by the embodiment of the present invention using the Bi-LSTM can quickly and accurately recognize the character group training samples input by the user through the touch screen, realize the rapid recognition of the character group training samples, and have more accurate recognition performance.

[0118] In an optional embodiment, if Fig. 9 As shown, the handwriting recognition model based on the bidirectional long short-term memory network includes a series-connected feature extraction module and a fully connected module, the feature extraction module includes a plurality of series-connected feature extraction units, and the feature extraction unit includes a series-connected bidirectional long short-term memory network and a random inactivation layer.

[0119] In the embodiment of the present invention, the input end of the feature extraction module is used as the input end of the handwriting recognition model, the output end of the feature extraction module is connected to the input end of the fully connected module, and the output end of the fully connected module is used as the output end of the handwriting recognition model.

[0120] The training samples of the character group training samples are input to the input end of the feature extraction module. The feature extraction module extracts and classifies all the features included in the training samples. The feature extraction modules of the embodiment of the present invention are set to multiple to ensure the accuracy of feature extraction. In an optional embodiment, the feature extraction module includes four feature extraction units connected in series, which can achieve rapid convergence of the handwriting recognition model on the basis of ensuring the recognition accuracy of the character group training samples, further improve the recognition speed, and achieve the optimal design of recognition accuracy and recognition speed.

[0121] Furthermore, in an embodiment of the present invention, the feature extraction unit includes a bidirectional long short-term memory network and a random inactivation layer connected in series. In an embodiment of the present invention, by connecting the bidirectional long short-term memory network in series with the random inactivation layer, the neurons corresponding to the preset proportion can be randomly frozen during the training of the bidirectional long short-term memory network to suppress overfitting. In a specific example, the random inactivation layer can be a Dropout layer, which can randomly make neurons of certain hidden layer nodes in the bidirectional long short-term memory network not work, eliminate the weakened joint adaptability between neuron nodes, enhance the generalization ability, and prevent the model from overfitting. The Dropout layer can ensure that the handwriting recognition model maintains accuracy when an individual clue is lost, and can reduce weight connections to increase the robustness of the handwriting recognition model in the absence of individual connection information.

[0122] In an embodiment of the present invention, the fully connected layer synthesizes the features extracted by the feature extraction module and integrates the feature information with category distinction. In an embodiment of the present invention, the fully connected module includes two fully connected layers in series, one of which is connected to the output end of the feature extraction unit, and can further enhance the features extracted by the feature extraction unit. For example, the fully connected layer can enhance the feature channel of 256 to the feature channel of 512. The other fully connected layer is connected to the previous fully connected layer, and the category probability of each character is calculated using the excitation function to achieve category integration. The handwriting recognition model of the embodiment of the present invention thus formed has high recognition accuracy and fast recognition speed.

[0123] On the basis of the above step S210 (i.e., on the basis of completing the training phase process), the following steps S220-S240 (i.e., executing the recognition phase process) are executed, and the handwriting recognition model obtained in the embodiment of the present invention can be used to recognize the character group input by the user through the touch screen. From the perspective of a terminal device with data processing capability, for example, the terminal device is a smart phone with a touch display function, and the smart phone uses the trained handwriting recognition model to recognize the character group training sample input by the user through handwriting, that is, the handwriting recognition model of the embodiment of the present invention is applied to Figure 1 Taking the scenario shown as an example, the process of the identification phase in this embodiment is as follows:

[0124] S220, obtaining sampling points in the writing trajectory of the character group input by the user through handwriting on the touch screen, and determining the trajectory points of the character group, wherein the parameters of the trajectory points include coordinate parameters and time parameters.

[0125] Specifically, the acquisition module samples the trajectory displayed on the touch screen at a preset frequency in real time to obtain multiple sampling points of the writing trajectory of single-word characters or character groups input by handwriting. According to the sampling points collected during the user's handwriting process, the trajectory points of the character group written by the user relative to the touch screen input interface can be determined, and the coordinate parameters and time parameters of the trajectory points can be used to determine the trajectories of all characters in the entire character group.

[0126] In a specific example, Fig.10 The dashed line of the smartphone shown is the handwriting area for inputting character groups. When the user performs handwriting input in the dashed line area, the area where the dashed line box is located is used as the coordinate area. Fig.10 The X-axis and Y-axis are shown as the coordinate system. At this time, the position of each trajectory point of the character group in the input interface can be represented by a two-dimensional coordinate (x, y). It is worth noting that the coordinate system is only an exemplary way to locate the character in the coordinate area. In actual applications, the coordinate system may not be displayed in the handwriting input interface.

[0127] like Fig.10 As shown, user A uses a smart phone to perform handwriting input in the handwriting area of ​​the handwriting input interface (the dotted box area in the figure), and the character group of the handwriting input is "eight, nine, ten". Taking the single character "eight" as an example, in the process from the beginning of handwriting to the end of input of this character, at a preset sampling frequency, multiple sampling points corresponding to the writing trajectory are obtained, and the sampling points include time parameters in the acquisition process. For the writing trajectory of the character displayed on the touch screen display interface, each sampling point corresponds to the trajectory point of the writing trajectory, including coordinate parameters and time parameters. The coordinate parameters and time parameters of the trajectory point are respectively the coordinate points of the sampling point in the coordinate system of the working surface of the mobile phone. The time parameter is, for example, the absolute value of the time of each sampling point where writing occurs, the relative value of the time, or the time difference between the sampling point and the previous sampling point. The principles of the sampling points and trajectory points of the characters "nine" and "ten" in the character group are the same, and will not be repeated here.

[0128] S230: Preprocess the trajectory points of the character group (the character group input by the user through handwriting on the touch screen).

[0129] For example, Fig.11 As shown, step S230 includes:

[0130] S231, normalizing the overall size of the trajectory points of each row of characters in the character group based on coordinate parameters.

[0131] Further, step S231 includes:

[0132] Based on the extreme values of the coordinate parameters of each trajectory point of each line of characters, the overall size of the trajectory points of each line of characters is normalized based on the coordinate parameters.

[0133] Exemplarily, since the coordinate parameters of the trajectory points in the character group have been obtained in step S220, based on Fig.10 the shown coordinate system, the extreme values of the coordinate parameters among all the trajectory points of the character group can be obtained. For example, the minimum and maximum values of the trajectory point coordinates in the Y direction, and the minimum and minimum values of the trajectory point coordinates in the X direction, so that the overall size of the character group handwritten by the user on the mobile input interface can be obtained, that is, the overall size of the character group in the input area, as Fig.10 shown by the solid rectangle frame. Further, after obtaining the overall size of the character group, the entire character group is standardized, that is, normalized processing based on the coordinate parameters.

[0134] Specifically, the embodiment of the present invention sets a preset standard size for the character group. For example, the preset standard sizes in the X direction and Y direction are N*10 pixels and 10 pixels (10 pixels represents that the preset standard size of a single character is 10*10 pixels in width (X direction - row direction) * height (Y direction - column direction), and N indicates the number of characters included in the row of characters). And if the overall size of a certain row of characters in the character group obtained according to the foregoing coordinate parameter extreme values is 3000 pixels in the X direction and 100 pixels in the Y direction, then the overall size of this row of characters can be standardized to 300 pixels in the X direction and 10 pixels in the Y direction, realizing the normalization of the overall size. In this normalization process, all the coordinate parameters of all the trajectory points need to be normalized to ensure the authenticity of the writing trajectory. In another specific example, the embodiment of the present invention does not limit the preset standard size in the X direction. In this way, the user can determine the horizontal spacing between characters in the character group according to his own handwriting habit, improving the user experience.

[0135] S232. Resample each continuous trajectory formed by the trajectory points of the normalized character group so that the trajectory point density of each continuous trajectory is equal to the set density value, thereby realizing the standardization or unification of the continuous trajectories in the character group based on the sampling density.

[0136] Exemplarily, as Fig.12 shown, step S232 includes:

[0137] S2321. Obtain the number of trajectory points included in each continuous trajectory formed by the trajectory points of the normalized character group.

[0138] The continuous trajectory in the embodiment of the present invention is defined as the trajectory formed in the input area in a state of uninterrupted time. In a specific example, as Fig.10 shown, when the user writes the character "八" in the handwritten character group, the radicals forming the character "八" include "丿" and As can be seen from Fig.10 , when the user inputs this character, there is no continuity between the two radicals, that is, the character "八" is not a continuous trajectory. Further, during the writing process, that is, from the first time the user puts the pen down to the time of lifting the pen this time, the trajectory "丿" can be formed in a continuous time period. Therefore, the trajectory "丿" is a continuous trajectory. Similarly, the trajectory can also be obtained during the continuous handwritten input time of the user and is a continuous trajectory.

[0139] In another specific example, as Fig.10 shown, when the user writes the stroke of the single-character "九", when the user forms a pause first and then a hook at the bend of this stroke, then at this time this stroke is from the horizontal "一", "pause and bend" to the oblique hook to complete the entire process, the time at the pause is not continuous. Therefore, the user-written in this state is not a continuous trajectory, while the horizontal "一" and the oblique hook in the writing process are two continuous trajectories respectively.

[0140] In another specific example, as Fig.10 shown, the "十" written by the user is a connected stroke. The user completes the writing of this character at one time from the first time of putting the pen down to the time of lifting the pen this time, and there is no pause at the bend. Therefore, the continuous trajectory in the embodiment of the present invention can also be called a stroke, but is not limited to a standard stroke and can be a connected stroke. More specifically, this character is continuously formed by the user in terms of time, and there is no situation where the trajectory points pause in the same input area. At this time, it is a continuous trajectory. Therefore, the continuous trajectory in the embodiment of the present invention is a stroke continuously formed in terms of time, and each continuous trajectory can represent the characteristics of the character written by the user, which can improve the accuracy of the handwritten recognition method. In a specific example, the embodiment of the present invention also eliminates the trajectory points located at the same coordinates in the same continuous trajectory to improve the processing speed of the trajectory points.

[0141] S2322. Calculate the trajectory point density of the continuous trajectory according to the length of the continuous trajectory and the number of trajectory points included.

[0142] In this step, the embodiment of the present invention uses the coordinate parameters of the trajectory points to obtain the length of the continuous trajectory. The length in the embodiment of the present invention is not the sum of the starting distances obtained from the coordinate parameters of the starting trajectory point and the ending trajectory point of the continuous trajectory. That is to say, the length of the continuous trajectory in the embodiment of the present invention is the sum of the distances between adjacent trajectory points in a continuous time period. Using the length of the continuous trajectory and the number of trajectory points on this length, the trajectory point density of the current continuous trajectory can be determined, so that the relationship between the density of the current continuous trajectory and the density of the standardized continuous trajectory can be determined, further improving the recognition accuracy of the handwritten recognition method in the embodiment of the present invention.

[0143] In a specific example, as Fig.10 shown, the horizontal stroke "one" and the oblique hook in the character "nine" written by the user are two continuous trajectories respectively. Then, the trajectory point density of each continuous trajectory is calculated. For example, the length of the continuous trajectory of the horizontal stroke "one" is the length of the entire continuous trajectory from the starting point to the ending point among its trajectory points, including the arc length during handwriting. The trajectory point density is the continuous trajectory length divided by the number of trajectory points.

[0144] S2323. Determine the relationship between the trajectory point density of the continuous trajectory and the set density value: If the trajectory point density of the continuous trajectory is greater than the set density value, downsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value; if the trajectory point density of the continuous trajectory is less than the set density value, upsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value.

[0145] The embodiment of the present invention uses the trajectory point density determined in the foregoing step S2322 and the set density value to make a judgment, and performs standardization processing on the continuous trajectory corresponding to the trajectory point density that does not conform to the judgment principle, so as to realize the standardization and normalization of the continuous trajectory. This handwritten recognition method can be applied to any device with a touch screen, eliminating the requirement for the device sampling performance when the touch display device executes the handwritten recognition method.

[0146] In a specific example, taking the character "nine" in the character group input by the user as an example, it includes continuous trajectories: "丿", "one" and the oblique hook The set density value is 30. If the trajectory point density value of the continuous trajectory "丿" is 30 and the trajectory point density value is equal to the set density value, it means that the density of this continuous trajectory has been standardized and no upsampling or downsampling processing is required.

[0147] If the trajectory point density value of the continuous trajectory "one" is 15, which is less than the set density value 30, it means that the trajectory points currently obtained according to the sampling points may not be able to characterize all the features of the continuous trajectory. Therefore, the embodiment of the present invention further upsamples the continuous trajectory so that the trajectory point density of the continuous trajectory "one" is equal to the set density value. In a specific example, the upsampling includes trajectory point interpolation processing. For example, 15 interpolation points need to be added to achieve a trajectory point density that meets the set density value. One interpolation point can be added for every two trajectory points to achieve a uniform distribution of interpolation points, thereby further improving the recognition accuracy.

[0148] If the continuous trajectory The trajectory point density value is 50, then the continuous trajectory is horizontal The trajectory point density value is greater than the set density value 30, indicating that the trajectory points currently obtained according to the sampling points can already characterize all the features of the continuous trajectory, and the current trajectory points are already in a redundant state, which affects the recognition speed of the handwriting recognition method. Therefore, the embodiment of the present invention further downsamples the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value. In a specific example, downsampling includes deleting trajectory points. For example, 20 trajectory points need to be deleted to achieve a trajectory point density value that meets the standardized requirements of the set density value.

[0149] S233, performing overall angle correction on the trajectory points of the character group after continuous trajectory resampling, so that all characters in the character group are in a horizontal direction based on the coordinate system, that is, parallel to Fig.10 In a specific example, the angle of the tilted characters in the character group can be corrected by Hough transform, so as to achieve the overall angle correction of the track points in the entire character group, which can further improve the accuracy of handwriting recognition.

[0150] It should be noted that, similar to the training stage, in the recognition stage, the key step in the preprocessing step S230 is the resampling step S232, while the normalization step S231 and the angle correction step S233 are respectively preferred steps.

[0151] S240: Input the trajectory points of the preprocessed character group into a trained handwriting recognition model to recognize the character group input by the user's handwriting.

[0152] The trajectory points of the preprocessed character group to be recognized are input into the handwriting recognition model, and the handwriting recognition model can recognize the character group input by the user. The handwriting model of the embodiment of the present invention is a handwriting recognition model based on a bidirectional long short-term memory network, which includes a plurality of feature extraction modules and a fully connected module connected in series. In a specific example, Fig.10As shown, the character group obtained by the handwriting recognition model can be displayed in the recognition area above the handwriting area represented by the dotted frame of the mobile phone to edit the character group.

[0153] It should be noted that in step S214, the handwriting recognition model can be directly trained using the trajectory points of multiple preprocessed training samples of character groups that may contain one line of characters or multiple lines of characters. In this way, the trained handwriting recognition model can learn the ability to recognize the character groups that include one line of characters or multiple lines of characters input by the user through the touch screen. In the recognition stage, the trajectory points of the preprocessed character groups are directly input into the trained handwriting recognition model to recognize the character groups input by the user.

[0154] In addition, in step S214, each line of characters in the preprocessed multiple character group training samples can also be used to form a training sample, that is, the handwriting recognition model is trained with the character group training samples including single-line characters, so that the trained handwriting recognition model learns the ability to recognize the character group including a line of characters (or a character group of single-line characters, or simply a line character group) input by the user through the touch screen handwriting. Based on this, when performing recognition in the recognition stage, it is necessary to first determine (for example, according to the coordinate parameters of each character in the character group) whether the character group input by the user through the touch screen handwriting includes only one line of characters or multiple lines of characters: if it only includes one line of characters, it can be directly preprocessed and input into the trained handwriting recognition model for recognition to obtain the character group input by the user; if it includes multiple lines of characters, the multiple lines of characters can be split into multiple single-line characters by line splitting (for example, line splitting according to the coordinate parameters of each character in the character group), and then the multiple single-line characters are preprocessed and input into the trained handwriting recognition model for recognition, and the recognition results are spliced ​​to obtain the character group input by the user.

[0155] In summary, the handwriting recognition method of the embodiment of the present invention can accurately recognize the character group of the user's handwriting input, has the advantages of strong operational convenience, high recognition accuracy, and is applicable to terminal devices with multiple sampling rates, and has broad application prospects. The handwriting recognition method can be applied to any device with a touch screen, solves the dependence of the handwriting recognition method on the device, eliminates the requirement of the touch display device for the sampling performance of the device to execute the handwriting recognition method, and uses the handwriting recognition method of the embodiment of the present invention to be compatible with different terminal devices and ensure the accuracy of handwriting recognition of each terminal device.

[0156] Another embodiment of the present invention provides a touch display device, such as Fig.13 As shown, including:

[0157] An acquisition module, used to acquire sampling points in the writing trajectory of a character group input by a user through handwriting on a touch screen, determine the trajectory points of the character group and related parameters of each trajectory point, wherein the related parameters include coordinate parameters and time parameters;

[0158] A preprocessing module, used for preprocessing the trajectory points of the character group, including: resampling each continuous trajectory formed by the trajectory points of the character group so that the trajectory point density of each continuous trajectory is equal to a set density value;

[0159] The recognition module is used to input the pre-processed trajectory points into the trained handwriting recognition model to recognize the character group input by the user's handwriting.

[0160] The touch display device of the embodiment of the present invention can be any product or component with a touch display function, such as electronic paper, mobile phone, tablet computer, television, display, notebook computer, digital photo frame, navigator, etc., which is not limited in this embodiment.

[0161] In a specific example, taking the touch display device as a tablet computer with a touch display function, the acquisition module, the preprocessing module and the identification module can be third-party applications installed in the tablet computer, or the acquisition module, the preprocessing module and the identification module can also be implemented as plug-ins or components in the third-party application, or the acquisition module, the preprocessing module and the identification module can also be system tools that come with the operating system in the terminal.

[0162] A computer device according to another embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the handwriting recognition method as described above when executing the program.

[0163] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: obtaining sampling points in a writing trajectory of a character group input by handwriting of a user through a touch screen, determining the trajectory points of the character group, wherein the parameters of the trajectory points include coordinate parameters and time parameters; preprocessing the trajectory points of the character group, including: resampling each continuous trajectory formed by the trajectory points of the character group so that the trajectory point density of each continuous trajectory is equal to a set density value; and inputting the trajectory points of the preprocessed character group into a trained handwriting recognition model to identify the character group input by handwriting of the user.

[0164] In practical applications, the computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0165] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0166] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0167] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0168] like Fig.14As shown, a structural schematic diagram of a computer device provided by another embodiment of the present invention. Fig.14 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0169] like Fig.14 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0170] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0171] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0172] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig.14 not shown, usually called a "hard drive"). Although Fig.14 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0173] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0174] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 20. Fig.14 As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that although Fig.14 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0175] The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a handwriting recognition method provided by an embodiment of the present invention.

[0176] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the embodiments here. All obvious changes or modifications derived from the technical solution of the present invention are still within the protection scope of the present invention.

Claims

1. A handwriting recognition method, characterized in that: include: Acquire multiple character group training samples and perform training according to the character group training samples to obtain a handwriting recognition model; Acquire sampling points in the writing trajectory of the character group input by the user through the touch screen, and determine the trajectory points of the character group, wherein the parameters of the trajectory points include coordinate parameters and time parameters; Preprocessing the trajectory points of the character group includes: resampling each continuous trajectory formed by the trajectory points of the character group so that the trajectory point density of each continuous trajectory is equal to a set density value; Inputting the trajectory points of the preprocessed character group into the trained handwriting recognition model to recognize the character group input by the user's handwriting; The step of obtaining a plurality of character group training samples and training a handwriting recognition model according to the character group training samples further comprises: Obtain multiple character group training samples; Acquire sampling points in the writing trajectories of the plurality of character group training samples, and determine the trajectory points of the character group training samples, wherein the parameters of the trajectory points include coordinate parameters and time parameters; Preprocessing the trajectory points of the plurality of character group training samples respectively includes: resampling each continuous trajectory formed by the trajectory points of the character group training samples so that the trajectory point density of each continuous trajectory is equal to a set density value; A handwriting recognition model is obtained by training the trajectory points of the preprocessed multiple character group training samples; Wherein, the obtaining of a plurality of character group training samples further comprises: Establishing a character library, wherein for each character in the character library, obtaining characters inputted by handwriting by multiple persons through a touch screen; For multiple sentences in the sentence dictionary, a character is randomly selected from characters input by handwriting of multiple people through the touch screen to form each sentence, so as to obtain multiple character group training samples.

2. The method according to claim 1, characterized in that The preprocessing of the trajectory points of the character group further includes: before the resampling, normalizing the overall size of the trajectory points of each row of characters in the character group based on coordinate parameters.

3. The method according to claim 2, characterized in that The normalizing the overall size of the trajectory points of each line of characters in the character group based on the coordinate parameters includes: normalizing the overall size of the trajectory points of each line of characters based on the coordinate parameters based on the extreme values ​​of the coordinate parameters of each trajectory point of each line of characters.

4. The method according to claim 1, characterized in that The preprocessing of the trajectory points of the plurality of character group training samples further includes: before the resampling, normalizing the overall size of the trajectory points of each row of characters in the character group training samples based on coordinate parameters.

5. The method according to claim 4, characterized in that Normalizing the overall size of the trajectory points of each row of characters in the character group training sample based on the coordinate parameters includes: normalizing the overall size of the trajectory points of each row of characters in the character group training sample based on the coordinate parameters based on the extreme values ​​of the coordinate parameters of each trajectory point in each row of characters in the character group training sample.

6. The method according to claim 1, characterized in that The step of resampling each continuous trajectory formed by the trajectory points of the character group so that the trajectory point density of each continuous trajectory is equal to the set density value comprises: Obtaining the number of trajectory points contained in each continuous trajectory formed by the trajectory points of the character group; Calculating the trajectory point density of the continuous trajectory according to the length of the continuous trajectory and the number of trajectory points included; Determine the relationship between the trajectory point density of the continuous trajectory and the set density value: if the trajectory point density of the continuous trajectory is greater than the set density value, downsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value; if the trajectory point density of the continuous trajectory is less than the set density value, upsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value.

7. The method according to claim 1, characterized in that The step of resampling each continuous trajectory formed by the trajectory points of the character group training sample so that the trajectory point density of each continuous trajectory is equal to the set density value comprises: Obtaining the number of trajectory points contained in each continuous trajectory formed by the trajectory points of the character group training sample; Calculating the trajectory point density of the continuous trajectory according to the length of the continuous trajectory and the number of trajectory points included; Determine the relationship between the trajectory point density of the continuous trajectory and the set density value: if the trajectory point density of the continuous trajectory is greater than the set density value, downsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value; if the trajectory point density of the continuous trajectory is less than the set density value, upsample the continuous trajectory so that the trajectory point density of the continuous trajectory is equal to the set density value.

8. The method according to claim 1, characterized in that The preprocessing of the trajectory points of the character group further comprises: The trajectory points of the character group after continuous trajectory resampling are subjected to overall angle correction.

9. The method according to claim 1, characterized in that: The preprocessing of the trajectory points of the plurality of character group training samples respectively further comprises: The trajectory points of the character group training samples after continuous trajectory resampling are subjected to overall angle correction.

10. The method according to claim 1, characterized in that The handwriting recognition model is a handwriting recognition model based on a bidirectional long short-term memory network.

11. The method according to claim 10, characterized in that The handwriting recognition model based on the bidirectional long short-term memory network includes a series-connected feature extraction module and a fully connected module, the feature extraction module includes a plurality of series-connected feature extraction unit modules, and the feature extraction unit includes a series-connected bidirectional long short-term memory network and a random inactivation layer.

12. The method according to claim 11, characterized in that The feature extraction module includes four feature extraction units connected in series.

13. A touch display device using the handwriting recognition method according to any one of claims 1 to 12, characterized in that: include: An acquisition module, used to acquire sampling points in the writing trajectory of a character group input by a user through handwriting on a touch screen, determine the trajectory points of the character group and related parameters of each trajectory point, wherein the related parameters include coordinate parameters and time parameters; A preprocessing module, used for preprocessing the trajectory points of the character group, including: resampling each continuous trajectory formed by the trajectory points of the character group so that the trajectory point density of each continuous trajectory is equal to a set density value; The recognition module is used to input the pre-processed trajectory points into the trained handwriting recognition model to recognize the character group input by the user's handwriting.

14. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 12 is implemented.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Method and device for hand input

    CN106033316A

  • Continuous character gesture track recognizing method based on STDW

    CN106354252A