WO2022252821A1 - 一种手写笔编辑笔势识别方法、介质及电子设备 - Google Patents

一种手写笔编辑笔势识别方法、介质及电子设备 Download PDF

Info

Publication number
WO2022252821A1
WO2022252821A1 PCT/CN2022/085895 CN2022085895W WO2022252821A1 WO 2022252821 A1 WO2022252821 A1 WO 2022252821A1 CN 2022085895 W CN2022085895 W CN 2022085895W WO 2022252821 A1 WO2022252821 A1 WO 2022252821A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
electronic device
area
gesture
coordinates
Prior art date
Application number
PCT/CN2022/085895
Other languages
English (en)
French (fr)
Inventor
李淑玲
胡月
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022252821A1 publication Critical patent/WO2022252821A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03545Pens or stylus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/0412Digitisers structurally integrated in a display

Definitions

  • the present application relates to the field of terminal technology, in particular to a method, medium and electronic device for recognizing editing gestures with a stylus.
  • the handwritten character is immediately converted into a printed character.
  • the user uses the stylus to edit the printed character, the user can use the stylus to draw on the selected target printed character.
  • the wavy line realizes the function of deleting the target printed character, and the function of selecting the target printed character can also be realized by drawing a straight line on the selected target printed character by using the stylus.
  • the current stylus pen deletion shortcut gesture judgment method still has certain recognition pain points: when the user wants to delete some characters in the printed characters, use the stylus to draw a wavy line on the selected target printed characters, and the electronic device It is easy to misidentify the deletion gesture of drawing a wavy line on the selected target printed character by the stylus as the selected gesture, and then select and display the target printed character selected by the stylus instead of deleting the target printed character. In this way, there is The situation where the stylus deletes the shortcut gesture is misrecognized, and the user's physical examination is poor.
  • Embodiments of the present application provide a stylus pen editing gesture recognition method, medium and electronic equipment.
  • the embodiment of the present application provides a method for recognizing a stylus editing gesture, the method comprising:
  • the electronic device When the electronic device detects that the gesture trajectory generated by the user using the stylus on the screen of the electronic device overlaps with the characters displayed on the screen, determine the overlapping first character area of the character and gesture trajectory;
  • the electronic device determines whether the overlapping relationship between the gesture track and the first character area satisfies a first predetermined condition
  • the electronic device determines that the editing operation corresponding to the gesture track is a deletion operation, and deletes the overlapping characters.
  • the embodiment of the present application considers the writing and editing scene of real pen and paper writing, so as to achieve the perceptual consistency of character editing.
  • the deletion function can be realized by covering the text characters, that is, drawing different line shapes on the text characters, such as horizontal lines, oblique lines, wavy lines, etc., as long as the coverage rate reaches a certain level.
  • a parameter range can be quickly deleted.
  • the setting rule of character highlighting can be adopted, and the method of circle selection, horizontal line or wavy line under the character can be used, etc.
  • Such a setting rule is more in line with the psychological expectation of the user's handwriting editor, and it is easier to learn and remember. Therefore, to a certain extent, the problem of misrecognition of the delete gesture that the stylus pen draws a wavy line on the selected target printed character as the selected gesture is avoided.
  • the above-mentioned method further includes: the first character area is two overlapping coordinates of the highest point and the lowest point in the height direction of all the characters that are parallel to the width direction. a straight line, and two straight lines that respectively include the leftmost coordinate and the rightmost coordinate in the width direction of the character and are parallel to the height direction, enclosing a rectangular area.
  • the electronic device determines whether the overlapping relationship between the gesture trajectory and the first character area satisfies a first predetermined condition, including:
  • the electronic device determines a first ratio of the area of the first trajectory region of the gesture trajectory to the area of the first character region; wherein, the first trajectory The areas are two straight lines that respectively contain the highest point coordinates and the lowest point coordinates of the character height direction of the gesture track in the first character area and are parallel to the width direction, and respectively contain the leftmost coordinates and the rightmost coordinates of the character width direction The rectangular area surrounded by two straight lines parallel to the height direction;
  • the electronic device determines that the first predetermined condition is met when it is determined that the first ratio is within the first parameter interval.
  • the first parameter interval may be a set parameter interval of the curve coverage ratio.
  • the above method further includes: the electronic device determining whether the overlapping relationship between the gesture trajectory and the first character area satisfies a first predetermined condition, including:
  • the electronic device acquires an inclination angle between the straight line gesture track and the character width direction of the first character area;
  • the electronic device determines that the inclination angle is in the second parameter interval, it obtains a third ratio of the area of the second trajectory area to the area of the second character area;
  • the second character area is two straight lines that respectively include the highest point coordinate and the lowest point coordinate of the character height direction of the character and are parallel to the straight line direction, and respectively include the leftmost coordinate and the rightmost coordinate in the character width direction.
  • the rectangular area surrounded by two straight lines with side coordinates and parallel to the normal direction of the straight line;
  • the second trajectory area is two straight lines parallel to the straight line direction where the highest point coordinate and the lowest point coordinate of the character height direction of the gesture trajectory in the first character area are located, and the leftmost coordinate and the lowest point coordinate in the character width direction.
  • the rectangular area surrounded by two straight lines parallel to the normal direction of the straight line where the coordinates on the right are located;
  • the electronic device determines that the first predetermined condition is met when it is determined that the third ratio is in the third parameter interval.
  • the second parameter interval may be a set parameter interval of the straight line inclination
  • the third parameter interval may be a set parameter interval of the straight line coverage
  • the above method further includes: the electronic device determining whether the overlapping relationship between the gesture trajectory and the first character area satisfies a first predetermined condition, including:
  • the electronic device determines a second ratio between the area of the first trajectory area and the area of the first character area; wherein, the first trajectory area contains the The coordinates of the highest point and the coordinates of the lowest point in the character height direction of the gesture track in the first character area and two straight lines parallel to the width direction, and the leftmost coordinates and rightmost coordinates in the character width direction respectively and parallel to the height The rectangular area surrounded by two straight lines in the direction;
  • the electronic device determines that the first predetermined condition is met when it is determined that the second ratio is within the fourth parameter interval.
  • the fourth parameter interval may be a set parameter interval of the polyline.
  • the above method further includes: if the type of the gesture trajectory is a curve type, the electronic device adopts fast Fourier transformation to obtain the sine wave of the curved gesture trajectory gather;
  • the electronic device obtains the frequency of the preset sine waves in the sine wave set according to the frequency value from large to small;
  • the electronic device determines that the frequency of the preset sine wave is within the fifth parameter interval, it determines that the first predetermined condition is met.
  • the fifth parameter interval may be a set parameter interval in the frequency domain of the curve.
  • the above method further includes: if the type of the gesture trajectory is a curve type, the electronic device acquires the height of the curved gesture trajectory in the first character area The highest point coordinates and the lowest point coordinates of the direction;
  • the electronic device determines an inclination angle between a line between the highest point and the lowest point and the height direction according to the coordinates of the highest point and the lowest point;
  • the electronic device determines that the inclination angle is in the sixth parameter interval, it determines that the first predetermined condition is met.
  • the sixth parameter interval may be a set parameter interval of the curve angle.
  • the above-mentioned method further includes: the electronic device determines that the number of overlapping characters is multiple, and the electronic device determines that the gesture track and the first When the overlapping relationship between a character area satisfies the first predetermined condition, the overlapping relationship between the gesture trajectory on each character of the overlapping characters and the single first character area of each character is also judged Whether the second predetermined condition is satisfied, and if it is judged that the second predetermined condition is satisfied, delete the characters satisfying the second predetermined condition.
  • the electronic device can determine whether the coverage rate of the gesture track on each character meets the reference standard, thereby deleting characters meeting the reference standard (the second predetermined condition), reducing the rate of mistaken deletion, and achieving accurate identification of the deletion operation.
  • the above-mentioned method further includes: the first character area is two straight lines that respectively contain the coordinates of the highest point and the coordinates of the lowest point in the height direction of a single character and are parallel to the height direction, and Respectively contain the leftmost coordinates and rightmost coordinates of a single character in the width direction and are parallel to the width direction, a rectangular area surrounded by two straight lines.
  • the above-mentioned method further includes: judging the overlapping relationship between the gesture trajectory on each of the multiple overlapping characters and the single first character area of each character Whether the second predetermined condition is met, including:
  • the electronic device determines the width ratio of the width value of each character in the overlapping characters to the width value of the first character area, and the height value of each character in the overlapping characters and the width value of the first character area A height ratio of the height value, the electronic device determines that the first predetermined condition is satisfied when the electronic device determines that the width ratio is in the seventh parameter interval and the height ratio is in the eighth parameter interval.
  • the seventh parameter interval may be the setting parameter interval of the single character coverage in the horizontal direction
  • the eighth parameter interval may be the setting parameter interval of the single character vertical coverage.
  • the above method further includes: the electronic device determining whether the overlapping relationship between the gesture trajectory and the first character area satisfies a predetermined condition, including:
  • the electronic device determines whether the character is a first language character or a second language character
  • the electronic device determines that it is a character in the first language, it acquires a predetermined condition corresponding to the character in the first language, and determines whether the overlapping relationship between the gesture track and the first character area satisfies the a predetermined condition corresponding to the first language character;
  • the electronic device determines that it is a character in the second language, it acquires a predetermined condition corresponding to the character in the second language, and determines whether the overlapping relationship between the gesture trajectory and the first character area satisfies the The predetermined condition corresponding to the first language type.
  • the short-cut gesture editing function of the stylus has not considered the difference in recognition parameters under the rendering effect of different characters. It can be understood that the embodiment of the present application judges the language type of the printed character selected in the editing operation, that is, Chinese or English , and then use differentiated gesture type parameter recognition for different languages, which improves the recognition accuracy of stylus shortcut gestures and improves user experience.
  • the first language includes any one of Chinese, English, German, and French
  • the second language includes any one of Chinese, English, German, and French. A sort of.
  • the characters are printed characters converted from handwritten characters.
  • the characters are displayed on the operation interface of a preset application program on the electronic device, and the preset application program is memo, pen calculator, Nebo for Huawei, Any kind of handwriting.
  • the embodiment of the present application also provides a readable medium, and instructions are stored on the readable medium, and when the instructions are executed on the electronic equipment, the electronic equipment realizes any one of the above described in the first aspect. Stylus editing gesture recognition method.
  • an embodiment of the present application further provides an electronic device, including: a memory configured to store instructions executed by one or more processors of the electronic device, and
  • the processor is one of the processors of the electronic device, configured to execute the method for recognizing editing gestures with a stylus according to any one of the first aspect.
  • FIGS. 1A to 1J are schematic diagrams showing application scenarios of a method for recognizing editing gestures with a stylus according to some embodiments of the present application.
  • FIG. 2 shows a software structural block diagram of a tablet 100 implementing the technical solution of the present application according to an embodiment of the present application.
  • FIG. 3 shows a schematic diagram of an application scenario of a tablet using a stylus for quick gesture recognition.
  • Fig. 4 shows a schematic diagram of multi-character coverage for curved gesture trajectories according to an embodiment of the present application.
  • Fig. 5 shows a schematic diagram of changes in the frequency domain of a curve of a curve gesture trajectory according to an embodiment of the present application.
  • Fig. 6 shows a schematic diagram of a curve angle of a curve gesture trajectory according to an embodiment of the present application.
  • Fig. 7 shows a schematic diagram of single-character coverage according to an embodiment of the present application.
  • Fig. 8 shows a schematic flowchart of a method for recognizing Chinese characters when the trajectory of the user's delete gesture is a curve, according to some embodiments of the present application.
  • FIG. 9 shows a schematic diagram of multi-character coverage corresponding to a polyline gesture trajectory according to an embodiment of the present application.
  • Fig. 10 shows a schematic diagram of coverage of a single character corresponding to a polyline gesture trajectory according to an embodiment of the present application.
  • Fig. 11 shows a schematic flowchart of a method for recognizing Chinese characters when the trace of the user's delete gesture is a broken line, according to some embodiments of the present application.
  • Fig. 12 shows a schematic diagram of drawing a straight line on a "target character” and a parameter range of the inclination angle of the line according to some embodiments of the present application.
  • Fig. 13 shows a schematic diagram of drawing a straight line on a "target word” and the coverage of the straight line according to some embodiments of the present application.
  • Fig. 14 shows a schematic flowchart of a method for recognizing Chinese characters when the trace of the user's delete gesture is a straight line, according to some embodiments of the present application.
  • Fig. 15 shows a schematic flowchart of a method for recognizing English characters when the trajectory of the user's delete gesture is a curve, according to some embodiments of the present application.
  • FIG. 16 shows a possible structural block diagram of the electronic device 100 shown in FIG. 1 according to an embodiment of the present application.
  • Illustrative embodiments of the present application include, but are not limited to, a stylus pen editing gesture recognition method, medium, and electronic device.
  • an embodiment of the present application discloses a method for recognizing editing gestures of a stylus. Specifically, after the characters written by the user with a stylus are converted into printed characters, if the user draws a set line trajectory on the converted printed characters, for example, a horizontal line, an oblique line, a folded line, a wavy line, etc., the set If the specified line track overlaps with printed characters, then it can be determined whether the user's operation is a delete operation according to the coverage relationship between the line track and the character area where the printed character overlapping with the line track is located. If it is determined to be a delete operation, then Printed characters overlapping with line traces are deleted. Therefore, to a certain extent, the problem of misrecognition of the delete gesture that the stylus pen draws a wavy line on the selected target printed character as the selected gesture is avoided.
  • the specific scheme will be described below.
  • the stylus editing gesture recognition method provided in the embodiment of the present application is applied to various software with stylus writing and editing functions, such as memo, pen calculator, Nebo for Huawei, handwriting, etc.
  • the embodiments of the present application are applicable to various input and editing scenarios such as global handwriting and handwriting transferred to printed form in an electronic device system.
  • the stylus gesture recognition method provided by the embodiment of the present application will be further described below by taking the software with stylus writing and editing functions as a memo and the scene of handwriting-to-printed input and editing in an electronic device system as an example.
  • FIGS. 1A to 1J are schematic diagrams showing application scenarios of a method for recognizing editing gestures with a stylus according to some embodiments of the present application.
  • This application scenario includes the electronic device 100. Assuming that the user wants to make notes in the memo in the electronic device 100, the user first needs to open the memo, then, the user creates a new memo, and after turning on the handwriting function of the memo, perform handwriting Note operation.
  • the display interface of the electronic device 100 displays a memo control 10 , and the user can open the memo by clicking the memo control 10 .
  • the electronic device 100 enters the operation interface of the memo.
  • the operation interface of the memo includes a create button 11 .
  • the electronic device 100 displays the newly created memo.
  • the newly created memo interface includes a handwriting control 12 and a handwriting-to-print control 13 .
  • the electronic device 100 displays a handwriting interface, as shown in FIG. 1D , the handwriting interface includes a handwriting area 14 and a printed text display area 15 .
  • the application scenario also includes a stylus 200.
  • the stylus 200 can establish a communication connection with the electronic device 100 through Bluetooth, so as to perform touch operations on the electronic device 100.
  • the touch operations include Editing operations and handwriting operations, etc.
  • the user can also directly turn on the power button of the stylus 200 to perform touch operations on the electronic device 100 , but it is not limited thereto.
  • the characters written by the user in the handwriting area 14 with the stylus 200 can be converted into printed characters in real time and displayed in the printed display area 15 .
  • the handwriting area 14 is floating on the print display area 15, or the handwriting area 14 partially overlaps the print display area 15, but not limited thereto.
  • the delete function can be realized by covering the text characters, that is, drawing different line shapes on the text characters, such as horizontal lines, oblique lines, wavy lines, etc. , which can realize the delete function.
  • the following describes several operations for deleting Chinese characters.
  • the handwriting operation interface includes Chinese characters 16
  • the stylus 200 draws wavy lines 17 on some of the characters 161 in the Chinese characters 16 , and performs a deletion operation on some of the characters 161 .
  • the content of the partial character 161 may be "and the so-called”.
  • the electronic device 100 may determine whether the user's operation is a deletion operation according to the coverage of the wavy line 17 on the four characters "and the so-called", and determine that the deleted characters are the four characters "the so-called”. If it is determined to be a deletion operation, some characters 161 are deleted.
  • FIG. 1F after the electronic device 100 deletes the partial character 161 , the cursor 18 stays on the right side of the character or punctuation before the partial character 161 , and the character behind the partial character 161 moves forward to the right side of the cursor.
  • the stylus 200 draws a broken line 19 on a part of the character 161 in the Chinese character 16 , and deletes the part of the character 161 .
  • the content of the partial character 161 may be "and the so-called”.
  • the electronic device 100 may determine whether the user's operation is a deletion operation according to the coverage of the broken line 19 on the four characters "and the so-called", and determine that the deleted characters are the four characters "the so-called”. If it is determined to be a deletion operation, some characters 161 are deleted.
  • FIG. 1F after the electronic device 100 deletes the partial character 161 , the cursor 18 stays on the right side of the character or punctuation before the partial character 161 , and the character behind the partial character 161 moves forward to the right side of the cursor.
  • the stylus 200 draws a straight line 20 on a part of the character 161 in the Chinese character 16 , and deletes the part of the character 161 .
  • the content of the partial character 161 may be "and the so-called”.
  • the electronic device 100 may determine whether the user's operation is a deletion operation according to the coverage 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”. If it is determined to be a delete operation, part of the characters 161 are deleted.
  • FIG. 1F after the electronic device 100 deletes the partial character 161 , the cursor 18 stays on the right side of the character or punctuation before the partial character 161 , and the character behind the partial character 161 moves forward to the right side of the cursor.
  • the stylus 200 draws oblique lines 21 on part of the characters 161 in the Chinese characters 16 , and deletes the part of the characters 161 .
  • the content of the partial character 161 may be "and the so-called”.
  • the electronic device 100 may determine whether the user's operation is a deletion operation according to the coverage of the slash 21 on the four characters "and the so-called", and determine that the deleted characters are the four characters "and the so-called”. If it is determined to be a delete operation, part of the characters 161 are deleted.
  • FIG. 1F after the electronic device 100 deletes the partial character 161 , the cursor 18 stays on the right side of the character or punctuation before the partial character 161 , and the character behind the partial character 161 moves forward to the right side of the cursor.
  • the definitions of the coverage relationship between curves, straight lines, oblique lines, broken lines, and the character area where printed characters are located are different. It can be understood that the coverage rate of a curve is the ratio between the area surrounded by the curve and the character area where the target printed characters are located. degree of relationship.
  • the coverage of the polyline is the degree of relationship between the area enclosed by the polyline and the area of the target typographic characters.
  • the straight line and oblique line are based on the inclination angle between the straight line and oblique line and the width direction of the target printed body. It will be introduced in detail below.
  • Character 221 performs a delete operation.
  • the content of some characters 221 may be "implicit positive”.
  • the electronic device 100 detects the deletion operation, and deletes part of the characters 221 .
  • the upper limit of the English setting parameter range is less than or equal to the upper limit value of the Chinese setting parameter range.
  • the judging method of the stylus 200 drawing broken lines, straight lines, and oblique lines on some characters 221 of the English characters 22 is the same as that of the stylus 200 drawing broken lines, straight lines, and oblique lines on some characters of the Chinese characters, and will not be repeated here. repeat.
  • the electronic device 100 applicable to this embodiment is a variety of terminal devices with writing and editing functions with a stylus, such as a tablet, a mobile phone, a computer, etc., but is not limited thereto.
  • the stylus 200 applicable to the embodiment itself is various types of stylus with writing and editing functions on electronic devices, such as active capacitive pens and passive capacitive pens, etc., but not limited thereto.
  • the electronic device 100 is the tablet 100
  • the software with writing and editing functions on the tablet is the memo as an example, and the technical solution of the present application will be introduced in detail with reference to the accompanying drawings.
  • Fig. 2 shows a software structure block diagram for implementing the technical solution of the present application tablet 100 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system is divided into four layers, which are application program layer, application program framework layer, system library and kernel layer from top to bottom.
  • the application layer can include a series of applications.
  • the memo application 21 can include a series of applications.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include a window manager 22, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
  • the view system 22 includes visual controls, such as controls for displaying text, for displaying pictures, and so on.
  • the view system can be used to build applications.
  • An interface can consist of one or more views.
  • an interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
  • the system layer includes Android Runtime (Android Runtime) 23, and Android Runtime 23 is used to be responsible for the scheduling and management of the Android system.
  • Android Runtime is used to be responsible for the scheduling and management of the Android system.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least a display driver 24 and a sensor driver 25 .
  • the sensor driver 26 of the electronic device 100 can drive the touch sensor to receive handwritten characters.
  • the signal transmitted by the pen 200 in contact with the touch screen of the electronic device 100 is used to determine the coordinates corresponding to the gesture trajectory (may be referred to as gesture) formed by the stylus 200 on the touch screen for editing operations (such as sliding and clicking).
  • the memo application 21 can perform a regression fitting prediction operation on the coordinates of the gesture operation of the selected target printed character according to the stylus 200 to identify the gesture type, for example, if the coordinates of the gesture operation are fitted into a straight line, then it is a straight line type, or curve type if there are peaks and troughs. For example, as shown in FIG. 1E , the memo application 21 determines that the wavy line 17 is a curve type according to the coordinates of the wavy line 17 .
  • the memo application 21 judges whether the touch operation of the stylus 200 is a delete operation according to the gesture type determined by the gesture trajectory coordinate data corresponding to the edit operation, and if it is judged that the touch operation of the stylus 200 is a delete operation, sends a message to the view system 22 Send the delete target printed character instruction, the view system 22 obtains the view data of the deleted target printed character according to the deleted target printed character instruction, and sends the view data of the deleted target printed character to the Android runtime 23, and the Android runtime 23. Send the view data of the deleted target printed character to the display driver 24 of the kernel layer, thereby driving the touch screen to display the display interface of the deleted target printed character. For example, as shown in FIG.
  • the electronic device 100 displays part of the character After 161 is deleted, it is displayed that the cursor 18 stays on the position on the right side of the previous character or punctuation point of the part character 161, and the characters behind the part character 161 move forward to the display interface on the right side of the cursor.
  • Fig. 2 is only a block diagram of a software structure for implementing the technical solution of the present application, but is not limited to this block diagram, and each functional module in the software structure shown in Fig. 100 is the subject of execution of the steps, which specifically introduces the technical solution of the present application.
  • characters can include text characters, symbols, or both characters and symbols.
  • the reference factor of cultural differences is added to the judgment of the gesture type in the embodiment of the present application, and the recognition of different languages is considered.
  • Chinese and English in text and character layout There is a big difference between Chinese and English in text and character layout The difference is that a single Chinese character occupies a large space and the space between Chinese characters is narrow, while a single English letter occupies a small space, and English is composed of words, there are spaces between words, and there is a certain space between characters.
  • a text character presentation mode if the same parameter identification interval is used when editing text characters, it is easy to misuse.
  • FIG. 3 shows a schematic diagram of an application scenario in which a tablet utilizes a stylus for quick gesture recognition.
  • the touch interface includes a writing area 20 and a printed character display area 31.
  • the touch electronic device 200 detects that the user enters a character in the writing area 20, it immediately converts the handwritten character into a printed character and displays it on the printed character display. District 31.
  • the content of the English characters 32 is: Culture difference in editing
  • the content of the Chinese characters 35 is: Chinese and English characters display cultural differences.
  • the user uses the stylus 200 to draw a curved line 31 (wavy line) on an English word 321 (eg Culture) to delete the English word 321 (eg Culture).
  • the user uses the stylus 200 to draw a curved line 37 (wavy line) on the Chinese word 351 (eg culture) to delete the Chinese word 351 (eg culture).
  • the short-cut gesture editing function of the stylus has not considered the difference in recognition parameters under the rendering effect of different characters. It can be understood that the embodiment of the present application judges the language type of the printed character selected in the editing operation, that is, Chinese or English , and then use differentiated gesture type parameter recognition for different languages, which improves the recognition accuracy of stylus shortcut gestures and improves user experience.
  • printed characters may be any one or more of Chinese, English, Japanese, etc., but is not limited thereto.
  • Printed characters can include literal characters and formulas. This article will take Chinese and English as examples to illustrate the technical solution of this application.
  • the coordinates of the highest point of the "target word” in the y direction are (0,y 11 )
  • the coordinates of the lowest point in the y direction are (0,y 12 )
  • the rightmost coordinates of the "target word” in the x direction is (x 12 ,0)
  • the leftmost coordinate is (x 11 ,0).
  • the character area where the target print character is located is defined as: a straight line including coordinates (0,y 12 ) and parallel to the x-axis, a straight line including coordinates (0,y 11 ) and parallel to the x-axis, including coordinates (x 11 , 0) and a straight line parallel to the y-axis, and the area enclosed by a line with coordinates (x 12 ,0) and parallel to the y-axis.
  • the higher the coverage rate of the curve 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, and the lower the coverage rate of the curve, it indicates that the editing operation is a deletion operation.
  • the probability of the selected operation under the font character is higher.
  • the higher the frequency domain of the curve corresponding to the curve drawn by the stylus 200 on the target printed character and the higher the curve angle the higher the coverage of the curve corresponding to the curve drawn by the stylus 200 on the target printed character. Higher, it indicates that the probability that the editing operation is a deletion operation is higher.
  • 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 judgment method.
  • the edit operation is the basis for the delete operation, if at least one condition is satisfied, the edit operation is determined to be a delete operation.
  • the following introduces the curve coverage and its judgment rule, the curve frequency domain and its judgment rule, the curve angle and its Judgment rules.
  • the following introduces the definition of curve coverage.
  • the coordinates of the lowest point of the curve in the y direction are (0, y 22 )
  • the coordinates of the highest point in the y direction are (0, y 21 )
  • the “target word” is at the leftmost point in the x direction
  • the side coordinates are (x 21 ,0)
  • the rightmost coordinates are (x 22 ,0).
  • the trajectory area 2 where the curve is located is defined as: a straight line containing coordinates (0,y 22 ) and parallel to the y-axis, a straight line containing coordinates (0,y 21 ) and parallel to the y-axis, containing coordinates (x 21 ,0) and a straight line parallel to the x-axis, and an area enclosed by a straight line with coordinates (x 22 ,0) parallel to the x-axis.
  • the ordinate difference (y 22 -y 21 ) and the abscissa difference (x 22 -x 21 ) are calculated, and the product of the two is used as the coverage area of the curve.
  • the ratio of the curve coverage area to the "target word” area is taken as the area coverage rate S, and the coverage rate Q is defined as the minimum area coverage rate.
  • the coverage calculation method is:
  • the judgment rule of curve coverage is introduced below: if the curve coverage is within the set parameter interval, that is, the area coverage S of the curve gesture type is within the area coverage judgment interval Q, then the user's editing operation is determined to be a delete operation.
  • FIG. 5 shows a schematic diagram of changes in the frequency domain of a curve of a curved gesture trajectory according to the embodiment of the present application.
  • FFT Fast Fourier Transform
  • Fig. 5 is a schematic diagram of decomposing an irregular waveform in the character area 1 on the left into waveforms of at least three cycles on the right using Fast Fourier Transformation, specifically, the trajectory coordinates on the periodically collected curve gestures
  • the data is input into the FFT formula, and the output results include at least the waveform of the periodic frequency f1 in the FFT variation branch 1, the waveform of the periodic frequency f2 in the FFT variation branch 2, and the waveform of the periodic frequency f3 in the FFT variation branch 3. If the periodic frequency If any one of f1, periodic frequency f2 and periodic frequency f3 is within the set frequency interval, it is deemed to meet the judgment condition of the delete gesture.
  • Fig. 6 shows a schematic diagram of a curve angle of a curve gesture trajectory according to an embodiment of the present application.
  • first determine the character area 1 of the "target word” according to the above method then determine the curve in the character area 1, judge according to all point sets of the curve gesture, and determine the highest point in the y direction of the curve gesture trajectory
  • the coordinates (x 0 , y 0 ) and the coordinates of the lowest point (x 1 , y 1 ) the angle between the line connecting the coordinates of the highest point and the coordinates of the lowest point and the x direction is used as the curve angle
  • positioning Q is the curve angle interval, if If the angle of the gesture curve is within this interval, it is considered to meet the judgment condition.
  • Table 1 exemplarily illustrates the setting parameter range corresponding to each parameter type:
  • the setting parameter interval of the curve coverage rate can be 0.35 to 1
  • the setting parameter interval of the curve angle parameter can be: the upper slash (the angle connecting the trough to the peak) is 0.27 to 10.83, and the lower slash (The angle between the peak and the trough is -0.24 to -10.15, and the setting parameter interval of the frequency domain of the curve can be 5Hz to 30Hz.
  • the concepts of single-character horizontal coverage and single-character vertical coverage are introduced below. It can be understood that the horizontal and vertical directions refer to the width direction and the height direction of the characters.
  • the horizontal and vertical coverage ratio of a single character refers to the horizontal and vertical coverage ratio of the gesture formed on each character in the target print character by the editing operation in the character area of each character.
  • Fig. 7 shows a schematic diagram of single-character coverage according to an embodiment of the present application. As shown in Figure 7, first determine the character area of each character in the "target word” according to the above method, and then determine the curve in each character area 1, as shown in Figure 7, determine the "target word” in the “target word” according to the above method The character area 1 of the "word” character, and the track area 2 of the curve in character area 1.
  • the vertical coverage of a single character that is, the vertical coordinate difference (y 12 -y 11 ) of the highest point coordinates and the lowest point coordinates of the curve gesture trajectory on each character in a single "target word” is the same as that in the "target word”
  • the ratio of the ordinate difference (y 22 -y 21 ) between the highest point coordinate and the lowest point coordinate of each character defines Qy as the judgment interval of the ordinate coverage rate of a single character. For example, Qy is 0.35 to 1.
  • the single-character abscissa coverage is in the judgment interval Qx, that is, greater than or equal to the upper limit of the judgment interval Qx, less than or equal to the lower limit of the judgment interval Qx
  • the single-character ordinate coverage is in the judgment interval Qy, that is, greater than or equal to The upper limit value of the judgment interval Qy is less than or equal to the lower limit value of the judgment interval Qy. If S ⁇ Q, that is, the single-character abscissa coverage rate is in the judgment interval Qx, and the single-character ordinate coverage rate is in the judgment interval Qy, then it is considered
  • the editing operation corresponding to the target printed character that meets the conditions is a deletion operation.
  • Fig. 8 shows a schematic flowchart of a method for recognizing Chinese characters when the trajectory of the user's delete gesture is a curve, according to some embodiments of the present application. As shown in Figure 8, the method includes:
  • Step 801 Detect that the user uses the stylus 200 to edit the printed characters converted from the handwritten characters in the display interface of the memo application program, and identify the language type of the target printed characters selected by the editing operation.
  • the tablet 100 can obtain the coordinate set of the gesture trajectory drawn by the user with the stylus 200 on the target printed character, and the coordinate set of the target printed character, if the coordinate set of the gesture trajectory is consistent with each of the target printed characters If the coordinate sets of characters have partially identical coordinates (horizontal and vertical coordinate values), it is determined that the gesture track overlaps with the target printed character, thereby determining that the touch operation of the stylus 200 is an editing operation.
  • the tablet 100 collects the strokes of the target handwritten characters corresponding to the target printed characters to obtain the gesture trajectory coordinates of the target handwritten characters, and inputs the gesture trajectory coordinates of the target handwritten characters into the language type recognition model to obtain the language type of the target handwritten characters, namely Get the language type of printed characters.
  • Language type recognition models can be implemented based on neural network models, such as convolutional neural network models, deep sparse convolutional neural network models, deep recurrent neural network models, etc. for data preprocessing, feature extraction, and text classification.
  • the handwriting operation interface of the memo application program includes printed characters converted from handwritten characters, such as Chinese characters 16, and the stylus 200 performs editing operations on some characters 161 in Chinese characters 16, such as drawing wavy line17.
  • the content of part character 261 can be "and the so-called”.
  • the tablet 100 recognizes that the language type of some characters 261 is Chinese.
  • Step 802 Identify the gesture type of the editing operation of the stylus 200 on the selected target print character.
  • the tablet 100 needs to recognize the gesture type of the editing operation of the stylus 200 on the selected target print character.
  • the gesture type can be curve, straight line, polyline, etc.
  • Step 803 If it is recognized that the gesture type of the editing operation of the stylus 200 on the selected target printed character is a curved gesture, then obtain the curve drawn by the stylus 200 on the target printed character at the location of the target printed character. Curve coverage, curve frequency domain, and curve angle for character regions.
  • the tablet 100 judges the coverage rate of the wavy line 17 corresponding to the Chinese language on some characters 161, the coverage rate of the wavy line 17 on some characters 161, and the curve frequency of the wavy line 17 on some characters 161. Whether the domain parameter or the curve angle is within the setting parameter interval.
  • Step 804 Judging whether any one of the acquired curve coverage, curve frequency domain and curve angle is within the set parameter range. If yes, go to step 805. If not, go to step 806.
  • Step 805 The type of the editing operation cannot be determined, and a prompt message to perform the editing operation again is displayed to the user.
  • the tablet 100 when the type of the editing operation cannot be determined, the tablet 100 will display a prompt message for the user to perform the editing operation again. After the user performs the editing operation again, the tablet 100 performs step 801 to step 805 again.
  • Step 806 Obtain the horizontal and vertical coverage ratio of a single character of a single character on the target printed character.
  • Step 806 Judging whether the acquired horizontal and vertical coverage of a single character is within the set parameter range, if yes, go to step 808, if not, go to 809.
  • the tablet 100 in order to reduce the rate of mistaken deletion, after performing step 803, the tablet 100 can also directly obtain and judge the coverage rate of the editing gesture formed by the editing operation on each character, if the selected target character If the coverage rate of the editing gesture on each character is greater than the set coverage rate or within the set coverage rate range, then it is determined as the target character selected by the editing gesture.
  • Step 808 Determine that the editing operation is a delete operation, delete the selected printed character, the cursor stays on the right side of the character before the selected printed character, and the text character behind the selected printed character moves forward to the cursor place.
  • Step 809 Delete the selected typographical characters that meet the single-character coverage.
  • the broken line here is a zigzag connection composed of a plurality of line segments from top to bottom along the character font or formula connected in sequence from end to end.
  • the difference from Embodiment 1 is that the basis for judging in Embodiment 2 in the polyline gesture operation is that the tablet 100 acquires the polyline coverage corresponding to the polyline drawn by the stylus 200 on the target printed character and the target printed character.
  • the single-character polyline coverage rate According to the polyline coverage rate and the single-character polyline coverage rate in the target printed character, it is determined that the editing operation is a deletion operation.
  • the content of the selected target printed character is: "target word”, under the current xy coordinate system, the y direction refers to the “target word” from left to right In the width direction, the x direction refers to the height direction of the "target word” from top to bottom.
  • the coordinates of the highest point of the "target word” in the y direction are (0,y 11 )
  • the coordinates of the lowest point in the y direction are (0,y 12 )
  • the rightmost coordinates of the "target word” in the x direction is (x 12 ,0)
  • the leftmost coordinate is (x 11 ,0).
  • the character area where the target print character is located is defined as: a straight line including coordinates (0,y 12 ) and parallel to the x-axis, a straight line including coordinates (0,y 11 ) and parallel to the x-axis, including coordinates (x 11 , 0) and a straight line parallel to the y-axis, and the area enclosed by a line with coordinates (x 12 ,0) and parallel to the y-axis.
  • the following introduces the definition of polyline coverage.
  • the coordinates of the lowest point of the polyline in the y direction are (0,y 22 )
  • the coordinates of the highest point in the y direction are (0,y 21 )
  • the "target word" is at the leftmost point in the x direction
  • the side coordinates are (x 21 ,0)
  • the rightmost coordinates are (x 22 ,0).
  • the trajectory area 2 where the polyline is located is defined as: a straight line containing coordinates (0,y 22 ) and parallel to the y-axis, a straight line containing coordinates (0,y 21 ) and parallel to the y-axis, and a straight line containing coordinates (x 21 ,0) and a straight line parallel to the x-axis, and an area enclosed by a straight line with coordinates (x 22 ,0) parallel to the x-axis.
  • the ordinate difference (y 22 -y 21 ) and the abscissa difference (x 22 -x 21 ) are calculated, and the product of the two is used as the coverage area of the polyline.
  • the ratio of the polyline 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.
  • the coverage calculation method is:
  • the judgment rule of polyline coverage is introduced below: if the polyline coverage is within the set parameter interval, that is, the area coverage S of the polyline gesture type is within the area coverage judgment interval Q, then the user's editing operation is determined to be a delete operation.
  • Fig. 10 shows a schematic diagram of single character coverage according to an embodiment of the present application. As shown in Figure 10, first determine the character area of each character in the "target word” according to the above method, and then determine the curve in each character area 1, as shown in Figure 10, determine the "target word” in the “target word” according to the above method The character area 1 of the "word” character, and the track area 2 of the curve in character area 1.
  • the vertical coverage of a single character that is, the vertical coordinate difference (y 12 -y 11 ) of the highest point coordinates and the lowest point coordinates of the curve gesture trajectory on each character in a single "target word” is the same as that in the "target word”
  • the ratio of the ordinate difference (y 22 -y 21 ) between the highest point coordinate and the lowest point coordinate of each character defines Qy as the judgment interval of the ordinate coverage rate of a single character. For example, Qy is 0.35 to 1.
  • the single-character abscissa coverage is in the judgment interval Qx, that is, greater than or equal to the upper limit of the judgment interval Qx, less than or equal to the lower limit of the judgment interval Qx
  • the single-character ordinate coverage is in the judgment interval Qy, that is, greater than or equal to The upper limit value of the judgment interval Qy is less than or equal to the lower limit value of the judgment interval Qy. If S ⁇ Q, that is, the single-character abscissa coverage rate is in the judgment interval Qx, and the single-character ordinate coverage rate is in the judgment interval Qy, then it is considered
  • the editing operation corresponding to the target printed character that meets the conditions is a deletion operation.
  • Fig. 11 shows a schematic flowchart of a method for recognizing Chinese characters when the trace of the user's delete gesture is a broken line, according to some embodiments of the present application. As shown in Figure 11, the method includes:
  • Step 1101 and step 1102 have the same technical means as steps 801 and 802 in Embodiment 1, and will not be repeated here.
  • Step 1103 When it is recognized that the gesture type of the editing operation of the stylus 700 on the selected target printed character is a folded line gesture, then obtain the fold line drawn by the stylus 700 on the target printed character in the target printed character. The polyline coverage of the character area where the character is located.
  • Step 1104 Determine whether the obtained polyline coverage is within the set parameter range. If not, go to step 1105. If yes, go to step 1106.
  • Step 1105 The type of the editing operation cannot be determined, and a prompt message to perform the editing operation again is displayed to the user.
  • the tablet 110 will display a prompt message for the user to perform the editing operation again. After the user performs the editing operation again, the tablet 110 performs steps 1101 to 1104 again.
  • Steps 1106 to 1109 have the same technical means as steps 306 and 309 in Embodiment 1, and will not be repeated here.
  • step 1102 in order to reduce the rate of mistaken deletion, after step 1102 is executed, the horizontal and vertical coverage of the editing gestures on each character in the target character selected by the editing operation can be directly judged, if the selected If the coverage rate of the editing gesture on each character in the target character is within the set coverage range, then it is determined as the target character selected by the editing gesture.
  • the user may draw a set line track on the converted printed character, for example, a horizontal line or an oblique line, so that the set line track overlaps the printed character, which is set as a delete operation.
  • a set line track on the converted printed character, for example, a horizontal line or an oblique line
  • the horizontal line and the oblique line are collectively referred to as a straight line, and the method for judging the deletion operation will be described.
  • Fig. 12 shows a schematic diagram of drawing a straight line on the "target character” and the parameter range of the inclination angle of the line.
  • the selected target The content of the printed characters is: "target word”.
  • the y direction refers to the width direction of the "target word” from left to right
  • the x direction refers to the height direction of the "target word” from top to bottom.
  • Figure 13 shows a schematic diagram of drawing a straight line on the "target word” and the coverage of the straight line, as shown in Figure 13, assuming that in the embodiment of the present application, the selected target printed character
  • the content is: "target character”, under the current xy coordinate system, the x direction refers to the width direction of the "target character” from left to right, and the y direction refers to the height direction of the "target character” from top to bottom.
  • D direction is the direction of the straight line
  • F is the normal direction of the gesture trajectory of the straight line, as shown in Figure 13
  • the coordinates of the highest point of the "target character” in the y direction are (x 5 , y 5 )
  • the coordinates of the lowest point in the y direction are (x 6 , y 6 ).
  • the leftmost coordinate of the "target word" in the x direction is (x 7 , y 7 )
  • the rightmost coordinate in the x direction is (x 8 , y 8 ).
  • the character area 3 where the "target word” is located is defined as: a straight line including coordinates (x 5 , y 5 ) and parallel to the D direction, a straight line including coordinates (x 6 , y 6 ) and parallel to the D direction, including the coordinates ( x 7 , y 7 ) and a straight line parallel to the F direction, including the rectangular area surrounded by the coordinates (x 8 , y 8 ) and parallel to the F direction.
  • the character area 4 where the straight line is located is defined as: a straight line including the coordinates (x 5 , y 5 ) parallel to the D direction, a straight line including the coordinates (x 6 , y 6 ) and parallel to the D direction, including the coordinates (x 3 , y 3 ) and parallel to the F direction, including the rectangular area enclosed by the coordinates (x 4 , y 4 ) and parallel to the F direction.
  • the ratio of the area of the character area 4 to the area of the character area 3 is taken as the area coverage J.
  • the judgment interval of the area coverage ratio is K, and if the area coverage ratio J is in the judgment interval K, it is judged that the editing operation is a deletion operation.
  • single-character coverage of straight lines and straight lines is the same as that of the above-mentioned curves and polylines.
  • Single-character horizontal coverage refers to the difference between the maximum and minimum abscissa difference of the curve on each character and the The ratio of the maximum and minimum abscissa difference.
  • the vertical coverage of a single character refers to the ratio of the maximum and minimum ordinate difference of each character on the curve to the maximum and minimum ordinate difference of each character.
  • the judgment rule is also the same as above. I won't go into details here.
  • Fig. 14 shows a schematic flowchart of a method for recognizing Chinese characters when the trace of the user's delete gesture is a straight line, according to some embodiments of the present application. As shown in Figure 14, the method includes:
  • step 1401 and step 1402 are the same as those of step 701 and step 702 in the second embodiment, and will not be repeated here.
  • Step 1403 When it is recognized that the gesture type of the editing operation of the stylus 200 on the selected target printed character is a straight line gesture, obtain the straight line drawn by the stylus 200 on the target printed character. The inclination angle between the character area where it is located and the left and right horizontal direction of the printed characters.
  • Step 1404 Determine whether the acquired inclination angle is within a preset inclination angle interval. If not, go to step 1405. If yes, go to step 1406.
  • Step 1406 Obtain the straight line coverage rate of the straight line drawn by the stylus 200 on the target printed character in the character area where the target printed character is located;
  • step 1407 Determine whether the acquired straight line coverage is within the set parameter interval, if yes, go to step 1408, if not, go to step 1405.
  • Steps 1408 to 1410 have the same technical means as steps 706 and 709 in Embodiment 1, and will not be repeated here.
  • the upper limit of the English setting parameter interval is less than or equal to the Chinese setting parameter The upper limit of the range.
  • Fig. 15 shows a schematic flowchart of a method for recognizing editing gestures with a stylus according to some embodiments of the present application. As shown in Figure 15, the method includes:
  • Steps 1501 to 1509 have the same technical means as steps 701 to 709, except that the value range of the set parameter interval in step 304 of the embodiment is different, that is, if it is recognized that the written language is English, each of the above parameter intervals According to the font size and spacing of English characters, select the corresponding differentiated interval range for operation judgment.
  • the judging method of the stylus 200 for drawing broken lines, straight lines, and oblique lines on some characters in English characters is the same as that of the stylus 200 for drawing broken lines, straight lines, and oblique lines on some characters of Chinese characters.
  • 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.
  • Table 1 exemplifies the setting parameter intervals corresponding to each parameter type in Chinese and English:
  • FIG. 16 shows a possible structural block diagram of the electronic device 100 shown in FIG. 1 according to an embodiment of the present application.
  • the electronic device 100 can execute the method for recognizing a stylus editing gesture provided by the embodiment of the present application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 111, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, and a power management module 141 , battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192 , a camera 193, a display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air 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, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. . Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is a cache memory.
  • the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc.
  • the processor 110 communicates with the camera 193 through the CSI interface to realize the shooting function of the electronic device 100 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to realize the display function of the electronic device 100 .
  • the USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 111 , the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • 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 , a modem processor, a baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them 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 through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless local area network (wireless local area networks, WLAN) (such as Wi-Fi network), bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS) applied on the electronic device 100. ), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the electronic device 100 can establish a communication connection with the stylus 200 through Bluetooth (BT) in the wireless communication module 160 .
  • BT Bluetooth
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR techniques, etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • code division multiple access code division multiple access
  • CDMA broadband Code division multiple access
  • WCDMA wideband code division multiple access
  • time division code division multiple access time-division code division multiple access
  • TD-SCDMA time-division code division multiple access
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a Beidou navigation satellite system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • Beidou navigation satellite system beidou navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used 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 or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as 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. Such as saving music, video and other files in the external memory card.
  • the internal memory 111 may be used to store computer-executable program codes including instructions.
  • the internal memory 111 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
  • the internal memory 111 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash memory (universal flash storage, UFS) and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 111 and/or instructions stored in a memory provided in the processor.
  • the internal memory 111 can be used to store the Overlay configuration file corresponding to the application program.
  • 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. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • the audio module 170 may also be used to encode and decode audio signals.
  • the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
  • the touch sensor 180K is also called “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 called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
  • the electronic device 100 can receive the signal transmitted by the stylus 200 in contact with the touch display screen of the electronic device 100 through the touch sensor 180K, so as to know the coordinates of the stylus 200 on the touch display screen, and the electronic device 100 According to the coordinate data corresponding to the trajectory of the stylus 200 on the touch display screen, it is judged whether the user operation of the hand is a deletion operation, and if so, the character drawn by the line is deleted.
  • the keys 190 include a power key, a volume key and the like.
  • the key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
  • the motor 191 can generate a vibrating reminder.
  • the indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 195 is used for connecting a SIM card.
  • the essence of the technical solution of the embodiment of the present application or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions It is used to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in the various embodiments of the present application.
  • the aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Character Discrimination (AREA)

Abstract

一种手写笔编辑笔势识别方法,包括:电子设备(100)在检测到用户利用手写笔(200)在电子设备(100)的屏幕上所产生的笔势轨迹,与屏幕上显示的字符产生重叠的情况下,确定重叠的字符的第一字符区域和笔势轨迹;电子设备(100)确定笔势轨迹与第一字符区域之间的重叠关系是否满足第一预定条件;在满足第一预定条件的情况下,电子设备(100)确定笔势轨迹对应的编辑操作为删除操作,并删除重叠的字符。从而在一定程度上避免了将手写笔(200)在所选中的目标印刷体字符上画波浪线的删除笔势误识别为选中笔势的问题。还公开了一种手写笔编辑笔势识别介质及电子设备(100)。

Description

一种手写笔编辑笔势识别方法、介质及电子设备
本申请要求于2021年05月31日提交中国专利局、申请号为202110602320.4、申请名称为“一种手写笔编辑笔势识别方法、介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,特别涉及一种手写笔编辑笔势识别方法、介质及电子设备。
背景技术
随着触控类电子设备的不断迭代更新,很多触控类电子设备都配备了手写笔作为提升办公效率的方式,手写笔除了基础的字符或图形输入功能外,一些手写笔产品中加入了快捷笔势编辑的功能。
例如,用户利用手写笔书写手写体字符后,手写体字符即时转化为印刷体字符,在用户利用手写笔对印刷体字符进行编辑操作的情况下,用户可以利用手写笔在选中的目标印刷体字符上画波浪线实现删除目标印刷体字符的功能,也可以利用手写笔在所选中的目标印刷体字符上画直线实现选中目标印刷体字符的功能。
但是,目前的手写笔删除快捷笔势判断方法仍存在一定的识别痛点问题:当用户想要删除印刷体字符中的部分字符,利用手写笔在所选中的目标印刷体字符上画波浪线,电子设备容易将手写笔在所选中的目标印刷体字符上画波浪线的删除笔势误识别为选中笔势,进而对手写笔所选中的目标印刷体字符进行选中显示而不是删除目标印刷体字符,如此,存在手写笔删除快捷笔势误识别的情形,用户体检较差。
发明内容
本申请实施例提供了一种手写笔编辑笔势识别方法、介质及电子设备。
第一方面,本申请实施例提供了一种手写笔编辑笔势识别方法,该方法包括:
所述电子设备在检测到用户利用手写笔在所述电子设备的屏幕上所产生的笔势轨迹,与所述屏幕上显示的字符产生重叠的情况下,确定重叠的所述字符的第一字符区域和笔势轨迹;
所述电子设备确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足第一预定条件;
在满足第一预定条件的情况下,所述电子设备确定所述笔势轨迹对应的编辑操作为删除操作,并删除重叠的所述字符。
在对笔势轨迹显示的规则上,本申请实施例考虑了真实纸笔的书写编辑场景,达到文字符编辑的感知一致性。对于删除操作的笔势轨迹,在纸笔书写中,用户经常采用涂抹的方式对部分文字符进行删除,即采用“所见即所得”的心理感知。因此,在电子设备的书写过程中,删除功能可以用在文字符上方进行覆盖的方式实现,即在文字符上画不同的线形,如横线、斜线、波浪线 等,只要覆盖率达到某一参数区间,即可实现快速删除。而选中功能,可采用文字符凸显的设置规则,可采用圈选、文字符下方横线或波浪线的方式等。这样的设置规则更符合用户手写编辑的心理预期,有更好的易学易记性。从而在一定程度上避免了将手写笔在所选中的目标印刷体字符上画波浪线的删除笔势误识别为选中笔势的问题。
在上述第一方面的一种可能的实现中,上述方法还包括:所述第一字符区域为分别包含重叠的所有所述字符高度方向的最高点坐标和最低点坐标且平行于宽度方向的两条直线,以及分别包含所述字符宽度方向的最左侧坐标和最右侧坐标且平行于高度方向的两条直线,围成的矩形区域。
在上述第一方面的一种可能的实现中,所述电子设备确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足第一预定条件,包括:
在所述笔势轨迹类型为曲线类型的情况下,所述电子设备确定所述笔势轨迹的第一轨迹区域的面积和所述第一字符区域的面积的第一比值;其中,所述第一轨迹区域为分别包含所述第一字符区域中笔势轨迹的字符高度方向的最高点坐标和最低点坐标且平行于宽度方向的两条直线,以及分别包含字符宽度方向的最左侧坐标和最右侧坐标且平行于高度方向的两条直线,围成的矩形区域;
所述电子设备在判断出所述第一比值在第一参数区间的情况下,确定满足第一预定条件。
可以理解,第一参数区间可以为曲线覆盖率的设定参数区间。
在上述第一方面的一种可能的实现中,上述方法还包括:所述电子设备确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足第一预定条件,包括:
在所述笔势轨迹类型为直线类型的情况下,所述电子设备获取直线笔势轨迹与所述第一字符区域的字符宽度方向的倾斜角度;
所述电子设备在判断出所述倾斜角度在第二参数区间的情况下,获取第二轨迹区域的面积和第二字符区域的面积的第三比值;
其中,所述第二字符区域为分别包含所述字符的字符高度方向的最高点坐标和最低点坐标且平行于直线方向的两条直线,以及分别包含字符宽度方向的最左侧坐标和最右侧坐标且平行于直线法线方向的两条直线,围成的矩形区域;
所述第二轨迹区域为所述第一字符区域中笔势轨迹的字符高度方向的最高点坐标和最低点坐标所在的平行于直线方向的两条直线,以及字符宽度方向的最左侧坐标和最右侧坐标所在的平行于直线法线方向的两条直线,围成的矩形区域;
所述电子设备在判断出所述第三比值在第三参数区间的情况下,确定满足第一预定条件。
可以理解,第二参数区间可以为直线倾角的设定参数区间,第三参数区间可以为直线覆盖率的设定参数区间。
在上述第一方面的一种可能的实现中,上述方法还包括:所述电子设备确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足第一预定条件,包括:
在所述笔势轨迹类型为折线类型的情况下,所述电子设备确定第一轨迹区域的面积和所述第一字符区域的面积的第二比值;其中,所述第一轨迹区域为分别包含所述第一字符区域中笔势轨迹的字符高度方向的最高点坐标和最低点坐标且平行于宽度方向的两条直线,以及分别包含字符宽度方向的最左侧坐标和最右侧坐标且平行于高度方向的两条直线,围成的矩形区域;
所述电子设备在判断出所述第二比值在第四参数区间的情况下,确定满足第一预定条件。
可以理解,第四参数区间可以为折线的设定参数区间。
在上述第一方面的一种可能的实现中,上述方法还包括:在所述笔势轨迹类型为曲线类型的情况下,所述电子设备采用快速傅里叶变化获取所述曲线笔势轨迹的正弦波集合;
所述电子设备获取所述正弦波集合中按照频率值由大至小排在前的预设条正弦波的频率;
所述电子设备在判断出所述预设条正弦波的频率在第五参数区间的情况下,确定满足第一预定条件。
可以理解,第五参数区间可以为曲线频域的设定参数区间。
在上述第一方面的一种可能的实现中,上述方法还包括:在所述笔势轨迹类型为曲线类型的情况下,所述电子设备获取所述曲线笔势轨迹在所述第一字符区域的高度方向的最高点坐标和最低点坐标;
所述电子设备根据所述最高点坐标和最低点坐标确定所述最高点和所述最低点之间的连线与所述高度方向的倾斜角度;
所述电子设备在判断出所述倾斜角度在第六参数区间的情况下,确定满足第一预定条件。
可以理解,第六参数区间可以为曲线角度的设定参数区间。
在上述第一方面的一种可能的实现中,上述方法还包括:所述电子设备判断出重叠的所述字符的数量为多个,并且所述电子设备在确定所述笔势轨迹与所述第一字符区域之间的重叠关系满足第一预定条件的情况下,还判断重叠的所述多个字符中的每个字符上的笔势轨迹与每个字符的单第一字符区域之间的重叠关系是否满足第二预定条件,并在判断出满足所述第二预定条件的情况下,删除满足所述第二预定条件的字符。
可以理解,电子设备可以判断笔势轨迹在每个字符上的覆盖率是否符合参考标准,从而删除满足参考标准(第二预定条件)的字符,降低误删率,达到删除操作的精准识别。
在上述第一方面的一种可能的实现中,上述方法还包括:所述第一字符区域为分别包含单个字符高度方向的最高点坐标和最低点坐标且平行于高度方向的两条直线,以及分别包含单个字符宽度方向的最左侧坐标和最右侧坐标且平行于宽度方向的两条直线,围成的矩形区域。
在上述第一方面的一种可能的实现中,上述方法还包括:判断重叠的所述多个字符中的每个字符上的笔势轨迹与每个字符的单第一字符区域之间的重叠关系是否满足第二预定条件,包括:
所述电子设备确定重叠的所述字符中每个字符的宽度值与所述第一字符区域宽度值的宽度比值,以及重叠的所述字符中每个字符的高度值与所述第一字符区域高度值的高度比值,所述电子设备在判断出所述宽度比值在第七参数区间,所述高度比值在第八参数区间的情况下,确定满足第一预定条件。
可以理解,第七参数区间可以为单字符横方向覆盖率的设定参数区间,第八参数区间可以为单字符纵方向覆盖率的设定参数区间。
在上述第一方面的一种可能的实现中,上述方法还包括:所述电子设备确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足预定条件,包括:
所述电子设备判断出所述字符是第一语言字符还是第二语言字符;
所述电子设备在判断出是第一语言字符的情况下,获取所述第一语言字符对应的预定条件,并确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足所述第一语言字符对应的预定条件;
所述电子设备在判断出是第二语言字符的情况下,获取所述第二语言字符对应的预定条件,并确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足所述第一语言类型对应的预定 条件。
目前,手写笔快捷笔势编辑功能尚未考虑到不同文字符呈现效果下的识别参数区别,可以理解,本申请实施例通过对编辑操作所选中的印书体字符的语言类型进行判断,即中文还是英文,之后对不同语种采用差异化的笔势类型参数识别,提高了手写笔快捷笔势的识别准确率,提升了用户体验。
在上述第一方面的一种可能的实现中,所述第一语言包括中文、英文、德文、法文中的任意一种,所述第二语言包括中文、英文、德文、法文中的任意一种。
在上述第一方面的一种可能的实现中,所述字符为手写体字符转化后的印书体字符。
在上述第一方面的一种可能的实现中,所述字符在所述电子设备上的预设应用程序的操作界面显示,所述预设应用程序为备忘录、笔写计算器、Nebo for Huawei、随手写中的任意一种。
第二方面,本申请实施例还提供了一种可读介质,所述可读介质上存储有指令,该指令在电子设备上执行时使电子设备实现第一方面种中任一项所述的手写笔编辑笔势识别方法。
第三方面,本申请实施例还提供了一种电子设备,包括:存储器,用于存储由电子设备的一个或多个处理器执行的指令,以及
处理器,是所述电子设备的处理器之一,用于执行第一方面中任一项所述的手写笔编辑笔势识别方法。
附图说明
图1A至1J根据本申请的一些实施例,示出了一种手写笔编辑笔势识别方法的应用场景示意图。
图2根据本申请实施例,示出了一种实现本申请技术方案的平板100的软件结构框图。
图3示出了一种平板利用手写笔快捷笔势识别的应用场景示意图。
图4根据本申请实施例,示出了一种对于曲线笔势轨迹的多字符覆盖率的示意图。
图5根据本申请实施例,示出了一种曲线笔势轨迹的曲线频域变化的示意图。
图6根据本申请实施例,示出了一种曲线笔势轨迹的曲线角度的示意图。
图7根据本申请实施例,示出了一种单字符覆盖率的示意图。
图8根据本申请的一些实施例,示出了对于中文字符,当用户的删除笔势轨迹为曲线时进行识别的方法的流程示意图。
图9根据本申请实施例,示出了一种对应于折线笔势轨迹的多字符覆盖率的示意图。
图10根据本申请实施例,示出了一种对应于折线笔势轨迹的单字符覆盖率的示意图。
图11根据本申请的一些实施例,示出了对于中文字符,当用户的删除笔势轨迹为折线时进行识别的方法的流程示意图。
图12根据本申请的一些实施例,示出了一种在“目标字”上画直线以及直线倾角参数区间的示意图。
图13根据本申请的一些实施例,示出了一种在“目标字”上画直线以及直线覆盖率的示意图。
图14根据本申请的一些实施例,示出了对于中文字符,当用户的删除笔势轨迹为直线时进行识别的方法的流程示意图。
图15根据本申请的一些实施例,示出了对于英文字符,当用户的删除笔势轨迹为曲线时进 行识别的方法的流程示意图。
图16根据本申请的实施例示出了图1所示的电子设备100的一种可能的结构框图。
具体实施方式
本申请的说明性实施例包括但不限于一种手写笔编辑笔势识别方法、介质及电子设备。
为了解决背景技术中提到的技术问题,本申请实施例公开了一种手写笔编辑笔势识别方法。具体地,用户利用手写笔书写的字符转化为印刷体字符后,如果用户在转化后的印刷体字符上画设定的线条轨迹,例如,横线、斜线、折线、波浪线等,使设定的线条轨迹与印刷体字符重叠,则可以根据线条轨迹和与线条轨迹重叠的印刷体字符所在的字符区域之间的覆盖关系,确定用户的操作是否为删除操作,如果确定是删除操作,则将与线条轨迹重叠的印刷体字符删除。从而在一定程度上避免了将手写笔在所选中的目标印刷体字符上画波浪线的删除笔势误识别为选中笔势的问题。具体方案将在下文进行描述。
下面通过附图和实施例,对本申请实施例的技术方案做进一步的详细描述。
本申请实施例提供的手写笔编辑笔势识别方法应用在具有手写笔书写和编辑功能的各种软件中,例如备忘录、笔写计算器、Nebo for Huawei、随手写等。本申请实施例适用于电子设备系统中的全局手写、手写转印刷体等多种输入编辑场景。
下文将以具有手写笔书写和编辑功能的软件为备忘录,电子设备系统中的手写转印刷体输入编辑场景为例,对本申请实施例提供的手写笔笔势识别方法进行进一步说明。
图1A至1J根据本申请的一些实施例,示出了一种手写笔编辑笔势识别方法的应用场景示意图。
该应用场景中包括电子设备100,假设用户想要在电子设备100中的备忘录中做笔记,用户先要打开备忘录,然后,用户创建一个新的备忘录,并在开启备忘录的手写功能后,进行手写笔记操作。
例如,如图1A所示,电子设备100的显示界面显示备忘录控件10,用户可以通过点击备忘录控件10打开备忘录。在用户点击备忘录控件10后,电子设备100进入备忘录的操作界面。如图1B所示,备忘录的操作界面包括创建按钮11。用户在点击创建按钮21后,电子设备100显示新建的备忘录。如图1C所示,新建的备忘录界面包括手写控件12和手写体转印刷体控件13。在用户想要使用电子设备100的手写功能、手写字符转化为印刷体字符功能、以及手写笔直接对手写字符转化后的印刷体字符的编辑操作功能的情况下,用户可以点击手写控件12和手写体转印刷体控件13,此时,电子设备100显示手写界面,如图1D所示,该手写界面包括手写区域14和印刷体显示区域15。
继续参阅图1D,该应用场景中还包括手写笔200,在一些应用场景中,手写笔200可以通过蓝牙与电子设备100建立通信连接,从而在电子设备100上进行触控操作,触控操作包括编辑操作和手写操作等。此外,在其他应用场景中,用户也可以直接打开手写笔200的电源键,便可以在电子设备100上进行触控操作,但不限于此。
在该应用场景中,用户手持手写笔200在手写区域14写的字符可以实时转化成印刷体字符,显示在印刷体显示区域15。手写区域14悬浮在印刷体显示区域15上,或者手写区域14与印刷体显示区域15部分重叠,但不限于此。
用户在对印刷体显示区域15上的印刷体字符进行编辑时,如果想要对部分印刷体字符进行删除操作,可以直接利用手持的手写笔200对印刷体显示区域15中所想要删除的印刷体字符上画删除线,删除线可以为直线或者曲线,电子设备100检测到此操作,即删除被画线的印刷体字符。
在手写笔200在电子设备100上书写并编辑的过程中,删除功能可以用在文字符上方进行覆盖的方式实现,即在文字符上画不同的线形,如横线、斜线、波浪线等,可实现删除功能。下面介绍几种对中文字符的删除操作。
例如,如图1E所示,该手写操作界面包括中文字符16,手写笔200在中文字符16中的部分字符161上画波浪线17,对部分字符161进行删除操作。部分字符161的内容可以为“而所谓的”。电子设备100可以根据波浪线17对“而所谓的”这4个字符的覆盖率来确定用户的操作是否为删除操作,并确定删除的字符为“而所谓的”这4个字符。在确定为是删除操作的情况下,将部分字符161删除。如图1F所示,电子设备100将部分字符161删除后,将光标18停留在部分字符161前一个字符或标点右侧的位置,部分字符161后面的字符前移至光标右侧。
又如,如图1G所示,手写笔200在中文字符16中的部分字符161上画折线19,对部分字符161进行删除操作。部分字符161的内容可以为“而所谓的”。电子设备100可以根据折线19对“而所谓的”这4个字符的覆盖率来确定用户的操作是否为删除操作,并确定删除的字符为“而所谓的”这4个字符。在确定为是删除操作的情况下,将部分字符161删除。如图1F所示,电子设备100将部分字符161删除后,将光标18停留在部分字符161前一个字符或标点右侧的位置,部分字符161后面的字符前移至光标右侧。
又如,如图1H所示,手写笔200在中文字符16中的部分字符161上画直线20,对部分字符161进行删除操作。部分字符161的内容可以为“而所谓的”。电子设备100可以根据横线20对“而所谓的”这4个字符的覆盖率来确定用户的操作是否为删除操作,并确定删除的字符为“而所谓的”这4个字符。在确定为是删除操作的情况下,删除部分字符161。如图1F所示,电子设备100将部分字符161删除后,将光标18停留在部分字符161前一个字符或标点右侧的位置,部分字符161后面的字符前移至光标右侧。
又如,如图1I所示,手写笔200在中文字符16中的部分字符161上画斜线21,对部分字符161进行删除操作。部分字符161的内容可以为“而所谓的”。电子设备100可以根据斜线21对“而所谓的”这4个字符的覆盖率来确定用户的操作是否为删除操作,并确定删除的字符为“而所谓的”这4个字符。在确定为是删除操作的情况下,删除部分字符161。如图1F所示,电子设备100将部分字符161删除后,将光标18停留在部分字符161前一个字符或标点右侧的位置,部分字符161后面的字符前移至光标右侧。
曲线、直线和斜线、折线与印刷体字符所在的字符区域之间的覆盖关系的定义不同,可以理解,曲线的覆盖率是曲线围成的区域与目标印书体字符所在字符区域之间的关系度。折线的覆盖率是折线围成的面积与目标印书体字符的面积之间的关系度。而直线和斜线则是根据直线和斜线与目标印刷体宽度方向的倾斜角度。下文将具体介绍。
下面再介绍一种对英文字符体的删除操作,例如,如图1J所示,该手写操作界面包括英文字符22,手写笔200在英文字符22中的部分字符221上画波浪线23,对部分字符221进行删除操作。部分字符221的内容可以为“implicit positive”。电子设备100检测到该删除操作,将部分字符221删除。
英文和中文因为字符体特征差异比较大,曲线、直线和斜线、折线覆盖率的判断阈值也不同, 英文设定参数区间的上限值小于等于中文设定参数区间的上限值,下文将具体介绍。
手写笔200在英文字符22中的部分字符221上画折线、直线、斜线的判断方式与手写笔200在中文字符的部分字符上画折线、直线、斜线的判断方式相同,在此不再赘述。
适用于本身实施例的电子设备100为具有手写笔书写和编辑功能的各种终端设备,例如,平板、手机、电脑等,但不限于此。
适用于本身实施例的手写笔200为具有在电子设备上书写和编辑功能的各种类型的手写笔,例如,主动式电容笔和被动式电容笔等,但不限于此。
为了便于说明,下文以电子设备100为平板100,平板上的具有手写笔书写和编辑功能的软件为备忘录为例,结合附图详细介绍本申请的技术方案。
图2根据本申请实施例,示出了一种实现本申请技术方案平板100的软件结构框图,如图2所示,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,系统库和内核层。
应用程序层可以包括一系列应用程序。例如备忘录应用程序21。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。应用程序框架层可以包括窗口管理器22,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
视图系统22包括可视控件,例如显示文字符的控件,显示图片的等。视图系统可用于构建应用程序。界面可以由一个或多个视图组成的。例如,包括短信通知图标的界面,可以包括显示文字符的视图以及显示图片的视图。
系统层包括安卓运行时(Android Runtime)23,安卓运行时23用于负责安卓系统的调度和管理。
内核层是硬件和软件之间的层。内核层至少包含显示驱动24,传感器驱动25。
本申请实施例中,在用户利用手写笔200对备忘录应用程序21显示界面中的手写体字符转化后的印刷体字符进行编辑操作的情况下,电子设备100的传感器驱动26可以驱动触摸传感器,接收手写笔200与电子设备100的触控显示屏接触发射的信号,从而确定手写笔200在触控显示屏上进行编辑操作(例如滑动、点击)所行成的笔势轨迹(可以简称笔势)对应的坐标数据,根据笔势轨迹坐标数据确定手写笔200对所选中的目标印刷体字符的编辑操作的笔势类型。例如,备忘录应用程序21可以根据手写笔200对所选中的目标印刷体字符的笔势操作的坐标进行回归拟合预测操作,识别笔势类型,例如,若笔势操作的坐标拟合成直线,则为直线类型,如果有波峰和波谷,则为曲线类型。例如,如图1E所示,备忘录应用程序21根据波浪线17的坐标,判断波浪线17为曲线类型。
备忘录应用程序21根据编辑操作对应的笔势轨迹坐标数据确定的笔势类型,判断手写笔200的触控操作是否是删除操作,在判断手写笔200的触控操作是删除操作的情况下,向视图系统22发送删除目标印刷体字符指令,视图系统22根据删除目标印刷体字符指令得到删除目标印刷体字符的视图数据,并将该删除目标印刷体字符的视图数据发送给安卓运行时23,安卓运行时23将删除目标印刷体字符的视图数据发送给内核层的显示驱动24,从而驱动触控显示屏显示删除目标印书体字符的显示界面,例如,如图1F所示,电子设备100将部分字符161删除后,显示将光标 18停留在部分字符161前一个字符或标点右侧的位置,部分字符161后面的字符前移至光标右侧的显示界面。
可以理解,图2只是实现本申请技术方案平板100的一种软件结构框图,但不限于此结构框图,图2所示的软件结构中的各功能模块均集成在平板100中,下面将以平板100为步骤的执行主体具体介绍本申请的技术方案。
可以理解,字符可以包括文字符、符号或者字符和符号,本申请实施例的笔势类型判断中加入文化差异这一参考因素,考虑了不同语种的识别,中文与英文在文字符排版上存在很大的差异,单个中文字符占据空间较大且中文字符之间间距较窄,而英文单个字符母占据空间较小,且英文以单词为组成单元,单词之间存在空格,有一定的文字符间距。这样的文字符呈现方式,在进行文字符编辑时,如果采用同样的参数识别区间,则很容易出现误操作的情况。比如用波浪线进行删除时,英文字符的目标文字符(要删除的字符)前后因为有空格存在,所以可以精准删除某个单词,但中文间距较小,很容易对目标文字符的前后文字符进行划线覆盖,从而造成误删除的现象。
例如,图3示出了一种平板利用手写笔快捷笔势识别的应用场景示意图,如图3所示,在该应用场景中,包括触控电子设备200和手写笔200,触控电子设备200的触控界面包括书写区20和印刷体文字符显示区31,触控电子设备200检测到用户在书写区20输入文字符后,即时将手写文字符转印刷体文字符显示在印刷体文字符显示区31。以在印刷体文字符显示区31显示的英文字符32和中文字符35为例,英文字符32的内容为:Culture difference in editing,中文字符35的内容为:中英字符展示文化差异。
假设用户利用手写笔200在英文单词321(例如Culture)上画曲线31(波浪线),删除英文单词321(例如Culture)。用户利用手写笔200在中文词语351(例如文化)上画曲线37(波浪线),删除中文词语351(例如文化)。由于英文词与词的间距d1较大,而中文字符与字符的间距d2较小,当用户利用手写笔200画的波浪线部分落在与用户所想要删除的中文词语351(例如文化)相邻的字符(例如示)上时,存在误将与中文词语351相邻的字符删除的问题,即当前手写笔删除快捷笔势存在误识别的情形,用户体检较差。
目前,手写笔快捷笔势编辑功能尚未考虑到不同文字符呈现效果下的识别参数区别,可以理解,本申请实施例通过对编辑操作所选中的印书体字符的语言类型进行判断,即中文还是英文,之后对不同语种采用差异化的笔势类型参数识别,提高了手写笔快捷笔势的识别准确率,提升了用户体验。
可以理解,印刷体字符的语言类型可以为中文、英文、日语等中任意一种或多种,但不限于此。印刷体字符可以包括文字符和公式。本文将以中文和英文为例说明本申请的技术方案。
对于中文字符,当笔势轨迹为曲线时,判定曲线笔势轨迹是否为删除操作,与笔势轨迹为直线、斜线或者折线时不同。为了说明曲线的覆盖率,先介绍一下被选中的目标印刷体字符所在的字符区域的定义,例如,如图4所示,假设本申请实施例中,被选中的目标印刷体字符内容为:“目标字”,在当前xy坐标系下,x方向是指“目标字”从左至右的宽度方向,y方向是指“目标字”从上至下的高度方向。
其中,首先根据“目标字”在触控显示屏内所有点的坐标集合,确定坐标集合中y方向的最高点的坐标和最低点的坐标,同时x方向筛选出最左侧的坐标和最右侧的坐标,进而确定目标印刷体字符所在的字符区域。
例如,“目标字”在y方向最高点的坐标为(0,y 11),在y方向最低点的坐标为(0,y 12),以及“目标字”在x方向的最右侧的坐标为(x 12,0),最左边的坐标为(x 11,0)。目标印刷体字符所在的字符区域被定义为:包含坐标(0,y 12)且平行于x轴的直线、包含坐标(0,y 11)且平行于x轴的直线、包含坐标(x 11,0)且平行于y轴的直线,以及包含坐标为(x 12,0)且平行于y轴的直线围成的区域。
然后,计算两者纵坐标差值(y 12-y 11),并计算两者横坐标差值(x 12-x 11),之后将纵坐标差值与横坐标差值的乘积作为字符区域1的面积,即“目标字”面积。
可以理解,手写笔200在目标印刷体字符上所画的曲线对应的曲线覆盖率越高,则表明编辑操作为删除操作的概率越高,曲线覆盖率越低,则表明编辑操作为在目标印刷体字符下的选中操作的概率越高。同理,手写笔200在目标印刷体字符上所画的曲线对应的曲线频域越高和曲线角度越高,则表明手写笔200在目标印刷体字符上所画的曲线对应的曲线覆盖率越高,则表明编辑操作为删除操作的概率越高,因此,本申请实施例可以根据手写笔200在目标印刷体字符上所画的曲线对应的曲线覆盖率、曲线频域和曲线角度作为判断该编辑操作是否是删除操作的依据,满足至少一种条件即判定编辑操作为删除操作。
为了提高删除操作识别的精确度,下面引入手写笔200在目标印刷体字符上所画的曲线在字符区域1中的曲线覆盖率及其判断规则、曲线频域及其判断规则和曲线角度及其判断规则。
下面先介绍曲线覆盖率的定义,首先,根据字符区域内的曲线所有点的坐标集合中,筛选出曲线笔势高度方向的最高点坐标、高度方向的最低点坐标、宽度方向最右侧的坐标、宽度方向最左侧的坐标,确定曲线所在的轨迹区域。例如,如图4所示,曲线在y方向的最低点坐标为(0,y 22),在y方向的最高点坐标为(0,y 21),以及“目标字”在x方向的最左侧的坐标为(x 21,0),最右侧的坐标为(x 22,0)。曲线所在的轨迹区域2被定义为:包含坐标(0,y 22)且平行于y轴的直线、包含坐标(0,y 21)且平行于y轴的直线、包含坐标(x 21,0)且平行于x轴的直线,以及包含坐标为(x 22,0)且平行于x轴的直线围成的区域。
然后,计算出纵坐标差值(y 22-y 21)与横坐标差值(x 22-x 21),两者乘积作为曲线的覆盖面积。
曲线覆盖面积与“目标字”面积的比值作为面积覆盖率S,定义覆盖率Q为最小面积覆盖率。
如图4所示,在该坐标系下,覆盖率计算方式为:
Figure PCTCN2022085895-appb-000001
下面再介绍曲线覆盖率的判断规则:若曲线覆盖率在设定参数区间,即曲线笔势类型的面积覆盖率S在面积覆盖率判断区间Q,则确定用户的编辑操作为删除操作。
下面介绍曲线频域的定义和判断规则。可以理解,傅里叶原理表明:任何连续测量的时序或信号,都可以表示为不同频率的正弦波信号的无限叠加。在本申请实施例中,图5根据本申请实施例,示出了一种曲线笔势轨迹的曲线频域变化的示意图。如图5所示,首先根据上述方法确定“目标字”的字符区域1,然后确定字符区域1中的曲线,并采用快速傅里叶变换(Fast Fourier Transform,FFT)的方法,将曲线转换为一些具有固定规律周期频率的波形集合,在周期频率集合中采用频率区间范围作为判断标准,例如5Hz到30Hz。如果笔势曲线的波形集合中的任意一个分支的周期频率在这个区间内,则认为符合删除笔势的判断条件。
例如,图5是将左侧字符区域1中的一条不规则波形采用快速傅里叶变分解为右侧至少三个 周期的波形的示意图,具体地,将周期性采集的曲线笔势上的轨迹坐标数据输入到FFT公式中,输出结果至少包括FFT变化分支1中的周期频率f1的波形、FFT变化分支2中的周期频率f2的波形、FFT变化分支3中的周期频率f3的波形,如果周期频率f1、周期频率f2和周期频率f3中任意一个在设定频率区间内,则认为符合删除笔势的判断条件。
下面介绍曲线角度的定义和判断规则。
图6根据本申请实施例,示出了一种曲线笔势轨迹的曲线角度的示意图。如图6所示,首先根据上述方法确定“目标字”的字符区域1,然后确定字符区域1中的曲线,根据曲线笔势的所有点集合进行判断,确定曲线笔势轨迹中的y方向的最高点的坐标(x 0,y 0)和最低点的坐标(x 1,y 1),最高点的坐标和最低点的坐标连线与x方向的角度作为曲线角度,定位Q为曲线角度区间,如果笔势曲线的角度在此区间内则认为符合判断条件。
表1示例性的说明各个参数类型对应的设定参数区间:
Figure PCTCN2022085895-appb-000002
表1中示出,曲线覆盖率的设定参数区间可以为0.35至1,曲线角度参数的设定参数区间可以为:上斜线(波谷至波峰连线角度)为0.27至10.83,下斜线(波峰至波谷连线角度为-0.24至-10.15,曲线频域的设定参数区间可以为5Hz至30Hz。
为了降低误删率,达到删除操作的精准识别,还可以判断编辑操作的编辑笔势在每个字符上的覆盖率,若编辑笔势在每个字符上的覆盖率大于设定覆盖率或在设定覆盖率区间,则确定为编辑笔势所选定的“目标字”符。例如,如图3所示,当用户利用手写笔200画的波浪线37部分落在与用户所想要删除的中文词语351(例如“文化”)相邻的字符(例如“示”)上时,由于波浪线37在与用户所想要删除的中文词语351(例如“文化”)相邻的字符(例如示)的覆盖率不在预设区间,则不会误将与中文词语351相邻的字符删除,提高用户体检。
下面介绍单字符横向覆盖率和单字符纵坐标覆盖率概念。可以理解,横纵方向即字符的宽度方向和高度方向。单字符横纵方向覆盖率是指,编辑操作在目标印刷体字符中每个字符上形成的笔势在每个字符的字符区域的横纵方向覆盖率。
图7根据本申请实施例,示出了一种单字符覆盖率的示意图。如图7所示,首先根据上述方法确定“目标字”中每个字符的字符区域,然后确定每个字符区域1中的曲线,如图7所示,根据上述方法确定“目标字”中“字”字符的字符区域1,字符区域1中的曲线的轨迹区域2。
单字符横向覆盖率,即“目标字”中每个字符上的曲线笔势轨迹的最右侧坐标和最左侧坐标的横坐标差值(x 22-x 11)与“目标字”中每个字符上的最右侧坐标和最左侧坐标的横坐标差值(x 12-x 11)的比率,定义Qx为单字符横坐标覆盖率判断区间。例如,Qx为0.42至1。
同理,单字符纵向覆盖率,即单个“目标字”中每个字符的上的曲线笔势轨迹最高点坐标和最低点坐标的纵坐标差值(y 12-y 11)与“目标字”中每个字符的最高点坐标和最低点坐标的纵坐标差值(y 22-y 21)比率,定义Qy为单字符纵坐标覆盖率判断区间。例如,Qy为0.35至1。
单字符横坐标覆盖率是否在判断区间Qx,即大于或等于判断区间Qx的上限值,小于等于判断区间Qx的下限值,单字符纵坐标覆盖率是在判断区间Qy,即大于或等于判断区间Qy的上限值,小于等于判断区间Qy的下限值,如果S≥Q,即同时满足单字符横坐标覆盖率在判断区间Qx,单字符纵坐标覆盖率在判断区间Qy,则认为符合条件的目标印刷体字符对应的该编辑操作为删除操作。
实施例一
图8根据本申请的一些实施例,示出了对于中文字符,当用户的删除笔势轨迹为曲线时进行识别的方法的流程示意图。如图8所示,该方法包括:
步骤801:检测到用户利用手写笔200对备忘录应用程序显示界面中的手写体字符转化后的印刷体字符进行编辑操作,识别出该编辑操作所选中的目标印刷体字符的语言类型。
可以理解,平板100可以获取用户利用手写笔200对目标印刷体字符所画的笔势轨迹的坐标集合,以及目标印刷体字符的坐标集合,若笔势轨迹的坐标集合与目标印刷体字符中的每个字符的坐标集合存在部分相同的坐标(横纵坐标值),则确定笔势轨迹与目标印刷体字符重叠,从而确定手写笔200的触控操作为编辑操作。
平板100对目标印刷体字符对应的目标手写字符进行笔触打点采集,得到目标手写字符的笔势轨迹坐标,并将目标手写字符的笔势轨迹坐标输入语言类型识别模型,得到目标手写字符的语言类型,即得到印刷体字符的语言类型。语言类型识别模型可以基于神经网络模型实现,例如卷积神经网络模型、深度稀疏卷积神经网络模型、深度递归神经网络模型等进行数据预处理、特征提取和文字分类等操作。
例如,如图1E所示,该备忘录应用程序的手写操作界面包括手写体字符转化后的印刷体字符,例如中文字符16,手写笔200在中文字符16中的部分字符161上进行编辑操作,例如画波浪线17。部分字符261的内容可以为“而所谓的”。平板100识别到部分字符261的语言类型为中文。
步骤802:识别手写笔200对所选中的目标印刷体字符的编辑操作的笔势类型。
如上所述,不同的笔势类型对应不同的判断依据,因此,需要平板100识别手写笔200对所选中的目标印刷体字符的编辑操作的笔势类型。笔势类型可以为曲线、直线和折线等。
步骤803:如果识别出手写笔200对所选中的目标印刷体字符的编辑操作的笔势类型为曲线类笔势,则获取手写笔200在目标印刷体字符上所画的曲线在目标印刷体字符所在的字符区域的曲线覆盖率、曲线频域和曲线角度。
例如,如图1E所示,平板100判断中文语种对应的波浪线17在部分字符161上的覆盖率、波浪线17在部分字符161上的覆盖率、波浪线17在部分字符161上的曲线频域参数或曲线角度是否分别在设定参数区间。
步骤804:判断获取的曲线覆盖率、曲线频域和曲线角度中任意一种参数是否在设定参数区间。若是,则转至步骤805。若否,则转至步骤806。
步骤805:无法确定该编辑操作的类型,向用户显示再次进行编辑操作的提示信息。
可以理解,在一些实施例中,平板100在无法确定该编辑操作的类型的情况下,会显示用户再次进行编辑操作的提示信息。在用户再次执行该编辑操作后,平板100再次执行步骤801至步 骤805。
步骤806:获取目标印刷体字符上中单个字符的单字符横纵方向覆盖率。
可以理解,为了降低误删率,需要获取目标印刷体字符上中单个字符的单字符横纵方向覆盖率。
步骤806:判断获取的单字符横纵方向覆盖率是否在设定参数区间,若是,则转至步骤808,若否,则转至809。
此外,在其它一些实施例中,为了降低误删率,平板100在执行步骤803之后,还可以直接获取并判断编辑操作形成的编辑笔势在每个字符上的覆盖率,若所选中的目标字符中编辑笔势在每个字符上的覆盖率大于设定覆盖率或者在设定覆盖率区间,则确定为编辑笔势所选定的目标字符。
步骤808:确定该编辑操作为删除操作,删除所选中的印刷体字符,光标停留在所选中的印刷体字符前一个字符右侧的位置,所选中的印刷体字符后面的文字符前移至光标处。
步骤809:删除所选中的符合单字符覆盖率的印书体字符。
实施例二
可以理解,此处的折线为沿着字符体或者公式从上至下的多条线段顺次首尾依次相接组成的曲折连线。与实施例一不同的是,实施例二在折线类笔势操作中应用到的判断依据是平板100获取手写笔200在目标印刷体字符上所画的折线对应的折线覆盖率和目标印刷体字符中单字符折线覆盖率,根据折线覆盖率和目标印刷体字符中单字符折线覆盖率确定该编辑操作是删除操作。例如,如图9所示,假设本申请实施例中,被选中的目标印刷体字符内容为:“目标字”,在当前xy坐标系下,y方向是指“目标字”从左至右的宽度方向,x方向是指“目标字”从上至下的高度方向。
例如,“目标字”在y方向最高点的坐标为(0,y 11),在y方向最低点的坐标为(0,y 12),以及“目标字”在x方向的最右侧的坐标为(x 12,0),最左边的坐标为(x 11,0)。目标印刷体字符所在的字符区域被定义为:包含坐标(0,y 12)且平行于x轴的直线、包含坐标(0,y 11)且平行于x轴的直线、包含坐标(x 11,0)且平行于y轴的直线,以及包含坐标为(x 12,0)且平行于y轴的直线围成的区域。
然后,计算两者纵坐标差值(y 12-y 11),并计算两者横坐标差值(x 12-x 11),之后将纵坐标差值与横坐标差值的乘积作为字符区域1的面积,即“目标字”面积。
为了提高删除操作识别的精确度,下面引入手写笔200在目标印刷体字符上所画的折线在字符区域1中的折线覆盖率及其判断规则。
下面先介绍折线覆盖率的定义,首先,根据字符区域内的折线所有点的坐标集合中,筛选出折线笔势高度方向的最高点坐标、高度方向的最低点坐标、宽度方向最右侧的坐标、宽度方向最左侧的坐标,确定折线所在的轨迹区域。例如,如图4所示,折线在y方向的最低点坐标为(0,y 22),在y方向的最高点坐标为(0,y 21),以及“目标字”在x方向的最左侧的坐标为(x 21,0),最右侧的坐标为(x 22,0)。折线所在的轨迹区域2被定义为:包含坐标(0,y 22)且平行于y轴的直线、包含坐标(0,y 21)且平行于y轴的直线、包含坐标(x 21,0)且平行于x轴的直线,以及包含坐标为(x 22,0)且平行于x轴的直线围成的区域。
然后,计算出纵坐标差值(y 22-y 21)与横坐标差值(x 22-x 21),两者乘积作为折线的覆盖面积。
折线覆盖面积与“目标字”面积的比值作为面积覆盖率S,定义覆盖率Q为最小面积覆盖率。
如图10所示,在该坐标系下,覆盖率计算方式为:
Figure PCTCN2022085895-appb-000003
下面再介绍折线覆盖率的判断规则:若折线覆盖率在设定参数区间,即折线笔势类型的面积覆盖率S在面积覆盖率判断区间Q,则确定用户的编辑操作为删除操作。
为了降低误删率,还可以判断编辑操作的编辑笔势在每个字符上的覆盖率,若编辑笔势在每个字符上的覆盖率大于设定覆盖率,则确定为编辑笔势所选定的“目标字”符。
与上文中提到的折线的单字符横向覆盖率和单字符纵坐标覆盖率的概念相同。
图10根据本申请实施例,示出了一种单字符覆盖率的示意图。如图10所示,首先根据上述方法确定“目标字”中每个字符的字符区域,然后确定每个字符区域1中的曲线,如图10所示,根据上述方法确定“目标字”中“字”字符的字符区域1,字符区域1中的曲线的轨迹区域2。
单字符横向覆盖率,即“目标字”中每个字符上的曲线笔势轨迹的最右侧坐标和最左侧坐标的横坐标差值(x 22-x 11)与“目标字”中每个字符上的最右侧坐标和最左侧坐标的横坐标差值(x 12-x 11)的比率,定义Qx为单字符横坐标覆盖率判断区间。例如,Qx为0.42至1。
同理,单字符纵向覆盖率,即单个“目标字”中每个字符的上的曲线笔势轨迹最高点坐标和最低点坐标的纵坐标差值(y 12-y 11)与“目标字”中每个字符的最高点坐标和最低点坐标的纵坐标差值(y 22-y 21)比率,定义Qy为单字符纵坐标覆盖率判断区间。例如,Qy为0.35至1。
单字符横坐标覆盖率是否在判断区间Qx,即大于或等于判断区间Qx的上限值,小于等于判断区间Qx的下限值,单字符纵坐标覆盖率是在判断区间Qy,即大于或等于判断区间Qy的上限值,小于等于判断区间Qy的下限值,如果S≥Q,即同时满足单字符横坐标覆盖率在判断区间Qx,单字符纵坐标覆盖率在判断区间Qy,则认为符合条件的目标印刷体字符对应的该编辑操作为删除操作。
图11根据本申请的一些实施例,示出了对于中文字符,当用户的删除笔势轨迹为折线时进行识别的方法的流程示意图。如图11所示,该方法包括:
步骤1101和步骤1102与实施例一中的步骤801和802的技术手段相同,在此不在赘述。
步骤1103:在识别出手写笔700对所选中的目标印刷体字符的编辑操作的笔势类型为折线类笔势的情况下,则获取手写笔700在目标印刷体字符上所画的折线在目标印刷体字符所在的字符区域的折线覆盖率。
步骤1104:判断获取的折线覆盖率是否在设定参数区间。若否,则转至步骤1105。若是,则转至步骤1106。
步骤1105:无法确定该编辑操作的类型,向用户显示再次进行编辑操作的提示信息。
可以理解,在一些实施例中,平板110在无法确定该编辑操作的类型的情况下,会显示用户再次进行编辑操作的提示信息。在用户再次执行该编辑操作后,平板110再次执行步骤1101至步骤1104。
步骤1106至步骤1109与实施例一中的步骤306和309的技术手段相同,在此不在赘述。
如此,降低由于折线在与用户所想要删除的文字符相邻的字符的覆盖率不在预设区间,则不会误将与用户所想要删除的相邻的文字符删除,提高用户体检。
此外,在其他实施例中,为了降低误删率,在执行步骤1102之后,可以直接判断编辑操作所 选中的目标字符中编辑笔势在每个字符上的横纵方向的覆盖率,若所选中的目标字符中编辑笔势在每个字符上的覆盖率在设定覆盖率区间,则确定为编辑笔势所选定的目标字符。
实施例三
可以将用户在转化后的印刷体字符上画设定的线条轨迹,例如,横线、斜线,使设定的线条轨迹与印刷体字符重叠,设定为删除操作。下面将横线和斜线统称为直线,说明删除操作的判断方法。
可以理解,若直线的倾斜角度趋于90度的时候,则是延印刷体字符高度方向竖线,而不是删除笔势。因此,可以先判断直线的倾角是否在直线区间内,在一定程度上,排出趋向竖线的情况。
例如,图12根据本申请的一些实施例,示出了一种在“目标字”上画直线以及直线倾角参数区间的示意图,如图12所示,假设本申请实施例中,被选中的目标印刷体字符内容为:“目标字”,在当前xy坐标系下,y方向是指“目标字”从左至右的宽度方向,x方向是指“目标字”从上至下的高度方向。
根据上述描述确定“目标字”的字符区域1。然后确定直线在字符区域1中两端的坐标(x 3,y 3)和(x 4,y 4),计算出纵坐标差值(y 4-y 3)与横坐标差值(x 4-x 3),然后计算纵坐标差值(y 4-y 3)与横坐标差值(x 4-x 3)的比值,然后根据该比值的反正切值,确定直线在字符区域1的倾斜角度。y表示,x表示。直线倾角采用的区间范围Y可以为-45度至45度、-50度至50度、-55度至55度或者-75度至75度等。
下面再介绍直线覆盖率的定义:
图13根据本申请的一些实施例,示出了一种在“目标字”上画直线以及直线覆盖率的示意图,如图13所示,假设本申请实施例中,被选中的目标印刷体字符内容为:“目标字”,在当前xy坐标系下,x方向是指“目标字”从左至右的宽度方向,y方向是指“目标字”从上至下的高度方向。D方向为直线所在的方向,F为直线笔势轨迹的法线方向,如图13所示,直线在字符区域1中两端点的坐标(x 3,y 3)和(x 4,y 4),“目标字”在y方向的最高点坐标为(x 5,y 5),在y方向的最低点坐标为(x 6,y 6)。“目标字”在x方向的最左侧的坐标为(x 7,y 7),在x方向的最右侧的坐标为(x 8,y 8)。
“目标字”所在的字符区域3被定义为:包含坐标(x 5,y 5)且平行于D方向的直线,包含坐标(x 6,y 6)且平行于D方向的直线,包含坐标(x 7,y 7)且平行于F方向的直线,包含坐标(x 8,y 8)且平行于F方向的直线围成的矩形区域。
直线所在的字符区域4被定义为:包含坐标(x 5,y 5)且平行于D方向的直线,包含坐标(x 6,y 6)且平行于D方向的直线,包含坐标(x 3,y 3)且平行于F方向的直线,包含坐标(x 4,y 4)且平行于F方向的直线围成的矩形区域。
字符区域4的面积和字符区域3的面积的比值作为面积覆盖率J。面积覆盖率的判断区间为K,在面积覆盖率J在判断区间K,则判断该编辑操作为删除操作。
同理,直线、直线的单字符覆盖率的定义与上述曲线和折线相同,单字符横向覆盖率是指编辑操作在每个字符上的曲线的最大、最小横坐标差值与每个字符上的最大、最小横坐标差值的比率。单字符纵向覆盖是指每个字符的上的曲线最大、最小纵坐标差值与每个字符的最大、最小纵坐标差值比率。判断规则也与上述相同。在此不在赘述。
图14根据本申请的一些实施例,示出了对于中文字符,当用户的删除笔势轨迹为直线时进行识别的方法的流程示意图。如图14所示,该方法包括:
步骤1401和步骤1402与实施例二中的步骤701和步骤702技术手段相同,在此不再赘述。
步骤1403:在识别出手写笔200对所选中的目标印刷体字符的编辑操作的笔势类型为直线类笔势的情况下,获取手写笔200在目标印刷体字符上所画的直线在目标印刷体字符所在的字符区域与印书体字符左右水平方向的倾斜角。
步骤1404:判断获取的倾斜角是否在预设倾斜角区间。若否,则转至步骤1405。若是,则转至步骤1406。
当判断为是直线时,调出对应的直线倾角参数区间,如果识别结果在参数区间内,则判定本次的编辑操作为删除操作,否则操作失败,笔势线型消失,用户可重新进行操作。
步骤1406:获取手写笔200在目标印刷体字符上所画的直线在目标印刷体字符所在的字符区域的直线覆盖率;
1407:判断获取的直线覆盖率是否在设定参数区间,若是,则转至步骤1408,若否,则转至步骤1405。
步骤1408至步骤1410与实施例一中的步骤706和709的技术手段相同,在此不在赘述。
实施例四
与实施例一不同的是,由于中文的字符中的字之间无间距,而英文的字符中的字(词)之间存在间距,英文设定参数区间的上限值小于等于中文设定参数区间的上限值。
图15根据本申请的一些实施例,示出了一种手写笔编辑笔势识别方法的流程示意图。如图15所示,该方法包括:
步骤1501至步骤1509与步骤701至步骤709的技术手段相同,只是与实施例一种步骤304的设定参数区间的取值范围不一样,即如果识别为书写语言为英文,则上述各个参数区间根据英文的字符体大小和间距,选择对应的差异化区间范围进行操作判断。
同理,可以理解,手写笔200在英文字符中的部分字符上画折线、直线、斜线的判断方式与手写笔200在中文字符的部分字符上画折线、直线、斜线的判断方式相同,可参见实施例二和实施例三中的技术手段。只是英文设定参数区间的上限值小于等于中文设定参数区间的上限值。例如,如图6所示,在中文和英文为同样字号等间距的情况下,确定英文单个字的宽度值,和中文单个字的宽度值与单个字的宽度值之和的比值1,确定中文单个字的宽度值,和中文单个字的宽度值与单个字的宽度值之和的比值2,比值1和比值2之间相除得到比值3,比值3乘以中文的下限值得到英文的下限值。
表1示例性的说明中英文各个参数类型对应的设定参数区间:
Figure PCTCN2022085895-appb-000004
Figure PCTCN2022085895-appb-000005
图16根据本申请的实施例示出了图1所示的电子设备100的一种可能的结构框图。该电子设备100能够执行本申请实施例提供的手写笔编辑笔势识别方法。具体地,如图16所示,电子设备100可以包括处理器110,外部存储器接口120,内部存储器111,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请的实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字符信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。
可以理解的是,本申请的实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器111,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调 制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如Wi-Fi网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。本申请实施例中,电子设备100可以通过无线通信模块160中的蓝牙(bluetooth,BT)与手写笔200建立通信连接关系。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(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,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器111可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器111可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器111可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存 储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器111的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。内部存储器111可以用于存储应用程序对应的Overlay配置文件。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字符音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字符音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控显示屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。本申请实施例中,电子设备100可以通过触摸传感器180K接收手写笔200与电子设备100的触控显示屏接触发射的信号,从而得知手写笔200在触控显示屏上的坐标,电子设备100根据手写笔200在触控显示屏上走过的轨迹对应的坐标数据判断手该用户操作是否为删除操作,若是,则删除被画线的字符。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。
本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。

Claims (16)

  1. 一种手写笔编辑笔势识别方法,应用于电子设备,其特征在于,所述方法包括:
    所述电子设备在检测到用户利用手写笔在所述电子设备的屏幕上所产生的笔势轨迹,与所述屏幕上显示的字符产生重叠的情况下,确定重叠的所述字符的第一字符区域和笔势轨迹;
    所述电子设备确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足第一预定条件;
    在满足第一预定条件的情况下,所述电子设备确定所述笔势轨迹对应的编辑操作为删除操作,并删除重叠的所述字符。
  2. 根据权利要求1所述的方法,其特征在于,所述第一字符区域为分别包含重叠的所有所述字符高度方向的最高点坐标和最低点坐标且平行于宽度方向的两条直线,以及分别包含所述字符宽度方向的最左侧坐标和最右侧坐标且平行于高度方向的两条直线,围成的矩形区域。
  3. 根据权利要求2所述的方法,其特征在于,所述电子设备确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足第一预定条件,包括:
    在所述笔势轨迹类型为曲线类型的情况下,所述电子设备确定所述笔势轨迹的第一轨迹区域的面积和所述第一字符区域的面积的第一比值;其中,所述第一轨迹区域为分别包含所述第一字符区域中笔势轨迹的字符高度方向的最高点坐标和最低点坐标且平行于宽度方向的两条直线,以及分别包含字符宽度方向的最左侧坐标和最右侧坐标且平行于高度方向的两条直线,围成的矩形区域;
    所述电子设备在判断出所述第一比值在第一参数区间的情况下,确定满足第一预定条件。
  4. 根据权利要求2所述的方法,其特征在于,所述电子设备确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足第一预定条件,包括:
    在所述笔势轨迹类型为直线类型的情况下,所述电子设备获取直线笔势轨迹与所述第一字符区域的字符宽度方向的倾斜角度;
    所述电子设备在判断出所述倾斜角度在第二参数区间的情况下,获取第二轨迹区域的面积和第二字符区域的面积的第三比值;
    其中,所述第二字符区域为分别包含所述字符的字符高度方向的最高点坐标和最低点坐标且平行于直线方向的两条直线,以及分别包含字符宽度方向的最左侧坐标和最右侧坐标且平行于直线法线方向的两条直线,围成的矩形区域;
    所述第二轨迹区域为所述第一字符区域中笔势轨迹的字符高度方向的最高点坐标和最低点坐标所在的平行于直线方向的两条直线,以及字符宽度方向的最左侧坐标和最右侧坐标所在的平行于直线法线方向的两条直线,围成的矩形区域;
    所述电子设备在判断出所述第三比值在第三参数区间的情况下,确定满足第一预定条件。
  5. 根据权利要求2所述的方法,其特征在于,所述电子设备确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足第一预定条件,包括:
    在所述笔势轨迹类型为折线类型的情况下,所述电子设备确定第一轨迹区域的面积和所述第一字符区域的面积的第二比值;其中,所述第一轨迹区域为分别包含所述第一字符区域中笔势轨 迹的字符高度方向的最高点坐标和最低点坐标且平行于宽度方向的两条直线,以及分别包含字符宽度方向的最左侧坐标和最右侧坐标且平行于高度方向的两条直线,围成的矩形区域;
    所述电子设备在判断出所述第二比值在第四参数区间的情况下,确定满足第一预定条件。
  6. 根据权利要求2所述的方法,其特征在于,所述方法包括:
    在所述笔势轨迹类型为曲线类型的情况下,所述电子设备采用快速傅里叶变化获取所述曲线笔势轨迹的正弦波集合;
    所述电子设备获取所述正弦波集合中按照频率值由大至小排在前的预设条正弦波的频率;
    所述电子设备在判断出所述预设条正弦波的频率在第五参数区间的情况下,确定满足第一预定条件。
  7. 根据权利要求2所述的方法,其特征在于,所述方法包括:
    在所述笔势轨迹类型为曲线类型的情况下,所述电子设备获取所述曲线笔势轨迹在所述第一字符区域的高度方向的最高点坐标和最低点坐标;
    所述电子设备根据所述最高点坐标和最低点坐标确定所述最高点和所述最低点之间的连线与所述高度方向的倾斜角度;
    所述电子设备在判断出所述倾斜角度在第六参数区间的情况下,确定满足第一预定条件。
  8. 根据权利要求1至7任一项所述的方法,其特征在于,所述电子设备判断出重叠的所述字符的数量为多个,并且所述电子设备在确定所述笔势轨迹与所述第一字符区域之间的重叠关系满足第一预定条件的情况下,还判断重叠的所述多个字符中的每个字符上的笔势轨迹与每个字符的单第一字符区域之间的重叠关系是否满足第二预定条件,并在判断出满足所述第二预定条件的情况下,删除满足所述第二预定条件的字符。
  9. 根据权利要求8述的方法,其特征在于,所述第一字符区域为分别包含单个字符高度方向的最高点坐标和最低点坐标且平行于高度方向的两条直线,以及分别包含单个字符宽度方向的最左侧坐标和最右侧坐标且平行于宽度方向的两条直线,围成的矩形区域。
  10. 根据权利要求9所述的方法,其特征在于,判断重叠的所述多个字符中的每个字符上的笔势轨迹与每个字符的单第一字符区域之间的重叠关系是否满足第二预定条件,包括:
    所述电子设备确定重叠的所述字符中每个字符的宽度值与所述第一字符区域宽度值的宽度比值,以及重叠的所述字符中每个字符的高度值与所述第一字符区域高度值的高度比值,所述电子设备在判断出所述宽度比值在第七参数区间,所述高度比值在第八参数区间的情况下,确定满足第一预定条件。
  11. 根据权利要求1至10任一项所述的方法,其特征在于,所述电子设备确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足预定条件,包括:
    所述电子设备判断出所述字符是第一语言字符还是第二语言字符;
    所述电子设备在判断出是第一语言字符的情况下,获取所述第一语言字符对应的预定条件, 并确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足所述第一语言字符对应的预定条件;
    所述电子设备在判断出是第二语言字符的情况下,获取所述第二语言字符对应的预定条件,并确定所述笔势轨迹与所述第一字符区域之间的重叠关系是否满足所述第一语言类型对应的预定条件。
  12. 根据权利要求11所述的方法,其特征在于,所述第一语言包括中文、英文、德文、法文中的任意一种,所述第二语言包括中文、英文、德文、法文中的任意一种。
  13. 根据权利要求1至10任一项所述的方法,其特征在于,所述字符为手写体字符转化后的印书体字符。
  14. 根据权利要求1至7任一项所述的方法,其特征在于,所述字符在所述电子设备上的预设应用程序的操作界面显示,所述预设应用程序为备忘录、笔写计算器、Nebo for Huawei、随手写中的任意一种。
  15. 一种可读介质,其特征在于,所述可读介质上存储有指令,该指令在电子设备上执行时使电子设备实现权利要求1至14中任一项所述的手写笔编辑笔势识别方法。
  16. 一种电子设备,包括:存储器,用于存储由电子设备的一个或多个处理器执行的指令,以及
    处理器,是所述电子设备的处理器之一,用于执行权利要求1至14中任一项所述的手写笔编辑笔势识别方法。
PCT/CN2022/085895 2021-05-31 2022-04-08 一种手写笔编辑笔势识别方法、介质及电子设备 WO2022252821A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110602320.4 2021-05-31
CN202110602320.4A CN115480659A (zh) 2021-05-31 2021-05-31 一种手写笔编辑笔势识别方法、介质及电子设备

Publications (1)

Publication Number Publication Date
WO2022252821A1 true WO2022252821A1 (zh) 2022-12-08

Family

ID=84323866

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/085895 WO2022252821A1 (zh) 2021-05-31 2022-04-08 一种手写笔编辑笔势识别方法、介质及电子设备

Country Status (2)

Country Link
CN (1) CN115480659A (zh)
WO (1) WO2022252821A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1493961A (zh) * 2002-10-31 2004-05-05 株式会社日立制作所 手写输入装置、程序和手写输入方法系统
CN102455869A (zh) * 2011-09-29 2012-05-16 北京壹人壹本信息科技有限公司 一种利用手势编辑文字的方法及装置
CN107533646A (zh) * 2015-04-24 2018-01-02 富士通株式会社 输入处理程序、输入处理装置、输入处理方法、字符确定程序、字符确定装置、以及字符确定方法
CN107533647A (zh) * 2015-04-24 2018-01-02 富士通株式会社 输入控制程序、输入控制装置、输入控制方法、字符修正程序、字符修正装置以及字符修正方法
CN111476209A (zh) * 2019-05-14 2020-07-31 深圳传音控股股份有限公司 手写输入的识别方法、设备及计算机存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1493961A (zh) * 2002-10-31 2004-05-05 株式会社日立制作所 手写输入装置、程序和手写输入方法系统
CN102455869A (zh) * 2011-09-29 2012-05-16 北京壹人壹本信息科技有限公司 一种利用手势编辑文字的方法及装置
CN107533646A (zh) * 2015-04-24 2018-01-02 富士通株式会社 输入处理程序、输入处理装置、输入处理方法、字符确定程序、字符确定装置、以及字符确定方法
CN107533647A (zh) * 2015-04-24 2018-01-02 富士通株式会社 输入控制程序、输入控制装置、输入控制方法、字符修正程序、字符修正装置以及字符修正方法
CN111476209A (zh) * 2019-05-14 2020-07-31 深圳传音控股股份有限公司 手写输入的识别方法、设备及计算机存储介质

Also Published As

Publication number Publication date
CN115480659A (zh) 2022-12-16

Similar Documents

Publication Publication Date Title
US20210103386A1 (en) Identification of candidate characters for text input
KR102544780B1 (ko) 필기 입력에 따른 사용자 인터페이스 제어 방법 및 이를 구현한 전자 장치
US10796133B2 (en) Image processing method and apparatus, and electronic device
JP5784141B2 (ja) 重畳筆記による手書き入力方法
US8943092B2 (en) Digital ink based contextual search
US20160132232A1 (en) Electronic device and method for processing handwritten document data
US20040240739A1 (en) Pen gesture-based user interface
US20140337804A1 (en) Symbol-based digital ink analysis
JP2013097643A (ja) 手書き入力装置及び手書き入力制御プログラム
WO2019105457A1 (zh) 图像处理方法、计算机设备和计算机可读存储介质
US20160321238A1 (en) Electronic device, method and storage medium
EP2990921A1 (en) Electronic device and method for providing drawing function thereof
US20150347000A1 (en) Electronic device and handwriting-data processing method
CN109753202B (zh) 一种截屏方法和移动终端
US20140079317A1 (en) Electronic apparatus and handwritten document processing method
US20160170632A1 (en) Interacting With Application Beneath Transparent Layer
US9927971B2 (en) Electronic apparatus, method and storage medium for generating chart object
US20160139802A1 (en) Electronic device and method for processing handwritten document data
US20230135661A1 (en) Image processing method and apparatus for smart pen, and electronic device
US20160117093A1 (en) Electronic device and method for processing structured document
WO2022252821A1 (zh) 一种手写笔编辑笔势识别方法、介质及电子设备
CN111428721A (zh) 词语释义的确定方法、装置、设备及存储介质
CN113641292B (zh) 在触摸屏上进行操作的方法和电子设备
US9697422B2 (en) Electronic device, handwritten document search method and storage medium
WO2024066505A1 (zh) 一种显示内容的方法、装置及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22814868

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE