Embodiments of this disclosure relate to the field of computer technologies, and particularly, to a handwriting recognition method and apparatus, a handwriting recognition system and an interactive display.
In a related handwriting recognition method, generally, after a user has written on an electronic whiteboard, a handwritten trajectory is recognized, and text of a recognition result is stored in the form of a document. If the user wants to view the recognition result, he/she must open the document in the background for browsing; if the user wants to confirm whether there is an error in the recognition result, word-by-word comparison with the original handwritten trajectory is needed, and if there is an error in the recognition result, second editing in the document is needed. This interactive mode is very inconvenient for the user to use and has low recognition efficiency.
In the embodiments of the present disclosure, there are provided a handwriting recognition method and apparatus, for solving the problem in the related handwriting recognition method that the handwriting recognition result cannot be viewed in real time by the user.
In order to solve the above technical problem, the present disclosure is implemented as follows.
In a first aspect of the embodiments of the present disclosure, there is provided a handwriting recognition method, comprising:
In some embodiments, the information further comprises a user writing state, which comprises pen-starting, pen-moving or pen-lifting, the determining condition is that no new trajectory point is detected within a preset duration after a pen-lifting moment of the current trajectory point, and the starting trajectory point is a next trajectory point of a last trajectory point inputted to the text recognition model last time, or a first trajectory point of the handwriting screen.
In some embodiments, the displaying the first text recognition result in a form of print in a first display area of the handwriting screen comprises:
In some embodiments, the displaying the first text recognition result in a form of print in a first display area of the handwriting screen comprises:
In some embodiments, after displaying the first text recognition result in the form of print, the method comprises:
In some embodiments, the erasure operation comprises selecting the target text.
In some embodiments, the erasure operation comprises a first erasure gesture, and the erasing the target text comprises:
In some embodiments, the erasure operation comprises a second erasure gesture, and the erasing the target text comprises:
In some embodiments, the label comprises a first label or a second label, wherein the first label comprises row information of the word trajectory and the second label comprises time information, paragraph information, or batch information of the word trajectory.
In some embodiments, the displaying the first text recognition result in a form of print in a first display area of the handwriting screen comprises:
In some embodiments, the performing row division on the first to-be-recognized trajectory points comprises:
In some embodiments, the determining whether two adjacent words are in a same row comprises:
In some embodiments, the handwriting recognition method further comprises:
In some embodiments, the handwriting recognition method further comprises:
In some embodiments, the displaying the second text recognition result in a form of print in a second display area comprises:
In some embodiments, the displaying the second text recognition result in a form of print in a second display area comprises:
In some embodiments, the determining whether the word in the second text recognition result is in the same row as the word in the first text recognition result comprises:
In some embodiments, the determining whether the word in the second text recognition result is in the same row as the word in the first text recognition result comprises:
In some embodiments, the first threshold is in positive correlation with a width of the word in the second text recognition result; and/or
In some embodiments, the displaying the word in the second text recognition result in the same row as the word in the first text recognition result comprises:
In a second aspect of the embodiments of the present disclosure, there is provided a handwriting recognition apparatus, comprising:
In some embodiments, the information further comprises a user writing state, which comprises pen-starting, pen-moving, or pen-lifting, the determining condition is that no new trajectory point is detected within a preset duration after a pen-lifting moment of the current trajectory point, and the starting trajectory point is a next trajectory point of a last trajectory point inputted to the text recognition model last time, or a first trajectory point of the handwriting screen.
In a third aspect of the embodiments of the present disclosure, there is provided an interactive display, comprising a touch module, a display module, a processor, a memory, and a program or instructions stored on the memory and executable on the processor, wherein the program or the instructions, when executed by the processor, implement the steps of the handwriting recognition method of the first aspect described above.
In a fourth aspect of the embodiments of the present disclosure, there is provided a readable storage medium having thereon stored a program or instructions, wherein the program or the instructions, when executed by a processor, implement the steps of the handwriting recognition method of the first aspect described above.
In a fifth aspect of the embodiments of the present disclosure, there is provided a handwriting recognition apparatus, comprising:
Ina sixth aspect of the embodiments of the present disclosure, there is provided a handwriting recognition system, comprising the handwriting recognition apparatus of the fifth aspect described above, wherein the handwriting recognition apparatus comprises:
In the embodiments of the present disclosure, after the handwritten trajectory is recognized in real-time, the text recognition result of the handwritten trajectory is displayed in real time in the form of print, thereby facilitating the user to view and correct the text recognition result in real time, so as to effectively improve the recognition rate and enhance the interactivity with the user.
Various other advantages and benefits will become apparent to one of ordinary skill in the art by reading the detailed description of preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the present disclosure. Moreover, identical reference numerals refer to identical components throughout the drawings. In the drawings:
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only some of the embodiments of the present disclosure, but not all of them. All other embodiments, which can be derived by one of ordinary skill in the art from the embodiments in the present disclosure without making inventive efforts, are intended to fall within the scope of protection of the present disclosure.
Referring to
Step 11: detecting information of a plurality of trajectory points corresponding to a handwritten trajectory of a user on a handwriting screen, the information comprising a coordinate, the plurality of trajectory points comprising a starting trajectory point and a current trajectory point. In some embodiments, the information further comprises a user writing state, which comprises pen-starting, pen-moving, or pen-lifting.
The handwriting screen can be a handwriting device such as an electronic conference whiteboard and the like and is provided with a touch module and a display module.
In an embodiment of the present disclosure, the trajectory points can comprise trajectory points of one or more characters, and the characters can be Chinese, English, or number.
In an embodiment of the present disclosure, an upper left corner of the handwriting screen can be taken as an origin, the extension from which from left to right is an X axis and the extension from which from up to down is a Y axis. Alternatively, a lower left corner of the handwriting screen can also be taken as an origin, the extension from which from left to right is an X axis and the extension from which from down to up is a Y axis. In the embodiment of the present disclosure, there is no limitation on the setting of the coordinate axes.
In an embodiment of the present disclosure, pen-starting refers to a first trajectory point of one stroke, pen-lifting refers to a last trajectory point of one stroke, and pen-moving refers to an intermediate trajectory point of one stroke.
In an embodiment of the present disclosure, alternatively, each trajectory point can be denoted as follows: (x, y, t, flag), where x and y denote position coordinates of each trajectory point, t is writing time of the trajectory point, and flag denotes a user writing state (pen-starting, pen-moving, or pen-lifting).
The current trajectory point refers to a last trajectory point handwritten by the user on the handwriting screen.
Step 12: determining whether the current trajectory point is an ending trajectory point according to a determining condition, if the current trajectory point meets the determining condition, taking the current trajectory point as an ending trajectory point, and taking trajectory points between the starting trajectory point and the ending trajectory point as first to-be-recognized trajectory points.
In some embodiments, the determining condition is that no new trajectory point is detected within a preset duration after a pen-lifting moment of the current trajectory point, and the starting trajectory point is a next trajectory point of a last trajectory point inputted to the text recognition model last time, or a first trajectory point of the handwriting screen. Here, “a last trajectory point” and “a next trajectory point” both refer to trajectory points inputted to the text recognition model. For example, trajectory points written in the case where a word recognition function is suspended does not belong to the trajectory points inputted to the text recognition model.
The first to-be-recognized trajectory points comprises the starting trajectory point and the ending trajectory point of the handwritten trajectory.
It should be appreciated that when a plurality of words are written in succession, a writing interval between the words does not exceed a threshold (for example, 500 ms or 2000 ms), otherwise it is considered that what is written is still a single word.
Step 13: recognizing the first to-be-recognized trajectory points by using a text recognition model to obtain a first text recognition result. The first text recognition result can comprise one word or a text paragraph comprising a plurality of words.
Step 14: displaying the first text recognition result in a form of print in a first display area of the handwriting screen.
In some embodiments, the plurality of words comprised in the first text recognition result are stored as word trajectories, wherein each word is stored as one word trajectory. In this way, processes such as drawing, modification, erasure, and the like, can be respectively performed on each word in the first text recognition result. For example, the plurality of words comprised in the first text recognition result are separately drawn one by one.
It should be understood that row division can also be performed on the first to-be-recognized trajectory points; and the plurality of words comprised in the first text recognition result are respectively drawn row by row according to a result of the row division. In this way, when an operation such as modification, erasure, and the like, is performed on the text in the first text recognition result, the processing of row division can be implemented. For example, the words comprised in the first text recognition result can be associated with a same label, and the label can comprise row information of the words. A label can be set for each trajectory point, each word trajectory or word.
Of course, the words comprised in the first text recognition result can also be wholly stored as one word trajectory and drawn as a whole. The word trajectory can be stored in a designated storage area. In this way, when an operation such as modification, erasure, and the like, is performed on the first text recognition result, the whole processing can be implemented. For example, the words comprised in the first text recognition result can be associated with a same label, and the label can comprise time information, paragraph information, or batch information of the words.
For the print, for example, standard text such as SimSun, KaiTi, SimHei, or the like, is employed for Chinese, and standard text such as Times New Roman, or the like, is employed for English and number, so as to be distinguished from the handwritten trajectory.
Please refer to
In an embodiment of the present disclosure, after the handwritten trajectory is recognized in real time, the text recognition result of the handwritten trajectory is displayed in real time in the form of print, thereby facilitating the user to view and correct the text recognition result in real time, so as to effectively improve the recognition rate and enhance the interactivity with the user.
Since what is received by the text recognition model is coordinates of many trajectory points which are arranged according to a writing time order without row division, and the text recognition model performs recognition according to row-by-row text trajectory points, it is needed to first perform row division on all the trajectory points; if the user writes a plurality of rows, row division is required for the trajectory points, and if the user only writes one row, row division is not required. That is, in the embodiment of the present disclosure, before the information of the first to-be-recognized trajectory points is recognized by using the text recognition model, row division can also be performed on the first to-be-recognized trajectory points. In some embodiments, a label comprising row information of words is set according to the row division result.
In an embodiment of the present disclosure, row division can be performed on the first to-be-recognized trajectory points by using a projection method. That is, performing row division on the first to-be-recognized trajectory points comprises:
That is, the number of the X-axis coordinate values of all the trajectory points in the first to-be-recognized trajectory points is projected onto the Y axis. If there are too many words in one row, i.e., too many trajectory points, the number of the X-axis coordinate values on the Y axis will be larger; and if there is row division in the handwritten trajectory, the number of the X-axis coordinate values on the Y axis at a blank position in front and back two rows will be smaller or 0, that is, there will be a trough, whose value is taken as a basis for the row division.
However, if the words corresponding to the first to-be-recognized trajectory points written by the user are inclined, it will be inaccurate at this time if row division on the first to-be-recognized trajectory points is performed according to the above projection method. Therefore, alternatively, in the embodiment of the present disclosure, before row division is performed on the first to-be-recognized trajectory points, the method can further comprise:
Since the coordinate values of the to-be-recognized trajectory points can range from 0 to thousands or tens of thousands, the influence of orders of magnitude is eliminated in order to facilitate calculation.
In other embodiments, the performing row division on the first to-be-recognized trajectory points can further comprise: dividing the first to-be-recognized trajectory points into the plurality of words according to the information of each trajectory point in the first to-be-recognized trajectory points; and determining whether two adjacent words are in a same row, wherein the two adjacent words comprise a first word written earlier and a second word written later.
It is determined whether the two adjacent words are in the same row according to a height and a position coordinate of the second word and a height and a position coordinate of the first word. For example, it is determined whether a first difference between an abscissa of a left edge of the second word and an abscissa of a right edge of the first word is less than a first threshold; it is determined whether a second difference between an ordinate of a top edge of the second word and an ordinate of a top edge of the first word is less than a second threshold; and in the case where the first difference is less than the first threshold and the second difference is less than the second threshold, it is determined that the second word and the first word are in the same row.
The first threshold is in positive correlation with a width of the second word, for example, the first threshold is half of the width of the second word. The second threshold is in positive correlation with a height of the first word, for example, the second threshold is half of the height of the first word.
In an embodiment of the present disclosure, alternatively, before recognizing the information of the first to-be-recognized trajectory points by using the text recognition model to obtain the first text recognition result, the method further comprises: normalizing the coordinates of the first to-be-recognized trajectory points into a same numerical range, for example, into (0, 1).
In an embodiment of the present disclosure, text recognition on the information of the first to-be-recognized trajectory points can be performed by using a Seq2Seq network. Of course, in other embodiments of the present disclosure, other text recognition models, for example, a RNN network, and the like, can be employed.
In an embodiment of the present disclosure, alternatively, after recognizing the information of the first to-be-recognized trajectory points by using the text recognition model to obtain the first text recognition result, the method further comprises: performing semantic correction on the first text recognition result. For example, the semantic correction can comprise: Chinese semantic correction and/or English semantic correction, and when there is an incorrectly recognized letter in a single English word, the incorrect letter is corrected according to context semantic information.
Since users have a very high degree of freedom when writing on the electronic whiteboard, some users preferring to write on a right half of the electronic whiteboard first and then write on a left half, some users preferring to write on a middle area first and then write on an upper half or a lower half. The related handwriting recognition method is that recognition is performed according to the time sequence of the writing by the user and the recognition result is once written into a document, in which storage is also performed according to the recognition sequence without considering the spatial position relation of the typesetting of the original handwritten trajectory. This results in the user needing to find the position of the original handwritten trajectory according to the recognition result if the original handwritten trajectory is written in a random order, when the user compares the recognition result with the original handwritten trajectory, and thus it is very inconvenient.
In order to solve the above problem, in the embodiment of the present disclosure, alternatively, the displaying the first text recognition result in a first display area in a form of print comprises:
In the embodiment of the present disclosure, after the handwritten trajectory is recognized, the handwritten trajectory on the handwriting screen is erased in real time, and the text recognition result of the handwritten trajectory is displayed in real time in the form of print in the area where the handwritten trajectory is located, thereby further facilitating the user to view and correct the text recognition result in real time.
In an embodiment of the present disclosure, alternatively, the determining the first display area according to the coordinates of the first to-be-recognized trajectory points comprises:
However, if the words corresponding to the first to-be-recognized trajectory points written by the user are inclined, the first display area is, at this time, an inclined rectangular box if the first display area is determined according to the original coordinates of the first to-be-recognized trajectory points. In an embodiment of the present disclosure, alternatively, the determining the first display area according to the coordinates of the first to-be-recognized trajectory points comprises:
In an embodiment of the present disclosure, alternatively, a method of performing inclination correction on the coordinates of the first to-be-recognized trajectory points can be as follows: first, one rectangular box can be determined according to the original coordinates of the first to-be-recognized trajectory points, and then, one point is determined as a rotation center of the rectangular box to rotate the rectangular box, wherein the rotation center can be a center point of the rectangular box or another point.
According to the corrected coordinates, the first rectangular box is determined in the manner of the steps 41 and 42 as the first display area. That is to say, the minimum X-axis coordinate, the minimum Y-axis coordinate, the maximum X-axis coordinate, and the maximum Y-axis coordinate in the steps 41 and 42 are all the corrected coordinates.
In an embodiment of the present disclosure, alternatively, the displaying the first text recognition result in the form of print in the first display area comprises:
In an embodiment of the present disclosure, alternatively, a correspondence relation between the font and the word space can be stored in advance, and when the size of the font is determined, the word space is also determined. Of course, a manner in which the word space can be determined according to the size of the first display area is not excluded.
In an embodiment of the present disclosure, alternatively, after displaying the first text recognition result in the form of print in the area where the handwritten trajectory is located, the method further comprises:
In some embodiments, the erasure operation comprises selecting the target text. For example, after the target text is selected, the target text can be erased by clicking a deletion/erasure button.
In some other embodiments, a corresponding erasure operation can be performed according to an erasure gesture of the user. For example, after an erasure function is selected, a word trajectory intersected with an erasure trajectory is deleted. Alternatively, through the erasure gesture, for example, a palm touching the display panel to generate an eraser sign, the user deletes a word trajectory intersected with a trajectory of hand movement. The erasure gesture can be, for example, a flat ellipse gesture, a polyline, a zigzag, a reverse N, a cross, etc., as long as it does not affect the writing. It should be understood that the corresponding relation between the erasure gesture and the erasure operation can be set according to actual needs. Partial or complete erasure on the text recognition result can be performed by the user. After the erasure operation, the user can rewrite.
For the partial erasure, as described above, each word comprised in the first text recognition result is separately stored as one word trajectory, so that only the word trajectory intersected with the trajectory of the erasure gesture can be deleted. That is, in some embodiments, according to a first erasure gesture of the user, the word trajectory intersected with the trajectory of the first erasure gesture is erased.
Please refer to
For the erasure manner shown in
For the erasure manner shown in
For the partial deletion, in other embodiments, according to a second erasure gesture of the user, a word trajectory intersected with a trajectory of the second erasure gesture is erased, and a word trajectory having the same label as the word trajectory is erased. The label here is a first label, which comprises row information of the word trajectory. That is, the word trajectory intersected with the trajectory of the second erasure gesture can be erased, and a word trajectory belonging to the same row as the word trajectory is erased. Similarly, these erased word trajectories will be cleared from the drawing board and at the same time will also be removed from designated storage areas.
For the complete deletion, as described above, the words comprised in the first text recognition result can be associated with the same label, so that the overall deletion of all the words comprised in the first text recognition result can be conveniently implemented by deleting the word trajectory intersected with the trajectory of the erasure gesture. The label here is a second label, which comprises time information, paragraph information or batch information of the word trajectory. That is, the word trajectory intersected with the trajectory of the second erasure gesture can be erased, and handwritten word trajectories belonging to the same time period, the same paragraph, or the same batch as the word trajectory are erased.
In the above embodiment, by drawing each word individually and storing the word trajectory individually, different erasure operations performed according to different erasure gestures can be conveniently implemented, for example, only the word trajectory intersected with the trajectory of the erasure gesture can be deleted, or both the word trajectory intersected with the trajectory of the erasure gesture and the word trajectories in the same row thereof can be deleted, or both the word trajectory intersected with the trajectory of the erasure gesture and the handwritten word trajectories in the same time period, the same paragraph, or the same batch thereof can be deleted.
In addition, it should be understood that, regardless of whether the erasure operation is performed, the writing of a word can be continued after the first text recognition result is displayed in the form of print. Accordingly, processes such as detection, determining, recognition, display, and the like, similar to the first to-be-recognized trajectory points, can be performed on to-be-recognized trajectory points corresponding to a handwritten trajectory which is continuously written. That is, the handwriting recognition method further comprises step 52 to step 55.
Step 52: detecting information of second to-be-recognized trajectory points corresponding to a handwritten trajectory of the user on the handwriting screen, the information comprising a coordinate, time and a user writing state, the user writing state comprising pen-starting, pen-moving and pen-lifting, the second to-be-recognized trajectory points comprising a starting trajectory point and an ending trajectory point.
In an embodiment of the present disclosure, in the step S52, the user can rewrite in the erasure area, or in another position. That is, in the step S52, information of the second to-be-recognized trajectory points corresponding to a handwritten trajectory rewritten by the user is detected, the information comprising a coordinate, time, and a user writing state, the user writing state comprising: pen-starting, pen-moving and pen-lifting; the second to-be-recognized trajectory points comprising a starting trajectory point and an ending trajectory point.
Of course, in an embodiment of the present disclosure, the user can also write at another position without performing the erasure operation. Step 53: determining whether a current trajectory point is the ending trajectory point of the second to-be-recognized trajectory points according to the determining condition, if the current trajectory point meets the determining condition, taking the current trajectory point as the ending trajectory point of the second to-be-recognized trajectory points, and taking trajectory points between the starting trajectory point and the ending trajectory point as the second to-be-recognized trajectory points.
In some embodiments, the determining condition is that no new trajectory point is detected within a preset duration after a pen-lifting moment of the current trajectory point and the starting trajectory point is a next trajectory point of a last trajectory point inputted to the text recognition model last time.
Step 54: recognizing the second to-be-recognized trajectory points by using the text recognition model to obtain a second text recognition result.
Before the second to-be-recognized trajectory points are recognized, processes such as row division and/or normalization can also be performed on the second to-be-recognized trajectory points. Please refer to the processing on the first to-be-recognized trajectory points described above, which is not described one by one here. Similarly, after the second to-be-recognized trajectory points are recognized, semantic correction processing can also be performed.
Step 55: displaying the second text recognition result in a form of print in a second display area.
For the print, for example, SimSun, KaiTi, SimHei, or the like, is employed for Chinese, and Times New Roman, or the like, is employed for English and number, so as to be distinguished from the handwritten trajectory, and alternatively, the print is the same as the print employed for the first text recognition result.
In an embodiment of the present disclosure, after the handwritten trajectory is recognized, the handwritten trajectory on the handwriting screen is erased in real time, and the recognition result of the handwritten trajectory is displayed in real time in the form of print in an area where the handwritten trajectory is located, thereby facilitating the user to view, check and correct the recognition result in real time and improving the interactivity with the user.
In an embodiment of the present disclosure, it is supported that erasure and rewriting are performed many times by the user.
In an embodiment of the present disclosure, alternatively, the displaying the second text recognition result in a form of print in a second display area comprises:
Similarly, before the displaying the second text recognition result in a form of print in a second display area, the method can further comprise:
Step 73: determining the second display area according to the corrected coordinates.
For example, on the basis of the corrected coordinates, the second display area is determined according to the steps 61 and 62 described above.
In an embodiment of the present disclosure, alternatively, the displaying the second text recognition result in a form of print in a second display area comprises:
In the step 81, the display information of the first display area is acquired. In the step 82, it should be appreciated that: due to difference in fonts of different words, “same size of fonts” means substantially the same, but does not strictly limit the same in both width and height; “words aligned” also means that substantially aligned, but does not strictly limit aligned in both row and column directions.
In some embodiments, the step 82 comprises: step 821, determining whether a word in the second text recognition result and a word in the first text recognition result are in a same row; and step 822, if the determining result is yes, displaying the word in the second text recognition result and the word in the first text recognition result in the same row. It should be understood that, only in the case where a distance (comprising a distance in a row direction and a distance in a column direction) between the second display area and the first display area is close, it is determined whether the word in the second text recognition result and the word in the first text recognition result are in the same row.
In the step 821, it can be determined whether a first space between the word in the second text recognition result and the word in the first text recognition result in a row direction of the text is less than a first threshold and a second space between the word in the second text recognition result and the word in the first text recognition result in a column direction of the text is less than a second threshold, according to a position coordinate of the word in the second text recognition result and a position coordinate of the word in the first text recognition result; and in the case where the first space is less than the first threshold and the second space is less than the second threshold, it is determined that the word in the second text recognition result is in the same row with the word in the first text recognition result.
In the case where the word in the second text recognition result is on a right side of the word in the first text recognition result, the first space in the row direction of the text can be characterized by a difference between an abscissa of a left edge of the word in the second text recognition result and an abscissa of a right edge of the word in the first text recognition result.
Similarly, in the case where the word in the second text recognition result is on a left side of the word in the first text recognition result, the first space in the row direction of the text can be characterized by a difference between an abscissa of a right edge of the word in the second text recognition result and an abscissa of a left edge of the word in the first text recognition result.
The first threshold can also be determined according to size and position relations between the words. The first threshold can also be in positive correlation with a width of the word in the second text recognition result, for example, it can be half of the width of the word in the second text recognition result.
The second space in the column direction of the text can be characterized by a difference between an ordinate of a top edge of the word in the second text recognition result and an ordinate of a top edge of the word in the first text recognition result.
The second threshold is in positive correlation with a height of the word in the first text recognition result, for example, it can be half of the height of the word in the first text recognition result.
In the above embodiment, when there have already been some words on the drawing board, that is, after the first text recognition result has been displayed in the form of print in the first display area, when a new word is written, a display area for the newly written word, which comprises information such as a starting position, a size of the word, and the like, can be determined according to boundary information of the existing word, for example, information such as upper left and lower right of the word. Therefore, the display of the later written word can be corrected according to the earlier displayed word.
Please refer to
It can be seen that, in (c) of
In addition, for words-in-one-same-row determining, a reference line can be set, as shown in
In the case where there are, in the row direction, earlier displayed words on both left and right sides of a later written word, the earlier displayed word on either side is taken as a reference to determine whether the later written word and the earlier displayed word are in one same row.
Through the above embodiment, at least one of the following problems can be solved: since the position and the size of the font are non-uniform when writing each time, problems such as non-uniform sizes and placement positions of words of the recognized standard text, or a phenomenon of words overlapped occur; or, problems such as position or size deviation between new words and existing words occur when writing is performed again at a same position after a part of words (i.e., the target text) in the first text recognition result is erased.
In some embodiments, a same label can also be set for the words displayed in the same row, the label reflecting information of the row where the words are located. In this way, even if handwritten words belong to different batches, the words can still be erased row by row according to a corresponding erasure gesture as long as they are displayed in a same row.
Similarly, in the case where the words comprised in the first text recognition result are respectively drawn row by row, the target text can be erased according to the erasure operation of the user on the target text in the first text recognition result, and the word trajectory belonging to the same row as the target text is erased.
In an embodiment of the present disclosure, alternatively, a correspondence relation between a font and a word space can be stored in advance, and when a size of the font is determined, the word space is also determined. Of course, a manner in which the word space can be determined according to the size of the second display area is not excluded.
According to the above display method, the display effect of the text recognition result can be improved.
Referring to
In an embodiment of the present disclosure, after the handwritten trajectory is recognized in real time, the text recognition result of the handwritten trajectory is displayed in real time in the form of print, thereby facilitating the user to view and correct the text recognition result in real time, so as to effectively improve the recognition rate and enhance the interactivity with the user.
In an embodiment of the present disclosure, alternatively, the handwriting recognition apparatus further comprises at least one of :
In an embodiment of the present disclosure, alternatively, the row division module is configured to acquire the number of X-axis coordinate values of the first to-be-recognized trajectory points corresponding to each Y-axis coordinate value of the first to-be-recognized trajectory points; and perform row division on the first to-be-recognized trajectory points according to the number of the X-axis coordinate values on a Y axis.
In an embodiment of the present disclosure, alternatively, the handwriting recognition apparatus further comprises:
In an embodiment of the present disclosure, alternatively, the display module is configured to remove the handwritten trajectory corresponding to the first to-be-recognized trajectory points on the handwriting screen; determine a first display area according to the coordinates of the first to-be-recognized trajectory points; and display the first text recognition result in the form of print in the first display area.
In an embodiment of the present disclosure, alternatively, the display module is configured to acquire a minimum X-axis coordinate, a minimum Y-axis coordinate, a maximum X-axis coordinate, and a maximum Y-axis coordinate of the first to-be-recognized trajectory points; and
In an embodiment of the present disclosure, alternatively, the display module is further configured to determine whether the handwritten trajectory corresponding to the first to-be-recognized trajectory points is inclined; if the handwritten trajectory corresponding to the first to-be-recognized trajectory points is inclined, perform inclination correction on the coordinates of the first to-be-recognized trajectory points to obtain corrected coordinates; and determine the first display area according to the corrected coordinates.
In an embodiment of the present disclosure, alternatively, the display module is further configured to determine a size of a font of the first text recognition result according to a size of the first display area; determine a word space of the first text recognition result according to the size of the font of the first text recognition result; and display the first text recognition result in the first display area according to the determined size of the font and the determined word space.
In an embodiment of the present disclosure, alternatively, the handwriting recognition apparatus further comprises:
In an embodiment of the present disclosure, alternatively, the display module is further configured to acquire a minimum X-axis coordinate, a minimum Y-axis coordinate, a maximum X-axis coordinate, and a maximum Y-axis coordinate in the second to-be-recognized trajectory points; and determine a second rectangular box according to the minimum X-axis coordinate, the minimum Y-axis coordinate, the maximum X-axis coordinate and the maximum Y-axis coordinate in the second to-be-recognized trajectory points, and take the second rectangular box as the second display area.
In an embodiment of the present disclosure, alternatively, the display module is further configured to acquire display information of the first text recognition result, the display information comprising a size of a font and a coordinate; and determine the second display area according to the display information, and display the second text recognition result in the form of print in the second display area, a size of a font in the second text recognition result being the same as the size of the font in the first text recognition result, a word in the second text recognition result being aligned with a word in the first text recognition result.
In an embodiment of the present disclosure, the above function modules can be integrated into one entity device, or can be disposed in a plurality of entity devices. For example, the detection module configured to detect information of trajectory points corresponding to the handwritten trajectory of the user on the handwriting screen and the display module configured to display the text recognition result in a form of print can be disposed on the handwriting screen which can be referred to as a front end at this time, and the recognition module configured to recognize information of the to-be-recognized trajectory points by using the text recognition model to obtain the text recognition result can be disposed on a server which can also be referred to as a back end at this time. See
In an embodiment of the present disclosure, there is further provided an interactive display, comprising a touch module, a display module, a processor, a memory, and a program or instructions stored on the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement each process of the handwriting recognition method embodiments, and same technical effects can be achieved, which will not be repeated here in order to avoid repetition.
In an embodiment of the present disclosure, there is further provided a handwriting recognition apparatus, as shown in
In an embodiment of the present disclosure, there is further provided a handwriting recognition system, comprising the handwriting recognition apparatus described in the above embodiment, wherein the handwriting recognition apparatus comprises: a first processor located on a server side and configured to recognize to-be-recognized trajectory points by using a text recognition model to obtain a text recognition result; and a second processor located on a terminal side and configured to draw words comprised in the text recognition result one by one and store each word as one word trajectory.
In an embodiment of the present disclosure, there is further provided a readable storage medium having thereon stored a program or instructions, wherein the program or instructions, when executed by a processor, implement each process of the handwriting recognition method embodiments, and same technical effects can be achieved, which will not be repeated here in order to avoid repetition.
The processor is the processor in the terminal described in the above embodiment. The readable storage medium comprises a computer-readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, or the like.
As shown in
The memory 610 can comprise, for example, a system memory, a non-volatile storage medium, and the like. The system memory has thereon stored, for example, an operating system, an application, a boot loader, other programs, and the like. The system memory can comprise a volatile storage medium, such as a random access memory (RAM) and/or cache memory. The non-volatile storage medium has thereon stored, for example, instructions of the corresponding embodiment for performing the display method. The non-volatile storage medium includes, but is not limited to, a magnetic disk memory, an optical memory, a flash memory, and the like.
The processor 620 can be implemented by means of a discrete hardware component such as a general-purpose processor, digital signal processor (DSP), application specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor, and the like. Accordingly, each device, such as the determining device and the determination device, can be implemented by a central processing unit (CPU) running the instructions that are in the memory for performing the corresponding steps, or can be implemented by a dedicated circuit performing the corresponding steps.
The bus 600 can use any of a variety of bus architectures. For example, the bus architectures include, but are not limited to, an industry standard architecture (ISA) bus, a micro channel architecture (MCA) bus, and a peripheral component interconnect (PCI) bus.
The computer system can also comprise an input/output interface 630, a network interface 640, a storage interface 650, and the like. These interfaces 630, 640, 650, and the memory 610 and the processor 620 can be connected through the bus 600. The input/output interface 630 can provide a connection interface for input/output devices such as a display, a mouse, a keyboard, and the like. The network interface 640 provides a connection interface for a variety of networking devices. The storage interface 640 provides a connection interface for external storage devices such as a floppy disk, a USB flash disk, and an SD card.
It should be noted that, terms “comprise”, “include”, or any other variation thereof, herein, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements not only comprises those elements, but also comprises other elements not expressly listed, or further comprises elements inherent in such a process, method, article, or apparatus. Without further limitations, an element defined by a statement “comprising a . . . ” does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the method and apparatus in the embodiments of the present disclosure is not limited to performing functions in the order illustrated or discussed, but can also comprise performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved, for example, the described method can be performed in a different order from the described order, and various steps can also be added, omitted, or combined. In addition, features described with reference to certain examples can be combined in other examples.
Through the description of the foregoing embodiments, those skilled in the art can clearly understand that the method of the foregoing embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present disclosure can be embodied in a form of a software product, wherein the computer software product is stored in a storage medium (such as a ROM/RAM, magnetic disk, optical disk) and comprises several instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, a network device, or the like) to execute the method according to the embodiments of the present disclosure.
While the embodiments of the present disclosure have been described above in conjunction with the accompanying drawings, the present disclosure is not limited to the above specific embodiments.
The above specific embodiments are only illustrative and not restrictive. Under the enlightenment of the present disclosure, without departing from the spirit of the present disclosure and the scope protected by the claims, one of ordinary skill in the art can also make many forms, all of which fall within the protection of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
PCT/CN2021/074622 | Feb 2021 | WO | international |
PCT/CN2021/097349 | May 2021 | WO | international |
This application is the United States national phase of International Application No. PCT/CN2021/107460 filed Jul. 20, 2021, and claims priority to the applications PCT/CN2021/074622 filed on Feb. 1, 2021 and PCT/CN2021/097349 filed on May 31, 2021, the disclosures of which are hereby incorporated by reference in their entirety.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2021/107460 | 7/20/2021 | WO |