CN116630994B - Method for recognizing pen gestures in input method, related device and medium - Google Patents

Method for recognizing pen gestures in input method, related device and medium Download PDF

Info

Publication number
CN116630994B
CN116630994B CN202310888999.7A CN202310888999A CN116630994B CN 116630994 B CN116630994 B CN 116630994B CN 202310888999 A CN202310888999 A CN 202310888999A CN 116630994 B CN116630994 B CN 116630994B
Authority
CN
China
Prior art keywords
track
target
increment
coordinate
points
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202310888999.7A
Other languages
Chinese (zh)
Other versions
CN116630994A (en
Inventor
闫杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202310888999.7A priority Critical patent/CN116630994B/en
Publication of CN116630994A publication Critical patent/CN116630994A/en
Application granted granted Critical
Publication of CN116630994B publication Critical patent/CN116630994B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/32Digital ink
    • G06V30/333Preprocessing; Feature extraction
    • G06V30/347Sampling; Contour coding; Stroke extraction
    • 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/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/62Extraction of image or video features relating to a temporal dimension, e.g. time-based feature extraction; Pattern tracking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/32Digital ink
    • G06V30/36Matching; Classification
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the disclosure provides a pen gesture recognition method in an input method, a related device and a medium. The pen gesture recognition method comprises the following steps: displaying a first area in an input method interface, wherein the first area comprises a text input by using the input method; generating a target track based on the sliding of the target touch body in the first area; acquiring coordinates of a plurality of track points on the target track; acquiring coordinate increment between adjacent track points in coordinates of a plurality of track points; acquiring a target increment trend symbol string based on the coordinate increment between each two adjacent track points; and identifying the pen gesture corresponding to the target track based on the target increment trend symbol string. The embodiment of the disclosure improves the flexibility and accuracy of pen gesture recognition and reduces the occupation of resources. The embodiment of the disclosure can be applied to the fields of input methods, data processing, word processing and the like.

Description

Method for recognizing pen gestures in input method, related device and medium
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a gesture recognition method in an input method, a related device, and a medium.
Background
When inputting text using an input method, it often happens that an object finds that the previously inputted text has an error or that an operation (such as post-selection pasting) is required for the previously inputted text. After the object finds that the text input by the upper screen area has errors or needs to operate on the text, the object makes strokes such as insertion, deletion, selection and the like on the upper screen area so as to perform insertion, deletion and the like.
In the related art, strokes such as insertion and deletion of an object are identified, and generally, the strokes are classified by a classification model. In the input method design stage, an accurate drawing method for each pen gesture needs to be determined, a large number of sample pen gestures are generated, and a classification model is input for training. The method can be classified according to the predefined standard strokes, and has poor flexibility. The classification accuracy is poor because of the habit of different objects representing different strokes. Classification model operation and storage takes up a significant amount of computing and storage resources.
Disclosure of Invention
The embodiment of the disclosure provides a pen gesture recognition method, a related device and a medium in an input method, which can improve the flexibility and accuracy of pen gesture recognition and reduce the occupation of resources.
According to an aspect of the present disclosure, there is provided a gesture recognition method in an input method, including:
Displaying a first area in an input method interface, wherein the first area comprises a text input by using the input method;
generating a target track based on the sliding of the target touch body in the first area;
acquiring coordinates of a plurality of track points on the target track;
acquiring coordinate increment between adjacent track points in coordinates of a plurality of track points;
acquiring a target increment trend symbol string based on the coordinate increment between each two adjacent track points;
and identifying the pen gesture corresponding to the target track based on the target increment trend symbol string.
According to an aspect of the present disclosure, there is provided a gesture recognition apparatus in an input method, including:
the first display unit is used for displaying a first area in the input method interface, wherein the first area comprises a text input by the input method;
the first generation unit is used for generating a target track based on the sliding of the target touch body in the first area;
the first acquisition unit is used for acquiring coordinates of a plurality of track points on the target track;
a second obtaining unit, configured to obtain coordinate increments between coordinate adjacent track points in the plurality of track points;
the third acquisition unit is used for acquiring a target increment trend symbol string based on the coordinate increment among the adjacent track points;
And the first identification unit is used for identifying the pen gesture corresponding to the target track based on the target increment trend symbol string.
Optionally, the first obtaining unit is configured to: acquiring first coordinates and second coordinates of a plurality of track points on the target track;
the second acquisition unit is used for: acquiring a first coordinate increment of the first coordinate and a second coordinate increment of the second coordinate between adjacent track points in the track points;
the third acquisition unit is used for: acquiring a first target increment trend symbol string of the first coordinate based on the first coordinate increment between each adjacent track point, and acquiring a second target increment trend symbol string of the second coordinate based on the second coordinate increment between each adjacent track point;
the first identifying unit is used for: if at least one of the first target increment trend symbol string and the second target increment trend symbol string has symbol jump of at least two times of target increment trend symbol, identifying the pen gesture corresponding to the target track as a deletion pen gesture; and if no sign jump of at least a secondary target increment trend symbol occurs in the first target increment trend symbol string and the second target increment trend symbol string, identifying the pen gesture corresponding to the target track as an insertion pen gesture when the number of jumps between a first character and a second character in the second target increment trend symbol string is 0 and the maximum value of a first coordinate difference between track points on the target track is smaller than a third threshold value, otherwise identifying the pen gesture corresponding to the target track as a selection pen gesture.
Optionally, the first identifying unit is further configured to:
acquiring an input history of a target object for inputting the text in the input method interface;
acquiring a plurality of history insertion strokes input in the input history record;
obtaining the maximum value of a first coordinate difference between track points on a pen potential track corresponding to the history inserted pen potential;
solving a second average value and a second variance for the maximum values corresponding to the plurality of history insertion strokes;
the third threshold is determined based on the second average, the variance, and a predetermined coefficient.
Optionally, the third obtaining unit is specifically configured to:
if the coordinate increment between the adjacent track points is positive and the absolute value of the coordinate increment is larger than a first threshold value, setting the sign of the increment trend symbol of the adjacent track points to be positive; if the coordinate increment between the adjacent track points is negative and the absolute value of the coordinate increment is larger than a first threshold value, setting the sign of the increment trend symbol of the adjacent track points to be negative; otherwise, setting the sign of the incremental trend symbol of the adjacent track points to 0;
connecting the increment trend symbols of the adjacent track points according to the sequence of the adjacent track points on the target track to generate the original increment trend symbol string;
And acquiring the target increment trend symbol string from the original increment trend symbol string.
Optionally, the third obtaining unit is further specifically configured to:
acquiring the curvature of each track point in the adjacent track points on the target track;
determining a third average value of the curvature of each of the adjacent track points;
and determining the first threshold corresponding to the track point based on the third average value.
Optionally, the third obtaining unit is specifically configured to:
compressing consecutive identical incremental trend symbols in said original string of incremental trend symbols into one of said incremental trend symbols if the number of consecutive identical incremental trend symbols is greater than a second threshold;
and deleting the continuous identical increment trend symbol if the number of the continuous identical increment trend symbol is not greater than a second threshold value, so as to obtain the target increment trend symbol string.
Optionally, the third obtaining unit is further specifically configured to:
acquiring midpoint increment trend symbols from the continuous identical increment trend symbols;
acquiring a fourth average value of curvatures of adjacent track points corresponding to the midpoint increment trend symbols on the target track;
And determining the second threshold corresponding to the continuous same increment trend symbol based on the fourth average value.
Optionally, the third obtaining unit is further specifically configured to:
equally dividing the original incremental trend symbol string into a plurality of substrings;
determining the most increment trend symbol in each sub-string as the target increment trend symbol corresponding to the sub-string;
and connecting the target increment trend symbols corresponding to the sub-strings according to the sequence of the sub-strings to obtain the target increment trend symbol string.
Optionally, the first generating unit is specifically configured to:
each time the target touch body continuously slides in the first area, identifying the target touch body as a candidate track;
acquiring the duration and duration of the candidate track;
screening out a screened track from a plurality of candidate tracks based on the duration and the duration;
and acquiring the target track from the screened track.
Optionally, the first generating unit is further specifically configured to:
determining a first score for the candidate trajectory based on the duration;
determining a second score for the candidate trajectory based on the duration;
Determining a total score for the candidate trajectory based on the first score and the second score;
and screening the screened track from a plurality of candidate tracks based on the total score.
Optionally, the first generating unit is further specifically configured to:
sequentially selecting a plurality of anchor points from the starting point of the screened track at a first time interval on the screened track;
determining the minimum distance between the anchor point and each text pixel point of the first area;
and identifying the screened track as the target track based on the minimum distances of the anchor points.
Optionally, the first generating unit is further specifically configured to:
determining a first average of the minimum distances of the plurality of anchor points;
and if the first average value is smaller than a preset threshold value, identifying the screened track as the target track.
Optionally, the first obtaining unit is specifically configured to:
equally dividing the time length between the start time and the end time of the target track into a plurality of time intervals;
and acquiring coordinates of the track points corresponding to the midpoints of the time intervals on the target track.
Optionally, the first obtaining unit is specifically configured to:
Dividing the length of the target track into a plurality of track sections;
acquiring curvatures of midpoints of a plurality of track intervals on the target track;
taking the midpoint of the curvature meeting a first condition as the track point;
and acquiring coordinates of a plurality of track points.
Optionally, the first obtaining unit is specifically configured to:
dividing the length of the target track into a plurality of track sections;
acquiring touch pressures of midpoints of a plurality of track intervals;
taking the midpoint of the touch pressure meeting a second condition as the track point;
and acquiring coordinates of a plurality of track points.
Optionally, before displaying the first area in the input method interface, the gesture recognition apparatus further includes:
the second display unit is used for displaying a gesture enabling control on the input method interface;
and the first receiving unit is used for receiving the trigger of the gesture enabling control.
Optionally, after identifying the pen gesture corresponding to the target track based on the target increment trend symbol string, the pen gesture identifying device further includes:
the third display unit is used for displaying a second area in the input method interface and used for receiving handwriting input if the pen gesture corresponding to the target track is recognized as an insertion pen gesture;
And the first inserting unit is used for receiving the handwriting input in the second area, identifying the handwriting input as text to be inserted, and inserting the text to the position of the inserted gesture.
Optionally, after identifying the pen gesture corresponding to the target track based on the target increment trend symbol string, the pen gesture identifying device further includes:
a fourth obtaining unit, configured to obtain, as a text to be deleted, a text covered by the deletion pen gesture in the first area if it is identified that the pen gesture corresponding to the target track is the deletion pen gesture;
the fourth display unit is used for displaying the text to be deleted in the first correction frame of the input method interface;
a second receiving unit, configured to receive a correction of the text to be deleted in the first correction box by a target object;
a first deleting unit, configured to delete the corrected text to be deleted from the text in the first area.
Optionally, after identifying the pen gesture corresponding to the target track based on the target increment trend symbol string, the pen gesture identifying device further includes:
a fifth obtaining unit, configured to obtain, as a selection target text, a text covered by the selection pen gesture in the first area if it is identified that the pen gesture corresponding to the target track is the selection pen gesture;
A fifth display unit, configured to display the selection target text in a second correction frame of the input method interface;
a third receiving unit configured to receive correction of the selection target text in the second correction frame by a target object;
a first activating unit configured to activate an operation option list for the corrected selection target text;
and the first operation unit is used for responding to the selection of a target operation option in the operation option list and executing the operation corresponding to the target operation option on the selected target text.
According to an aspect of the present disclosure, there is provided an electronic device including a memory storing a computer program and a processor implementing a gesture recognition method in an input method as described above when the processor executes the computer program.
According to an aspect of the present disclosure, there is provided a computer-readable storage medium storing a computer program which, when executed by a processor, implements a gesture recognition method in an input method as described above.
According to an aspect of the present disclosure, there is provided a computer program product comprising a computer program which is read and executed by a processor of a computer device, causing the computer device to perform a gesture recognition method in an input method as described above.
In the embodiment of the disclosure, a target track generated by sliding an object in a first area is acquired. When the pen potential represented by the target track is identified, coordinates of a plurality of track points are acquired on the target track, coordinate increment of the track points is determined along the target track, the coordinate increment is represented by a target increment trend symbol, and the coordinate increment is connected into a target increment trend symbol string. The change of the coordinate increment of the track point on the target track with different pen potentials, such as insertion, deletion, selection and the like, has respective rules, and the rules are embodied in the target increment trend symbol string. Thus, the pen gesture corresponding to the target track can be identified based on the target increment trend symbol string. According to the scheme, a standard drawing method for defining the pen gestures in advance is not needed, and the flexibility of pen gesture recognition is improved. According to the scheme, the pencil potential is identified by utilizing the change rule of the coordinate increment of the track point on the target track of different pencil potentials, so that the method is applicable to the object, the influence caused by different habits of different objects for making the same pencil potential is reduced, and the accuracy of pencil potential identification is improved. According to the scheme, a training model is not needed, and occupation of computing resources and storage resources is reduced.
Additional features and advantages of the disclosure will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the disclosure. The objectives and other advantages of the disclosure will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosed embodiments and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain, without limitation, the disclosed embodiments.
FIG. 1 is a architectural diagram of a gesture recognition method in an input method of an embodiment of the present disclosure;
fig. 2A-E are schematic interface diagrams of an input method gesture recognition method according to an embodiment of the present disclosure applied to an input method gesture recognition scene;
FIG. 3 is a flow chart of a method of gesture recognition in an input method according to one embodiment of the present disclosure;
FIGS. 4A-B are schematic diagrams of an interface for starting the gesture recognition service at step 310 of FIG. 3;
FIGS. 5A-C are schematic illustrations of several display forms of step 310 of FIG. 3 with respect to a first region;
FIG. 6A is a schematic diagram of several target trajectories corresponding to a selection gesture in accordance with an embodiment of the present disclosure;
FIG. 6B is a schematic diagram of several target trajectories corresponding to a delete gesture according to an embodiment of the disclosure;
FIG. 6C is a schematic diagram of several target trajectories corresponding to an insertion gesture according to an embodiment of the present disclosure;
FIG. 7 is a flow chart of step 320 of FIG. 3 with respect to generating a target trajectory;
FIG. 8 is a schematic diagram of a specific implementation of step 320 in FIG. 3 with respect to generating a target track;
FIG. 9 is a flowchart of a specific implementation of identifying a target trajectory using the minimum anchor-to-text pixel distance of FIG. 8;
FIG. 10 is a schematic diagram of a specific implementation process for identifying a target track from a screened track;
FIG. 11 is a first flowchart of acquiring coordinates of a trace point in step 330 of FIG. 3;
FIG. 12 is a schematic diagram of a first implementation of the process of obtaining coordinates of the track point in step 330 in FIG. 3;
FIG. 13 is a second flowchart of acquiring coordinates of a trace point of step 330 of FIG. 3;
FIG. 14 is a schematic diagram showing a second implementation process for obtaining coordinates of the track point in step 330 in FIG. 3;
FIG. 15 is a third flowchart of acquiring coordinates of a trajectory point of step 330 of FIG. 3;
FIG. 16 is a joint exploded flow chart of steps 330-360 of FIG. 3;
FIG. 17 is a flowchart of a specific implementation of the get target delta trend string of step 1630 of FIG. 16;
FIG. 18 is a flowchart of a specific implementation of step 1710 of FIG. 17 to set a first threshold;
FIG. 19 is a first exploded flowchart of step 1730 of FIG. 17 to derive a target incremental trend string from the original incremental trend string;
FIG. 20 is a schematic diagram of a first implementation of step 1730 of FIG. 17 to obtain a target incremental trend string from the original incremental trend string;
FIG. 21 is a flowchart of a specific implementation of step 1910 of FIG. 19 where a second threshold is set;
FIG. 22 is a second exploded flowchart of step 1730 of FIG. 17 for deriving a target incremental trend string from the original incremental trend string;
FIG. 23 is a schematic diagram of a second implementation of step 1730 of FIG. 17 to obtain a target incremental trend string from the original incremental trend string;
FIG. 24 is a flowchart of a specific implementation of setting the third threshold at step 1640 in FIG. 16;
FIG. 25 is a schematic diagram of a specific implementation process for identifying a target track as a delete gesture according to an embodiment of the present disclosure;
FIG. 26 is a flowchart of an embodiment of the present disclosure when a gesture corresponding to a target track is an insertion gesture;
FIGS. 27A-C are schematic diagrams illustrating a specific implementation process when a pen gesture corresponding to a target track is an insertion pen gesture according to an embodiment of the present disclosure;
FIG. 28 is a flowchart of an embodiment of the present disclosure when a gesture corresponding to a target track is a delete gesture;
fig. 29A-D are schematic diagrams of a specific implementation process when a pen gesture corresponding to a target track is a deletion pen gesture according to an embodiment of the present disclosure;
FIG. 30 is a flowchart of an embodiment of the present disclosure when a gesture corresponding to a target track is a selection gesture;
31A-D are schematic diagrams of specific implementation processes when a pen gesture corresponding to a target track is a selected pen gesture according to an embodiment of the present disclosure;
FIG. 32 is a block diagram of a gesture recognition apparatus in an input method according to an embodiment of the present disclosure;
fig. 33 is a terminal structure diagram of a gesture recognition method in the input method shown in fig. 3 according to an embodiment of the present disclosure;
fig. 34 is a server configuration diagram of a gesture recognition method in the input method shown in fig. 3 according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, the present disclosure will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present disclosure.
Before proceeding to further detailed description of the disclosed embodiments, the terms and terms involved in the disclosed embodiments are described, which are applicable to the following explanation:
an input method comprises the following steps: refers to the coding method employed for inputting various symbols into a computer or other device such as a cell phone.
Pen potential: in handwriting text input, a portion of the input strokes of a particular layout are recognized as commands rather than text. These specific input strokes are called pen gestures. Common pen gestures include "select", "delete", "insert", and the like.
And (3) identifying the pen gesture in the input method: when a text is input by using an input method, input strokes of an object in a region displaying the input text are recognized, pen gestures such as insertion, deletion and selection are recognized, and modification operations such as insertion, deletion and the like are performed on the input text.
System architecture and scenario description applied to embodiments of the present disclosure
Fig. 1 is a system architecture diagram to which a gesture recognition method in an input method according to an embodiment of the present disclosure is applied. It includes a server 110, the internet 120, an object terminal 130, and the like.
The server 110 refers to a computer system capable of providing a gesture recognition service to the object terminal 130. The server 110 is required to have higher stability, security, performance, and the like than the target terminal 130. The server 110 may be one high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of one high-performance computer (e.g., a virtual machine), a combination of portions of multiple high-performance computers (e.g., virtual machines), etc. The server 110 may also communicate with the internet 120 in a wired or wireless manner, exchanging data.
The object terminal 130 is a device for acquiring a sliding track input by an object to recognize the sliding track in terms of a pen gesture. It includes touch screen terminals, desktop computers, laptops, PDAs (personal digital assistants), cell phones, car terminals, home theater terminals, dedicated terminals, etc. In addition, the device can be a single device or a set of a plurality of devices. For example, a plurality of devices are connected through a local area network, and a display device is commonly used for cooperative work to form a terminal. The terminals may also communicate with the internet 120, either wired or wireless, to exchange data.
The embodiment of the disclosure can be applied to any scene using handwriting input, in particular to an input method gesture recognition scene as shown in fig. 2A-E, and the like.
As shown in fig. 2A, the object terminal 130 is a computer terminal. When an object logs into the session application platform at the object terminal 130 to perform a session with other objects, the computer terminal interface displays session records of both parties of the session. The subject is entering text using the input method and has entered "listening and speaking" in the input box because of the good weather, we are going out to climb mountain together? "but the text has not yet been sent.
As shown in fig. 2B, the subject suddenly finds that the error is input, and should be "hearing colleague speaking", so that an insertion gesture is input between "hearing" and "speaking" to perform an insertion operation.
As shown in fig. 2C, after the object inputs the insertion gesture at the object terminal 130, the object terminal 130 moves the input cursor between "listen" and "say", and the object inputs two words of "colleague" in the handwriting area using the input method, and then clicks the "confirm" control.
As shown in fig. 2D, after the object clicks the "confirm" control, the object terminal 130 inserts the "colleague" two words between "listen" and "say" when the text in the input box is "listen colleague say" because the tomorrow is good, and we want the team to go out to climb the mountain together? The object then clicks the send control.
As shown in fig. 2E, after the object clicks the "send" control, the object terminal 130 will "listen to colleagues," because of the good weather, we will get out of the mountain along with the team? "send to session object".
For gesture recognition, the related art generally uses a classification model for gesture recognition, which has several disadvantages as follows:
1. the flexibility is poor: the related technology requires education objects to trace according to the preset pencil situation of a specific form of the system, otherwise, the object intention cannot be correctly identified, and the man-machine interaction is not natural enough.
2. The accuracy is poor: the classification model has high requirements on the form precision of the strokes, so that the recognition error rate is high. Different subjects may have differences in pen-gesture methods when expressing the same intent due to different personal habits. The classification model is used for classification, and if the object does not accurately draw a preset pen form, misjudgment of the model is most likely to be caused.
3. The consumption resources are large: the classification model identification process needs to be subjected to multiple steps of feature extraction, model calculation and the like, and the calculated amount is large. Meanwhile, the model parameters also need a certain storage space. This problem is particularly pronounced in object terminals. In addition, a large amount of sample data needs to be collected in advance to train the model during model training.
General description of embodiments of the disclosure
According to one embodiment of the present disclosure, a method of gesture recognition in an input method is provided.
The gesture recognition method in the input method is often used for the input method gesture recognition scene as in fig. 2A-E. The problems of low accuracy, poor flexibility, high computing resource consumption and the like of the stroke identification in the related technology exist, and the method is difficult to directly apply to an input method stroke identification scene. The input method gesture recognition method disclosed by the embodiment of the invention can improve the gesture recognition accuracy and flexibility in the input method and can also save calculation resources.
As shown in fig. 3, a gesture recognition method in an input method according to an embodiment of the present disclosure may include:
step 310, displaying a first area in an input method interface, wherein the first area comprises a text input by an input method;
step 320, generating a target track based on sliding of the target touch body in the first area;
step 330, acquiring coordinates of a plurality of track points on the target track;
step 340, acquiring coordinate increment between adjacent track points in coordinates of a plurality of track points;
350, acquiring a target increment trend symbol string based on the coordinate increment between each two adjacent track points;
Step 360, based on the target increment trend symbol string, identifying the pen gesture corresponding to the target track.
The above steps 310-360 are generally described below.
The gesture recognition method may be performed by the object terminal 130 shown in fig. 1 or may be performed by the server 110 shown in fig. 1.
In step 310, a first region is displayed in the input method interface, the first region containing text entered using the input method.
The input method interface refers to an interface displayed by the object terminal 130 in response to the start of the input method after the start of the input method. The first region refers to a region in which text is displayed. After the input method is started, the gesture recognition service may be started directly. Considering that an object-initiated input method is generally intended for text input using an input method, a gesture recognition service is not necessarily required, and thus, in an embodiment, it is required that whether or not the gesture recognition service is enabled is selected by the object.
In a specific implementation of this embodiment, before the first area is displayed in the input method interface, the gesture recognition method according to the embodiment of the present disclosure further includes:
displaying a gesture enabling control on an input method interface;
a trigger for a gesture-enabled control is received.
Referring to FIG. 4A, after the input method is started, there is a "gesture-enabled" control on the input interface of the input method. After clicking the "gesture-enabled" control, the object enables the gesture recognition service.
In addition to starting the gesture recognition service based on the gesture-enabled control, in another embodiment, referring to fig. 4B, the object voice speaks "start gesture recognition", at which time the object terminal 130 recognizes the object voice and then starts the gesture recognition service, and a prompt message "will start gesture recognition for you, please wait slightly" is displayed on the interface to remind the object of the start progress.
After determining to enter the gesture recognition service, the stroke entered by the object terminal 130 may be recognized as text or as a gesture.
The input method interface comprises a first area, wherein the first area comprises text input by using an input method.
Several display forms of the first region are described below in connection with fig. 5A-5C:
(1) As shown in fig. 5A, on the input method interface of the session application platform, the input text is "listen and talk", and the first area containing "listen and talk" is specifically a handwriting area on the input method interface, and there is an insertion gesture represented by a diagonal line between "listen" and "talk".
(2) As shown in fig. 5B, on the input method interface of the session application platform, the input text is "listen and talk", and the first area containing "listen and talk" is specifically an upper screen area on the input method interface, and there is an insertion gesture represented by a diagonal line between "listen" and "talk".
(3) As shown in fig. 5C, on the input method interface of the text editing application platform, the input text includes "weather today is good". The first area containing "today's weather is particularly the upper screen area on the input method interface, and there is an insertion gesture represented by a diagonal line between" day "and" day ".
In step 320, a target trajectory is generated based on the sliding of the target contact in the first region. The target touch body refers to an object that slides a first area displayed on the terminal of the object, such as a finger of the object, and also such as a stylus held by the object. The sliding of the target contact body in the first area forms a target track. For example, referring to fig. 5A and 5B, a diagonal line track between "listen" and "say" is a target track. Referring again to fig. 5C, for example, the diagonal trajectory between "day" and "day" is the target trajectory.
After the target track is obtained, in step 330, coordinates of a plurality of track points are obtained on the target track; then, in step 340, acquiring coordinate increment between adjacent track points in coordinates of the track points; then, a target increment trend symbol string is acquired in step 350 based on the coordinate increment between each adjacent track point; finally, based on the target incremental trend symbol string, a gesture corresponding to the target track is identified at step 360. As shown in fig. 6A, the object may slide out of the target trajectory shown in fig. 6A on the first area of the object terminal 130, and the target trajectory shown in fig. 6A may be recognized with a high probability as a selection gesture. As further shown in fig. 6B, the object may slide out the target track shown in fig. 6B on the first area of the object terminal 130, and the target track shown in fig. 6B may be identified with a high probability as a deletion gesture. As also shown in fig. 6C, the object may slide out of the target track shown in fig. 6C on the first area of the object terminal 130, and the target track shown in fig. 6C may be identified with a high probability as an insertion gesture. The embodiment has the characteristics of simple calculation, high accuracy, strong expansibility and no need of extra storage space. In the pen gestures formed by all the different pen stroke layouts illustrated in fig. 6A-6C, the recognition is performed using the embodiments of the present disclosure with 100% accuracy. And the actual measurement accuracy of other pen gesture recognition products is about 70.4% or 74.1%, and the like, which is far lower than the accuracy achieved by the embodiment of the disclosure.
Through the steps 310-360, the embodiment of the disclosure does not need to define the standard drawing method of the pen gesture in advance, so that the flexibility of pen gesture recognition is improved. According to the scheme, the pencil potential is identified by utilizing the change rule of the coordinate increment of the track point on the target track of different pencil potentials, so that the method is applicable to the object, the influence caused by different habits of different objects for making the same pencil potential is reduced, and the accuracy of pencil potential identification is improved. According to the scheme, a training model is not needed, and occupation of computing resources and storage resources is reduced.
The above is a general description of steps 310-360. The implementation of step 310 is more fully described above and will be described in greater detail below with respect to the specific implementation of steps 320-360.
Detailed description of step 320
In step 320, a target trajectory is generated based on the sliding of the target contact in the first region.
Referring to fig. 7, in one embodiment, step 320 includes:
step 710, identifying each continuous sliding of the target touch object in the first area as a candidate track;
step 720, obtaining the duration and duration of the candidate track;
step 730, screening out the screened track from the plurality of candidate tracks based on the duration and the duration;
Step 740, acquiring a target track from the screened tracks.
Steps 710-740 are described in detail below.
In step 710, the target touch may have more than one continuous swipe in the first area, and some may be continuous swipes due to false touches, so not all continuous swipes may be determined to be the target trajectory. In order to reduce the gesture recognition of the sliding track generated by the false touch, it is necessary to perform filtering for each continuous sliding, so step 710 first recognizes each continuous sliding as a candidate track for performing the next filtering operation. For example, referring to fig. 8, the inputted text contained on the first area is "listening and speaking", and on the first area, there are three candidate tracks, which are denoted as candidate track 1, candidate track 2, and candidate track 3.
After determining the candidate trajectory, in step 720, the duration and duration of the candidate trajectory are obtained. For example, with continued reference to FIG. 8, candidate track 1 is obtained for a duration of 5 centimeters and for a duration of 1 second; acquiring a candidate track 2 with a duration of 2 cm and a duration of 0.1 seconds; the candidate trajectory 3 is acquired with a duration of 8 cm and a duration of 2 seconds.
Next, in step 730, a filtered trajectory is selected from the plurality of candidate trajectories based on the duration and duration. For example, if the duration of the candidate track is less than the length threshold or the duration is less than the time threshold, the candidate track is deleted. Assume a duration of 4 cm and a time threshold of 0.5 seconds. Since the duration 2 cm of the candidate track 2 is smaller than the duration 4 cm and the duration 0.1 seconds is smaller than the time threshold 0.5 seconds, the candidate track 2 is deleted. With continued reference to fig. 8, after trajectory screening, candidate trajectory 1 is taken as screened trajectory 1 and candidate trajectory 3 is taken as screened trajectory 2.
After the screened trajectories are obtained in step 730, step 740 obtains target trajectories in the screened trajectories.
The benefit of this embodiment is that it screens candidate tracks based on duration and duration, which may eliminate such false touches, greatly improving the flexibility of gesture recognition and saving computing resources for gesture recognition, considering that not all slides represent gestures, which may be inadvertently encountered if the duration of the track is too short, or the duration is too short.
The foregoing is a general description of steps 710-740, and a detailed description will be provided below for specific implementations of steps 730-740.
In one embodiment, step 730 includes:
determining a first score for the candidate trajectory based on the duration;
determining a second score for the candidate trajectory based on the duration;
determining a total score for the candidate trajectory based on the first score and the second score;
and screening the screened tracks from the candidate tracks based on the total score.
Specifically, the first score of the candidate track is determined based on the duration, and a method of looking up a comparison table of the duration range and the first score may be adopted, or a formula method may be adopted.
(1) The duration range and first score table lists the correspondence of duration range and first score. The continuous length range is obtained according to the continuous length, and then the continuous length range and the first score comparison table are searched according to the continuous length range, so that the first score can be obtained. An example of a length-on-duration range versus first score table is as follows:
TABLE 1
For example, if the duration of the candidate track 3 in the above example is 8 cm, the duration is in the range of 5-9 cm, and the corresponding first score is 80 is obtained by looking up table 1.
The method for searching the continuous length range and the first score comparison table has the advantages of simplicity, easiness, and low processing cost.
(2) When using the formula, the first score may be set to be proportional to the duration, for example:
f1 =k1·g1 equation 1
Wherein F1 represents a first fraction, G1 represents a duration, and K1 is a preset constant, which can be set according to actual needs. For example, k1=10, and g1=8 is substituted, and the first score f1=80.
The method for determining the first score through the formula has the advantages of high accuracy, and the formula can be adjusted according to the requirement, so that the flexibility is high.
The second score of the candidate track is determined based on the duration, and the method of looking up the duration range and the second score comparison table can be adopted, and a formula method and the like can also be adopted.
(1) The duration range and second score lookup table lists the correspondence of duration ranges to second scores. The duration range is obtained according to the duration, and then the duration range and the second score comparison table are searched according to the duration range, so that the second score can be obtained. The following is an example of a duration range versus second score table:
TABLE 2
For example, if the duration of candidate track 3 in the above example is 2 seconds, the duration is in the range of 1-2 seconds, and the corresponding second score is 60 is obtained by looking up table 2.
The method for searching the duration range and the second score comparison table has the advantages of simplicity, easiness, and low processing cost.
(2) When using the formula, the second score may be set to be proportional to the duration, for example:
f2 =k2·g2 formula 2
Wherein F2 represents a second fraction, G2 represents a duration, and K2 is a preset constant, which can be set according to actual needs. For example, k2=30, and g2=2 is substituted, and the second score f2=60.
The mode of determining the second score through the formula has the advantages of high accuracy, and the formula can be adjusted according to the requirement, so that the flexibility is high.
The determination of the total score of the candidate trajectory based on the first score and the second score may take the form of calculating an average or weighted average of the first score and the second score.
When the average of the first score and the second score is calculated as the total score, for example, the first score of the candidate track 3 is 80, the second score is 60, and the total score is (80+60)/2=70. The advantage of using the average to calculate the total score is that the effect of duration and duration on generating the target trajectory can be equally reflected.
When calculating the weighted average of the first score and the second score as the total score, for example, weights of 0.6 and 0.4 are set for the duration and the duration, respectively, the first score of the candidate track 3 is 80, and the second score is 60, the total score is 80×0.6+60×0.4=72. The advantage of using a weighted average to calculate the total score is that different weights can be set for duration and duration, increasing the flexibility of generating the target trajectory.
The screened track is selected from the plurality of candidate tracks based on the total score, the candidate tracks with the total score being greater than the score threshold value can be used as the screened tracks, or the plurality of candidate tracks are sorted based on the total score, and the first few sorted tracks are selected as the screened tracks.
The benefits of this embodiment are: the flexibility and the correctness of generating the target track can be improved by respectively calculating the first fraction of the duration and the second fraction of the duration and determining the screened track from the candidate tracks.
The above is a detailed description of step 730, and a detailed description will be developed below for the specific implementation of step 740.
Referring to fig. 9, in one embodiment, step 740 includes:
step 910, sequentially selecting a plurality of anchor points from the starting point of the screened track at a first time interval on the screened track;
step 920, determining a minimum distance from the anchor point to each text pixel point in the first region;
step 930, identifying the screened track as a target track based on the minimum distance of the plurality of anchor points.
Steps 910-930 are described in detail below.
In step 910, the start point of the screened track refers to the track point corresponding to the start time among the track points forming the screened track. The first time interval refers to a previously set acquisition time interval. For example, referring to fig. 10, there are a post-screening trajectory 1 and a post-screening trajectory 2 on the first region. And sequentially selecting a plurality of anchors for the screened track 1 at a first time interval to obtain 4 anchors, wherein the anchors comprise an anchor h1, an anchor h2, an anchor h3 and an anchor h4. And sequentially selecting a plurality of anchors for the screened track 2 at a first time interval to obtain 3 anchors, wherein the anchors comprise an anchor g1, an anchor g2 and an anchor g3.
In step 920, the text pixel points refer to the pixels of the text included in the first region. For example, referring to fig. 10, text pixels include pixels corresponding to "listen" and "say". The distance between the anchor point and each text pixel point can be obtained by calculating cosine similarity or Euclidean distance, and a specific distance calculation formula can be set according to actual requirements, and the embodiment is not limited in detail. For example, with continued reference to FIG. 10, the minimum distance from anchor points h1-h4 to text pixels is {1.0 cm, 0.2 cm, 0.3 cm, 1.3 cm }, and the minimum distance from anchor points g1-g3 to text pixels is {1.0 cm, 1.6 cm, 2.2 cm }.
At step 930, the filtered trajectory is identified as the target trajectory based on the minimum distance of the plurality of anchor points. In one embodiment, step 930 includes: sorting the plurality of screened tracks based on the minimum distance of the plurality of anchor points; and identifying the first few screened tracks in the sorting result as target tracks.
In another embodiment, step 930 includes:
determining a first average of minimum distances of the plurality of anchor points;
and if the first average value is smaller than the preset threshold value, identifying the screened track as a target track.
For example, with continued reference to FIG. 10, the first average value 1 is determined to be 0.7 cm based on the minimum distance from the anchor points h1-h4 to the text pixel being {1.0 cm, 0.2 cm, 0.3 cm, 1.3 cm } and the first average value 2 is determined to be 1.6 cm based on the minimum distance from the anchor points g1-g3 to the text pixel being {1.0 cm, 1.6 cm, 2.2 cm }. Assuming that the predetermined threshold is 1.1 cm, the screened trajectory 1 is rejected since 1.6 cm of the second average value 2 is greater than the predetermined threshold, and the screened trajectory 2 is identified as the target trajectory since 0.7 cm of the first average value 1 is less than the predetermined threshold.
The benefits of this embodiment of steps 910-930 are: even if the screened track with the duration and the duration meeting the conditions is not necessarily the target track capable of being used for triggering the gesture recognition, the screened track is screened again by utilizing the minimum distance between the anchor point and each text pixel point, and the flexibility and the accuracy of the gesture recognition are further improved.
The above is a detailed description of step 320.
Detailed description of step 330
Step 330, acquiring coordinates of a plurality of track points on the target track.
For the decomposition of step 330, various decomposition modes are presented in the presently disclosed embodiments. Each decomposition mode expands the detailed description of step 330 at a different angle. The first decomposition mode is described first.
Referring to fig. 11, in one embodiment, step 330 includes:
step 1110, equally dividing the time length between the start time and the end time of the target track into a plurality of time intervals;
step 1120, acquiring coordinates of a track point corresponding to a midpoint of each time interval on the target track.
Steps 1110-1120 are described in detail below.
In step 1110, the start time of the target track refers to the time corresponding to the start of the sliding of the target touch on the first area, and the end time refers to the time corresponding to the end of the sliding of the target touch on the first area. For example, referring to fig. 12, the first area has a target track with a start time of 12 minutes 01 seconds and an end time of 12 minutes 03 seconds, and the length of time is 2 seconds.
With continued reference to fig. 12, the time length of the target track is equally divided into 4 time intervals, resulting in time interval 1:0-0.5 seconds, time interval 2:0.5-1 second, time interval 3:1-1.5 seconds, time interval 4:1.5-2 seconds. Note that the sliding of the target touch body on the first area is not uniform, so the track length of the target track corresponding to each time area is not the same although the time areas are equally divided.
In step 1120, a midpoint of each time zone corresponds to one track point, and coordinates of the track points corresponding to the midpoints of the respective time intervals are obtained. For example, with continued reference to fig. 12, the coordinates of the trajectory point corresponding to the midpoint of the time zone 1 are obtained as (x 1 ,y 1 ) The coordinates of the track point corresponding to the midpoint of the time zone 2 are obtained as (x 2 ,y 2 ) The coordinates of the track point corresponding to the midpoint of the time zone 3 are obtained as (x 3 ,y 3 ) The coordinates of the track point corresponding to the midpoint of the time zone 4 are obtained as (x 4 ,y 4 ) The coordinates of the obtained plurality of track points are { (x) 1 ,y 1 ),(x 2 ,y 2 ),(x 3 ,y 3 ),(x 4 ,y 4 )}。
The benefits of this embodiment are: the coordinates of a plurality of track points are obtained by using the time intervals which are equally divided, so that the influence of the sliding time of the target touch body on the gesture recognition is reflected, and the accuracy of the gesture recognition is improved.
The above is a detailed description of the first decomposition mode, and the second decomposition mode is described below.
Referring to fig. 13, in one embodiment, step 330 includes:
step 1310, equally dividing the length of the target track into a plurality of track sections;
step 1320, obtaining curvatures of midpoints of a plurality of track intervals on a target track;
step 1330, using the midpoint with curvature meeting the first condition as the track point;
step 1340, obtaining coordinates of a plurality of track points.
Steps 1310-1340 are described in detail below.
In step 1310, the length of the target track refers to the length of the track generated from the start time to the end time after the target touch object starts to slide on the first area. For example, referring to fig. 14, the length of the target track is equally divided into 4 track sections, and track section 1 is obtained: 0-2 cm, track interval 2:2-4 cm, track interval 3:4-6 cm, track interval 4:6-8 cm.
At step 1320, the curvature of the midpoint of the plurality of track intervals on the target track is obtained, where the curvature is the rotation rate of the pointer relative to the arc length and the tangential angle of a point on the curve is defined by differentiation, indicating the degree to which the curve deviates from a straight line. The curvature mathematically indicates the value of the degree of curvature of the curve at a certain point.
In step 1330, the midpoint of the curvature meeting the first condition may be the track point, or the midpoint of the curvature greater than the predetermined curvature threshold may be the track point, or the plurality of midpoints may be sorted based on the curvature, and the midpoint of the sorted track points may be the track point.
In step 1340, coordinates of a plurality of trajectory points are acquired. For example, with continued reference to fig. 14, the coordinates of the track point corresponding to the midpoint of the track section 1 are obtained as (x 5 ,y 5 ) The coordinates of the track point corresponding to the midpoint of the track section 2 are obtained as (x 6 ,y 6 ) The coordinates of the track point corresponding to the midpoint of the track section 3 are obtained as (x 7 ,y 7 ) The coordinates of the track point corresponding to the midpoint of the track section 4 are obtained as (x 8 ,y 8 ) The coordinates of the obtained plurality of track points are { (x) 5 ,y 5 ),(x 6 ,y 6 ),(x 7 ,y 7 ),(x 8 ,y 8 )}。
The benefits of this embodiment are: the coordinates of a plurality of track points are obtained by utilizing the track sections which are equally divided, so that the influence of the sliding track of the target touch body on the gesture recognition is reflected, and the gesture recognition accuracy is improved.
The above is a detailed description of the second decomposition mode, and the third decomposition mode is described below.
Referring to fig. 15, in one embodiment, step 330 includes:
step 1510, equally dividing the length of the target track into a plurality of track sections;
Step 1520, obtaining a touch pressure of midpoints of a plurality of track intervals;
step 1530, using the midpoint of the touch pressure meeting the second condition as the track point;
step 1540, obtaining coordinates of a plurality of track points.
Steps 1510-1540 are described in detail below.
In step 1510, the length of the target track is also referred to as the length of the track that is generated from the start time to the end time after the target contact starts to slide on the first area, similar to step 1310. For example, referring to fig. 14, the length of the target track is equally divided into 4 track sections, and track section 1 is obtained: 0-2 cm, track interval 2:2-4 cm, track interval 3:4-6 cm, track interval 4:6-8 cm.
In step 1520, the sliding of the target touch object on the first area corresponds to the touch, and the importance of the midpoint of the track section to the gesture recognition can be determined by using the touch. In general, the greater the touch at a midpoint, the more important the midpoint is for gesture recognition.
In step 1530, the midpoint of the touch pressure meeting the second condition may be the track point, where the midpoint of the touch pressure greater than the predetermined touch pressure threshold is the track point, or the plurality of midpoints may be sorted based on the touch pressure, and the midpoint of the first rank is the track point.
At step 1540, coordinates of a plurality of trace points are obtained. For example, referring to fig. 14, the coordinates of the track point corresponding to the midpoint of track section 1 are obtained as (x 5 ,y 5 ) The coordinates of the track point corresponding to the midpoint of the track section 2 are obtained as (x 6 ,y 6 ) The coordinates of the track point corresponding to the midpoint of the track section 3 are obtained as (x 7 ,y 7 ) The coordinates of the track point corresponding to the midpoint of the track section 4 are obtained as (x 8 ,y 8 ) The coordinates of the obtained plurality of track points are { (x) 5 ,y 5 ),(x 6 ,y 6 ),(x 7 ,y 7 ),(x 8 ,y 8 )}。
The benefits of this embodiment are: the coordinates of a plurality of track points are obtained by utilizing the equally divided track intervals and the judgment of the touch pressure, so that the influence of the sliding pressure of the target touch body on the recognition of the pen gesture is reflected, and the accuracy of the recognition of the pen gesture is improved.
The coordinates of the track point include any one of the following: a first coordinate and a second coordinate. The first coordinate represents the X-axis coordinate of the track point and the second coordinate represents the Y-axis coordinate of the track point. For example, the coordinates of the track point are (x, y), and the first coordinates are x and the second coordinates are y.
In one embodiment, referring to fig. 16, step 330 includes:
step 1610, obtaining first coordinates and second coordinates of a plurality of track points on the target track.
As shown in fig. 12, the first coordinate is { x } 1 ,x 2 ,x 3 ,x 4 Second coordinate is { y } 1 ,y 2 ,y 3 ,y 4 }. As also shown in FIG. 14, the first coordinate is { x } 5 ,x 6 ,x 7 ,x 8 Second coordinate is { y } 5 ,y 6 ,y 7 ,y 8 }。
The advantage of this embodiment is that the coordinates are divided into a first coordinate and a second coordinate, so that the subsequent step separately counts the coordinate increment on the first coordinate and the second coordinate, which is more helpful for improving the accuracy of the gesture recognition.
It should be noted that, the above embodiment shows the case where the coordinates include two dimensional coordinates of the first coordinate and the second coordinate, but does not exclude the case where the coordinates further include a third dimensional coordinate and above. For example, the coordinates include third coordinates in addition to the first coordinates and the second coordinates. Wherein the third coordinate represents the Z-axis coordinate of the track point. For example, the coordinates of the track point are (x, y, z), the first coordinate is x, the second coordinate is y, and the third coordinate is z.
The above is a detailed description of step 330.
Step 340 detailed description
Step 340, acquiring coordinate increment between coordinate adjacent track points in the plurality of track points.
Specifically, the coordinate increment refers to a difference in coordinates between adjacent track points, and the coordinate increment includes any one of the following: a first coordinate increment and a second coordinate increment. The first coordinate increment refers to the difference of the first coordinates between adjacent track points, and the second coordinate increment refers to the difference of the second coordinates between adjacent track points. Wherein the first coordinate increment may be expressed as f (X n -X n-1 )=X n -X n-1 ,f(X n -X n-1 ) Is the difference between the first coordinate at the nth time and the first coordinate at the (n-1) th time. The second coordinate increment may be expressed as f (Y n -Y n-1 )=Y n -Y n-1 ,f(Y n -Y n-1 ) Is the difference between the second coordinates at the nth time and the (n-1) th time. For example, the track point 1 and the track point 2 are adjacent track points, and it is assumed that the coordinates of the track point 1 are (x 1 ,y 1 ) The coordinates of the locus point 2 are (x 2 ,y 2 ). The first coordinate increment is x 2 -x 1 The second coordinate increment is y 2 -y 1
In one embodiment, with continued reference to FIG. 16, step 340 includes:
step 1620, acquiring a first coordinate increment of a first coordinate between adjacent track points in the track points and a second coordinate increment of a second coordinate. For example, the first coordinate is { x } 1 ,x 2 ,x 3 ,x 4 And the second coordinate is { y } 1 ,y 2 ,y 3 ,y 4 First coordinate increment { (x) 2 -x 1 ),(x 3 -x 2 ),(x 4 -x 3 ) Second coordinate increment { (y) 2 -y 1 ),(y 3 -y 2 ),(y 4 -y 3 )}。
The advantage of this embodiment is that the statistics of the coordinate increment on the first and second coordinates alone is more helpful for improving the accuracy of the gesture recognition.
The above is a detailed description of step 340.
Step 350 detailed description
Step 340, obtaining the target increment trend symbol string based on the coordinate increment between each adjacent track points.
The target increment trend symbol string is used to represent the direction of movement of the coordinate increment. The target delta trend string includes any one of the following: a first target delta trend symbol string and a second target delta trend symbol string.
The first target increment trend symbol is used for representing the movement direction of the first coordinate. If x 2 -x 1 Greater than 0 indicates that the first coordinate is moving in the positive X-axis direction, which may be represented by a positive number, such as 1. If x 2 -x 1 Less than 0, which indicates that the first coordinate is moving in the negative X-axis direction, may be represented by a negative number, such as-1. If x 2 -x 1 Equal to 0, which means that the first coordinate moves in a direction perpendicular to the X-axis, which can be denoted by 0.
The second target increment trend symbol is used for representing the movement direction of the second coordinate. If y 2 -y 1 Greater than 0 indicates that the second coordinate is moving in the positive Y-axis direction, which may be represented by a positive number, such as 1. If y 2 -y 1 Less than 0, which indicates that the second coordinate is moving in the negative Y-axis direction, may be represented by a negative number, such as-1. If y 2 -y 1 Equal to 0, which means that the second coordinate moves in a direction perpendicular to the Y-axis, which can be denoted by 0.
In one embodiment, with continued reference to FIG. 16, step 350 includes:
step 1630, based on the first coordinate increment between each adjacent track point, acquiring a first target increment trend symbol string of the first coordinate, and based on the second coordinate increment between each adjacent track point, acquiring a second target increment trend symbol string of the second coordinate.
For example, the first coordinate increment is {0.7,0, -2,0}, then the first target increment tenderer may be {1,0, -1,0}. The second coordinate increment is { -1.4,0,1.3,0}, then the second target increment tenderer may be { -1,0,1,0}.
Step 1630 is described in detail below.
In one embodiment, referring to FIG. 17, step 1630 includes:
step 1710, if the coordinate increment between adjacent track points is positive, and the absolute value of the coordinate increment is greater than the first threshold, setting the sign of the increment trend symbol of the adjacent track points to be positive; if the coordinate increment between the adjacent track points is negative and the absolute value of the coordinate increment is larger than a first threshold value, the sign of the increment trend sign of the adjacent track points is set to be negative; otherwise, the sign of the incremental trend symbol of the adjacent track point is set to 0;
step 1720, connecting incremental trend symbols of each adjacent track point according to the sequence of the adjacent track points on the target track, and generating an original incremental trend symbol string;
step 1730, obtain a target incremental trend symbol string from the original incremental trend symbol string.
Steps 1710-1730 are generally described below.
In step 1710, since there may be a jitter error when the target touch object slides on the first area, or there may be an acquisition error when the target terminal acquires the coordinates of the track point, in order to alleviate the influence of the error on determining the incremental trend symbol, the embodiment introduces a first threshold. When the absolute value of the coordinate increment is less than or equal to the first threshold value, there is a high possibility that there is an error, and the sign of the increment trend symbol corresponding to the coordinate increment is set to 0.
For example, the coordinate increment is 0.2, and if the first threshold is not considered, the increment trend symbol is 1; if the first threshold of 0.5 is considered, the target delta trend is 0. For another example, the coordinate increment is-0.3, and if the first threshold is not considered, the increment trend symbol is-1; if the first threshold of 0.5 is considered, the target delta trend is 0. Note that even if the coordinate increment is normally generated without jitter error or acquisition error, setting the sign of the increment trend symbol to 0 does not affect the accuracy of pen gesture recognition because the coordinate increment is small.
After each incremental trend symbol is obtained, step 1720 first connects each incremental trend symbol in the order of adjacent track points on the target track, generating an original incremental trend symbol string. For example, each incremental trend symbol is 0,1, -1,0, respectively, then the original incremental trend symbol string is {0,1, -1,0}.
After the original delta trend symbol string is obtained, step 1730 obtains the target delta trend symbol string from the original delta trend symbol string. The target incremental trend symbol string may be obtained by compressing consecutive identical incremental trend symbols in the original incremental trend symbol string, for example, after compressing consecutive identical incremental trend symbols in the original incremental trend symbol string {0,1, -1,0}, the target incremental trend symbol string is {0,1, -1,0}.
The method has the advantages that the increment trend symbol is determined by utilizing the magnitude relation between the absolute value of the coordinate increment and the first threshold value, so that the influence caused by acquisition errors or shaking errors can be effectively relieved, and the accuracy of pen gesture recognition is improved.
Step 1710 and step 1730 are described in detail below.
In one embodiment, referring to fig. 18, the first threshold in step 1710 is set by:
step 1810, obtaining the curvature of each track point in adjacent track points on the target track;
step 1820, determining a third average value of the curvature of each of the adjacent track points;
step 1830, determining a first threshold corresponding to the track point based on the third average value.
Steps 1810-1830 are described in detail below.
In step 1810, similar to step 1320, the curvatures are all numerical values that mathematically indicate the degree of curvature of the curve at a certain point. In this embodiment, where the curvature is small, the absolute value of the coordinate increment is only required to be larger than a smaller value to illustrate the increment trend; the opposite is true where the curvature is large.
A third average value is determined based on the resulting respective curvatures at step 1820, and then a first threshold value is determined based on the third average value at step 1830.
For example, with three curvatures, 0.3,0.4 and 0.5, respectively, the third average value is found to be 0.4, then the first threshold value may be 0.4.
The embodiment has the advantages that the first threshold value can be flexibly set by utilizing the third average value determined by the curvatures of different track points, the setting flexibility of the first threshold value is improved, and the personalized drawing method of different objects in the process of generating the target track in a sliding manner can be fully considered.
In another embodiment, the first threshold may be determined jointly based on a sliding speed of the target touch in the first region and an acquisition frequency of acquiring coordinates of the plurality of trajectory points. Note that the faster the sliding speed, the fewer the number of trajectory points, so the larger the first threshold will be; and the larger the acquisition frequency, the greater the number of trajectory points, the smaller the second threshold value.
In a specific implementation of this embodiment, the first threshold in step 1710 may also be set by:
determining a third score based on a sliding speed of the target touch in the first area;
determining a fourth score based on an acquisition frequency at which coordinates of the plurality of trajectory points are acquired;
determining a first total score based on the third score and the fourth score;
a first threshold is determined based on the first total score.
Specifically, the third score is determined based on the sliding speed of the target touch body in the first area, and a mode of searching a sliding speed range and a third score comparison table can be adopted, or a formula method and the like can be adopted.
(1) The sliding speed range and third score table lists the sliding speed range versus third score. And obtaining a sliding speed range according to the sliding speed, and searching a sliding speed range and a third score comparison table according to the sliding speed range to obtain a third score. An example of a sliding speed range versus third score table is as follows:
TABLE 3 Table 3
For example, if the sliding speed of the target touch body in the first area is 4 cm/s, the sliding speed ranges from 3 cm to 5 cm, and the corresponding first score is 90 is obtained by looking up table 3.
The above method for searching the sliding speed range and the first score comparison table has the advantages of simplicity, easiness, low processing cost and the like.
(2) When using the formula, a third score may be set proportional to the sliding speed, for example:
f3 =k3·g3 formula 3
Wherein F3 represents a first fraction, G3 represents a sliding speed, and K3 is a preset constant, which can be set according to actual needs. For example, k3=45/2, and g3=4 is substituted, and the third fraction f3=90.
The method for determining the third score through the formula has the advantages of high accuracy, and the formula can be adjusted according to the requirement, so that the flexibility is high.
The fourth score is determined based on the acquisition frequency of the coordinates of the plurality of track points, and a method of searching a comparison table of the acquisition frequency range and the fourth score may be adopted, or a formula method may be adopted.
(1) The acquired frequency range and fourth score table lists the correspondence between the acquired frequency range and fourth score. The acquired frequency range is obtained according to the acquired frequency, and then the acquired frequency range and a fourth score comparison table are searched according to the acquired frequency range, so that a fourth score can be obtained. An example of a table of frequency ranges versus fourth scores is obtained as follows:
/>
TABLE 4 Table 4
For example, if the acquisition frequency of the plurality of acquired track points is 15 track points/second, the acquisition frequency range is 10-20 track points/second, and the corresponding second score is 60 is obtained by looking up table 4.
The method for searching and acquiring the frequency range and the fourth score comparison table has the advantages of simplicity, easiness, and low processing cost.
(2) When the formula is used, the fourth fraction may be set to be proportional to the acquisition frequency, for example:
f4 =k4·g4 formula 4
Wherein F4 represents the second fraction, G4 represents the acquisition frequency, and K4 is a preset constant, which can be set according to actual needs. For example, k4=4, and g4=15 is substituted, and the fourth fraction f4=60.
The mode of determining the fourth fraction through the formula has the advantages of high accuracy, and the formula can be adjusted according to the requirement, so that the flexibility is high.
The first total score is determined based on the third score and the fourth score, and may be in the form of calculating an average or weighted average of the third score and the fourth score.
When calculating the average of the third score and the fourth score as the first total score, for example, the third score is 90 and the fourth score is 60, the first total score is (90+60)/2=75. The advantage of using the average to calculate the total score is that the impact of the slip speed and the acquisition frequency on determining the first threshold can be equally reflected.
When calculating the weighted average of the third score and the fourth score as the first total score, for example, weights of 0.6 and 0.4 are set for the sliding speed and the acquisition frequency, respectively, the third score is 90, and the fourth score is 70, the first total score is 90×0.6+60×0.4=78. The advantage of using a weighted average to calculate the total score is that different weights can be set for the sliding speed and the acquisition frequency of the trajectory points, increasing the flexibility of determining the first threshold.
The first threshold value is determined based on the first total score, and a mode of searching a comparison table of the first total score range and the first threshold value can be adopted, or a formula method and the like can be adopted.
(1) The first total score range and the first threshold value comparison table lists the corresponding relation between the first total score range and the first threshold value. The first total score range is obtained according to the first total score, and then the first total score range and the first threshold value comparison table are searched according to the first total score range, so that the first threshold value can be obtained. An example of a first total score range versus first threshold table is as follows:
TABLE 5
For example, if the first total score is 78, the first total score ranges from 70 to 80, and the corresponding first threshold is 0.6 is obtained by looking up table 5.
The method for searching the first total score range and the first threshold value comparison table has the advantages of simplicity, easiness, and low processing cost.
(2) When the formula is used, the first threshold may be set to be proportional to the first sum score, for example:
d1 =k5·s1 formula 5
Wherein D1 represents a first threshold, S1 represents a first total score, and K5 is a preset constant, which can be set according to actual needs. For example, k5=3/390, s1=78 is substituted, and then the first threshold d1=0.6.
The mode of determining the first threshold through the formula has the advantages of high accuracy, and the formula can be adjusted according to the requirement, so that the flexibility is high.
The above is a detailed description of step 1710. Step 1730 is described in detail below.
For the decomposition of step 1730, various decomposition modes are presented in the presently disclosed embodiments. Each decomposition mode expands the detailed description of step 1730 at a different angle. The first decomposition mode is described first.
In one embodiment, referring to fig. 19, step 1730 includes:
step 1910, compressing the continuous identical incremental trend symbols into one incremental trend symbol for the continuous identical incremental trend symbols in the original incremental trend symbol string if the number of continuous identical incremental trend symbols is greater than the second threshold; and if the number of the continuous identical incremental tendencies is not greater than the second threshold value, deleting the continuous identical incremental tendencies to obtain the target incremental tendencies string.
For example, referring to FIG. 20, the original delta trend symbol string is {0,1,1,1,1,1,0, -1, -1, -1, -1, -1, -1, -1, -1,1,1,1,1,1,1,1,0,0,0,0,0,1,0}. Consecutive identical incremental tendencies are {0}, {1, 1}, {0}, { -1, -1, -1, -1, -1, -1, {1, 1}, {0, {1}, {0}. Assume that the second threshold is 4. Since the number of incremental tendencies in {0} is 1 and is not greater than the second threshold value, the incremental tendencies are deleted. Since the number of incremental tendencies in {1, 1} is 5 and greater than the second threshold, {1, 1} is compressed to {1}. Since the number of increment trending symbols in { -1, -1, -1, -1, -1, -1, -1} is 9 and greater than the second threshold value, { -1, -1, -1, -1, -1, -1, -1} is compressed to { -1}. Since the number of incremental trend symbols in {1, 1} is 7, and is greater than the second threshold, {1, 1} is compressed to {1}. Since the number of increment trending symbols in {0, 0} is 5 and greater than the second threshold, {0, 0} is compressed to {0}. Since the number of incremental tendencies in {1} is 1 and is not greater than the second threshold value, the incremental tendencies are deleted. Through the above process, the target increment trend symbol string {1, -1, 0} is finally obtained.
In one embodiment, referring to fig. 21, the second threshold in step 1910 is set by:
step 2110, obtaining midpoint increment trend symbols from the continuous same increment trend symbols;
step 2120, obtaining a fourth average value of curvatures of adjacent track points corresponding to the midpoint increment trend symbols on the target track;
step 2130, determining a second threshold corresponding to consecutive identical incremental tendencies based on the fourth average.
Steps 2110-2130 are described in detail below.
In step 2110, the midpoint increment trend is an increment trend at a middle position among consecutive identical increment trend. For example, consecutive identical incremental tendencies are {1, 1}, the midpoint increment trend is the third "1" in {1,1 }. For another example, if consecutive identical incremental tendencies are { -1, -1, -1, -1, -1, -1}, then the midpoint incremental tendencies are the third "-1" or the fourth "-1" of { -1, -1, -1, -1, -1 }.
In step 2120, similar to step 1810, the curvatures all refer to numerical values that mathematically indicate the degree of curvature of the curve at a certain point. In this embodiment, where the curvature is small, it is smoother, and the number of consecutive identical incremental tendencies needs to be greater than a relatively large number. Where the curvature is large, it is steeper, and the number of consecutive identical incremental tendencies may be greater than a relatively small number. The curvature at the midpoint increment trend is located exactly in the middle of the segment track, and is representative, so the midpoint increment trend is taken.
After determining the fourth average based on the respective curvatures, a second threshold is determined based on the fourth average at step 2130.
For example, the curvatures of the adjacent track points corresponding to the midpoint increment tendencies on the target track are 0.4 and 0.6 respectively, and the fourth average value is 0.5, and the second threshold value is 5 according to the fourth average value with threshold coefficient=0.5×10. The threshold coefficient can be set according to actual requirements.
The benefit of this embodiment is that the second threshold value can be set according to the curvature by using the fourth average value determined by the curvature corresponding to the midpoint increment trend symbol, improving the setting flexibility of the second threshold value.
In another embodiment, the second threshold may be determined based on a sliding speed of the target touch body in the first area and an acquisition frequency of acquiring coordinates of the plurality of trajectory points. Note that the faster the sliding speed, the fewer the number of trajectory points, so the smaller the second threshold will be; and the larger the acquisition frequency, the greater the number of trajectory points, the greater the second threshold.
In a specific implementation of this embodiment, the second threshold in step 1910 may also be set by:
determining a fifth score based on a sliding speed of the target touch in the first area;
Determining a sixth score based on an acquisition frequency at which coordinates of the plurality of trajectory points are acquired;
determining a second total score based on the fifth score and the sixth score;
a second threshold is determined based on the second total score.
Specifically, the fifth score is determined based on the sliding speed of the target touch body in the first area, and a mode of searching a sliding speed range and a fifth score comparison table can be adopted, or a formula method and the like can be adopted.
(1) The sliding speed range and fifth score table lists the sliding speed range and fifth score correspondence. The sliding speed range is obtained according to the sliding speed, and then the sliding speed range and the fifth score comparison table are searched according to the sliding speed range, so that the fifth score can be obtained. An example of a sliding speed range versus fifth score table is as follows:
TABLE 6
For example, if the sliding speed of the target touch object in the first area is 4 cm/s, the sliding speed ranges from 3 cm to 5 cm, and the corresponding fifth score is 60 is obtained by looking up table 6.
The above method for searching the sliding speed range and the fifth score comparison table has the advantages of simplicity, easiness, low processing cost and the like.
(2) When the formula is used, the fifth score may be set inversely proportional to the sliding speed, for example:
F5 =k6·g5+b equation 6
Wherein F5 represents a fifth fraction, G5 represents a sliding speed, and K6 and b are preset constants, which can be set according to actual needs. For example, k6= -10, b=100, and after g5=4 is substituted, the fifth fraction f5=60.
The mode of determining the fifth score through the formula has the advantages of high accuracy, and the formula can be adjusted according to the requirement, so that the flexibility is high.
The sixth score is determined based on the acquisition frequency of the coordinates of the plurality of track points, and the method of searching the comparison table of the acquisition frequency range and the sixth score may be adopted, or a formula method may be adopted.
(1) The acquired frequency range and sixth score lookup table lists the correspondence between the acquired frequency range and the sixth score. The acquired frequency range is obtained according to the acquired frequency, and then the acquired frequency range and a sixth score comparison table are searched according to the acquired frequency range, so that a sixth score can be obtained. An example of a table of frequency ranges versus sixth score is as follows:
TABLE 7
For example, if the acquisition frequency is 15/s, the acquisition frequency range is 10-20/s, and the corresponding second score is 60 is obtained by looking up table 7.
The method for searching and acquiring the frequency range and the sixth fractional comparison table has the advantages of simplicity, easiness, and low processing cost.
(2) When the formula is used, the sixth score may be set to be proportional to the acquisition frequency, for example:
f6 =k7·g6 formula 7
Wherein F6 represents a sixth score, G6 represents an acquisition frequency, and K7 is a preset constant, which can be set according to actual needs. For example, k7=4, and g6=15 is substituted, and then the sixth score f6=60.
The mode of determining the sixth score through the formula has the advantages of high accuracy, and the formula can be adjusted according to the requirement, so that the flexibility is high.
The second total score is determined based on the fifth score and the sixth score, and may be calculated by calculating an average or weighted average of the fifth score and the sixth score.
When the average of the fifth score and the sixth score is calculated as the second total score, for example, the fifth score is 60 and the sixth score is 60, the second total score is (60+60)/2=60. The advantage of using the average to calculate the total score is that the impact of the slip speed and the acquisition frequency on determining the second threshold can be equally reflected.
When calculating the weighted average of the fifth score and the sixth score as the second total score, for example, weights of 0.6 and 0.4 are set for the sliding speed and the acquisition frequency, respectively, the fifth score is 60, and the sixth score is 60, the second total score is 60×0.6+60×0.4=60. The advantage of using a weighted average to calculate the total score is that different weights can be set for the sliding speed and the acquisition frequency, increasing the flexibility of determining the second threshold.
The second threshold value is determined based on the second total score, and a mode of looking up a comparison table between the second total score range and the second threshold value can be adopted, or a formula method and the like can be adopted.
(1) The second total score range and the second threshold value comparison table lists the corresponding relation between the second total score range and the second threshold value. And obtaining a second total score range according to the second total score, and searching a comparison table of the second total score range and the second threshold value according to the second total score range to obtain the second threshold value. The following is an example of a second total score range versus second threshold table:
TABLE 8
For example, if the second total score is 60, the second total score ranges from 50 to 60, and the corresponding second threshold is 4 is obtained by looking up table 8.
The above-mentioned mode of looking up the second total score range and second threshold value comparison table has the advantages of simple and easy operation and low processing cost.
(2) When the formula is used, the first threshold may be set to be proportional to the first sum score, for example:
d2 =k8·s2 formula 8
Wherein D2 represents a second threshold, S2 represents a second total score, and K8 is a preset constant, which can be set according to actual needs. For example, k8=1/15, and s2=60 is substituted, and then the second threshold value d2=4.
The mode of determining the second threshold value through the formula has the advantages of high accuracy, and the formula can be adjusted according to the requirement, so that the flexibility is high.
The above is a detailed description of the first decomposition of step 1730 and the second decomposition of step 1730 is described in detail below.
In one embodiment, referring to fig. 22, step 1730 includes:
step 2210, equally dividing the original incremental trend symbol string into a plurality of substrings;
step 2220, determining the most increment trend symbol in each sub-string as the target increment trend symbol corresponding to the sub-string;
and step 2230, connecting the target increment trend symbols corresponding to the sub-strings according to the sequence of the sub-strings to obtain a target increment trend symbol string.
Steps 2210-2230 are described in detail below.
At step 2210, the original delta-trend symbol string includes a first number of delta-trend symbols, and is divided equally according to the first number to divide the original delta-trend symbol string equally into a plurality of sub-strings. Note that the multiple substrings are not all strings that contain the same number of incremental tendencies due to the first number of uncertainties. For example, if there are N total substrings, it is guaranteed that all 1 st to N-1 substrings contain the second number of incremental tendencies, and the nth substring contains the third number of incremental tendencies, and (N-1) ×second number+third number=first number.
Referring to FIG. 23, in one example, the original delta trend symbol string is {0,1,1,1,1,1,0, -1, -1, -1, -1, -1, -1, -1,1,1,1,1,1,1,1,0,0,0,0,0,1,0}, for a total of 29 delta trend symbols, i.e., a first number of 29. Dividing equally according to the first number, determining n=5, determining the second number as 7, and the third number as 1. The original incremental trend symbol string is then equally divided into 5 substrings, 1 st substring {0,1,1,1,1,1,0}, 2 nd substring {1, -1, -1, -1, -1, -1}, 3 rd substring {1, 1}, 4 th substring {1,0,0,0,0,0,1}, 5 th substring {0}.
At step 2220, the most incremental trend symbols in each sub-string are determined as the target incremental trend symbols for the sub-string. For example, with continued reference to FIG. 23, for the 1 st substring {0,1,1,1,1,1,0}, the most incremental trend is 1, then the 1 st target incremental trend is 1. For the 2 nd substring to be { -1, -1, -1, -1, -1, -1}, the most incremental trend symbol is-1, then the 2 nd target incremental trend symbol is-1. For the 3 rd substring of { -1, 1}, the most incremental trend symbol is 1, then the 3 rd target incremental trend symbol is 1. For the 4 th substring {1,0,0,0,0,0,1}, the most incremental trend is 0, then the 4 th target incremental trend is 0. For the 5 th substring {0}, the number of incremental trending symbols in the substring is too small to be deleted directly. Through the process, the 1 st target increment trend sign is 1, the 2 nd target increment trend sign is-1, the 3 rd target increment trend sign is 1, and the 4 th target increment trend sign is 0.
In step 2230, the target increment trend symbols corresponding to the sub-strings are connected in the order of the sub-strings to obtain a target increment trend symbol string. For example, with continued reference to FIG. 23, the 1 st through 4 th target delta tendencies are connected in the order of the substrings resulting in a target delta tendencies string of {1, -1, 0}.
The method has the advantages that the method uses the increment trend symbol with the greatest statistics of the initial increment trend symbol string at first and then respectively as the target increment trend symbol, and compared with the method which directly counts the target increment trend symbol from the initial increment trend symbol string, the method can save some calculation resources and improve the processing efficiency. In addition, the embodiment can flexibly adjust the length of each substring according to the number of the increment trend symbols in the original increment trend symbol string, so that the flexibility and universality of the gesture recognition are improved.
Step 360 detailed description
Step 360, based on the target increment trend symbol string, identifying the pen gesture corresponding to the target track.
In the case of deleting the pen gesture, at least two or more directional jumps in at least one of the X or Y axes occur. In the inserted pen potential, the number of times of the Y-axis direction jump is 0, and meanwhile, the whole coordinate change range of the X-axis is small. In selecting the pen potential, there is no more than one jump in both the X-axis and Y-axis directions.
According to the above rule, the pen gesture corresponding to the target track can be determined, so in an embodiment, the pen gesture corresponding to the target track is identified according to the number of times of symbol jumps of the target increment trend symbol in the first target increment trend symbol string and the second target increment trend symbol string.
In a specific implementation of this embodiment, referring to fig. 16, step 360 includes:
step 1640, if at least two sign jumps of the target increment trend symbol occur in at least one of the first target increment trend symbol string and the second target increment trend symbol string, identifying the pen gesture corresponding to the target track as a deletion pen gesture; and if the symbol jumps of the target increment trend symbol are not generated at least twice in the first target increment trend symbol string and the second target increment trend symbol string, identifying the pen gesture corresponding to the target track as an inserted pen gesture when the jump times between the first character and the second character in the second target increment trend symbol string are 0 and the maximum value of the first coordinate difference between track points on the target track is smaller than a third threshold value, otherwise, identifying the pen gesture corresponding to the target track as a selected pen gesture.
For example, for the first target delta trend {1,0, -1,0}, a "1" jump to "-1" occurs, i.e., the first target delta trend string has a symbol jump. For the second target delta trend symbol { -1,0,1,0}, a "-1" jump to "1" occurs, i.e. the second target delta trend symbol string has a symbol jump. The target track is not a deletion gesture because of a sign jump that does not belong to at least one of the first target delta trend symbol string and the second target delta trend symbol string that occurs at least twice. Since it also does not belong to the case where the number of jumps between the first character and the second character in the second target increment trend symbol string is 0 and the maximum value of the first coordinate difference between the track points on the target track is smaller than the third threshold value, the target track is not inserted with the pen gesture, the pen gesture corresponding to the target track is recognized as the selection pen gesture.
The benefits of this embodiment are: the pencil potential of the target track is judged by utilizing the change times of the movement directions on the transverse coordinate axis and the longitudinal coordinate axis, so that the rapidness and the accuracy of pencil potential identification are improved.
It should be noted that, considering that the insertion gesture is generally a vertical line, but the object may have a certain inclination preference when the insertion gesture is input, in an embodiment, the third threshold may be determined according to the historical insertion gesture of the object.
In a specific implementation of this embodiment, referring to fig. 24, the third threshold in step 1640 is set by:
step 2410, obtaining an input history of a target object for inputting text in an input method interface;
step 2420, obtaining a plurality of history insertion strokes input in the input history record;
2430, obtaining the maximum value of the first coordinate difference between the track points on the pen potential track corresponding to the history insertion pen potential;
2440, solving a second average value and a variance for the maximum values corresponding to the plurality of history insertion strokes;
step 2450 determines a third threshold based on the second average, the variance, and the predetermined coefficient.
Steps 2410-2450 are described in detail below.
In step 2410, the input history refers to the input record of the target object on the input method interface before the current gesture recognition service is performed. The input history record contains a target object history input text, and a history of inserted strokes made to the history input text.
At step 2420, a plurality of history insertion strokes entered in the input history are obtained. For example, referring to fig. 6C, three historical insertion strokes of different tilt angles may be obtained.
In step 2430, a maximum value of the first coordinate difference between the trace points on the pen potential trace corresponding to the history of inserted pen potentials is obtained. For the inserted pen potential, the maximum value of the first coordinate difference is generally the first coordinate difference from the start track point to the end track point, regardless of the sampling jitter error at the time of sliding. For example, the first of the insertion strokes in FIG. 6C and the second of the insertion strokes in FIG. 6C. Note that the maximum value of the first coordinate difference is not necessarily the first coordinate difference from the start locus point to the end locus point, for example, the third insertion pen potential in fig. 6C.
In step 2440, a second average and variance are obtained for the maximum values corresponding to the plurality of history-inserted pen potentials. For example, the maximum value of the first coordinate value of the first insertion pen potential in fig. 6C is 0.6 cm, the maximum value of the first coordinate value of the second insertion pen potential in fig. 6C is 2 cm, and the maximum value of the first coordinate value of the third insertion pen potential in fig. 6C is 0.4 cm. Calculate a second average value: (0.6+2+0.4)/3=1, i.e., the second average value is 1. Variance- >:{(0.6-1) 2 +(2-1) 2 +(0.4-1) 2 }/3=1.23 2 Variance->1.23.
Step 2450 determines a third threshold based on the second average, the variance, and the predetermined coefficient. For example, the third threshold is μ+k×σ, μ represents the second average value, σ represents the variance, and k represents the predetermined coefficient. The preset coefficient is set in advance according to the actual requirement.
The benefits of this embodiment are: the third threshold value is determined by utilizing a plurality of historical insertion strokes, so that the inclination preference of the target object to the input insertion strokes is fully reflected, and the accuracy of identifying the insertion strokes is improved.
Implementation details for identifying target track as deletion gesture
Referring to fig. 25, in an example, a first region is displayed in an input method interface, the first region containing text that is "listening and speaking", and a target track is generated based on sliding of a target touch body in the first region, the target track being "z" shaped. On the target track of the Z shape, a first coordinate and a second coordinate of a plurality of track points are obtained. The first coordinates include: {339.1,339.1,342.5,354.6,388.7,417.7,422.9,4
23.1,415.5,407.1,398.6,388.2,372.1,363.9,355.1,350.7,360.3,371.3,375.2,378.9,382.1,385.5,420.1,420.5,420.9,421.4,421.8,422.2,423.2,422.9
}. The second coordinates include: {991.7,991.7,989.6,985.9,982.5,980.1,973.3,973.3,97
3.3,973.3,973.3,975.9,982.1,990.3,1000.8,1007.9,1017.3,1020.4,1023.3,1023.5,1020.4,1017.6,1012.8,1011.4,1010.7,1010.3,1001.3,1001.3,10
01.3,1001.3}。
Acquiring the first coordinate increment from the first coordinate includes: {0,3.4,12.1, 34.1,29.0,5.2,0.2, -7.6, -8.4, -8.5, -10.4, -16.1, -8.2, -8.8, -4.4,9.6,11.0,3.9,3.7,3.2,3.4,34.6,0.4,0.4,0.5,0.4,0.4,1.0, -0.3}.
Acquiring the second coordinate increment from the second coordinate includes: {0, -2.1, -3.7, -3.4, -2.4, -6.8,0,0,0,0,2.6,6.2,8.2, 10.5,7.1,9.4,3.1,2.9,0.2, -3.1, -2.8, -4.8, -1.4, -0.7, -0.4,0,0,0,0}.
The first original incremental trend symbol string for obtaining the first coordinates based on the first coordinate increment is {0,1,1,1,1,1,0, -1, -1, -1, -1, -1, -1, -1, -1,1,1,1,1,1,1,1,0,0,0,0,0,1,0}. The first target delta trend symbol string is {1, -1,0}.
Based on the second coordinate increment, obtaining a second original increment trend symbol string of the second coordinate includes: {0, -1, -1, -1, -1,0,0,0,0,0,1,1,1,1,1,1,1,1,0, -1, -1, -1, -1, -1,0,0,0,0,0}. The second target delta trend symbol string is { -1,0,1, -1,0}.
The first target increment trend symbol string is jumped from "1" to "-1", and the first target increment trend symbol string is jumped from "-1" to "1", namely, the symbol of the second first target increment trend symbol is jumped. A "1" jump to "1" occurs in the second target delta trend symbol string, and a "1" jump to "1" occurs, i.e., a symbol jump of a second target delta trend symbol occurs. Therefore, the pen gesture corresponding to the target track of the "z" shape is recognized as the deletion pen gesture.
Identifying target track correspondenceIs the processing step after inserting the pen form
In the above-described embodiment, the recognition of the pen potential corresponding to the target track is realized, and the following processing steps of the embodiment of the present disclosure will be described in detail below with reference to fig. 26 and fig. 27A-C if the pen potential of the target track is recognized as the insertion pen potential.
Referring to fig. 26, after step 360, the gesture recognition method of the embodiment of the present disclosure further includes:
step 2610, if it is identified that the gesture corresponding to the target track is an insertion gesture, displaying a second area in the input method interface for receiving handwriting input;
step 2620, receiving handwriting input in the second area, and recognizing the handwriting input as text to be inserted, and inserting the text into the position of the inserted gesture.
Steps 2610-2620 are described in detail below.
In step 2610, if the gesture corresponding to the target track is recognized as the insertion gesture, it is indicated that the object wants to insert text, so the object terminal displays a second area in the input method interface, where the second area is used to receive handwriting input. For example, referring to FIG. 27A, in the text editing application in the input method interface, the text that the object has entered is "weather today is good," when there is a target track interposed between "air" and "very". Referring to fig. 27B, after recognizing that the gesture corresponding to the target track is the insertion gesture, the object terminal displays a second region in the input method interface, which may receive handwriting input.
At step 2620, handwriting input is received in the second region and recognized as text to be inserted, inserted into the position of the inserted gesture. For example, with continued reference to FIG. 27B, the second region has a close control and a determine control thereon. If the object clicks the close control, the second region ends the display. If the object clicks the determination control, the "true" of the handwriting input in the second area is determined to be text to be inserted. Referring to FIG. 27C, after the object clicks the determine control, "true" is inserted between "air" and "very" and finally the text on the first area is "very good weather today".
The advantage of this embodiment is that if an insertion gesture is recognized, text insertion is quickly and accurately achieved by receiving handwriting input with the second area and inserting into the position of the insertion gesture.
Processing steps after identifying pencil potential corresponding to target track as deleted pencil potential
The following processing steps of the embodiments of the present disclosure will be described in detail below with reference to fig. 28 and fig. 29A-D, if the gesture of the target track is recognized as a delete gesture.
Referring to fig. 28, after step 360, the gesture recognition method of the embodiment of the present disclosure further includes:
Step 2810, if it is identified that the pen gesture corresponding to the target track is a deletion pen gesture, acquiring a text covered by the deletion pen gesture in the first area, and taking the text as a text to be deleted;
2820, displaying a text to be deleted in a first correction box of the input method interface;
step 2830, receiving the correction of the target object to the text to be deleted in the first correction frame;
and 2840, deleting the corrected text to be deleted from the text in the first area.
Steps 2810-2840 are described in detail below.
In step 2810, the text covered by the deletion gesture in the first area refers to the text where each text pixel whose distance corresponds to the deletion gesture meets the distance condition. For example, referring to fig. 29A, in the text editing application in the input method interface, the text that the object has input is "weather today is good,", and there is a target track covering "weather is good,". After the situation that the gesture corresponding to the target track is the deletion gesture is identified, the text to be deleted is 'good every day'.
In step 2820, considering that the text to be deleted is not necessarily the text that the object really wants to delete, the text to be deleted is displayed in the first correction box of the input method interface so that the object can be corrected. For example, referring to fig. 29B, a first correction box is displayed on the input method interface, and the text to be deleted displayed in the first correction box is "good day and day,".
In step 2830, the first correction box is used to receive a correction of the text to be deleted by the object, so as to determine the corrected text to be deleted. For example, with continued reference to fig. 29B and 29C, the first correction box has a close control and a determine control thereon. If the object clicks the close control, the first correction box ends the display. If the object clicks the determination control, the text contained in the first correction box is determined to be corrected text to be deleted. In fig. 29B, the text to be deleted is "good weather" but the object may want to delete "good weather", and referring to fig. 29C, the object may correct the text to be deleted in the first correction frame, and determine that the corrected text to be deleted is "good weather".
In step 2840, the corrected text to be deleted is deleted from the text in the first area. For example, referring to fig. 29D, after "weather is good" for deleting the corrected text to be deleted, "after" text in the first area is changed from "weather today is good" to "today".
The embodiment has the advantage that if the deletion gesture is recognized, the text to be deleted is determined by using the first correction box, so that the text deletion is quickly and accurately realized.
Recognizing the corresponding pen potential of the target track as the processing step after selecting the pen potential
The following processing steps of the embodiments of the present disclosure will be described in detail below with reference to fig. 30 and fig. 31A-D, if the gesture of the target track is recognized as a delete gesture.
Referring to fig. 30, after step 360, the gesture recognition method of the embodiment of the present disclosure further includes:
step 3010, if the pen potential corresponding to the target track is identified as the selected pen potential, acquiring a text covered by the selected pen potential in the first area, and taking the text as the selected target text;
step 3020, displaying a selection target text in a second correction box of the input method interface;
step 3030, receiving the correction of the target object to the selected target text in the second correction frame;
step 3040, activating an operation option list of the corrected selection target text;
step 3050, responding to selection of a target operation option in the operation option list, and executing operation corresponding to the target operation option on the selected target text.
Steps 3010-3050 are described in detail below.
In step 3010, the text covered by the selected gesture in the first area refers to the text where each text pixel whose distance corresponds to the selected gesture meets the distance condition. For example, referring to fig. 31A, in the text editing application in the input method interface, the text that the object has input is "weather today is good", and there is a target track covering "weather is good". After the gesture corresponding to the target track is identified as the selected gesture, the target text is selected as' good day and day.
In step 3020, considering that the selection target text is not necessarily the text that the object really wants to select, the selection target text is displayed in the second correction box of the input method interface so that the object can be corrected. For example, referring to fig. 31B, a second correction frame is displayed on the input method interface, and the selection target text displayed in the second correction frame is "good daily.
In step 3030, a second correction box is used to receive a correction of the selection target text by the object to determine a corrected selection target text. For example, with continued reference to fig. 31B and 31C, a close control and a determine control are present on the second correction frame. If the object clicks the close control, the second correction box ends the display. If the object clicks the determination control, the text contained in the second correction box is determined to be corrected selection target text. The selection target text in fig. 31B is "good weather" but the object may want to select "good weather", and referring to fig. 31C, the object may correct the selection target text in the second correction frame, and determine that the corrected selection target text is "good weather".
In step 3040, the operation option list for the corrected selection target text may be activated in order to determine that the object really wants to operate the selection target text, considering that the object may want to delete or copy the corrected selection target text under the selection gesture. For example, referring to fig. 31D, after it is determined that the corrected selection target text is "weather-friendly", the activated operation option list contains operation options such as copy, paste, delete, and the like.
In step 3050, in response to selection of a target operation option in the operation option list, an operation corresponding to the target operation option is performed on the selection target text. For example, with continued reference to fig. 31D, the object may click on the copy operation option in the operation option list, thereby performing a copy operation on the selection target text "weather good".
The advantage of this embodiment is that if the selection gesture is identified, the selection target text is determined by the second correction box and the target operation corresponding to the selection gesture is realized by the operation option list, so that the operation corresponding to the selection gesture is quickly and accurately realized.
Apparatus and device descriptions of embodiments of the present disclosure
It will be appreciated that, although the steps in the various flowcharts described above are shown in succession in the order indicated by the arrows, the steps are not necessarily executed in the order indicated by the arrows. The steps are not strictly limited in order unless explicitly stated in the present embodiment, and may be performed in other orders. Moreover, at least some of the steps in the flowcharts described above may include a plurality of steps or stages that are not necessarily performed at the same time but may be performed at different times, and the order of execution of the steps or stages is not necessarily sequential, but may be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.
In the embodiments of the present application, when related processing is performed according to data related to the task content characteristics, such as the task content attribute information or the attribute information set, permission or agreement of the task content is obtained first, and the collection, use, processing, etc. of the data complies with related laws and regulations and standards. In addition, when the embodiment of the application needs to acquire the attribute information of the task content, the independent permission or independent consent of the task content is acquired through a popup window or a jump to a confirmation page and the like, and after the independent permission or independent consent of the task content is definitely acquired, the necessary relevant data of the task content for enabling the embodiment of the application to normally operate is acquired.
Fig. 32 is a schematic structural diagram of a gesture recognition apparatus 3200 in an input method according to an embodiment of the present disclosure. The gesture recognition apparatus 3200 in the input method includes:
a first display unit 3210, configured to display a first region in the input method interface, where the first region includes text input by using the input method;
a first generating unit 3220, configured to generate a target track based on the sliding of the target touch object in the first area;
A first acquisition unit 3230 for acquiring coordinates of a plurality of track points on a target track;
a second acquisition unit 3240 for acquiring coordinate increments between coordinate adjacent track points among the plurality of track points;
a third obtaining unit 3250, configured to obtain a target increment trend symbol string based on coordinate increments between each adjacent track points;
the first identifying unit 3260 is configured to identify a pen gesture corresponding to the target track based on the target increment trend symbol string.
Alternatively, the first acquisition unit 3230 is for: acquiring first coordinates and second coordinates of a plurality of track points on a target track;
the second acquisition unit 3240 is for: acquiring a first coordinate increment of a first coordinate and a second coordinate increment of a second coordinate between adjacent track points in the track points;
the third acquisition unit 3250 is for: acquiring a first target increment trend symbol string of a first coordinate based on a first coordinate increment between each two adjacent track points, and acquiring a second target increment trend symbol string of a second coordinate based on a second coordinate increment between each two adjacent track points;
the first identifying unit 3260 is for: if at least one of the first target increment trend symbol string and the second target increment trend symbol string has symbol jump of at least two times of target increment trend symbol, identifying the pen gesture corresponding to the target track as a deletion pen gesture; and if the symbol jumps of the target increment trend symbol are not generated at least twice in the first target increment trend symbol string and the second target increment trend symbol string, identifying the pen gesture corresponding to the target track as an inserted pen gesture when the jump times between the first character and the second character in the second target increment trend symbol string are 0 and the maximum value of the first coordinate difference between track points on the target track is smaller than a third threshold value, otherwise, identifying the pen gesture corresponding to the target track as a selected pen gesture.
Optionally, the first identifying unit 3260 is further configured to:
acquiring an input history record of a target object for inputting text in an input method interface;
acquiring a plurality of history insertion strokes input in an input history record;
obtaining the maximum value of a first coordinate difference between track points on a pen potential track corresponding to the history inserted pen potential;
solving a second average value and a variance of maximum values corresponding to the plurality of history insertion strokes;
a third threshold is determined based on the second mean, the variance, and the predetermined coefficient.
Optionally, the third acquiring unit 3250 is specifically configured to:
if the coordinate increment between the adjacent track points is positive and the absolute value of the coordinate increment is larger than a first threshold value, the sign of the increment trend symbol of the adjacent track points is set to be positive; if the coordinate increment between the adjacent track points is negative and the absolute value of the coordinate increment is larger than a first threshold value, the sign of the increment trend sign of the adjacent track points is set to be negative; otherwise, the sign of the incremental trend symbol of the adjacent track point is set to 0;
connecting incremental trend symbols of adjacent track points according to the sequence of the adjacent track points on a target track to generate an original incremental trend symbol string;
from the original incremental trend symbol string, a target incremental trend symbol string is obtained.
Optionally, the third acquiring unit 3250 is further specifically configured to:
acquiring the curvature of each track point in the adjacent track points on the target track;
determining a third average value of the curvature of each of the adjacent track points;
and determining a first threshold corresponding to the track point based on the third average value.
Optionally, the third acquiring unit 3250 is specifically configured to:
for consecutive identical incremental tendencies in the original string of incremental tendencies, if the number of consecutive identical incremental tendencies is greater than a second threshold, compressing the consecutive identical incremental tendencies into one incremental tendencies;
and if the number of the continuous identical incremental tendencies is not greater than the second threshold value, deleting the continuous identical incremental tendencies to obtain the target incremental tendencies string.
Optionally, the third acquiring unit 3250 is further specifically configured to:
acquiring midpoint increment trend symbols from continuous identical increment trend symbols;
acquiring a fourth average value of curvatures of adjacent track points corresponding to the midpoint increment trend sign on the target track;
based on the fourth average, a second threshold corresponding to consecutive identical incremental tendencies is determined.
Optionally, the third acquiring unit 3250 is further specifically configured to:
equally dividing the original incremental trend symbol string into a plurality of substrings;
Determining the most increment trend symbol in each substring as a target increment trend symbol corresponding to the substring;
and connecting the target increment trend symbols corresponding to the sub-strings according to the sequence of the sub-strings to obtain a target increment trend symbol string.
Alternatively, the first generating unit 3220 is specifically configured to:
each time the target touch body continuously slides in the first area, identifying the target touch body as a candidate track;
acquiring the duration and duration of the candidate track;
screening the screened tracks from the plurality of candidate tracks based on the duration and the duration;
and acquiring a target track from the screened tracks.
Optionally, the first generating unit 3220 is further specifically configured to:
determining a first score for the candidate trajectory based on the duration;
determining a second score for the candidate trajectory based on the duration;
determining a total score for the candidate trajectory based on the first score and the second score;
and screening the screened tracks from the candidate tracks based on the total score.
Optionally, the first generating unit 3220 is further specifically configured to:
sequentially selecting a plurality of anchor points from the starting point of the screened track at a first time interval on the screened track;
determining the minimum distance from the anchor point to each text pixel point of the first area;
And identifying the screened track as a target track based on the minimum distance of the anchor points.
Optionally, the first generating unit 3220 is further specifically configured to:
determining a first average of minimum distances of the plurality of anchor points;
and if the first average value is smaller than the preset threshold value, identifying the screened track as a target track.
Alternatively, the first acquiring unit 3230 is specifically configured to:
equally dividing the time length between the start time and the end time of the target track into a plurality of time intervals;
and acquiring coordinates of track points corresponding to the midpoints of the time intervals on the target track.
Alternatively, the first acquiring unit 3230 is specifically configured to:
dividing the length of a target track into a plurality of track sections;
acquiring curvatures of midpoints of a plurality of track intervals on a target track;
taking the midpoint of the curvature meeting the first condition as a track point;
coordinates of a plurality of track points are acquired.
Alternatively, the first acquiring unit 3230 is specifically configured to:
dividing the length of a target track into a plurality of track sections;
acquiring touch pressures of midpoints of a plurality of track intervals;
taking the midpoint of the touch pressure meeting the second condition as a track point;
coordinates of a plurality of track points are acquired.
Optionally, before the first area is displayed in the input method interface, the gesture recognition apparatus 3200 further includes:
A second display unit (not shown) for displaying a gesture-enabled control on the input method interface;
a first receiving unit (not shown) for receiving a trigger for a gesture-enabled control.
Optionally, after identifying the pen gesture corresponding to the target track based on the target increment trend symbol string, the pen gesture identifying device 3200 further includes:
a third display unit (not shown) configured to display a second area in the input method interface for receiving handwriting input if the gesture corresponding to the target track is recognized as an insertion gesture;
a first insertion unit (not shown) for receiving handwriting input in the second area and recognizing the handwriting input as text to be inserted into the position of the insertion gesture.
Optionally, after identifying the pen gesture corresponding to the target track based on the target increment trend symbol string, the pen gesture identifying device 3200 further includes:
a fourth obtaining unit (not shown) configured to obtain, as the text to be deleted, a text covered by the deletion gesture in the first area if it is identified that the gesture corresponding to the target track is the deletion gesture;
a fourth display unit (not shown) for displaying the text to be deleted in the first correction box of the input method interface;
A second receiving unit (not shown) for receiving correction of the text to be deleted in the first correction frame by the target object;
a first deleting unit (not shown) for deleting the corrected text to be deleted from the text in the first area.
Optionally, after identifying the pen gesture corresponding to the target track based on the target increment trend symbol string, the pen gesture identifying device 3200 further includes:
a fifth acquiring unit (not shown) configured to acquire, as the selection target text, text covered by the selected pen potential in the first area if it is recognized that the pen potential corresponding to the target track is the selection pen potential;
a fifth display unit (not shown) for displaying the selection target text in the second correction box of the input method interface;
a third receiving unit (not shown) for receiving correction of the selection target text in the second correction frame by the target object;
a first activating unit (not shown) for activating a list of operation options for the corrected selection target text;
and a first operation unit (not shown) for performing an operation corresponding to the target operation option on the selection target text in response to selection of the target operation option in the operation option list.
Referring to fig. 33, fig. 33 is a block diagram showing a part of a terminal implementing a gesture recognition method in an input method according to an embodiment of the present disclosure, the terminal including: radio Frequency (RF) circuitry 3310, memory 3315, input unit 3330, display unit 3340, sensor 3350, audio circuitry 3360, wireless fidelity (wireless fidelity, wiFi) module 3370, processor 3380, and power supply 3390. It will be appreciated by those skilled in the art that the terminal structure shown in fig. 33 is not limiting of a cell phone or computer and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The RF circuit 3310 may be used for receiving and transmitting signals during the process of receiving and transmitting information or communication, in particular, after receiving downlink information of the base station, it is processed by the processor 3380; in addition, the data of the design uplink is sent to the base station.
The memory 3315 may be used to store software programs and modules, and the processor 3380 performs various functional applications of the content terminal and data processing by executing the software programs and modules stored in the memory 3315.
The input unit 3330 may be used to receive input numerical or character information and generate key signal inputs related to setting and function control of the content terminal. Specifically, the input unit 3330 may include a touch panel 3331 and other input devices 3332.
The display unit 3340 may be used to display input information or provided information and various menus of the content terminal. The display unit 3340 may include a display panel 3341.
Audio circuitry 3360, speaker 3361, and microphone 3362 may provide an audio interface.
In this embodiment, the processor 3380 included in the terminal may perform the gesture recognition method in the input method of the previous embodiment.
Terminals of embodiments of the present disclosure include, but are not limited to, cell phones, computers, intelligent voice interaction devices, intelligent home appliances, vehicle terminals, touch screen terminals, and the like. The embodiments of the present invention may be applied to various fields including, but not limited to, input methods, word processing, and the like.
Fig. 34 is a block diagram of a portion of the server 110 implementing a gesture recognition method in an input method according to an embodiment of the present disclosure. The server 110 may vary considerably in configuration or performance and may include one or more central processing units (Central Processing Units, simply CPU) 3422 (e.g., one or more processors) and memory 3432, one or more storage media 3430 (e.g., one or more mass storage devices) storing applications 3442 or data 3444. Wherein the memory 3432 and the storage medium 3430 may be transitory or persistent storage. The program stored in the storage medium 3430 may include one or more modules (not shown), each of which may include a series of instruction operations on the server 110. Still further, the central processor 3422 may be configured to communicate with a storage medium 3430 and execute a series of instruction operations in the storage medium 3430 on the server 110.
The server 110 may also include one or more power supplies 3426, one or more wired or wireless network interfaces 3450, one or more input output interfaces 3458, and/or one or more operating systems 3441, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, and the like.
The central processor 3422 in the server 110 may be used to perform the gesture recognition method in the input method of the embodiments of the present disclosure.
The embodiments of the present disclosure also provide a computer-readable storage medium storing program code for executing the gesture recognition method in the input method of the foregoing embodiments.
The disclosed embodiments also provide a computer program product comprising a computer program. The processor of the computer device reads the computer program and executes it, so that the computer device executes the gesture recognition method in the input method described above.
The terms "first," "second," "third," "fourth," and the like in the description of the present disclosure and in the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein, for example. Furthermore, the terms "comprises," "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in this disclosure, "at least one" means one or more, and "a plurality" means two or more. "and/or" for describing association relation of association contents, the representation may have three kinds of relations, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context of the association is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
It should be understood that in the description of the embodiments of the present disclosure, the meaning of a plurality (or multiple) is two or more, and that greater than, less than, exceeding, etc. is understood to not include the present number, and that greater than, less than, within, etc. is understood to include the present number.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in essence or a part contributing to the related art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server 110, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It should also be appreciated that the various implementations provided by the embodiments of the present disclosure may be arbitrarily combined to achieve different technical effects.
The above is a specific description of the embodiments of the present disclosure, but the present disclosure is not limited to the above embodiments, and various equivalent modifications and substitutions can be made by those skilled in the art without departing from the spirit of the present disclosure, and are included in the scope of the present disclosure as defined in the claims.

Claims (16)

1. A method for recognizing a gesture in an input method, comprising:
displaying a first area in an input method interface, wherein the first area comprises a text input by using the input method;
generating a target track based on the sliding of the target touch body in the first area;
acquiring coordinates of a plurality of track points on the target track;
acquiring coordinate increment between adjacent track points in coordinates of a plurality of track points;
if the coordinate increment between the adjacent track points is positive and the absolute value of the coordinate increment is larger than a first threshold value, setting the sign of the increment trend symbol of the adjacent track points to be positive; if the coordinate increment between the adjacent track points is negative and the absolute value of the coordinate increment is larger than a first threshold value, setting the sign of the increment trend symbol of the adjacent track points to be negative; otherwise, setting the sign of the incremental trend symbol of the adjacent track points to 0;
Connecting the increment trend symbols of the adjacent track points according to the sequence of the adjacent track points on the target track to generate an original increment trend symbol string;
for the continuous identical incremental trend symbols in the original incremental trend symbol string, if the number of the continuous identical incremental trend symbols is larger than a second threshold value, compressing the continuous identical incremental trend symbols into one incremental trend symbol, and if the number of the continuous identical incremental trend symbols is not larger than the second threshold value, deleting the continuous identical incremental trend symbols to obtain a target incremental trend symbol string;
and identifying the pen gesture corresponding to the target track based on the target increment trend symbol string.
2. The pen gesture recognition method according to claim 1, wherein the first threshold is set by:
acquiring the curvature of each track point in the adjacent track points on the target track;
determining a third average value of the curvature of each of the adjacent track points;
and determining the first threshold corresponding to the track point based on the third average value.
3. The pen gesture recognition method according to claim 1, wherein the second threshold is set by:
Acquiring midpoint increment trend symbols from the continuous identical increment trend symbols;
acquiring a fourth average value of curvatures of adjacent track points corresponding to the midpoint increment trend symbols on the target track;
and determining the second threshold corresponding to the continuous same increment trend symbol based on the fourth average value.
4. The method of claim 1, wherein the pen gesture recognition is performed,
the obtaining coordinates of a plurality of track points on the target track includes: acquiring first coordinates and second coordinates of a plurality of track points on the target track;
the obtaining the coordinate increment between the coordinate adjacent track points in the track points comprises the following steps: acquiring a first coordinate increment of the first coordinate and a second coordinate increment of the second coordinate between adjacent track points in the track points;
the obtaining the target increment trend symbol string based on the coordinate increment between the adjacent track points comprises the following steps: acquiring a first target increment trend symbol string of the first coordinate based on the first coordinate increment between each adjacent track point, and acquiring a second target increment trend symbol string of the second coordinate based on the second coordinate increment between each adjacent track point;
The identifying, based on the target incremental trend symbol string, a pen gesture corresponding to the target track includes: if at least one of the first target increment trend symbol string and the second target increment trend symbol string has symbol jump of at least two times of target increment trend symbol, identifying the pen gesture corresponding to the target track as a deletion pen gesture; and if no sign jump of at least a secondary target increment trend symbol occurs in the first target increment trend symbol string and the second target increment trend symbol string, identifying the pen gesture corresponding to the target track as an insertion pen gesture when the number of jumps between a first character and a second character in the second target increment trend symbol string is 0 and the maximum value of a first coordinate difference between track points on the target track is smaller than a third threshold value, otherwise identifying the pen gesture corresponding to the target track as a selection pen gesture.
5. The pen gesture recognition method according to claim 4, wherein the third threshold is set by:
acquiring an input history of a target object for inputting the text in the input method interface;
acquiring a plurality of history insertion strokes input in the input history record;
Obtaining the maximum value of a first coordinate difference between track points on a pen potential track corresponding to the history inserted pen potential;
solving a second average value and a second variance for the maximum values corresponding to the plurality of history insertion strokes;
the third threshold is determined based on the second average, the variance, and a predetermined coefficient.
6. The gesture recognition method of claim 1, wherein generating the target trajectory based on the sliding of the target contact in the first region comprises:
each time the target touch body continuously slides in the first area, identifying the target touch body as a candidate track;
acquiring the duration and duration of the candidate track;
screening out a screened track from a plurality of candidate tracks based on the duration and the duration;
and acquiring the target track from the screened track.
7. The method of claim 6, wherein said screening the screened trajectories from the plurality of candidate trajectories based on the duration and the duration comprises:
determining a first score for the candidate trajectory based on the duration;
determining a second score for the candidate trajectory based on the duration;
Determining a total score for the candidate trajectory based on the first score and the second score;
and screening the screened track from a plurality of candidate tracks based on the total score.
8. The method of claim 6, wherein the acquiring the target track from the screened tracks comprises:
sequentially selecting a plurality of anchor points from the starting point of the screened track at a first time interval on the screened track;
determining the minimum distance between the anchor point and each text pixel point of the first area;
and identifying the screened track as the target track based on the minimum distances of the anchor points.
9. The gesture recognition method of claim 8, wherein the identifying the screened trajectory as the target trajectory based on the minimum distance of the plurality of anchor points comprises:
determining a first average of the minimum distances of the plurality of anchor points;
and if the first average value is smaller than a preset threshold value, identifying the screened track as the target track.
10. The method of claim 1, wherein the acquiring coordinates of a plurality of track points on the target track includes:
Equally dividing the time length between the start time and the end time of the target track into a plurality of time intervals;
and acquiring coordinates of the track points corresponding to the midpoints of the time intervals on the target track.
11. The method of claim 1, wherein the acquiring coordinates of a plurality of track points on the target track includes:
dividing the length of the target track into a plurality of track sections;
acquiring curvatures of midpoints of a plurality of track intervals on the target track;
taking the midpoint of the curvature meeting a first condition as the track point;
and acquiring coordinates of a plurality of track points.
12. The method of claim 1, wherein the acquiring coordinates of a plurality of track points on the target track includes:
dividing the length of the target track into a plurality of track sections;
acquiring touch pressures of midpoints of a plurality of track intervals;
taking the midpoint of the touch pressure meeting a second condition as the track point;
and acquiring coordinates of a plurality of track points.
13. The gesture recognition method of claim 1, wherein prior to displaying the first region in the input method interface, the gesture recognition method further comprises:
Displaying a gesture enabling control on the input method interface;
and receiving a trigger of the gesture enabling control.
14. A gesture recognition apparatus in an input method, comprising:
the first display unit is used for displaying a first area in the input method interface, wherein the first area comprises a text input by the input method;
the first generation unit is used for generating a target track based on the sliding of the target touch body in the first area;
the first acquisition unit is used for acquiring coordinates of a plurality of track points on the target track;
a second obtaining unit, configured to obtain coordinate increments between coordinate adjacent track points in the plurality of track points;
a third obtaining unit, configured to set the sign of the incremental trend symbol of the adjacent track point to be positive if the coordinate increment between the adjacent track points is positive and the absolute value of the coordinate increment is greater than a first threshold; if the coordinate increment between the adjacent track points is negative and the absolute value of the coordinate increment is larger than a first threshold value, setting the sign of the increment trend symbol of the adjacent track points to be negative; otherwise, setting the sign of the incremental trend symbol of the adjacent track points to 0; connecting the increment trend symbols of the adjacent track points according to the sequence of the adjacent track points on the target track to generate an original increment trend symbol string; for the continuous identical incremental trend symbols in the original incremental trend symbol string, if the number of the continuous identical incremental trend symbols is larger than a second threshold value, compressing the continuous identical incremental trend symbols into one incremental trend symbol, and if the number of the continuous identical incremental trend symbols is not larger than the second threshold value, deleting the continuous identical incremental trend symbols to obtain a target incremental trend symbol string;
And the first identification unit is used for identifying the pen gesture corresponding to the target track based on the target increment trend symbol string.
15. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements a gesture recognition method in an input method according to any one of claims 1 to 13 when executing the computer program.
16. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements a gesture recognition method in an input method according to any one of claims 1 to 13.
CN202310888999.7A 2023-07-19 2023-07-19 Method for recognizing pen gestures in input method, related device and medium Active CN116630994B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310888999.7A CN116630994B (en) 2023-07-19 2023-07-19 Method for recognizing pen gestures in input method, related device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310888999.7A CN116630994B (en) 2023-07-19 2023-07-19 Method for recognizing pen gestures in input method, related device and medium

Publications (2)

Publication Number Publication Date
CN116630994A CN116630994A (en) 2023-08-22
CN116630994B true CN116630994B (en) 2023-10-20

Family

ID=87617377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310888999.7A Active CN116630994B (en) 2023-07-19 2023-07-19 Method for recognizing pen gestures in input method, related device and medium

Country Status (1)

Country Link
CN (1) CN116630994B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203268A (en) * 2017-05-31 2017-09-26 吉林大学 A kind of three-dimensional style of brushwork recognition methods based on directional chain-code
CN111625179A (en) * 2020-06-02 2020-09-04 京东方科技集团股份有限公司 Graph drawing method, electronic device, and computer storage medium
CN111723304A (en) * 2020-01-03 2020-09-29 腾讯科技(深圳)有限公司 Track point identification method and related device
CN114529926A (en) * 2020-10-31 2022-05-24 华为技术有限公司 Character selection method and device for curved text and terminal equipment
CN115589786A (en) * 2021-04-22 2023-01-10 京东方科技集团股份有限公司 Method, device and system for recognizing hand-drawn figure and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8776213B2 (en) * 2011-07-07 2014-07-08 Bottomline Technologies (De), Inc. Mobile application security system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203268A (en) * 2017-05-31 2017-09-26 吉林大学 A kind of three-dimensional style of brushwork recognition methods based on directional chain-code
CN111723304A (en) * 2020-01-03 2020-09-29 腾讯科技(深圳)有限公司 Track point identification method and related device
CN111625179A (en) * 2020-06-02 2020-09-04 京东方科技集团股份有限公司 Graph drawing method, electronic device, and computer storage medium
CN114529926A (en) * 2020-10-31 2022-05-24 华为技术有限公司 Character selection method and device for curved text and terminal equipment
CN115589786A (en) * 2021-04-22 2023-01-10 京东方科技集团股份有限公司 Method, device and system for recognizing hand-drawn figure and computer readable storage medium

Also Published As

Publication number Publication date
CN116630994A (en) 2023-08-22

Similar Documents

Publication Publication Date Title
US9417710B2 (en) System and method for implementing sliding input of text based upon on-screen soft keyboard on electronic equipment
CN109614944B (en) Mathematical formula identification method, device, equipment and readable storage medium
CN106843737B (en) Text input method and device and terminal equipment
CN106251869B (en) Voice processing method and device
CN104718544A (en) Partial gesture text entry
CN104992709A (en) Method for executing voice command and voice recognition equipment
CN107918496B (en) Input error correction method and device for input error correction
CN107564526B (en) Processing method, apparatus and machine-readable medium
EP3483728A1 (en) Application prediction method, application preloading method, application prediction apparatus and application preloading apparatus
EP4273742A1 (en) Handwriting recognition method and apparatus, electronic device, and medium
CN104978045B (en) A kind of Chinese character input method and device
CN112507806A (en) Intelligent classroom information interaction method and device and electronic equipment
US20160371251A1 (en) English input method and input device
CN104680196A (en) Handwriting character recognizing method and system
CN113918030A (en) Handwriting input method and device and handwriting input device
CN110858291A (en) Character segmentation method and device
CN116630994B (en) Method for recognizing pen gestures in input method, related device and medium
CN111373473B (en) Method for voice recognition of electronic equipment and electronic equipment
CN102207824A (en) Sliding pinyin input method based on touch screen device
CN109192198B (en) Text input method based on sound wave perception
CN114782716A (en) Image matching method and device
CN110010131B (en) Voice information processing method and device
CN106293368B (en) Data processing method and electronic equipment
JP2013025390A (en) Handwriting input method
CN105094544B (en) Method and device for acquiring characters

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40092614

Country of ref document: HK