A handwriting pen editing gesture recognition method, medium and electronic device

By detecting the relationship between the pen stroke trajectory on the screen and the character overlap, and combining coverage, angle, and frequency domain parameters, the problem of misrecognition of pen strokes for deleting is solved, achieving higher recognition accuracy and user experience.

CN115480659BActive Publication Date: 2025-11-04HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110602320.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-31
Publication Date
2025-11-04
Estimated Expiration
2041-05-31

AI Technical Summary

Technical Problem

The existing method for determining the quick deletion gesture of a stylus is prone to misidentification, resulting in a poor user experience. When the stylus draws a wavy line on the selected target printed character, the electronic device may misidentify it as a selection gesture instead of a deletion gesture.

Method used

By detecting the overlap between the pen stroke trajectory and the characters on the screen, it determines whether predetermined conditions are met, including parameters such as coverage, angle, and frequency domain. It distinguishes between deletion and selection operations, and uses differentiated recognition parameters for characters in different languages ​​to improve recognition accuracy.

Benefits of technology

It effectively avoids the problem of mis-recognition of handwriting, improves the recognition accuracy of handwriting quick gestures and user experience, and ensures the accuracy of deletion operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115480659B_ABST
    Figure CN115480659B_ABST
Patent Text Reader

Abstract

The application relates to the terminal technical field and discloses a handwriting pen editing gesture recognition method, a medium and an electronic device. The method comprises the following steps: when the electronic device detects that a gesture track generated by a user using a handwriting pen on a screen of the electronic device overlaps with a character displayed on the screen, the electronic device determines a first character region of the overlapped character and the gesture track; the electronic device determines whether an overlapping relationship between the gesture track and the first character region meets a first predetermined condition; and when the first predetermined condition is met, the electronic device determines that an editing operation corresponding to the gesture track is a deletion operation, and deletes the overlapped character. In this way, the problem that a deletion gesture of drawing a wavy line on a selected target printed character by using the handwriting pen is misrecognized as a selection gesture is avoided to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminals, and in particular to a handwriting pen editing gesture recognition method, a medium and an electronic device. BACKGROUND

[0002] With the continuous iteration and update of touch-type electronic devices, many touch-type electronic devices are equipped with handwriting pens as a way to improve office efficiency. In addition to the basic character or graphic input function, some handwriting pen products have added the function of quick gesture editing.

[0003] For example, after a user writes a handwritten character using a handwriting pen, the handwritten character is immediately converted into a printed character. In the case where the user edits the printed character using the handwriting pen, the user can draw a wavy line on the selected target printed character using the handwriting pen to achieve the function of deleting the target printed character, or draw a straight line on the selected target printed character using the handwriting pen to achieve the function of selecting the target printed character.

[0004] However, the current handwriting pen deletion quick gesture recognition method still has certain recognition pain points. When a user wants to delete part of the characters in a printed character, draws a wavy line on the selected target printed character using the handwriting pen, the electronic device is likely to misrecognize the deletion gesture of drawing a wavy line on the selected target printed character using the handwriting pen as a selection gesture, and thus display the selected target printed character instead of deleting the target printed character. As such, there is a handwriting pen deletion quick gesture misrecognition situation, and the user experience is poor. SUMMARY

[0005] The present application provides a handwriting pen editing gesture recognition method, a medium and an electronic device.

[0006] In a first aspect, the present application provides a handwriting pen editing gesture recognition method, which comprises:

[0007] The electronic device determines a first character region of an overlapped character and a gesture trajectory when detecting that the gesture trajectory generated by the user using the handwriting pen on the screen of the electronic device overlaps with the character displayed on the screen.

[0008] The electronic device determines whether the overlapping relationship between the gesture trajectory and the first character region meets a first predetermined condition.

[0009] In the case where the first predetermined condition is met, the electronic device determines that the editing operation corresponding to the gesture trajectory is a deletion operation, and deletes the overlapped character.

[0010] In the rule of the stroke trajectory display, the embodiment of the present application considers the writing editing scene of the real pen and paper, and achieves the perceptual consistency of character editing. For the stroke trajectory of the deletion operation, in the pen and paper writing, the user often adopts the wiping way to delete part of the characters, that is, adopts the psychological perception of "what you see is what you get". Therefore, in the writing process of the electronic device, the deletion function can be realized in the way of covering above the characters, that is, drawing different lines such as horizontal line, diagonal line, wavy line and the like on the characters, as long as the coverage rate reaches a certain parameter interval, the fast deletion can be realized. The selection function can adopt the setting rule of character highlighting, and can adopt the circle selection, horizontal line or wavy line under the character and the like. Such setting rule is more consistent with the psychological expectation of the user's handwriting editing, and has better easy learning and easy remembering. Thus, the problem that the deletion stroke of the handwriting pen drawing the wavy line on the selected target printed character is misrecognized as the selection stroke is avoided to a certain extent.

[0011] In a possible implementation of the first aspect, the method further includes that the first character region is a rectangular region enclosed by two straight lines respectively containing the highest point coordinate and the lowest point coordinate of the character in the height direction and parallel to the width direction, and two straight lines respectively containing the leftmost coordinate and the rightmost coordinate of the character in the width direction and parallel to the height direction.

[0012] In a possible implementation of the first aspect, the electronic device determines whether the overlap relationship between the stroke trajectory and the first character region meets a first predetermined condition, including:

[0013] In the case that the stroke trajectory type is the curve type, the electronic device determines a first ratio of an area of a first trajectory region of the stroke trajectory and an area of the first character region; wherein the first trajectory region is a rectangular region enclosed by two straight lines respectively containing the highest point coordinate and the lowest point coordinate of the character in the height direction of the stroke trajectory in the first character region and parallel to the width direction, and two straight lines respectively containing the leftmost coordinate and the rightmost coordinate of the character in the width direction and parallel to the height direction.

[0014] The electronic device determines that the first predetermined condition is met in the case that the first ratio is in a first parameter interval.

[0015] It can be understood that the first parameter interval can be a set parameter interval of the curve coverage rate.

[0016] In a possible implementation of the first aspect, the method further includes: determining, by the electronic device, whether the overlapping relationship between the stroke track and the first character region meets a first predetermined condition, including: in a case where the stroke track type is a straight line type, obtaining, by the electronic device, an inclination angle of the straight line stroke track relative to a character width direction of the first character region;

[0017] obtaining, by the electronic device, a third ratio of an area of a second track region to an area of a second character region in a case where the inclination angle is in a second parameter interval;

[0018] The second character region is a rectangular region enclosed by two straight lines respectively containing a highest point coordinate and a lowest point coordinate in a character height direction of the character and parallel to a straight line direction, and two straight lines respectively containing a leftmost coordinate and a rightmost coordinate in a character width direction and parallel to a straight line normal direction.

[0019] The second track region is a rectangular region enclosed by two straight lines respectively containing a highest point coordinate and a lowest point coordinate in a character height direction of the stroke track in the first character region and parallel to a straight line direction, and two straight lines respectively containing a leftmost coordinate and a rightmost coordinate in a character width direction and parallel to a straight line normal direction.

[0020] determining, by the electronic device, that the first predetermined condition is met in a case where the third ratio is in a third parameter interval.

[0021] It can be understood that the second parameter interval can be a set parameter interval of the inclination angle of the straight line, and the third parameter interval can be a set parameter interval of the straight line coverage rate.

[0022] In a possible implementation of the first aspect, the method further includes: determining, by the electronic device, whether the overlapping relationship between the stroke track and the first character region meets a first predetermined condition, including:

[0023] In a case where the stroke track type is a polyline type, determining, by the electronic device, a second ratio of an area of a first track region to an area of the first character region; the first track region is a rectangular region enclosed by two straight lines respectively containing a highest point coordinate and a lowest point coordinate in a character height direction of the stroke track in the first character region and parallel to a width direction, and two straight lines respectively containing a leftmost coordinate and a rightmost coordinate in a character width direction and parallel to a height direction.

[0024] determining, by the electronic device, that the first predetermined condition is met in a case where the second ratio is in a fourth parameter interval.

[0025] It can be understood that the fourth parameter interval can be a set parameter interval of the polyline.

[0026] In a possible implementation of the first aspect, the method further includes: in a case where the stroke trajectory type is a curve type, the electronic device obtains a set of sine waves of the curve stroke trajectory by using a fast Fourier transform.

[0027] The electronic device obtains a frequency of a preset number of sine waves in the set of sine waves, which are arranged in descending order of frequency value.

[0028] The electronic device determines that the first predetermined condition is met in a case where the frequency of the preset number of sine waves is in a fifth parameter interval.

[0029] It can be understood that the fifth parameter interval can be a set parameter interval of a curve frequency domain.

[0030] In a possible implementation of the first aspect, the method further includes: in a case where the stroke trajectory type is a curve type, the electronic device obtains a highest point coordinate and a lowest point coordinate of the curve stroke trajectory in a height direction of the first character region.

[0031] The electronic device determines an inclination angle of a line between the highest point and the lowest point with respect to the height direction according to the highest point coordinate and the lowest point coordinate.

[0032] The electronic device determines that the first predetermined condition is met in a case where the inclination angle is in a sixth parameter interval.

[0033] It can be understood that the sixth parameter interval can be a set parameter interval of a curve angle.

[0034] In a possible implementation of the first aspect, the method further includes: the electronic device determines that the number of the overlapped characters is a plurality, and in a case where the electronic device determines that the overlap relationship between the stroke trajectory and the first character region meets the first predetermined condition, the electronic device further determines whether an overlap relationship between the stroke trajectory on each character of the plurality of overlapped characters and a single first character region of each character meets a second predetermined condition, and deletes the character meeting the second predetermined condition in a case where it is determined that the second predetermined condition is met.

[0035] It can be understood that the electronic device can determine whether a coverage rate of the stroke trajectory on each character meets a reference standard, so as to delete the character meeting the reference standard (the second predetermined condition), reduce a misdeletion rate, and achieve accurate recognition of a deletion operation.

[0036] In a possible implementation of the first aspect, the method further includes that the first character region is a rectangular region enclosed by two straight lines containing the highest point coordinate and the lowest point coordinate of the single character in the height direction respectively and parallel to the height direction, and two straight lines containing the leftmost coordinate and the rightmost coordinate of the single character in the width direction respectively and parallel to the width direction.

[0037] In a possible implementation of the first aspect, the method further includes that the electronic device determines whether the overlapping relationship between the stroke track and the first character region of each character in the multiple characters satisfies a second predetermined condition, including:

[0038] The electronic device determines a width ratio of the width value of each character in the multiple characters to the width value of the first character region, and a height ratio of the height value of each character in the multiple characters to the height value of the first character region, and determines that the first predetermined condition is satisfied when the width ratio is in a seventh parameter interval and the height ratio is in an eighth parameter interval.

[0039] It can be understood that the seventh parameter interval can be a set parameter interval of the horizontal direction coverage ratio of the single character, and the eighth parameter interval can be a set parameter interval of the vertical direction coverage ratio of the single character.

[0040] In a possible implementation of the first aspect, the method further includes that the electronic device determines whether the overlapping relationship between the stroke track and the first character region satisfies a predetermined condition, including:

[0041] The electronic device determines whether the character is a first language character or a second language character.

[0042] The electronic device determines whether the overlapping relationship between the stroke track and the first character region satisfies a predetermined condition corresponding to the first language character when the character is determined to be the first language character.

[0043] The electronic device determines whether the overlapping relationship between the stroke track and the first character region satisfies a predetermined condition corresponding to the first language type when the character is determined to be the second language character.

[0044] Currently, the handwriting pen shortcut stroke editing function does not consider the recognition parameter difference under different character presentation effects. It can be understood that the embodiments of the present application determine the language type of the edited operation selected handwritten body character, that is, Chinese or English, and then recognize different languages using differentiated stroke type parameters, thereby improving the recognition accuracy of the handwriting pen shortcut stroke and improving the user experience.

[0045] In a possible implementation of the first aspect, the first language includes any one of Chinese, English, German, and French, and the second language includes any one of Chinese, English, German, and French.

[0046] In a possible implementation of the first aspect, the character is a printed character converted from a handwritten character.

[0047] In a possible implementation of the first aspect, the character is displayed on an operation interface of a preset application on the electronic device, and the preset application is any one of a memo, a pen calculator, Nebo for Huawei, and a random writing.

[0048] In a second aspect, an embodiment of the present application further provides a readable medium, and the readable medium stores instructions, which, when executed on an electronic device, cause the electronic device to implement the handwriting pen editing gesture recognition method in any one of the first aspect.

[0049] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory configured to store instructions executed by one or more processors of the electronic device, and

[0050] The processor is one of the processors of the electronic device, and is configured to execute the handwriting pen editing gesture recognition method in any one of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0051] Figures 1A to 1 J According to some embodiments of the present application, an application scenario of a handwriting pen editing gesture recognition method is shown.

[0052] Figure 2 According to an embodiment of the present application, a software structure block diagram of a tablet 100 implementing the technical solution of the present application is shown.

[0053] Figure 3 An application scenario of a tablet using a handwriting pen quick gesture recognition is shown.

[0054] Figure 4 According to an embodiment of the present application, a diagram of a multi-character coverage of a curve gesture track is shown.

[0055] Figure 5 According to an embodiment of the present application, a diagram of a curve frequency domain change of a curve gesture track is shown.

[0056] Figure 6 According to an embodiment of the present application, a diagram of a curve angle of a curve gesture track is shown.

[0057] Figure 7 According to some embodiments of the present application, a schematic diagram of single character coverage is shown.

[0058] Figure 8 According to some embodiments of the present application, a schematic diagram of a method for recognizing, for a Chinese character, when a user's deletion stroke is a curve is shown.

[0059] Figure 9 According to some embodiments of the present application, a schematic diagram of multi-character coverage corresponding to a polyline stroke is shown.

[0060] Figure 10 According to some embodiments of the present application, a schematic diagram of single character coverage corresponding to a polyline stroke is shown.

[0061] Figure 11 According to some embodiments of the present application, a schematic diagram of a method for recognizing, for a Chinese character, when a user's deletion stroke is a curve is shown.

[0062] Figure 12 According to some embodiments of the present application, a schematic diagram of drawing a straight line on a "target word" and a straight line inclination parameter interval is shown.

[0063] Figure 13 According to some embodiments of the present application, a schematic diagram of drawing a straight line on a "target word" and a straight line coverage is shown.

[0064] Figure 14 According to some embodiments of the present application, a schematic diagram of a method for recognizing, for a Chinese character, when a user's deletion stroke is a curve is shown.

[0065] Figure 15 According to some embodiments of the present application, a schematic diagram of a method for recognizing, for an English character, when a user's deletion stroke is a curve is shown.

[0066] Figure 16 According to some embodiments of the present application, a possible structural block diagram of the electronic device 100 shown in FIG. 1 is shown. DETAILED DESCRIPTION

[0067] The illustrative embodiments of the present application include, but are not limited to, a handwriting pen editing stroke recognition method, a medium, and an electronic device.

[0068] To solve the technical problems mentioned in the background, the application embodiment discloses a handwriting pen editing gesture recognition method. Specifically, after the characters written by the user using the handwriting pen are converted into printed characters, if the user draws a set of line tracks, such as horizontal lines, diagonal lines, broken lines, wavy lines, etc., on the converted printed characters, and the set of line tracks overlap with the printed characters, the coverage relationship between the line tracks and the character area where the printed characters are located can be determined to determine whether the user's operation is a deletion operation, and if it is determined to be a deletion operation, the printed characters overlapping with the line tracks are deleted. Thus, to some extent, the problem of misrecognizing the deletion gesture of drawing a wavy line on the selected target printed character by the handwriting pen as a selection gesture is avoided. The specific scheme will be described below.

[0069] The technical solutions of the application embodiments will be further described in detail below with reference to the drawings and embodiments.

[0070] The handwriting pen editing gesture recognition method provided by the application embodiments is applied in various software with handwriting pen writing and editing functions, such as memos, pen writing calculators, Nebo for Huawei, and random writing. The application embodiments are suitable for various input editing scenarios in an electronic device system, such as global handwriting and handwriting to printed characters.

[0071] The handwriting pen gesture recognition method provided by the application embodiments will be further described below with the software with handwriting pen writing and editing functions as a memo and the handwriting to printed character input editing scenario in an electronic device system as an example.

[0072] Figures 1A to 1 J According to some embodiments of the application, an application scenario schematic diagram of a handwriting pen editing gesture recognition method is shown.

[0073] The application scenario includes an electronic device 100. It is assumed that a user wants to take notes in a memo in the electronic device 100. The user first opens the memo, then creates a new memo, and performs handwriting note operation after starting the handwriting function of the memo.

[0074] For example, as shown in FIG. 1, the display interface of the electronic device 100 displays a memo control 10. The user can open the memo by clicking the memo control 10. After the user clicks the memo control 10, the electronic device 100 enters the operation interface of the memo. As shown in FIG. 2, the operation interface of the memo includes a create button 11. After the user clicks the create button 21, the electronic device 100 displays a newly created memo. As shown in FIG. 3, the newly created memo includes a handwriting area 12. Figure 1A Figure 1B Figure 1C ​​As shown, the newly created memo interface includes a handwriting control 12 and a handwriting-to-print control 13. In the case where the user wants to use the handwriting function of the electronic device 100, the handwriting-to-print function, and the editing operation function of the printed characters converted from the handwriting characters by the handwriting pen, the user can click the handwriting control 12 and the handwriting-to-print control 13, at which time the electronic device 100 displays a handwriting interface, as shown in Figure 1D As shown, the handwriting interface includes a handwriting area 14 and a printed character display area 15.

[0075] Continuing to refer to Figure 1D The application scenario also includes a handwriting pen 200. In some application scenarios, the handwriting pen 200 can establish a communication connection with the electronic device 100 through Bluetooth, so as to perform touch operations on the electronic device 100, including editing operations and handwriting operations. In addition, in other application scenarios, the user can directly turn on the power key of the handwriting pen 200, so as to perform touch operations on the electronic device 100, but the application scenarios are not limited to this.

[0076] In the application scenario, the characters written by the user in the handwriting area 14 with the handwriting pen 200 can be converted into printed characters in real time and displayed in the printed character display area 15. The handwriting area 14 is suspended on the printed character display area 15, or the handwriting area 14 partially overlaps the printed character display area 15, but the application scenarios are not limited to this.

[0077] When the user edits the printed characters in the printed character display area 15, if the user wants to perform a deletion operation on part of the printed characters, the user can directly draw a deletion line on the printed characters that the user wants to delete in the printed character display area 15 with the handwriting pen 200 held in hand. The deletion line can be a straight line or a curved line, and the electronic device 100 detects the operation, that is, deletes the printed characters on which the line is drawn.

[0078] During the writing and editing of the handwriting pen 200 on the electronic device 100, the deletion function can be implemented in a manner of covering the characters, that is, drawing different lines on the characters, such as horizontal lines, diagonal lines, and wavy lines, to achieve the deletion function. The following describes several deletion operations on Chinese characters.

[0079] For example, as shown in Figure 1EAs shown in the figure, the handwriting operation interface includes Chinese characters 16. The stylus 200 draws a wavy line 17 on some characters 161 among the Chinese characters 16 to perform a deletion operation on the some characters 161. The content of the some characters 161 can be "and the so-called". The electronic device 100 can determine whether the user's operation is a deletion operation based on the coverage rate of the wavy line 17 on the four characters "and the so-called", and determine that the deleted characters are the four characters "and the so-called". In the case of determining that it is a deletion operation, the some characters 161 are deleted. As Figure 1F As shown, after the electronic device 100 deletes the some characters 16, it stops the cursor 18 at the position to the right of the previous character or punctuation of the some characters 161, and the characters behind the some characters 161 move forward to the right of the cursor.

[0080] Another example is, as Figure 1G As shown, the stylus 200 draws a broken line 19 on some characters 161 among the Chinese characters 16 to perform a deletion operation on the some characters 161. The content of the some characters 161 can be "and the so-called". The electronic device 100 can determine whether the user's operation is a deletion operation based on the coverage rate of the broken line 19 on the four characters "and the so-called", and determine that the deleted characters are the four characters "and the so-called". In the case of determining that it is a deletion operation, the some characters 161 are deleted. As Figure 1F As shown, after the electronic device 100 deletes the some characters 161, it stops the cursor 18 at the position to the right of the previous character or punctuation of the some characters 161, and the characters behind the some characters 161 move forward to the right of the cursor.

[0081] Another example is, as Figure 1H As shown, the stylus 200 draws a straight line 20 on some characters 161 among the Chinese characters 16 to perform a deletion operation on the some characters 161. The content of the some characters 161 can be "and the so-called". The electronic device 100 can determine whether the user's operation is a deletion operation based on the coverage rate of the horizontal line 20 on the four characters "and the so-called", and determine that the deleted characters are the four characters "and the so-called". In the case of determining that it is a deletion operation, the some characters 161 are deleted. As Figure 1F As shown, after the electronic device 100 deletes the some characters 161, it stops the cursor 18 at the position to the right of the previous character or punctuation of the some characters 161, and the characters behind the some characters 161 move forward to the right of the cursor.

[0082] Another example is, as Figure 1IAs shown, the stylus 200 draws a slant line 21 on some characters 161 of the Chinese characters 16, performing a deletion operation on some characters 161. The content of some characters 161 can be "and the so-called". The electronic device 100 can determine whether the user's operation is a deletion operation according to the coverage rate of the slant line 21 on these 4 characters "and the so-called", and determine that the deleted characters are these 4 characters "and the so-called". In the case of determining that it is a deletion operation, some characters 161 are deleted. As Figure 1F shown, after the electronic device 100 deletes some characters 161, it stops the cursor 18 at the position to the right of the character or punctuation before some characters 161, and moves the characters after some characters 161 to the right of the cursor.

[0083] The definitions of the coverage relationships between curves, straight lines, slant lines, broken lines and the character regions where the printed characters are located are different. It can be understood that the coverage rate of a curve is the relationship degree between the region enclosed by the curve and the character region where the target printed character is located. The coverage rate of a broken line is the relationship degree between the area enclosed by the broken line and the area of the target printed character. For straight lines and slant lines, it is based on the inclination angles of the straight lines and slant lines in the width direction of the target printed character. This will be specifically introduced below.

[0084] Next, another deletion operation on English fonts will be introduced. For example, as Figure 1J shown, this handwriting operation interface includes English characters 22. The stylus 200 draws a wavy line 23 on some characters 221 of the English characters 22, performing a deletion operation on some characters 221. The content of some characters 221 can be "implicit positive". The electronic device 100 detects this deletion operation and deletes some characters 221.

[0085] Because the character body characteristics of English and Chinese are quite different, the judgment thresholds of the coverage rates of curves, straight lines, slant lines and broken lines are also different. The upper limit value of the parameter interval set for English is less than or equal to the upper limit value of the parameter interval set for Chinese. This will be specifically introduced below.

[0086] The judgment method of the stylus 200 drawing a broken line, a straight line or a slant line on some characters 221 of the English characters is the same as that of the stylus 200 drawing a broken line, a straight line or a slant line on some characters of the Chinese characters, and will not be elaborated here.

[0087] The electronic device 100 applicable to the present embodiment is various terminal devices with the functions of stylus writing and editing, such as tablets, mobile phones, computers, etc., but not limited thereto.

[0088] The stylus 200 applicable to the present embodiment is various types of styli with the functions of writing and editing on electronic devices, such as active capacitive pens and passive capacitive pens, etc., but not limited thereto.

[0089] For the convenience of explanation, the following takes the electronic device 100 as a tablet 100, and takes the software with handwriting pen writing and editing function on the tablet as a memo as an example to introduce the technical solution of the present application in detail in combination with the drawings.

[0090] Figure 2 According to the embodiment of the present application, a software structure block diagram of the tablet 100 implementing the technical solution of the present application is shown, as shown in the figure, the layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the system library and the kernel layer. Figure 2

[0091] The application layer can include a series of applications. For example, the memo application 21.

[0092] The application framework layer provides application programming interface (application programming interface, API) and programming framework for the applications of the application layer. The application framework layer includes some pre-defined functions. The application framework layer can include window manager 22, content provider, view system, phone manager, resource manager, notification manager, etc.

[0093] The view system 22 includes visual controls, such as controls that display text characters, controls that display pictures, etc. The view system can be used to build applications. An interface can be composed of one or more views. For example, an interface including a short message notification icon can include a view that displays text characters and a view that displays pictures.

[0094] The system layer includes Android runtime 23, which is responsible for the scheduling and management of the Android system.

[0095] The kernel layer is the layer between hardware and software. The kernel layer at least contains display driver 24, sensor driver 25.

[0096] ​In the embodiment of the present application, in the case that the user edits the printed characters converted from the handwritten characters in the display interface of the memo application 21 by using the stylus 200, the sensor driver 26 of the electronic device 100 can drive the touch sensor to receive the signal emitted by the stylus 200 when the stylus 200 contacts the touch display screen of the electronic device 100, so as to determine the coordinate data corresponding to the gesture trajectory (which can be simply referred to as a gesture) formed by the editing operation (such as sliding or clicking) of the stylus 200 on the touch display screen, and determine the gesture type of the editing operation of the stylus 200 on the selected target printed character according to the coordinate data of the gesture trajectory. For example, the memo application 21 can perform a regression fitting prediction operation according to the coordinates of the gesture operation of the stylus 200 on the selected target printed character, and identify the gesture type. For example, if the coordinates of the gesture operation are fitted into a straight line, the gesture type is a straight line type, and if there are wave crests and troughs, the gesture type is a curve type. For example, as shown in FIG. 17, the memo application 21 determines that the wavy line 17 is of the curve type according to the coordinates of the wavy line 17. Figure 1E

[0097] The memo application 21 determines whether the touch operation of the stylus 200 is a deletion operation according to the gesture type determined according to the coordinate data of the gesture trajectory corresponding to the editing operation, and in the case that the touch operation of the stylus 200 is determined to be a deletion operation, sends a deletion target printed character instruction to the view system 22. The view system 22 obtains the view data of the deleted target printed character according to the deletion target printed character instruction, and sends the view data of the deleted target printed character to the Android runtime 23. The Android runtime 23 sends the view data of the deleted target printed character to the display driver 24 in the kernel layer, so as to drive the touch display screen to display the display interface of the deleted target printed character. For example, as shown in FIG. 18, the electronic device 100 displays the display interface in which the cursor 18 is located at the position right to the character before the partial character 161 or the punctuation mark, and the characters after the partial character 161 are moved to the right side of the cursor. Figure 1F

[0098] It can be understood that, Figure 2 only a software structure block diagram of the tablet 100 implementing the technical solution of the present application, but is not limited to this structure block diagram, Figure 2 each functional module in the software structure shown in FIG. 19 is integrated in the tablet 100, and the technical solution of the present application will be specifically introduced below with the tablet 100 as the execution subject.

[0099] ​​It can be understood that the character can include a letter, a symbol or a character and a symbol, and the culture difference is added as a reference factor in the gesture type judgment of the embodiment of the application, and the recognition of different languages is considered. There is a big difference in the layout of Chinese and English characters. A single Chinese character occupies a larger space and the space between Chinese characters is narrower, while a single English character occupies a smaller space, and English is composed of words, and there is a space between words, and there is a certain space between characters. Such character presentation method, when editing characters, if the same parameter recognition interval is used, it is easy to cause misoperation. For example, when using a wavy line to delete, because there is a space before and after the target character (the character to be deleted) of the English character, a certain word can be accurately deleted, but the space between Chinese characters is small, and it is easy to cross out the characters before and after the target character, thereby causing misdeletion.

[0100] For example, Figure 3 An application scenario of a tablet using a handwriting pen for fast gesture recognition is shown, as shown in Figure 3 As shown in the application scenario, the touch control electronic device 200 and the handwriting pen 200 are included, and the touch interface of the touch control electronic device 200 includes a writing area 20 and a printed character display area 31. The touch control electronic device 200 detects that the user inputs characters in the writing area 20, and immediately converts the handwritten characters into printed characters and displays the printed characters in the printed character display area 31. Taking the English characters 32 and the Chinese characters 35 displayed in the printed character display area 31 as an example, the content of the English characters 32 is: Culturedifference in editing, and the content of the Chinese characters 35 is: Chinese and English characters show cultural differences.

[0101] It is assumed that the user draws a curve 31 (a wavy line) on the English word 321 (for example, Culture) using the handwriting pen 200 to delete the English word 321 (for example, Culture). The user draws a curve 37 (a wavy line) on the Chinese word 351 (for example, culture) using the handwriting pen 200 to delete the Chinese word 351 (for example, culture). Because the space d1 between English words is larger, and the space d2 between Chinese characters is smaller, when the wavy line drawn by the user using the handwriting pen 200 falls on the character (for example, show) adjacent to the Chinese word 351 (for example, culture) that the user wants to delete, there is a problem of mistakenly deleting the character adjacent to the Chinese word 351, that is, the current handwriting pen deletion fast gesture has a misrecognition situation, and the user experience is poor.

[0102] Currently, the handwriting pen shortcut gesture editing function does not consider the recognition parameter difference under different character presentation effects. It can be understood that the embodiments of the present application judge the language type of the printed body character selected by the editing operation, that is, Chinese or English, and then recognize the different language types with differentiated gesture type parameters, thereby improving the recognition accuracy of the handwriting pen shortcut gesture and enhancing the user experience.

[0103] It can be understood that the language type of the printed body character can be any one or more of Chinese, English, Japanese, etc., but is not limited thereto. The printed body character can include a character and a formula. In this paper, Chinese and English will be taken as examples to illustrate the technical solutions of the present application.

[0104] For Chinese characters, when the gesture trajectory is a curve, it is different from when the gesture trajectory is a straight line, an oblique line or a broken line to determine whether the curve gesture trajectory is a deletion operation. In order to illustrate the coverage of the curve, first introduce the definition of the character area where the selected target printed body character is located, for example, as shown in Figure 4 , it is assumed that in the embodiments of the present application, the content of the selected target printed body character is: "target word", in the current xy coordinate system, the x direction refers to the width direction of the "target word" from left to right, and the y direction refers to the height direction of the "target word" from top to bottom.

[0105] Firstly, according to the coordinate set of all points of the "target word" in the touch display screen, the coordinates of the highest point and the lowest point in the y direction in the coordinate set are determined, and the leftmost coordinate and the rightmost coordinate in the x direction are selected, and then the character area where the target printed body character is located is determined.

[0106] For example, the coordinates of the highest point of the "target word" in the y direction are (0, y 11 ), the coordinates of the lowest point of the "target word" in the y direction are (0, y 12 ), and the rightmost coordinates of the "target word" in the x direction are (x 12 , 0), and the leftmost coordinates are (x 11 , 0). The character area where the target printed body character is located is defined as: the area enclosed by the straight line containing the coordinates (0, y 12 ) and parallel to the x axis, the straight line containing the coordinates (0, y 11 ) and parallel to the x axis, the straight line containing the coordinates (x 11 , 0) and parallel to the y axis, and the straight line containing the coordinates (x 12 , 0) and parallel to the y axis.

[0107] Then, the vertical coordinate difference (y 12 -y 11 ) is calculated, and the horizontal coordinate difference (x 12 -x 11Then, the product of the difference in the vertical coordinate and the difference in the horizontal coordinate is used as the area of ​​character region 1, that is, the area of ​​the "target character".

[0108] It is understood that the higher the curve coverage rate corresponding to the curve drawn by the stylus 200 on the target printed character, the higher the probability that the editing operation is a deletion operation; conversely, the lower the curve coverage rate, the higher the probability that the editing operation is a selection operation under the target printed character. Similarly, the higher the curve frequency domain and the higher the curve angle corresponding to the curve drawn by the stylus 200 on the target printed character, the higher the curve coverage rate corresponding to the curve drawn by the stylus 200 on the target printed character, and the higher the probability that the editing operation is a deletion operation. Therefore, in this embodiment, the curve coverage rate, curve frequency domain, and curve angle corresponding to the curve drawn by the stylus 200 on the target printed character can be used as the basis for determining whether the editing operation is a deletion operation. If at least one condition is met, the editing operation is determined to be a deletion operation.

[0109] To improve the accuracy of deletion operation recognition, the following section introduces the curve coverage and judgment rules of the curve drawn by the stylus 200 on the target printed character in character region 1, the curve frequency domain and its judgment rules, and the curve angle and its judgment rules.

[0110] The definition of curve coverage is introduced below. First, based on the coordinate set of all points of the curve within the character area, the coordinates of the highest point in the height direction, the lowest point in the height direction, the rightmost point in the width direction, and the leftmost point in the width direction are selected to determine the trajectory area of ​​the curve. For example, as shown below... Figure 4 As shown, the coordinates of the lowest point of the curve in the y-direction are (0, y). 22 The highest point in the y-direction has coordinates (0, y). 21 ), and the leftmost coordinate of the "target word" in the x-direction is (x 21 The rightmost coordinate is (x, 0), 22 The trajectory region 2 where the curve is located is defined as: containing coordinates (0, y). 22 A straight line parallel to the y-axis, containing the coordinates (0, y). 21 A straight line parallel to the y-axis, containing the coordinates (x... 21 A straight line parallel to the x-axis and containing coordinates (x, 0) and (x, 0), and a line containing coordinates (x, 0) and (x, 0). 22 The region enclosed by a straight line parallel to the x-axis (0, 0).

[0111] Then, calculate the difference in the ordinate (y). 22 -y 21 The difference between the x and y coordinates (x) 22 -x 21 The product of the two is the area covered by the curve.

[0112] The ratio of the curve coverage area to the "target word" area is taken as the area coverage S, and the coverage Q is defined as the minimum area coverage.

[0113] As shown in the coordinate system, the coverage calculation method is: Figure 4

[0114] The following describes the judgment rule of the curve coverage: if the curve coverage is in the set parameter interval, i.e., the area coverage S of the curve stroke type is in the area coverage judgment interval Q, it is determined that the user's editing operation is a deletion operation.

[0115] The following describes the definition and judgment rule of the curve frequency domain. It can be understood that the Fourier principle shows that any continuous measured time sequence or signal can be expressed as an infinite superposition of sinusoidal signals of different frequencies. In the embodiments of the present application,

[0116] According to the embodiments of the present application, a schematic diagram of the curve frequency domain change of the curve stroke trajectory is shown. As shown in the coordinate system, Figure 5 The first step is to determine the character area 1 of the "target word" according to the above method, then determine the curve in the character area 1, and use the Fast Fourier Transform (FFT) method to convert the curve into a waveform set with a fixed periodic frequency. In the periodic frequency set, the frequency interval range is used as the judgment standard, for example, 5Hz to 30Hz. If the periodic frequency of any branch in the waveform set of the stroke curve is in this interval, it is considered to meet the judgment condition of the deletion stroke. Figure 5 For example,

[0117] is a schematic diagram of decomposing an irregular waveform in the left character area 1 into at least three periodic waveforms on the right side using Fast Fourier Transform. Specifically, the trajectory coordinate data on the curve stroke collected periodically is input into the FFT formula, and the output result includes at least the waveform of the periodic frequency f1 in the FFT change branch 1, the waveform of the periodic frequency f2 in the FFT change branch 2, and the waveform of the periodic frequency f3 in the FFT change branch 3. If any one of the periodic frequency f1, the periodic frequency f2 and the periodic frequency f3 is in the set frequency interval, it is considered to meet the judgment condition of the deletion stroke. Figure 5 The following describes the definition and judgment rule of the curve angle.

[0118]

[0119] According to the embodiments of the present application, a schematic diagram of the curve angle of the curve stroke trajectory is shown. As shown in the coordinate system, Figure 6 Figure 6 ​As shown, first, the character region 1 of the "target word" is determined according to the above method, and then the curve in the character region 1 is determined, and the coordinates (x0, y0) of the highest point and the coordinates (x1, y1) of the lowest point in the y direction of the curve stroke are determined according to the all point set of the curve stroke, and the angle between the line connecting the coordinates of the highest point and the coordinates of the lowest point and the x direction is taken as the curve angle, and the Q is positioned as the curve angle interval, and if the angle of the curve stroke is in the interval, it is considered to meet the judgment condition.

[0120] Table 1 shows the set parameter interval corresponding to each parameter type:

[0121]

[0122] As shown in Table 1, the set parameter interval of the curve coverage can be 0.35 to 1, the set parameter interval of the curve angle parameter can be: the upper slope (the angle of the line connecting the trough to the peak) is 0.27 to 10.83, the lower slope (the angle of the line connecting the peak to the trough) is -0.24 to -10.15, and the set parameter interval of the curve frequency domain can be 5Hz to 30Hz.

[0123] In order to reduce the false deletion rate and achieve accurate recognition of the deletion operation, the coverage of the editing stroke of the editing operation on each character can also be judged, and if the coverage of the editing stroke on each character is greater than the set coverage or in the set coverage interval, it is determined that the "target word" symbol selected by the editing stroke. For example, as shown in Figure 3 As shown, when the wavy line 37 drawn by the user using the handwriting pen 200 falls on the character (for example, "demonstration") adjacent to the Chinese word 351 (for example, "culture") that the user wants to delete, since the coverage of the wavy line 37 on the character (for example, "demonstration") adjacent to the Chinese word 351 (for example, "culture") that the user wants to delete is not in the preset interval, the character adjacent to the Chinese word 351 will not be mistakenly deleted, and the user's experience is improved.

[0124] The concepts of single character horizontal coverage and single character vertical coordinate coverage will be introduced below. It can be understood that the horizontal and vertical directions are the width direction and height direction of the character. The single character horizontal and vertical coverage refers to the coverage of the stroke formed by the editing operation on each character in the target printed character in the horizontal and vertical directions of the character region of each character.

[0125] Figure 7 According to the embodiments of the present application, a schematic diagram of single character coverage is shown. As shown, Figure 7 First, the character region of each character in the "target word" is determined according to the above method, and then the curve in each character region 1 is determined, and the trajectory region 2 of the curve in the character region 1 is determined. Figure 7 As shown, the character region 1 of the "word" character in the "target word" is determined according to the above method, and the trajectory region 2 of the curve in the character region 1.

[0126] The single-character horizontal coverage rate, i.e., the ratio of the horizontal coordinate difference (x 22 -x 11 ) of the rightmost coordinate and the leftmost coordinate of the curve pen trajectory on each character in the "target word" to the horizontal coordinate difference (x 12 -x 11 ) of the rightmost coordinate and the leftmost coordinate of each character in the "target word", defines Qx as the single-character horizontal coordinate coverage judgment interval. For example, Qx is 0.42 to 1.

[0127] Similarly, the single-character vertical coverage rate, i.e., the ratio of the vertical coordinate difference (y 12 -y 11 ) of the highest point coordinate and the lowest point coordinate of the curve pen trajectory on each character in the single "target word" to the vertical coordinate difference (y 22 -y 21 ) of the highest point coordinate and the lowest point coordinate of each character in the "target word", defines Qy as the single-character vertical coordinate coverage judgment interval. For example, Qy is 0.35 to 1.

[0128] If the single-character horizontal coordinate coverage rate is in the judgment interval Qx, i.e., greater than or equal to the upper limit value of the judgment interval Qx, less than or equal to the lower limit value of the judgment interval Qx, and the single-character vertical coordinate coverage rate is in the judgment interval Qy, i.e., greater than or equal to the upper limit value of the judgment interval Qy, less than or equal to the lower limit value of the judgment interval Qy, if S≥Q, i.e., the single-character horizontal coordinate coverage rate is in the judgment interval Qx and the single-character vertical coordinate coverage rate is in the judgment interval Qy, it is considered that the target printed character corresponding to the editing operation meets the condition is a deletion operation.

[0129] Embodiment one

[0130] Figure 8 According to some embodiments of the present application, a flowchart of a method for recognizing when the user's deletion pen trajectory is a curve for a Chinese character is shown. As shown in Figure 8 , the method comprises:

[0131] Step 801: detecting that the user uses the handwriting pen 200 to edit the printed character converted from the handwritten character in the display interface of the memo application program, and identifying the language type of the target printed character selected by the editing operation.

[0132] It can be understood that the tablet 100 can obtain the coordinate set of the pen gesture trajectory drawn by the user using the stylus 200 on the target printed characters, as well as the coordinate set of the target printed characters. If there are some identical coordinates (horizontal and vertical coordinate values) between the coordinate set of the pen gesture trajectory and the coordinate set of each character in the target printed characters, it is determined that the pen gesture trajectory overlaps with the target printed characters, thereby determining that the touch operation of the stylus 200 is an editing operation.

[0133] The tablet 100 performs stroke dot collection on the target handwritten characters corresponding to the target printed characters, obtains the pen gesture trajectory coordinates of the target handwritten characters, and inputs the pen gesture trajectory coordinates of the target handwritten characters into the language type recognition model to obtain the language type of the target handwritten characters, that is, the language type of the printed characters. The language type recognition model can be implemented based on a neural network model, such as a convolutional neural network model, a deep sparse convolutional neural network model, a deep recurrent neural network model, etc., to perform operations such as data preprocessing, feature extraction, and text classification.

[0134] For example, as Figure 1F shown, the handwriting operation interface of this memo application includes the printed characters after the conversion of the handwritten characters. For example, for Chinese character 16, the stylus 200 performs an editing operation on a part of the character 161 in Chinese character 16, such as drawing a wavy line 17. The content of the part of the character 261 can be "and the so-called". The tablet 100 recognizes that the language type of the part of the character 261 is Chinese.

[0135] Step 802: Recognize the pen gesture type of the editing operation of the stylus 200 on the selected target printed characters.

[0136] As described above, different pen gesture types correspond to different judgment bases. Therefore, it is necessary for the tablet 100 to recognize the pen gesture type of the editing operation of the stylus 200 on the selected target printed characters. The pen gesture types can be curves, straight lines, broken lines, etc.

[0137] Step 803: If the recognized pen gesture type of the editing operation of the stylus 200 on the selected target printed characters is a curve-type pen gesture, obtain the curve coverage rate, curve frequency domain, and curve angle of the curve drawn by the stylus 200 on the target printed characters in the character area where the target printed characters are located.

[0138] For example, as Figure 1E shown, the tablet 100 determines whether the coverage rate of the wavy line 17 corresponding to the Chinese language on the part of the character 161, the coverage rate of the wavy line 17 on the part of the character 161, the curve frequency domain parameter or the curve angle of the wavy line 17 on the part of the character 161 are respectively within the set parameter intervals.

[0139] Step 804: judging whether any one of the obtained curve coverage, curve frequency domain and curve angle is in the set parameter interval. If yes, go to step 805. If no, go to step 806.

[0140] Step 805: unable to determine the type of the editing operation, display the prompt information of performing the editing operation again to the user.

[0141] It can be understood that in some embodiments, the tablet 100 displays the prompt information of performing the editing operation again to the user in the case of being unable to determine the type of the editing operation. After the user performs the editing operation again, the tablet 100 performs steps 801 to 805 again.

[0142] Step 806: obtaining the single character horizontal and vertical coverage of the single character in the target printed character.

[0143] It can be understood that in order to reduce the false deletion rate, the single character horizontal and vertical coverage of the single character in the target printed character needs to be obtained.

[0144] Step 806: judging whether the obtained single character horizontal and vertical coverage is in the set parameter interval. If yes, go to step 808. If no, go to step 809.

[0145] In addition, in some other embodiments, in order to reduce the false deletion rate, after performing step 803, the tablet 100 can also directly obtain and judge the coverage of the editing stroke formed by the editing operation on each character. If the coverage of the editing stroke on each character in the selected target character is greater than the set coverage or in the set coverage interval, it is determined that the target character selected by the editing stroke.

[0146] Step 808: determining that the editing operation is a deletion operation, deleting the selected printed character, and stopping the cursor at the position right to the previous character of the selected printed character, and moving the characters after the selected printed character to the cursor.

[0147] Step 809: deleting the selected printed character meeting the single character coverage.

[0148] Embodiment two

[0149] It can be understood that the broken line here is a zigzag line composed of a plurality of line segments in sequence and connected in order from top to bottom along the character body or formula. Different from embodiment one, the judgment basis applied in the broken line stroke operation in embodiment two is the broken line coverage corresponding to the broken line drawn by the handwriting pen 200 on the target printed character and the single character broken line coverage in the target printed character. The editing operation is determined to be a deletion operation according to the broken line coverage and the single character broken line coverage in the target printed character. For example, as shown inFigure 9 As shown, assuming that the selected target printed character content in this embodiment is "target character", in the current xy coordinate system, the y direction refers to the width direction of "target character" from left to right, and the x direction refers to the height direction of "target character" from top to bottom.

[0150] For example, the coordinates of the highest point of the "target character" in the y-direction are (0, y). 11 The coordinates of the lowest point in the y-direction are (0, y). 12 ), and the rightmost coordinate of the "target word" in the x-direction is (x 12 The leftmost coordinate is (x, 0), 11 The character region containing the target printed character is defined as: containing coordinates (0, y). 12 And a straight line parallel to the x-axis, containing the coordinates (0, y). 11 A straight line parallel to the x-axis, containing the coordinate (x... 11 A straight line parallel to the y-axis and containing coordinates (x, 0) and (x, y). 12 The region enclosed by a straight line parallel to the y-axis (0, 0).

[0151] Then, calculate the difference between their ordinates (y). 12 -y 11 ), and calculate the difference in their x-coordinates (x). 12 -x 11 Then, the product of the difference in the vertical coordinate and the difference in the horizontal coordinate is used as the area of ​​character region 1, that is, the area of ​​the "target character".

[0152] To improve the accuracy of deletion operation recognition, the following section introduces the coverage rate of the polyline drawn by the stylus 200 on the target printed character in character area 1 and its judgment rules.

[0153] The definition of polyline coverage is introduced below. First, based on the coordinate set of all points of the polyline within the character area, the coordinates of the highest point in the height direction, the lowest point in the height direction, the rightmost point in the width direction, and the leftmost point in the width direction are selected to determine the trajectory area of ​​the polyline. For example, as shown below... Figure 4 As shown, the coordinates of the lowest point of the broken line in the y-direction are (0, y). 22 The highest point in the y-direction has coordinates (0, y). 21 ), and the leftmost coordinate of the "target word" in the x-direction is (x 21 The rightmost coordinate is (x, 0), 22 The trajectory region 2 containing the polyline is defined as: containing coordinates (0, y). 22 A straight line parallel to the y-axis, containing the coordinates (0, y). 21and a straight line containing coordinates (x 21 , 0) and parallel to the x-axis, and the area enclosed by a straight line containing coordinates (x 22 , 0) and parallel to the x-axis.

[0154] Then, the longitudinal coordinate difference (y 22 -y 21 ) and the horizontal coordinate difference (x 22 -x 21 ) are calculated, and the product of the two is taken as the area covered by the polyline.

[0155] The ratio of the area covered by the polyline to the area of the "target word" is taken as the area coverage S, and the minimum area coverage Q is defined as the coverage rate.

[0156] As shown in Figure 10 , in this coordinate system, the coverage calculation method is:

[0157]

[0158] Next, the judgment rule for the polyline coverage rate is introduced: if the polyline coverage rate is in the set parameter interval, i.e., the area coverage rate S of the polyline gesture type is in the area coverage rate judgment interval Q, then the user's editing operation is determined to be a deletion operation.

[0159] In order to reduce the false deletion rate, the coverage rate of the editing gesture on each character can also be judged, and if the coverage rate of the editing gesture on each character is greater than the set coverage rate, then the "target word" symbol selected by the editing gesture is determined.

[0160] The single-character horizontal coverage rate and the single-character longitudinal coordinate coverage rate mentioned above are the same as the concepts mentioned above.

[0161] Figure 10 According to the embodiments of the present application, a schematic diagram of a single-character coverage rate is shown. As shown in Figure 10 , first, the character area of each character in the "target word" is determined according to the above method, and then the curve in each character area 1 is determined, as shown in Figure 10 , the character area 1 of the "word" character in the "target word" is determined according to the above method, and the trajectory area 2 of the curve in the character area 1.

[0162] The single-character horizontal coverage rate is the horizontal coordinate difference (x 22 -x 11 ) of the rightmost coordinate and the leftmost coordinate of the curve gesture trajectory on each character in the "target word", and the horizontal coordinate difference (x 12 -x 11) and the ratio of y

[0163] Similarly, the single character vertical coordinate coverage, i.e., the vertical coordinate difference (y 12 -y 11 ) of the highest point coordinate and the lowest point coordinate of the curve stroke track on each character in the single "target word" and the vertical coordinate difference (y 22 -y 21 ) of the highest point coordinate and the lowest point coordinate of each character in the "target word", define Qy as the single character vertical coordinate coverage judgment interval. For example, Qy is 0.35 to 1.

[0164] If the single character horizontal coordinate coverage is in the judgment interval Qx, i.e., greater than or equal to the upper limit value of the judgment interval Qx, less than or equal to the lower limit value of the judgment interval Qx, and the single character vertical coordinate coverage is in the judgment interval Qy, i.e., greater than or equal to the upper limit value of the judgment interval Qy, less than or equal to the lower limit value of the judgment interval Qy, if S≥Q, i.e., the single character horizontal coordinate coverage is in the judgment interval Qx and the single character vertical coordinate coverage is in the judgment interval Qy, it is considered that the editing operation corresponding to the target printed character that meets the condition is a deletion operation.

[0165] Figure 11 According to some embodiments of the present application, a flowchart of a method for recognizing when the user's deletion stroke track is a polyline for a Chinese character is shown. As shown in FIG. 10, the method comprises the following steps. Figure 11

[0166] Steps 1101 and 1102 are the same as the technical means of steps 801 and 802 in Embodiment One, and will not be repeated here.

[0167] Step 1103: In the case where the recognized editing operation type of the handwriting pen 700 on the selected target printed character is a polyline, the polyline coverage of the polyline drawn by the handwriting pen 700 on the target printed character in the character region where the target printed character is located is obtained.

[0168] Step 1104: Determine whether the obtained polyline coverage is in the set parameter interval. If not, go to step 1105. If yes, go to step 1106.

[0169] Step 1105: Unable to determine the type of the editing operation, display a prompt information to the user to perform the editing operation again.

[0170] ​It can be understood that in some embodiments, the tablet 110 displays a prompt message for the user to perform the editing operation again in the case that the type of the editing operation cannot be determined. After the user performs the editing operation again, the tablet 110 performs steps 1101 to 1104 again.

[0171] Steps 1106 to 1109 are the same as the technical means of steps 306 and 309 in Embodiment One, and thus are not described herein.

[0172] In this way, the adjacent character to the character that the user wants to delete is not mistakenly deleted due to the coverage of the broken line on the adjacent character being out of the preset range, and the user experience is improved.

[0173] In addition, in other embodiments, in order to reduce the deletion error rate, after step 1102 is performed, the coverage of the editing stroke on each character in the selected target character of the editing operation can be directly determined. If the coverage of the editing stroke on each character in the selected target character is in the set coverage range, the selected target character of the editing stroke is determined.

[0174] Embodiment Three

[0175] The user can draw a set line track, for example, a horizontal line or an oblique line, on the converted printed character, so that the set line track overlaps the printed character, and the set line track is set as a deletion operation. The horizontal line and the oblique line are collectively referred to as a straight line, and the judgment method of the deletion operation is described below.

[0176] It can be understood that if the inclination angle of the straight line tends to 90 degrees, it is a vertical line in the height direction of the printed character, rather than a deletion stroke. Therefore, it can be determined whether the inclination angle of the straight line is in the straight line range first, which to some extent, eliminates the case that tends to be a vertical line.

[0177] For example, Figure 12 According to some embodiments of the present application, a schematic diagram of drawing a straight line on a "target word" and a straight line inclination angle parameter range is shown, as shown in Figure 12 As shown, it is assumed that the content of the selected target printed character in the embodiments of the present application is "target word", and in the current xy coordinate system, the y direction refers to the width direction of "target word" from left to right, and the x direction refers to the height direction of "target word" from top to bottom.

[0178] The character region 1 of the "target word" is determined according to the above description. Then the coordinates (x3, y3) and (x4, y4) of the two ends of the straight line in the character region 1 are determined, the vertical coordinate difference (y4-y3) and the horizontal coordinate difference (x4-x3) are calculated, then the ratio of the vertical coordinate difference (y4-y3) and the horizontal coordinate difference (x4-x3) is calculated, and then the inclination angle of the straight line in the character region 1 is determined according to the inverse tangent value of the ratio. y represents, x represents. The interval range Y of the inclination angle of the straight line can be -45 degrees to 45 degrees, -50 degrees to 50 degrees, -55 degrees to 55 degrees, or -75 degrees to 75 degrees, etc.

[0179] The definition of the straight line coverage rate is introduced as follows:

[0180] Figure 13 According to some embodiments of the present application, a schematic diagram of drawing a straight line on a "target word" and a straight line coverage rate is shown, as shown in Figure 13 It is assumed that the selected target printed character content is "target word" in the embodiments of the present application, and in the current xy coordinate system, the x direction refers to the width direction of the "target word" from left to right, and the y direction refers to the height direction of the "target word" from top to bottom. The D direction is the direction of the straight line, and the F is the normal direction of the straight line pen trajectory, as shown in Figure 13 The coordinates (x3, y3) and (x4, y4) of the two ends of the straight line in the character region 1, the highest point coordinate of the "target word" in the y direction is (x5, y5), and the lowest point coordinate of the "target word" in the y direction is (x6, y6). The leftmost coordinate of the "target word" in the x direction is (x7, y7), and the rightmost coordinate of the "target word" in the x direction is (x8, y8).

[0181] The character region 3 where the "target word" is located is defined as: the rectangular region surrounded by the straight line containing the coordinate (x5, y5) and parallel to the D direction, the straight line containing the coordinate (x6, y6) and parallel to the D direction, the straight line containing the coordinate (x7, y7) and parallel to the F direction, and the straight line containing the coordinate (x8, y8) and parallel to the F direction.

[0182] The character region 4 where the straight line is located is defined as: the rectangular region surrounded by the straight line containing the coordinate (x5, y5) and parallel to the D direction, the straight line containing the coordinate (x6, y6) and parallel to the D direction, the straight line containing the coordinate (x3, y3) and parallel to the F direction, and the straight line containing the coordinate (x4, y4) and parallel to the F direction.

[0183] The ratio of the area of the character region 4 to the area of the character region 3 is taken as the area coverage rate J. The judgment interval of the area coverage rate is K, and if the area coverage rate J is in the judgment interval K, it is judged that the editing operation is a deletion operation.

[0184] Similarly, the definition of the straight line, the single character coverage of the straight line is the same as the above-mentioned curve and polyline, the single character horizontal coverage refers to the ratio of the maximum and minimum horizontal coordinate difference of the curve on each character to the maximum and minimum horizontal coordinate difference on each character. The single character vertical coverage refers to the ratio of the maximum and minimum vertical coordinate difference of the curve on each character to the maximum and minimum vertical coordinate difference on each character. The judgment rule is also the same as above. Here is not repeated.

[0185] Figure 14 According to some embodiments of the present application, a flowchart of a method for recognizing when the user's deletion pen gesture trajectory is a straight line for Chinese characters is shown. As shown in Figure 14 The method comprises:

[0186] Steps 1401 and 1402 are the same as steps 701 and 702 in embodiment two in terms of technical means, and are not repeated here.

[0187] Step 1403: In the case where the recognized pen gesture type of the handwriting pen 200 on the selected target printed body character is a straight line, the inclination angle of the straight line drawn by the handwriting pen 200 on the target printed body character in the horizontal direction left and right of the character region where the target printed body character is located is obtained.

[0188] Step 1404: Determine whether the obtained inclination angle is in the preset inclination angle interval. If not, go to step 1405. If yes, go to step 1406.

[0189] When it is determined to be a straight line, the corresponding straight line inclination angle parameter interval is called out. If the recognition result is within the parameter interval, it is determined that the current editing operation is a deletion operation, otherwise the operation fails, the pen gesture line type disappears, and the user can re-operate.

[0190] Step 1406: Obtain the straight line coverage of the straight line drawn by the handwriting pen 200 on the target printed body character in the character region where the target printed body character is located;

[0191] 1407: Determine whether the obtained straight line coverage is in the set parameter interval. If yes, go to step 1408. If not, go to step 1405.

[0192] Steps 1408 to 1410 are the same as steps 706 and 709 in embodiment one in terms of technical means, and are not repeated here.

[0193] Embodiment four

[0194] Different from embodiment one, since there is no space between the characters in Chinese, and there is a space between the characters (words) in English, the upper limit value of the parameter interval of English is less than or equal to the upper limit value of the parameter interval of Chinese.

[0195] Figure 15 According to some embodiments of the present application, a flowchart of a handwriting pen editing gesture recognition method is shown. As shown in Figure 15 the method comprises:

[0196] Steps 1501 to 1509 are the same as the technical means of steps 701 to 709, except that the value range of the parameter interval set in step 304 of embodiment one is different, that is, if the recognized writing language is English, then the above-mentioned various parameter intervals are selected according to the character size and spacing of English to operate and judge in the corresponding differentiated interval range.

[0197] Similarly, it can be understood that the judgment method of the handwriting pen 200 drawing a fold line, a straight line, and a slant line on part of the characters in the English characters is the same as that of the handwriting pen 200 drawing a fold line, a straight line, and a slant line on part of the characters in the Chinese characters, which can be referred to the technical means in embodiments two and three. Only the upper limit value of the English setting parameter interval is less than or equal to the upper limit value of the Chinese setting parameter interval. For example, as shown in Figure 6 in the case of the same font size and spacing of Chinese and English, the ratio of the width value of the English single character and the sum of the width value of the Chinese single character and the width value of the single character is 1, the ratio of the width value of the Chinese single character and the sum of the width value of the Chinese single character and the width value of the single character is 2, the ratio between the ratio 1 and the ratio 2 is divided to obtain the ratio 3, and the lower limit value of the Chinese is multiplied by the ratio 3 to obtain the lower limit value of the English.

[0198] Table 1 shows the setting parameter intervals corresponding to each parameter type of Chinese and English:

[0199]

[0200]

[0201] Figure 16 According to the embodiments of the present application, a possible structural block diagram of the electronic device 100 shown in FIG. 1 is shown. The electronic device 100 can execute the handwriting pen editing gesture recognition method provided by the embodiments of the present application. Specifically, as shown in Figure 16As shown, the electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 111, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0202] It can be understood that the structure shown by the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0203] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices, or can be integrated into one or more processors.

[0204] The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0205] The processor 110 can also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can hold instructions or data that the processor 110 has just used or is using in a loop. If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0206] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0207] The MIPI interface can be used to connect the processor 110 and peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to realize the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to realize the display function of the electronic device 100.

[0208] The USB interface 130 is an interface that conforms to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.

[0209] It can be understood that the interface connection relationship between the modules in the embodiments of the present application is only illustrative and does not constitute a structural limitation on the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.

[0210] The charging management module 140 is configured to receive charging input from a charger. The power management module 141 is configured to connect the battery 142 and the charging management module 140. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 111, the display screen 194, the camera 193, and the wireless communication module 160, etc. The power management module 141 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, impedance), etc.

[0211] The wireless communication function of the electronic device 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.

[0212] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals.

[0213] The mobile communication module 150 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1 and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves radiated by the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be arranged in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 can be arranged in the same device.

[0214] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a microphone 170B, etc.), or displays an image or a video through a display screen 194. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110 and be disposed in the same device as the mobile communication module 150 or other functional modules.

[0215] The wireless communication module 160 can provide a wireless communication solution applied to the electronic device 100, including wireless local area networks (WLAN) (such as a Wi-Fi network), Bluetooth (BT), a global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), and the like. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via an antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification, and radiate the signal as an electromagnetic wave via the antenna 2. In the present embodiment, the electronic device 100 can establish a communication connection relationship with the stylus 200 through Bluetooth (BT) in the wireless communication module 160.

[0216] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidu navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).

[0217] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.

[0218] The display screen 194 is configured to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diodes (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.

[0219] The electronic device 100 can implement a photographing function through an ISP, the camera 193, a video codec, a GPU, the display screen 194, and an application processor, and the like.

[0220] The external memory interface 120 can be configured to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be saved in the external memory card.

[0221] The internal memory 111 can be configured to store computer-executable program codes including instructions. The internal memory 111 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required for a function (such as a sound playing function, an image playing function, and the like), and the like. The data storage area can store data (such as audio data, a phone book, and the like) created during use of the electronic device 100, and the like. In addition, the internal memory 111 can include a high-speed random access memory, and can further include a non-volatile memory such as at least one of a magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 110 executes various function applications and data processing of the electronic device 100 by running instructions stored in the internal memory 111 and / or instructions stored in a memory disposed in the processor. The internal memory 111 can be configured to store an Overlay configuration file corresponding to an application program.

[0222] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.

[0223] The audio module 170 is configured to convert digital audio information into analog audio signals and to convert analog audio input into digital audio signals. The audio module 170 can also be configured to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some of the functional modules of the audio module 170 can be disposed in the processor 110.

[0224] The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch display screen". The touch sensor 180K is configured to detect a touch operation acting on or near the touch sensor 180K. The touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. The display screen 194 can be used to provide visual output related to the touch operation. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194. In the embodiments of the present application, the electronic device 100 can receive the signal transmitted by the stylus 200 when the stylus 200 contacts the touch display screen of the electronic device 100 through the touch sensor 180K, so as to obtain the coordinates of the stylus 200 on the touch display screen. The electronic device 100 determines whether the user operation is a deletion operation according to the coordinate data corresponding to the trajectory of the stylus 200 on the touch display screen. If so, the character drawn by the line is deleted.

[0225] The keys 190 include a power-on key, a volume key, etc. The keys 190 can be mechanical keys. They can also be touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0226] The motor 191 can generate a vibration prompt. The indicator 192 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, etc. The SIM card interface 195 is configured to connect a SIM card.

[0227] In essence or in the part that contributes to the prior art, or all or part of the technical solution of the embodiments of the present application can be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the various embodiment methods of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0228] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it should be understood that various changes in form and detail can be made therein without departing from the spirit and scope of the application.

Claims

1. A handwriting pen gesture recognition method, applied to electronic devices, characterized in that, The method comprises: The electronic device determines a first character region of the character overlapped by the stroke track and the stroke track when the electronic device detects that a stroke track generated by a user using a stylus on a screen of the electronic device overlaps a character displayed on the screen; The electronic device determines whether an overlapping relationship between the stroke track and the first character region meets a first predetermined condition; When the first predetermined condition is met, the electronic device determines that the editing operation corresponding to the stroke track is a deletion operation, and deletes the character overlapped; The electronic device determines whether an overlapping relationship between the stroke track and the first character region meets a first predetermined condition, comprising: determining a language type of the character overlapped; determining a stroke track type of the stroke track; determining a stroke type parameter corresponding to the language type and the stroke track type, wherein the stroke type parameter corresponding to different language types is different; determining whether the overlapping relationship between the stroke track and the first character region meets the first predetermined condition according to the stroke type parameter.

2. The method of claim 1, wherein, The first character region is a rectangular region enclosed by two straight lines respectively containing the highest point coordinate and the lowest point coordinate of the character in the height direction and parallel to the width direction, and two straight lines respectively containing the leftmost coordinate and the rightmost coordinate of the character in the width direction and parallel to the height direction.

3. The method of claim 2, wherein, The electronic device determines a first ratio of an area of a first track region of the stroke track to an area of the first character region when the stroke track type is a curve type, wherein the first track region is a rectangular region enclosed by two straight lines respectively containing the highest point coordinate and the lowest point coordinate of the character in the stroke track in the height direction and parallel to the width direction, and two straight lines respectively containing the leftmost coordinate and the rightmost coordinate of the character in the width direction and parallel to the height direction in the first character region; The electronic device determines that the first predetermined condition is met when it is determined that the first ratio is in a first parameter interval. The electronic device obtains an inclination angle of the straight line stroke track to the character width direction of the first character region when the stroke track type is a straight line type; 4. The method of claim 2, wherein, The electronic device obtains a third ratio of an area of a second track region to an area of a second character region when it is determined that the inclination angle is in a second parameter interval; The second character region is a rectangular region enclosed by two straight lines respectively containing the highest point coordinate and the lowest point coordinate of the character in the height direction and parallel to the straight line direction, and two straight lines respectively containing the leftmost coordinate and the rightmost coordinate of the character in the width direction and parallel to the normal direction of the straight line. ​ ​ The second trajectory area is a rectangular area surrounded by two straight lines parallel to the straight line direction and located at the highest point coordinate and the lowest point coordinate of the character height direction of the stroke trajectory in the first character area, and two straight lines parallel to the normal direction of the straight line and located at the leftmost coordinate and the rightmost coordinate of the character width direction. The electronic device determines that the first predetermined condition is met when the third ratio is determined to be in a third parameter interval.

5. The method of claim 2, wherein, The electronic device determines whether the overlap relationship between the stroke trajectory and the first character area meets the first predetermined condition according to the stroke type parameter, including: When the stroke trajectory type is a line type, the electronic device determines a first ratio of the area of the first trajectory area to the area of the first character area, wherein the first trajectory area is a rectangular area surrounded by two straight lines parallel to the width direction and containing the highest point coordinate and the lowest point coordinate of the character height direction of the stroke trajectory in the first character area, and two straight lines parallel to the height direction and containing the leftmost coordinate and the rightmost coordinate of the character width direction. The electronic device determines that the first predetermined condition is met when the second ratio is determined to be in a fourth parameter interval.

6. The method of claim 2, wherein, The method includes: When the stroke trajectory type is a curve type, the electronic device obtains a set of sine waves of the curve stroke trajectory by using fast Fourier transform; The electronic device obtains the frequency of a preset number of sine waves arranged in descending order of frequency value in the set of sine waves. The electronic device determines that the first predetermined condition is met when the frequency of the preset number of sine waves is determined to be in a fifth parameter interval.

7. The method of claim 2, wherein, The method includes: When the stroke trajectory type is a curve type, the electronic device obtains the highest point coordinate and the lowest point coordinate of the curve stroke trajectory in the height direction of the first character area. The electronic device determines the inclination angle between the line connecting the highest point and the lowest point and the height direction according to the highest point coordinate and the lowest point coordinate. The electronic device determines that the first predetermined condition is met when the inclination angle is determined to be in a sixth parameter interval.

8. The method according to any one of claims 1 to 7, characterized in that, The electronic device determines that the number of overlapping characters is multiple, and when the electronic device determines that the overlap relationship between the stroke trajectory and the first character area meets the first predetermined condition, the electronic device further determines whether the overlap relationship between the stroke trajectory on each of the multiple overlapping characters and the single first character area of each character meets a second predetermined condition, and deletes the character meeting the second predetermined condition when it is determined that the second predetermined condition is met.

9. The method of claim 8, wherein, The first character area is a rectangular area surrounded by two straight lines parallel to the height direction and containing the highest point coordinate and the lowest point coordinate of the single character height direction, and two straight lines parallel to the width direction and containing the leftmost coordinate and the rightmost coordinate of the single character width direction.

10. The method of claim 9, wherein, determining whether the overlapping relationship between the stroke trajectory on each of the plurality of characters and the single first character region of each character satisfies a second predetermined condition, comprises: The electronic device determines a width ratio of a width value of each of the overlapping characters to the first character region width value, and a height ratio of a height value of each of the overlapping characters to the first character region height value. The electronic device determines that the first predetermined condition is satisfied when the width ratio is in a seventh parameter interval and the height ratio is in an eighth parameter interval.

11. The method according to any one of claims 1 to 10, characterized in that, The electronic device determines whether the overlapping relationship between the stroke trajectory and the first character region satisfies a first predetermined condition according to the stroke type parameter, comprising: The electronic device determines whether the character is a first language character or a second language character. The electronic device determines whether the overlapping relationship between the stroke trajectory and the first character region satisfies the predetermined condition corresponding to the first language character when it is determined that the character is a first language character. The electronic device determines whether the overlapping relationship between the stroke trajectory and the first character region satisfies the predetermined condition corresponding to the first language type when it is determined that the character is a second language character.

12. The method of claim 11, wherein, The first language includes any one of Chinese, English, German, and French, and the second language includes any one of Chinese, English, German, and French.

13. The method according to any one of claims 1 to 10, characterized in that, The character is a printed character converted from a handwritten character.

14. The method according to any one of claims 1 to 7, characterized in that, The character is displayed on an operation interface of a preset application on the electronic device, and the preset application is any one of memo, pen calculator, Nebo for Huawei, and random handwriting.

15. A readable medium characterized by The readable medium stores instructions that, when executed on the electronic device, cause the electronic device to implement the handwriting pen editing stroke recognition method of any one of claims 1 to 14.

16. An electronic device comprising: The memory is configured to store instructions for execution by one or more processors of the electronic device, and The processor is one of the processors of the electronic device, and is configured to execute the handwriting pen editing stroke recognition method of any one of claims 1 to 14.

Citation Information

Patent Citations

  • Modification method based on handwriting input and terminal

    CN105843546A