Handwriting drawing method and apparatus, electronic device and storage medium

By acquiring and correcting the sample point feature information in the handwriting drawing method, the problem of unsmooth handwriting in the prior art is solved, and a better user experience and handwriting effect is achieved.

WO2025138524A1PCT designated stage expired Publication Date: 2025-07-03SHENZHEN HONGHE INNOVATION INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/091935
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-27
Filing Date
2024-05-09
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

The existing handwriting drawing methods are not good in generating handwriting, resulting in the handwriting being not smooth enough.

Method used

By acquiring the first characteristic information of N consecutive sampling points, the initial writing handwriting is displayed, and when the preset trigger condition is met, the initial handwriting is corrected based on the first characteristic information of the partial sampling points to determine the corrected writing handwriting.

Benefits of technology

It achieves improved smoothing effect of handwriting, better user impression, reduces data noise interference, and improves handwriting drawing efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024091935_03072025_PF_FP_ABST
    Figure CN2024091935_03072025_PF_FP_ABST
Patent Text Reader

Abstract

The present application is suitable for the technical field of human-computer interaction, and provides a handwriting drawing method and apparatus, an electronic device and a storage medium. The method comprises: acquiring first feature information of N continuous sampling points; displaying initial handwriting strokes on the basis of the first feature information of the N sampling points; acquiring second feature information of the current sampling point, wherein the N sampling points are acquired before the current sampling point; in response to the first feature information and / or the second feature information meeting a preset trigger condition, correcting the initial handwriting strokes on the basis of the first feature information of some of the N sampling points, and determining corrected handwriting strokes corresponding to the N sampling points; and displaying the corrected handwriting strokes.
Need to check novelty before this filing date? Find Prior Art

Description

Handwriting drawing method, device, electronic device and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application No. 202311828046.8 filed on December 27, 2023, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present application belongs to the field of human-computer interaction technology, and in particular relates to a handwriting drawing method, device, electronic device and storage medium. Background Art

[0004] Existing computer-aided imitation of actual handwriting effects is usually achieved using hardware devices such as touch screens and touch pens. Writing parameter information such as the movement speed or pressure value of the touch sampling point is collected from the hardware, and then these values ​​are visualized based on software to achieve the generation of handwriting.

[0005] Current pressure-sensitive handwriting generation methods typically calculate the straight-line distance based on the coordinates of two adjacent points. Based on the difference in pressure and other data between the two points, the line between the two points is then gradient-divided and filled with a gradually changing pattern, allowing the user to visually perceive changes in handwriting thickness. However, while this method can generate handwriting, the resulting rendering is subpar, with issues such as a lack of smoothness.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a handwriting drawing method, device, electronic device and storage medium, which can solve the problem of poor rendering effect of current handwriting drawing methods.

[0008] In a first aspect, an embodiment of the present application provides a handwriting drawing method, comprising:

[0009] Obtaining first feature information of N consecutive sampling points, where N is an integer greater than 1;

[0010] Displaying the initial handwriting according to the first feature information of the N sampling points;

[0011] Acquire second feature information of the current sampling point; the N sampling points are collected before the current sampling point;

[0012] In response to the first characteristic information and / or the second characteristic information satisfying a preset trigger condition, correcting the initial handwriting according to the first characteristic information of some of the N sampling points, and determining corrected handwriting corresponding to the N sampling points;

[0013] The corrected handwriting is displayed.

[0014] In a possible implementation of the first aspect, the initial handwriting is obtained by drawing a pattern on a first path line; the first path line is a writing path line between adjacent sampling points among the N sampling points;

[0015] The step of correcting the initial handwriting based on the first feature information of some of the N sampling points includes:

[0016] Clearing the pattern in the initial handwriting;

[0017] The first path lines are redrawn according to the first feature information of some of the N sampling points.

[0018] In a possible implementation of the first aspect, the step of correcting the initial handwriting based on the first feature information of some of the N sampling points includes:

[0019] The initial handwriting is corrected according to the first feature information of the first sampling point and the last sampling point among the N sampling points.

[0020] In a possible implementation of the first aspect, before the step of correcting the initial handwriting based on the first feature information of some of the N sampling points in response to the first feature information and / or the second feature information satisfying a preset trigger condition, the method further includes:

[0021] When a touch operation acting on the interactive device is detected, determining a starting sampling point according to an initiation position of the touch operation on the interactive device;

[0022] Establishing a first virtual sliding window according to the starting sampling point;

[0023] When a movement operation acting on the interactive device is detected, intermediate sampling points are sequentially collected on a movement trajectory corresponding to the movement operation, and the first virtual sliding window is adjusted according to the intermediate sampling points to obtain a second virtual sliding window; the N sampling points include the intermediate sampling points; and the sampling points in the second virtual sliding window are the N sampling points;

[0024] The step of correcting the initial handwriting according to the first feature information of some of the N sampling points in response to the first feature information and / or the second feature information satisfying a preset trigger condition comprises:

[0025] In response to the second feature information of the second virtual sliding window or the current sampling point meeting a preset trigger condition, the initial handwriting is corrected according to the first feature information of some sampling points among the N sampling points.

[0026] In a possible implementation of the first aspect, the method further includes:

[0027] The preset trigger condition is that the number of sampling points in the second virtual sliding window is greater than a first preset threshold; or,

[0028] A value corresponding to the second characteristic information of the current sampling point is outside a preset fluctuation range of the N sampling points; wherein the preset fluctuation range of the N sampling points is determined based on the first characteristic information of the N sampling points.

[0029] In a possible implementation of the first aspect, the method further includes:

[0030] Adjusting the second virtual sliding window to obtain a third virtual sliding window; the third virtual sliding window at least includes the current sampling point;

[0031] Determine whether the third virtual sliding window meets the preset trigger condition.

[0032] In a possible implementation of the first aspect, the first feature information includes position data and writing parameter information; before the step of acquiring the first feature information of N consecutive sampling points, the step further includes:

[0033] When a touch operation acting on the interactive device is detected, determining a starting sampling point according to an initiation position of the touch operation on the interactive device;

[0034] The step of correcting the initial handwriting based on the first feature information of some of the N sampling points includes:

[0035] Obtaining the position data of the starting sampling point;

[0036] Determining a second path connecting the first sampling point among the N sampling points and the starting sampling point according to the position data of the first sampling point among the N sampling points and the position data of the starting sampling point;

[0037] Determining a third path connecting the last sampling point among the N sampling points and the starting sampling point according to the position data of the last sampling point among the N sampling points and the position data of the starting sampling point;

[0038] respectively obtaining a second path length corresponding to the second path connection and a third path length corresponding to the third path connection;

[0039] The initial handwriting is corrected according to the second path length, the third path length, and the writing parameter information of the first sampling point and the last sampling point among the N sampling points.

[0040] In a second aspect, an embodiment of the present application provides a handwriting drawing device, comprising:

[0041] A first feature information acquisition module is configured to acquire first feature information of N consecutive sampling points, where N is an integer greater than 1;

[0042] an initial handwriting display module, which displays the initial handwriting according to the first feature information of the N sampling points;

[0043] A second feature information acquisition module is configured to acquire second feature information of a current sampling point; the N sampling points are acquired before the current sampling point;

[0044] a corrected handwriting generation module, in response to the first feature information and / or the second feature information satisfying a preset trigger condition, correcting the initial handwriting based on the first feature information of some of the N sampling points, and determining corrected handwriting corresponding to the N sampling points;

[0045] The corrected handwriting display module displays the corrected handwriting.

[0046] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the handwriting drawing method described in any one of the first aspects above when executing the computer program.

[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the handwriting drawing method described in any one of the first aspects above is implemented.

[0048] Compared with the related art, the embodiments of the present application have the following beneficial effects:

[0049] In an embodiment of the present application, when a preset trigger condition is met, the fill pattern on the path connecting the first N sampling points is redrawn based on the first feature information of some of the sampling points before the current sampling point. This can filter out data noise caused by other sampling points among the first N sampling points except for the aforementioned sampling points, thereby introducing less noise when drawing the fill pattern. This makes the transition of the fill pattern on the path connecting the first N sampling points smoother, thereby making the handwriting presented on the screen smoother and improving the user's viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] FIG1 is a flow chart of a handwriting drawing method according to an embodiment of the present application;

[0052] FIG2 is a flow chart of a handwriting drawing method provided in another embodiment of the present application;

[0053] FIG3 is a flow chart of a handwriting drawing method provided in another embodiment of the present application;

[0054] FIG4 is a flow chart of step S141 in a handwriting drawing method provided by another embodiment of the present application;

[0055] FIG5 is a schematic diagram of a first sliding window 51 obtained in an application scenario of another embodiment of the present application;

[0056] FIG6 is a schematic diagram of a second sliding window 52 obtained in an application scenario of another embodiment of the present application;

[0057] FIG7 is a schematic diagram of a third sliding window 53 obtained in an application scenario of another embodiment of the present application;

[0058] FIG8 is a schematic diagram of a fourth sliding window 54 obtained in an application scenario of another embodiment of the present application;

[0059] FIG9 is a schematic diagram of handwriting generated based on an existing handwriting drawing method;

[0060] FIG10 is a schematic diagram of handwriting generated based on the handwriting drawing method provided in an embodiment of the present application;

[0061] FIG11 is a schematic diagram of the structure of a handwriting drawing device provided in an embodiment of the present application;

[0062] FIG12 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.

[0064] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0065] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0066] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0067] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0068] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0069] As shown in FIG1 , an embodiment of the present application discloses a handwriting drawing method, which includes the following steps S110-S150:

[0070] S110: Obtain first feature information for N consecutive sampling points. N is an integer greater than 1. Specifically, the N sampling points are sampling points located before the current sampling point. That is, the sampling times of the N sampling points are before the sampling time of the current sampling point. Furthermore, the last of the N sampling points and the current sampling point are adjacent sampling points.

[0071] During the sampling process of the current sampling point, the embodiment of the present application continuously calculates the first feature information of the first N consecutive sampling points preceding the current sampling point, and corrects the handwriting corresponding to the interval of the first N sampling points. The first feature information includes position data and writing parameter information. The writing parameter information may include, for example, the pressure sensitivity value, writing speed, or contact area of ​​the writing pen. The position data may include X-axis coordinates and Y-axis coordinates. The present application is not limited to this.

[0072] S120: Display the initial handwriting based on the first feature information of the N sampling points. Specifically, based on the position data of the first N sampling points, generate a first path line between each adjacent sampling point in the first N sampling points. That is, the first path line is the writing path line between all adjacent points. For example, if there are five sampling points, the adjacent points of the five sampling points are connected, resulting in four lines. The first path line corresponds to these four lines.

[0073] The initial handwriting is formed by drawing a pattern on each line in the first path. The pattern parameters (such as the width or thickness of the pattern) filled on each line are determined based on the first feature information corresponding to the two endpoints of the line, such as the pressure sensitivity value. This determination process can be implemented according to relevant technologies and will not be further described in this embodiment. The handwriting is displayed in real time.

[0074] S130: Obtain second characteristic information of the current sampling point. As described above, the current sampling point is a sampling point whose corresponding sampling time is after the sampling times of the N sampling points and is adjacent to the N sampling points. In this embodiment, the second characteristic information also includes position data and writing parameter information. The position data may include X-axis coordinates and Y-axis coordinates. The writing parameter information may include, for example, the pressure sensitivity of the writing pen, writing speed, or contact area.

[0075] The writing path line between the last sampling point of the N sampling points and the current sampling point is used as a fourth path line. The fourth path line can be drawn based on the position data of the current sampling point and the position data of the last sampling point of the N sampling points. The pattern parameters drawn on the fourth path line can be determined based on the writing parameter information of the current sampling point and the writing parameter information of the last sampling point of the N sampling points.

[0076] S140: In response to the first characteristic information and / or the second characteristic information satisfying a preset trigger condition, the initial handwriting is corrected based on the first characteristic information of some of the N sampling points, and corrected handwriting corresponding to the N sampling points is determined. The corrected handwriting drawn in this step is drawn at the N sampling points preceding the current sampling point and does not include handwriting drawn at the current sampling point.

[0077] Specifically, it is determined whether the first feature information of N sampling points and / or the second feature information of the current sampling point meet a preset trigger condition. This is also known as determining whether the writing parameter information of the N sampling points and / or the writing parameter information of the current sampling point meet the preset trigger condition. If the preset trigger condition is met, it indicates that the writing parameter information between the current sampling point and the N sampling points has a significant deviation, or the number of sampling points with a smaller fluctuation range is greater than a first preset threshold. This indicates that the writing parameter information values ​​of the N sampling points are within an acceptable fluctuation range, and noise interference introduced by some of these sampling points can be filtered out when drawing the route pattern. Therefore, only the writing parameter information in the first feature information of the remaining sampling points among the N sampling points is used to draw the pattern on the path line, thereby obtaining corrected handwriting. For example, if N is 5, meaning there are five sampling points before the current sampling point, the fill pattern for all path lines between these five sampling points can be drawn based on the writing parameter information, such as the pressure sensitivity value, of the 1st, 3rd, and 5th sampling points. This allows for cross-point correction, filtering out noise interference introduced by other sampling points, and resulting in smoother handwriting. This method is particularly suitable for brushes, pressure-sensitive pens, and speed pens.

[0078] Exemplarily, the above-mentioned preset trigger condition may be that the corresponding value of the writing parameter information of the current sampling point is greater than the corresponding values ​​of the writing parameter information of N sampling points by a preset proportion, or the value of N is greater than a preset threshold, or the variance value calculated by combining the writing parameter information of the current sampling point and the writing parameter information of N sampling points is greater than another preset threshold, etc. This application does not impose any restrictions on this.

[0079] In this embodiment, this step specifically includes: clearing the pattern in the initial handwriting, and redrawing the pattern on the first path line based on the first feature information of some of the N sampling points. In other words, based on the writing parameter information, such as the pressure sensitivity value, in the first feature information of the aforementioned sampling points, pattern parameters, such as pattern thickness or pattern width, of the fill pattern on the first path line are determined, and then the pattern is drawn.

[0080] S150, displaying the corrected handwriting.

[0081] In an embodiment of the present application, when a preset trigger condition is met, the fill pattern on the path connecting the first N sampling points is redrawn based on the first feature information of some of the sampling points before the current sampling point. This can filter out data noise caused by other sampling points among the first N sampling points except for the aforementioned sampling points, thereby introducing less noise when drawing the fill pattern. This makes the transition of the fill pattern on the path connecting the first N sampling points smoother, thereby making the handwriting presented on the screen smoother and improving the user's viewing experience.

[0082] In this embodiment, when the preset trigger condition is not met, the current sampling point is updated, and the first N sampling points are updated to the first N+1 sampling points. A determination is then made as to whether the updated first feature information of the first N+1 sampling points and / or the updated second feature information of the current sampling point meet the preset trigger condition. When the preset trigger condition is met, the current sampling point also needs to be updated, and the first N sampling points are also updated, with the updated N sampling points at least including the current sampling point before the update.

[0083] In some optional embodiments, as shown in FIG2 , based on the embodiment corresponding to FIG1 , step S120 includes S121-S122:

[0084] S121 : Generate a first path line between adjacent sampling points in the N sampling points according to the position data of the N sampling points, and store the first path line.

[0085] S122 : Draw and display the initial handwriting according to the first path line and the writing parameter information of the N sampling points.

[0086] In this way, when redrawing the handwriting in step S140, after clearing the pattern in the initial handwriting, the stored first path connection can be directly used to redraw the pattern without recalculating the first path connection. That is, the embodiment of the present application can perform cross-point correction and store the historical path before filling, thereby achieving the purpose of dynamically modifying the historical path before filling. This is conducive to improving the efficiency of handwriting drawing, reducing the delay of handwriting display, and improving the user's writing experience.

[0087] In some optional embodiments, as shown in FIG3 , based on the embodiment corresponding to FIG1 , step S140 is replaced by step S141:

[0088] S141, in response to the first feature information and / or the second feature information satisfying a preset trigger condition, correcting the initial handwriting according to the first feature information of the first sampling point and the last sampling point among the N sampling points, and determining the corrected handwriting corresponding to the N sampling points.

[0089] Specifically, the first path line is filled with a pattern using the writing parameter information, such as pressure sensitivity, of the first and last sampling points among the N sampling points to determine the corrected handwriting corresponding to the N sampling points. This can filter out data noise or interference introduced by more sampling points, resulting in smoother corrected handwriting drawn at the first N sampling points, and better handwriting rendering.

[0090] Another embodiment of the present application discloses another handwriting drawing method. Based on the embodiment corresponding to FIG3 above, this embodiment further includes S100 before step S110:

[0091] S100: When a touch operation acting on an interactive device is detected, a starting sampling point is determined according to a location where the touch operation is initiated on the interactive device.

[0092] As shown in FIG4 , step S141 in this embodiment includes S1411 to S1416:

[0093] S1411: In response to the first characteristic information and / or the second characteristic information satisfying a preset trigger condition, obtain position data of the starting sampling point.

[0094] S1412 : Determine a second path line between the first sampling point among the N sampling points and the starting sampling point according to the position data of the first sampling point among the N sampling points and the position data of the starting sampling point.

[0095] S1413 : Determine a third path connecting the last sampling point among the N sampling points and the starting sampling point according to the position data of the last sampling point among the N sampling points and the position data of the starting sampling point.

[0096] S1414 , respectively obtaining a second path length corresponding to the second path connection and a third path length corresponding to the third path connection.

[0097] S1415 : Determine, based on the second path length and the third path length, the length of the path connecting the first sampling point and the last sampling point among the N sampling points as the fourth path length.

[0098] And S1416, correct the initial handwriting according to the fourth path length, the writing parameter information of the first sampling point among the N sampling points, and the writing parameter information of the last sampling point among the N sampling points, and determine the corrected handwriting corresponding to the N sampling points.

[0099] As an example and not a limitation, during the calculation process, the difference between the corresponding numerical value of the writing parameter information of the last sampling point among the N sampling points, such as the pressure value, and the corresponding numerical value of the writing parameter information of the first sampling point can be determined as the relative pressure difference. The quotient of the relative pressure difference and the preset minimum pressure change threshold is determined as the number of sub-segments. The ratio between the above-mentioned fourth path length and the number of sub-segments is determined as the sub-segment length corresponding to each field. The first path line is segmented according to the sub-segment length to obtain a plurality of sub-path lines. According to the corresponding numerical value of the writing parameter information of the previous sampling point, the minimum pressure change threshold and the number of sub-segments, the corresponding numerical value of the writing parameter information at the end point of each sub-writing route is determined. The pattern on the first path line can be redrawn to obtain the corrected writing handwriting corresponding to the N sampling points.

[0100] Specifically, a complete writing action, including the pen down (down), move (move), and pen up (up) actions, generates a set of touch points and a curved path formed by connecting the points in the set. The handwriting drawing method provided in this embodiment is based on calculating the path distance between any two points in a set of consecutive touch points and extracting the path between the two points. In other words, the path between the first and last sampling points in the N sampling points in the above embodiment is calculated.

[0101] The embodiment of the present application is implemented based on the tool class PathMeasure provided by the relevant technology. The specific structure of this class is PathMeasure(Path path, boolean forceClosed). Among them, path represents the target path to be measured, and forceClosed indicates whether the target path to be measured is closed. The tool class PathMeasure provides a method getLength() for calculating the path length. Calling this method can calculate the length of the target path to be measured of this class. The tool class PathMeasure also provides a method getSegment(float startD, float stopD, Path dst, boolean startWithMoveTo) for returning the path between the starting length and the ending length of the target. Among them, startD is the length of the starting intercepted path, and stopD is the length of the ending intercepted path. If the interception is successful, the interception result will be saved to dst. The return result of startWithMoveTo is a Boolean value, that is, if it returns true, it means that the interception is successful, and if it returns false, it means that the interception failed. The tool class PathMeasure also provides a setPath(Path path, boolean forceClosed) method for updating the path to be measured.

[0102] The embodiment of the present application defines a DrawPath class to illustrate how to obtain the distance between each point and the starting point. The attributes related to the algorithm contained in this class include the Path image attribute path and the collection ArrayList attribute lenList, and the methods related to the algorithm include getLen and getSegmentLen. When the Down event is triggered, the DrawPath class is created and initialized, path and lenList are created, the starting point of the path is moved to the touch point, and the getLen(Path) method is called to obtain the distance between the first point and the starting point. The specific implementation method of the getLen(Path) method is as follows: create a tool class PathMeasure class object pm, call the parameterized constructor PathMeasure(Path path, boolean forceClosed), and pass in the path and forceClosed in the current class. Call the getLength() method of the pm object to obtain the path length corresponding to the current point, that is, the first point. The path length is 0 and is saved in lenList, which is the first element in lenList.

[0103] When the Move event is triggered, if the current point is the nth point n, and the path path connects to point n, call the setPath(Path path) method of pm, pass in the current latest path as the path to be measured, call the getLen(Path) method to obtain the path length from the nth point to the starting point, and save it to lenList.

[0104] When the Up event is triggered, if the current point is the k-th point k, and the path path connects to point k, call the setPath(Path path) method of pm, pass in the current latest path as the path to be measured, call the getLen(Path) method to obtain the path length from the k-th point to the starting point, and save it to lenList.

[0105] Therefore, during the entire touch event, we can obtain the path length between any point n and the starting point. Based on this, we can obtain the path lengths startLen and endLen between any two points and the starting point and pass them to the getSegment(float startD, float stopD, Path dst, bollean startWithMoveTo) method of the pm object to obtain the path dst between the two points, thus obtaining the first path line mentioned above. Then, based on the getLen(Path) method, we pass the path dst to this method to obtain the path length of the first path line.

[0106] In some optional embodiments, based on any of the above embodiments, before step S110, the following steps are further included: S100-S102:

[0107] S100: When a touch operation acting on an interactive device is detected, a starting sampling point is determined according to a location where the touch operation is initiated on the interactive device.

[0108] S101: Establish a first virtual sliding window based on a starting sampling point. That is, the first virtual sliding window only includes the starting sampling point. The starting point of the first virtual sliding window is the starting sampling point.

[0109] S102: When a movement operation is detected on the interactive device, intermediate sampling points are sequentially collected along the movement trajectory corresponding to the movement operation. The N sampling points include the intermediate sampling points. That is, the N sampling points may also include the starting sampling point, or may only include the intermediate sampling points.

[0110] Step S111 is included between step S110 and step S130:

[0111] S111: Adjust the first virtual sliding window according to the intermediate sampling points to obtain a second virtual sliding window. The sampling points in the second virtual sliding window are the N sampling points mentioned above.

[0112] This step S111 may be located between step S110 and step S120, or may be located between step S120 and step S130. This application does not limit this.

[0113] Step S140 is replaced with step S142: In response to the second virtual sliding window or the second feature information of the current sampling point satisfying a preset trigger condition, the initial writing stroke is corrected according to the first feature information of some sampling points among the N sampling points, and the corrected writing stroke corresponding to the N sampling points is determined.

[0114] As an example rather than a limitation, the preset trigger condition is that the number of sampling points within the second virtual sliding window is greater than the first preset threshold. Alternatively, the numerical value of the writing parameter information in the second feature information of the current sampling point is outside the preset fluctuation range of the above N sampling points. The preset fluctuation range of the N sampling points is determined according to the writing parameter information in the first feature information of the N sampling points. For example, the preset fluctuation range is expressed as (a, b), where a < b. The numerical value of the writing parameter information corresponding to the current sampling point is expressed as k. When a < k < b, it means that the numerical value of the writing parameter information in the first feature information of the current sampling point is within the preset fluctuation range, otherwise it means that it is outside the preset fluctuation range. Exemplarily, a is the difference between the average value and the standard deviation value of the writing parameter information corresponding to the N sampling points. b is the sum value of the average value and the standard deviation value of the writing parameter information corresponding to the N sampling points. This application is not limited thereto.

[0115] In some optional embodiments, based on the above embodiments, the method further includes the steps of:

[0116] Adjust the second virtual sliding window to obtain a third virtual sliding window. The third virtual sliding window includes at least the current sampling point. Calculate the preset fluctuation range corresponding to the third virtual sliding window, and update the window start point of the third virtual sliding window.

[0117] Judge whether the third virtual sliding window satisfies the preset trigger condition.

[0118] The following is an example for illustration:

[0119] Referring to FIG. 5, define the data container window as a sliding window and define the maximum window length windowMaxSize. windowMaxSize can be, for example, 3. When the down event is triggered, a touch point, i.e., the sampling point P0, is generated, and the window is initialized to obtain the first sliding window 51, with the starting point of the window pointing to P0. Among them, if windowMaxSize is set too small, the effect of dynamic path modification is poor, that is, the smooth transition effect is poor. If windowMaxSize is set too large, on the one hand, the number of sampling points to be processed is too large, resulting in an impact on computing performance; on the other hand, users can easily perceive the change and the writing experience is not good. Therefore, when actually setting the value of windowMaxSize, the above factors should be considered comprehensively.

[0120] Referring to FIG. 6, when the Move event is triggered, a new touch sampling point P1 is generated, and the sampling point P1 is added to the window to form the second sliding window 52. Taking P0 as the starting point and P1 as the ending point, the corresponding path0 path is calculated and saved, and the handwriting between P0 and P1 is drawn. According to P0 and P1, the preset fluctuation range (c, d) is initialized, where c < d. c represents the difference between the average value and the standard deviation value of the writing parameter information corresponding to each point within the current window. d represents the sum value of the average value and the standard deviation value of the writing parameter information corresponding to each point within the current window.

[0121] Referring to FIG. 7, when the Move event is triggered again to generate a new touch sampling point P2, if the number of elements in the window is less than windowMaxSize after adding P2 and the value of the writing parameter information corresponding to the sampling point P2 is less than K, then the sampling point P2 is added to the window to form the third sliding window 53. And the preset fluctuation range (c, d) is updated, the path connection line path1 between P1 and P2 is stored, and the handwriting between P1 and P2 is drawn.

[0122] Referring to Figure 8 , the Move event continuously triggers the generation of touch sampling point P3. After adding P3, the number of sampling points within the window exceeds the maximum length windowMaxSize, or the corresponding value of the writing parameter information of sampling point P3 is outside the preset fluctuation range (c, d). In this case, the handwriting within the third sliding window 53 is processed, that is, the patterns drawn on path0 and path1 are cleared, and the patterns on path0 and path1 are redrawn based on the corresponding values ​​of the writing parameter information of P0 and P2. A new fourth sliding window 54 is established, and the window starting point of the fourth sliding window 54 can point to sampling point P2 or sampling point P3. In this embodiment, it points to sampling point P2, but this application is not limited to this. The preset fluctuation range (c, d) corresponding to the fourth sliding window 54 is updated based on the sampling points contained in the fourth sliding window 54. The path connecting line path2 between P2 and P3 is stored, and the handwriting between P2 and P3 is drawn.

[0123] Figure 9 is a handwriting diagram generated using an existing handwriting drawing method; Figure 10 is a handwriting diagram generated using the handwriting drawing method provided by an embodiment of the present application. Comparing the rendering effects of Figures 9 and 10, that is, comparing drawn handwriting 81 with drawn handwriting 82, it can be seen that the handwriting drawn using the method provided by the present application is significantly smoother, providing a better user experience.

[0124] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0125] It should be noted that the above-mentioned method embodiments disclosed in this application can be freely combined, and the technical solutions obtained after the free combination are also within the protection scope of this application.

[0126] Corresponding to the handwriting drawing method described in the above embodiment, FIG11 shows a structural block diagram of a handwriting drawing device provided in an embodiment of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0127] 11, the handwriting drawing device 11 includes:

[0128] The first feature information acquisition module 111 acquires first feature information of N consecutive sampling points, where N is an integer greater than 1.

[0129] The initial handwriting display module 112 displays the initial handwriting according to the first feature information of the N sampling points.

[0130] The second feature information acquisition module 113 acquires the second feature information of the current sampling point. The N sampling points are collected before the current sampling point.

[0131] The corrected handwriting generation module 114, in response to the first feature information and / or the second feature information meeting a preset trigger condition, corrects the initial handwriting according to the first feature information of some of the N sampling points, and determines the corrected handwriting corresponding to the N sampling points.

[0132] The corrected handwriting display module 115 displays the corrected handwriting.

[0133] In the embodiment of the present application, when a preset trigger condition is met, the fill pattern on the path connecting the first N sampling points is redrawn based on the first feature information of some of the sampling points before the current sampling point. This can filter out data noise caused by the other sampling points among the first N sampling points except for the aforementioned sampling points, thereby introducing less noise when drawing the fill pattern, making the transition of the fill pattern on the path connecting the first N sampling points smoother, thereby making the handwriting displayed on the screen smoother and improving the user's visual experience.

[0134] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0135] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0136] An embodiment of the present application also provides an electronic device, as shown in Figure 12, the electronic device 12 includes: at least one processor 121, a memory 122, and a computer program 123 stored in the memory 122 and capable of running on the at least one processor 121, and when the processor 121 executes the computer program 123, the steps in any of the above-mentioned method embodiments are implemented.

[0137] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments are implemented.

[0138] An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal implements the steps in the above-mentioned method embodiments.

[0139] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0140] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0141] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0142] In the embodiments provided in this application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0143] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0144] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A handwriting drawing method, comprising: Obtaining first feature information of N consecutive sampling points; Wherein N is an integer greater than 1; Displaying an initial writing handwriting according to the first feature information of the N sampling points; Obtaining second feature information of a current sampling point; The N sampling points are collected before the current sampling point; In response to the first feature information and / or the second feature information satisfying a preset trigger condition, correcting the initial writing handwriting according to the first feature information of some of the N sampling points, and determining a corrected writing handwriting corresponding to the N sampling points; Displaying the corrected writing handwriting.

2. The handwriting drawing method according to claim 1, wherein, The initial writing handwriting is obtained after pattern drawing on a first path connection; the first path connection is a writing path connection between adjacent sampling points among the N sampling points; The step of correcting the initial writing handwriting according to the first feature information of some of the N sampling points includes: Clearing the pattern in the initial writing handwriting; Redrawing a pattern on the first path connection according to the first feature information of some of the N sampling points.

3. The handwriting drawing method according to claim 1, wherein, The step of correcting the initial writing handwriting according to the first feature information of some of the N sampling points includes: Correcting the initial writing handwriting according to the first feature information of the first sampling point and the last sampling point among the N sampling points.

4. The handwriting drawing method according to any one of claims 1-3, before the step of correcting the initial writing handwriting according to the first feature information of some of the N sampling points in response to the first feature information and / or the second feature information satisfying a preset trigger condition, further comprising: When detecting a touch operation on an interactive device, determining a starting sampling point according to the starting position of the touch operation on the interactive device; Establishing a first virtual sliding window according to the starting sampling point; When detecting a moving operation on the interactive device, sequentially collecting intermediate sampling points on a moving trajectory corresponding to the moving operation, and adjusting the first virtual sliding window according to the intermediate sampling points to obtain a second virtual sliding window; the N sampling points include the intermediate sampling points; the sampling points in the second virtual sliding window are the N sampling points; The step of correcting the initial writing handwriting according to the first feature information of some of the N sampling points in response to the first feature information and / or the second feature information satisfying a preset trigger condition includes: In response to the second virtual sliding window or the second feature information of the current sampling point satisfying a preset trigger condition, correcting the initial writing handwriting according to the first feature information of some of the N sampling points.

5. The handwriting drawing method according to claim 4, the method further comprising: The preset trigger condition is that the number of sampling points in the second virtual sliding window is greater than a first preset threshold; Or, ​ The numerical value corresponding to the second feature information of the current sampling point is outside the preset fluctuation range of the N sampling points; wherein, the preset fluctuation range of the N sampling points is determined according to the first feature information of the N sampling points.

6. The handwriting drawing method according to claim 4, the method further comprising: Adjusting the second virtual sliding window to obtain a third virtual sliding window; The third virtual sliding window at least includes the current sampling point; Determining whether the third virtual sliding window meets the preset trigger condition.

7. The handwriting drawing method according to claim 3, wherein the first feature information includes position data and writing parameter information; before the step of obtaining the first feature information of consecutive N sampling points, further comprising: When detecting a touch operation acting on the interaction device, according to the starting position of the touch operation on the interaction device Determine the starting sampling point; The step of correcting the initial handwriting according to the first feature information of some of the N sampling points includes: Obtaining the position data of the starting sampling point; According to the position data of the first sampling point among the N sampling points and the position data of the starting sampling point, determining a second path connection line between the first sampling point and the starting sampling point among the N sampling points; According to the position data of the last sampling point among the N sampling points and the position data of the starting sampling point, determining a third path connection line between the last sampling point and the starting sampling point among the N sampling points; Respectively obtaining the second path length corresponding to the second path connection line and the third path length corresponding to the third path connection line; Correcting the initial handwriting according to the second path length, the third path length, and the writing parameter information of the first sampling point and the last sampling point among the N sampling points.

8. A handwriting drawing device, comprising: A first feature information acquisition module, configured to acquire the first feature information of consecutive N sampling points; The N is an integer greater than 1; An initial handwriting display module, configured to display the initial handwriting according to the first feature information of the N sampling points; A second feature information acquisition module, configured to acquire the second feature information of the current sampling point; The N sampling points are acquired before the current sampling point; A corrected handwriting generation module, configured to, in response to the first feature information and / or the second feature information meeting a preset trigger condition, correct the initial handwriting according to the first feature information of some of the N sampling points, and determine the corrected handwriting corresponding to the N sampling points; A corrected handwriting display module, configured to display the corrected handwriting.

9. The handwriting drawing device according to claim 8, wherein, The initial handwriting is obtained after pattern drawing on a first path connection line; the first path connection line is the writing path connection line between adjacent sampling points among the N sampling points; The handwriting drawing device is used for: Clearing the pattern in the initial handwriting; Redrawing the pattern on the first path connection line according to the first feature information of some of the N sampling points.

10. The handwriting drawing device according to claim 8, wherein, The handwriting drawing device is used for: Modify the initial writing stroke according to the first feature information of the first sampling point and the last sampling point among the N sampling points.

11. The handwriting drawing device according to any one of claims 8-10, wherein, Before the step of the handwriting drawing device modifying the initial writing stroke according to the first feature information of some sampling points among the N sampling points in response to the first feature information and / or the second feature information satisfying a preset trigger condition, it is used for: When detecting a touch operation on the interaction device, determine a starting sampling point according to the starting position of the touch operation on the interaction device. Establish a first virtual sliding window according to the starting sampling point. When detecting a moving operation on the interaction device, sequentially collect intermediate sampling points on the moving trajectory corresponding to the moving operation, and adjust the first virtual sliding window according to the intermediate sampling points to obtain a second virtual sliding window; the N sampling points include the intermediate sampling points; the sampling points in the second virtual sliding window are the N sampling points. The handwriting drawing device is used for: In response to the second virtual sliding window or the second feature information of the current sampling point satisfying a preset trigger condition, modify the initial writing stroke according to the first feature information of some sampling points among the N sampling points.

12. The handwriting drawing device according to claim 11, wherein the preset trigger condition is that the number of sampling points in the second virtual sliding window is greater than a first preset threshold; or The corresponding value of the second feature information of the current sampling point is outside the preset fluctuation range of the N sampling points; among which, The preset fluctuation range of the N sampling points is determined according to the first feature information of the N sampling points.

13. The handwriting drawing device according to claim 11, wherein the handwriting drawing device is used for: Adjust the second virtual sliding window to obtain a third virtual sliding window; the third virtual sliding window includes at least the current sampling point. Judge whether the third virtual sliding window satisfies the preset trigger condition.

14. The handwriting drawing device according to claim 10, wherein the first feature information includes position data and writing parameter information. Before the handwriting drawing device obtains the first feature information of continuous N sampling points, when detecting a touch operation on the interaction device, it is used to determine a starting sampling point according to the starting position of the touch operation on the interaction device. The handwriting drawing device is used for: Obtain the position data of the starting sampling point. According to the position data of the first sampling point among the N sampling points and the position data of the starting sampling point, determine a second path connection line between the first sampling point and the starting sampling point among the N sampling points. According to the position data of the last sampling point among the N sampling points and the position data of the starting sampling point, determine a third path connection line between the last sampling point and the starting sampling point among the N sampling points. Respectively obtain the second path length corresponding to the second path connection line and the third path length corresponding to the third path connection line. Modify the initial writing stroke according to the second path length, the third path length, and the writing parameter information of the first sampling point and the last sampling point among the N sampling points.

15. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

16. A computer-readable storage medium storing a computer program, wherein the computer program implements the method according to any one of claims 1 to 7 when executed by a processor.

17. A computer program product, when the computer program product runs on a mobile terminal, enabling the mobile terminal to implement the method according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Method and device for graphic rendering

    CN101216945A

  • Method and device for screening handwriting sampling points, equipment and storage medium

    CN113052002A

  • Graph drawing method, electronic equipment and storage medium

    CN113963079A

  • Handwriting method and system based on electronic equipment

    CN115205423A

  • Handwriting drawing method and device, electronic equipment and storage medium

    CN117908752A