Method for generating original handwriting stroke

The stroke width is calculated by collecting density and stroke parameters, and the center point of the circle and the Bezier curve are used to connect the intermediate points to form a closed polygon area, which solves the problem of broken pens and blank gaps when generating handwriting strokes in the existing technology, and achieves a smoother stroke. Generate effects.

WO2024212362A1PCT designated stage expired Publication Date: 2024-10-17JIANGSU ZHONGWEI TECH SOFTWARE SYST
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/103964
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-13
Filing Date
2023-06-29
Publication Date
2024-10-17

AI Technical Summary

Technical Problem

In the existing technology, when generating handwriting strokes, strokes change too much and too fast, resulting in pen breakage. Especially when a customized handwriting input device is not used, there is a problem of blank gaps in the stroke generation.

Method used

The stroke width is calculated by collecting density and stroke parameters. The center point is used to generate a circle and the Bezier curve is used to connect the intermediate points to form a closed polygon area. The polygon area is filled to generate the stroke, which avoids the problem of large distances between common tangent points and ensures a smooth connection.

Benefits of technology

The pen tip is generated without relying on screen customization hardware, which avoids pen breaks and blank gaps and provides a smoother user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023103964_17102024_PF_FP_ABST
    Figure CN2023103964_17102024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed is a method for generating an original handwriting stroke, comprising: setting stroke effect coefficient parameters; making a handwriting trigger element contact with a screen to generate an array; performing point position acquisition, obtaining position information of point positions, and putting same into the array; taking each point in the array as the center of a circle to generate a circle by applying the stroke effect coefficient parameters; obtaining intersection points of straight lines and the circles, wherein the straight lines are located on two adjacent circles and perpendicular to a line connecting of the centers of the two circles, and obtaining an intermediate point between the intersection points on the two adjacent circles; circulating the described operations to obtain all the intermediate points generated in a handwriting process, and connecting the intermediate points in sequence to form a Bezier curve to form a closed polygonal area; and finally filling the polygonal area to form a stroke, and storing the stroke. The method described in the present invention is executed without relying on customized hardware other than the screen, and has the advantages such as smooth connection, avoidance of stylus breakage, and good user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Method for generating original handwriting strokes

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 13, 2023, with application number 202310388630.X, and invention name “Method for Generating Original Handwriting Strokes”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present invention relates to the field of handwriting stroke generation, and in particular to a method for generating original handwriting strokes. Background Art

[0003] With the rapid development of information technology, human-computer interaction devices have evolved from simple text input to become a key input device for electronic calligraphy. Currently, these devices rely on customized handwriting input devices, such as smart styluses. These devices provide the user with the handwriting input location and convert the user's handwriting speed information provided by the handwriting input device into a speed scaling factor to generate the pen tip. Other devices use common tangent points to form closed areas for filling and generating pen tips. However, if the strokes vary significantly and the speed is too fast, the strokes may break. This is because the common tangent points of adjacent points are relatively large, resulting in gaps between the tips when they connect, and blank spaces are left when filling.

[0004] Summary of the Invention

[0005] The purpose of the present invention is to provide a method for generating original handwriting strokes, which can calculate the stroke width by collecting density and combining stroke parameters, and can generate strokes without the need for a screen combined with a customized handwriting input device.

[0006] In a first aspect, the present invention provides a method for generating original handwriting strokes, comprising the following steps:

[0007] Set the pen stroke effect coefficient parameters;

[0008] The handwriting trigger element contacts the screen, performs handwriting, and generates an array;

[0009] Perform point collection, obtain the location information of the current point, and put the location information into an array;

[0010] Generate a circle with each point in the array as the center and apply the stroke effect coefficient parameter;

[0011] Get the diameter of the connecting line perpendicular to the centers of two adjacent circles and the intersection point of the line with the circle;

[0012] Get the middle point between the intersection points of two adjacent circles on the same side of the connecting line, and thus get all the middle points generated during the handwriting process;

[0013] Connect in sequence to form a closed polygonal area;

[0014] Fill the polygonal area to form a stroke and save it.

[0015] In some embodiments,

[0016] The screen uses a capacitive screen;

[0017] When the contact between the handwriting trigger unit and the screen is released, the pen tip effect coefficient parameters can be reset. The pen tip effect coefficient parameters include color, pen width, pen tip parameters and effect coefficient;

[0018] The position information includes the x-axis coordinate and the y-axis coordinate.

[0019] In some embodiments, three consecutive points are recorded as point p2, point p1, and point cp in descending order of their generation time, and the current point position is recorded as point p. The determination and assignment process is as follows:

[0020] The length of the array is 1, point p is the first point, and the position information of point p is assigned to points p2, p1, and cp at the same time;

[0021] The length of the array is greater than 1. The position information of point p is assigned to point cp, the position information of the origin cp is assigned to point p1, and the position information of the origin p1 is assigned to p2.

[0022] In some embodiments, the effect coefficient includes an initial effect coefficient and a process effect coefficient. The set pen width value, pen tip parameter, initial effect coefficient and process effect coefficient are w, pressure, d1 and d2 respectively. The actual pen width value w1 is set.

[0023] w1=w*pressure, set the maximum pen width to max_w, max_w=w1, set the minimum pen width to min_w;

[0024] The radius of the circle generated with each point in the array as the center is calculated based on the density value between the collected points. The specific calculation process is:

[0025] The length of the array is 1, the density value of the first point is 0, and the radius is the minimum radius value: min_R = w1 / d1;

[0026] If the length of the array is greater than 1, traverse the points in the array from the second point. The distance between the current point and the previous point is recorded as I. If I is less than w, the density value of the current point is recorded as I*d2. Loop through the array to obtain the sum of the density values ​​of the current point and all previous points, recorded as sum. Divide sum by the number of points to obtain the average density value. Calculate r, which is equal to w1 minus (the square root of the absolute value of the difference between the average density value of the current point and the average density value of the previous point).

[0027] Compare r and min_w. If r is less than min_w, the radius of the circle with the current point as the center is min_w; otherwise, the radius of the circle with the current point as the center is r.

[0028] In some implementations, the value range of d1 is 1-w1, the value range of d2 is 5-10, min_w is 2, and the unit of the pen width and the unit of the circle radius are both pixels.

[0029] In some embodiments, the coordinates of the centers of three adjacent circles are p2(x2, y2), p1(x1, y1), and cp(x0, y0), and their radii are r2, r1, and r0, respectively. Taking p0(x0, y0) as an example, the formula of the circle is (x-x0) 2 +(y-y0) 2 =r0 2 ,

[0030] The process of obtaining the diameter of the connecting line perpendicular to the centers of two adjacent circles or the intersection of the straight line containing the diameter and the circle is as follows:

[0031] Calculate the slope k1 of the line connecting the centers of two adjacent circles, k1 = (y2-y1) / (x2-x1);

[0032] Determine whether k1 exists. If k1 exists and is not 0, then the slope of the line perpendicular to the connecting line is k = -1 / k1;

[0033] Based on the slope k and the coordinates of the centers of the two circles p1(x1, y1) and p2(x2, y2), respectively, obtain the equations of the lines I1 and I2 passing through the centers of the two circles and perpendicular to the connecting line. The equation of I1 is: y-y1=k*(x-x1), and the equation of I2 is: y-y2=k*(x-x2);

[0034] Solve the first set of equations to obtain the values ​​of x and y to obtain the coordinates of the intersection of the line I1 and the circle with center p1(x1, y1). The first set of equations includes y-y1=[-(x2-x1) / (y2-y1)]*(x-x1) and (x-x1) 2 +(y-y1) 2 =r1 2 ;

[0035] Solve the second set of equations to obtain the values ​​of x and y to obtain the coordinates of the intersection of the line I2 and the circle with center p2(x2, y2). The second set of equations includes y-y2=[-(x2-x1) / (y2-y1)]*(x-x2) and (x-x2) 2 +(y-y2) 2 =r2 2 ;

[0036] If k1 does not exist, the equations of the straight lines I1 and I2 passing through the centers of the two circles and perpendicular to the connecting line are y=y1 and y=y2 respectively. Substitute y=y1 into (x-x1) 2 +(y-y1) 2 =r1 2 , solve for the value of x, and you can get the coordinates of the intersection of the straight line I1 and the circle with center p1(x1, y1); substitute y=y2 into (x-x2) 2 +(y-y2) 2 =r2 2 , solve the value of x to get the coordinates of the intersection of the straight line I2 and the circle with the center p2(x2, y2);

[0037] If k1 is 0, the equations of the straight lines I1 and I2 passing through the centers of the two circles and perpendicular to the connecting line are x=x1 and x=x2 respectively. Substitute x=x1 into (x-x1) 2 +(y-y1) 2 =r1 2 , solve for the value of y, and you can get the coordinates of the intersection of the straight line I1 and the circle with the center p1(x1, y1); substitute x=x2 into (x-x2) 2 +(y-y2) 2 =r2 2 , solve the value of y and you can get the coordinates of the intersection of straight line I2 and the circle with center p2(x2, y2).

[0038] In some implementations, Bezier curves are used to connect all intermediate points generated during the handwriting process to form a closed polygonal area.

[0039] In some embodiments,

[0040] Let the straight line passing through the center of the circle cp(x0, y0) and perpendicular to the line connecting p1(x1, y1) and cp(x0, y0) be I0, and the straight line passing through the center of the circle p1(x1, y1) and perpendicular to the line connecting p1(x1, y1) and cp(x0, y0) be I1',

[0041] Let the coordinates of the two intersection points of line I2 and the circle with center p2(x2, y2) be A2_1(x2_1, y2_1) and A2_2(x2_2, y2_2) respectively; let the coordinates of the two intersection points of line I1 and the circle with center p1(x1, y1) be A1_1(x1_1, y1_1) and A1_2(x1_2, y1_2) respectively; let the coordinates of the two intersection points of line I1' and the circle with center p1(x1, y1) be A1_3(x1_3, y1_3) respectively. , A1_4(x1_4, y1_4); the coordinates of the two intersection points of the straight line I0 and the circle with center cp(x0, y0) are A0_1(x0_1, y0_1) and A0_2(x0_2, y0_2); the midpoint of the line connecting A2_1 and A1_1 is mid1_1, the midpoint of the line connecting A1_3 and A0_1 is mid0_1, the midpoint of the line connecting A2_2 and A1_2 is mid1_2, and the midpoint of the line connecting A1_4 and A0_2 is mid0_2,

[0042] The specific process of using Bezier curves to connect all the intermediate points generated during the handwriting process to form a closed polygonal area is as follows:

[0043] Starting from point mid1_1, draw a Bezier curve to point mid0_1, the control point of the Bezier curve is A1_1(x1_1, y1_1), then go to point mid1_2, draw a Bezier curve from point mid1_2 to mid0_2, the control point of the Bezier curve is A1_2(x1_2, y1_2),

[0044] According to this method, Bezier curves are drawn on all the intermediate points generated during the handwriting process to form a closed polygonal area.

[0045] In a second aspect, the present invention proposes a system for applying a method for generating original handwriting strokes, comprising a handwriting acquisition unit, a calculation unit, a framework forming unit, a filling unit, a storage unit, and a main control unit, wherein the handwriting acquisition unit, the calculation unit, the framework forming unit, the filling unit, and the storage unit are all connected to the main control unit, wherein:

[0046] The master control unit is used to coordinate the work of other units connected to it;

[0047] The storage unit is used to store the parameters for setting the pen stroke effect coefficient, other data information generated during the execution of the method for generating the original handwriting pen stroke, and the pen stroke;

[0048] The handwriting collection unit is connected to the screen and is used to collect the position information of the points generated during handwriting, generate an array, and put the position information of the points into the array;

[0049] The calculation unit is used to calculate the radius of the circle with each point in the array as the center, the diameter of the connecting line perpendicular to the centers of two adjacent circles or the intersection point of the straight line on which the diameter lies and the circle, and the midpoint of the line segment formed by connecting the intersection points of two adjacent circles on the same side of the connecting line;

[0050] The frame forming unit is used to sequentially connect all the intermediate points generated during the handwriting process to form a closed polygonal area;

[0051] The fill unit is used to fill the polygonal area to form a pen stroke.

[0052] In some embodiments, an editing unit is further included, which is connected to the main control unit and is used to modify the set pen width value, pen stroke parameters, and effect coefficient stored in the storage unit.

[0053] The advantages of the method for generating original handwriting strokes of the present invention are:

[0054] By setting the pressure sensitivity coefficient, the screen does not need to directly obtain the pen stroke parameters, so that the pressure sensitivity can be set without relying on custom hardware other than the screen;

[0055] Use the middle point of the intersection and the control point to draw the Bezier curve, so that no gaps will be generated. The control point makes the Bezier curve of the intersection smoother, making the connection between each line segment smoother and avoiding the phenomenon of broken pen.

[0056] By using a vertical line passing through the center of the circle instead of a common tangent point, the spacing between the common tangent points will not be large, thus avoiding pen breakage. At the same time, the intersection of the vertical line and the circle makes the thickness of the line segment closer to the set pen width, giving users a better experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] FIG1 is a flow chart of a method for generating original handwriting strokes in some embodiments of the present invention;

[0058] FIG2 is a conceptual diagram of generating a circle and an intermediate point in some embodiments of the present invention;

[0059] FIG3 is a schematic block diagram of a system for applying a method for generating original handwriting strokes in some embodiments of the present invention;

[0060] FIG4 is a schematic diagram of a pen stroke generated in some embodiments of the present invention. DETAILED DESCRIPTION

[0061] Example 1

[0062] In combination with the contents shown in FIG1 and FIG2 , this embodiment proposes a method for generating original handwriting strokes, comprising the following steps:

[0063] S1. Set pen tip effect coefficient parameters. Pen tip effect coefficient parameters include color, pen width, pen tip parameters, and effect coefficient. The effect coefficient includes initial effect coefficient and process effect coefficient. The set pen width value, pen tip parameters, initial effect coefficient, and process effect coefficient are w, pressure, d1, and d2 respectively. Set the actual pen width value w1, w1=w*pressure, set the maximum pen width value to max_w, max_w=w1, and set the minimum pen width value to min_w.

[0064] S2. The handwriting trigger element contacts the screen and performs handwriting to generate an array L. A capacitive screen is preferably used as the screen. The handwriting trigger element can be a smart stylus, or a user's finger or other object that can contact the screen without damaging it.

[0065] S3. Perform point acquisition, record the currently acquired point as point p, obtain the position information of point p, and put the position information of point p into array L, where the position information includes the x-axis coordinate and the y-axis coordinate;

[0066] S4. Record three consecutive points, determine their values, and generate a circle with each point in the array L as the center by setting the pen width, pen stroke parameters, and effect coefficient;

[0067] S5. Obtain the diameter of a connecting line perpendicular to the centers of two adjacent circles or the intersection of the straight line containing the diameter and the circle;

[0068] S6. Connect the intersection points of two adjacent circles on the same side of the connecting line to form a line segment, and obtain the midpoint of the line segment;

[0069] S7, looping the above operations to obtain all the intermediate points generated during the handwriting process, and sequentially connecting them to form a closed polygonal area;

[0070] S8. Fill the polygonal area to form a pen stroke and save it.

[0071] During the execution of the original handwriting stroke generation method, when the handwriting trigger unit and the screen are released from contact, the pen width value, pen stroke parameters and effect coefficient can be reset, so that the user can adjust the pen width according to needs, etc., providing the user with a better experience.

[0072] Suppose that the three consecutive points in S4 are sorted in descending order according to the time of their generation and recorded as point p2, point p1, and point cp. The judgment and assignment process is as follows:

[0073] The length of array L is 1, point p is the first point, and the position information of point p is assigned to points p2, p1, and cp at the same time;

[0074] The length of array L is greater than 1. The position information of point p is assigned to point cp, the position information of origin cp is assigned to point p1, and the position information of origin p1 is assigned to p2. The judgment and assignment process described here can be implemented using a for loop.

[0075] In S4, the radius of the circle generated with each point in the array L as the center is calculated based on the density value between the collected points. The specific calculation process is:

[0076] The length of array L is 1, the density value of the first point is 0, and the radius is the minimum radius value: min_R = w1 / d1;

[0077] If the length of array L is greater than 1, traverse the points in array L from the second point. The distance between the current point and the previous point is recorded as I. If I is less than w, the density value of the current point is recorded as I*d2. Loop through the points to obtain the sum of the density values ​​of the current point and all previous points, recorded as sum. Divide sum by the number of points to obtain the average density value. Calculate r, which is equal to w1 minus (the square root of the absolute value of the difference between the average density value of the current point and the average density value of the previous point).

[0078] Compare r and min_w. If r is less than min_w, the radius of the circle with the current point as the center is min_w; otherwise, the radius of the circle with the current point as the center is r.

[0079] The units of the pen width and the circle radius are both pixels.

[0080] It should be noted that, in some specific implementations, the value range of d1 is 1-w1, the value range of d2 is 5-10, and min_w is 2.

[0081] Assume that the center coordinates of the three adjacent circles are p2(x2, y2), p1(x1, y1), cp(x0, y0), and their radii are r2, r1, and r0 respectively.

[0082] The formula of a circle with its center at p0(x0,y0) is (x-x0) 2 +(y-y0) 2 =r0 2 ,

[0083] The formula of a circle with its center at p1(x1, y1) is (x-x1) 2 +(y-y1) 2 =r1 2 ,

[0084] The formula of a circle with its center at p2(x2, y2) is (x-x2) 2 +(y-y2) 2 =r2 2 ,

[0085] Taking two circles with centers p2(x2, y2) and p1(x1, y1) as examples, the process of obtaining the diameter of the connecting line perpendicular to the centers of the two adjacent circles or the intersection of the straight line containing the diameter and the circle in S5 is as follows:

[0086] Calculate the slope k1 of the line connecting the centers of two adjacent circles, k1 = (y2-y1) / (x2-x1);

[0087] Determine whether k1 exists. If k1 exists and is not 0, then the slope of the line perpendicular to the connecting line is k = -1 / k1;

[0088] Based on the slope k and the coordinates of the centers of the two circles p1(x1, y1) and p2(x2, y2), respectively, obtain the equations of the lines I1 and I2 passing through the centers of the two circles and perpendicular to the connecting line. The equation of I1 is: y-y1=k*(x-x1), and the equation of I2 is: y-y2=k*(x-x2);

[0089] Solve the first set of equations to obtain the values ​​of x and y to obtain the coordinates of the intersection of the line I1 and the circle with center p1(x1, y1). The first set of equations includes y-y1=[-(x2-x1) / (y2-y1)]*(x-x1) and (x-x1) 2 +(y-y1) 2 =r1 2 ;

[0090] Solve the second set of equations to obtain the values ​​of x and y to obtain the coordinates of the intersection of the line I2 and the circle with center p2(x2, y2). The second set of equations includes y-y2=[-(x2-x1) / (y2-y1)]*(x-x2) and (x-x2) 2 +(y-y2) 2 =r2 2 ;

[0091] If k1 does not exist, the equations of the straight lines I1 and I2 passing through the centers of the two circles and perpendicular to the connecting line are y=y1 and y=y2 respectively. Substitute y=y1 into (x-x1) 2 +(y-y1) 2 =r1 2 , solve for the value of x, and you can get the coordinates of the intersection of the straight line I1 and the circle with center p1(x1, y1); substitute y=y2 into (x-x2) 2 +(y-y2) 2 =r2 2 , solve the value of x to get the coordinates of the intersection of the straight line I2 and the circle with the center p2(x2, y2);

[0092] If k1 is 0, the equations of the straight lines I1 and I2 passing through the centers of the two circles and perpendicular to the connecting line are x=x1 and x=x2 respectively. Substitute x=x1 into (x-x1) 2 +(y-y1) 2 =r1 2 , solve for the value of y, and you can get the coordinates of the intersection of the straight line I1 and the circle with the center p1(x1, y1); substitute x=x2 into (x-x2) 2 +(y-y2) 2 =r2 2 , solve the value of y and you can get the coordinates of the intersection of straight line I2 and the circle with center p2(x2, y2).

[0093] In S7, Bezier curves are used to connect all the intermediate points generated during the handwriting process to form a closed polygonal area.

[0094] Let the straight line passing through the center of the circle cp(x0, y0) and perpendicular to the line connecting p1(x1, y1) and cp(x0, y0) be I0, and the straight line passing through the center of the circle p1(x1, y1) and perpendicular to the line connecting p1(x1, y1) and cp(x0, y0) be I1',

[0095] Let the coordinates of the two intersection points of line I2 and the circle with center p2(x2, y2) be A2_1(x2_1, y2_1) and A2_2(x2_2, y2_2) respectively; let the coordinates of the two intersection points of line I1 and the circle with center p1(x1, y1) be A1_1(x1_1, y1_1) and A1_2(x1_2, y1_2) respectively; let the coordinates of the two intersection points of line I1' and the circle with center p1(x1, y1) be A1_3(x1_3, y1_3) respectively. , A1_4(x1_4, y1_4); the coordinates of the two intersection points of the straight line I0 and the circle with center cp(x0, y0) are A0_1(x0_1, y0_1) and A0_2(x0_2, y0_2); the midpoint of the line connecting A2_1 and A1_1 is mid1_1, the midpoint of the line connecting A1_3 and A0_1 is mid0_1, the midpoint of the line connecting A2_2 and A1_2 is mid1_2, and the midpoint of the line connecting A1_4 and A0_2 is mid0_2,

[0096] The specific process of using Bezier curves to connect all the intermediate points generated during the handwriting process to form a closed polygonal area is as follows:

[0097] Starting from point mid1_1, draw a Bezier curve to point mid0_1, the control point of the Bezier curve is A1_1(x1_1, y1_1), then go to point mid1_2, draw a Bezier curve from point mid1_2 to mid0_2, the control point of the Bezier curve is A1_2(x1_2, y1_2),

[0098] According to this method, all the intermediate points generated during the handwriting process are drawn with Bezier curves to form a closed polygonal area, for example, a polygonal closed area with a shadow as shown in Figure 4 is formed.

[0099] Example 2

[0100] In conjunction with the content shown in FIG3 , this embodiment proposes a system for applying a method for generating original handwriting strokes, comprising a handwriting acquisition unit, a calculation unit, a frame forming unit, a filling unit, a storage unit, and a main control unit. The handwriting acquisition unit, the calculation unit, the frame forming unit, the filling unit, and the storage unit are all connected to the main control unit, wherein:

[0101] The master control unit is used to coordinate the work of other units connected to it;

[0102] The storage unit is used to store the set pen width value, pen stroke parameters, effect coefficient, other data information generated during the execution of the method for generating the original handwriting pen stroke, and the pen stroke;

[0103] The handwriting collection unit is connected to the screen and is used to collect the position information of the points generated during handwriting, generate an array L, and put the position information of the points into the array L;

[0104] The calculation unit is used to calculate the radius of the circle with each point in the array L as the center, the diameter of the connecting line perpendicular to the centers of two adjacent circles or the intersection point of the straight line containing the diameter and the circle, and the midpoint of the line segment formed by connecting the intersection points of two adjacent circles on the same side of the connecting line;

[0105] The frame forming unit is used to sequentially connect all the intermediate points generated during the handwriting process to form a closed polygonal area;

[0106] The fill unit is used to fill the polygonal area to form a pen stroke.

[0107] The system applying the method for generating original handwriting strokes also includes an editing unit connected to the main control unit for modifying the set pen width value, stroke parameters, and effect coefficient stored in the storage unit.

[0108] It is understood by those skilled in the art that several similar variations and improvements may be made without departing from the inventive concept of the present invention, and these should also be considered within the scope of protection of the present invention.

Claims

1. A method for generating original handwriting strokes, characterized in that: The steps include: Set the stroke effect coefficient parameters; The handwriting trigger element contacts the screen, performs handwriting, and generates an array; Perform point collection, obtain the location information of the current point, and put the location information into an array; Generate a circle by taking each point in the array as the center and applying the stroke effect coefficient parameter; Get the diameter of the connecting line perpendicular to the centers of two adjacent circles and the intersection point of the straight line with the circle; Get the middle point between the intersection points of two adjacent circles on the same side of the connecting line, and thus get all the middle points generated during the handwriting process; Connect in sequence to form a closed polygonal area; Fill the polygonal area to form a stroke and save it.

2. The method for generating original handwriting strokes according to claim 1, characterized in that: The screen uses a capacitive screen; When the contact between the handwriting trigger unit and the screen is released, the pen stroke effect coefficient parameters can be reset, and the pen stroke effect coefficient parameters include color, pen width, pen stroke parameters and effect coefficient; The position information includes an x-axis coordinate and a y-axis coordinate.

3. The method for generating original handwriting strokes according to claim 1, characterized in that: The three consecutive points are sorted from the time of generation to the time of generation, and are recorded as point p2, point p1, and point cp. The current point obtained is recorded as point p. The process of judging and assigning values ​​is as follows: The length of the array is 1, point p is the first point, and the position information of point p is assigned to point p2, point p1, and point cp at the same time; The length of the array is greater than 1. The position information of point p is assigned to point cp, the position information of the origin cp is assigned to point p1, and the position information of the origin p1 is assigned to p2.

4. The method for generating original handwriting strokes according to claim 2, characterized in that: The effect coefficient includes the initial effect coefficient and the process effect coefficient. The set pen width value, pen tip parameter, initial effect coefficient and process effect coefficient are w, pressure, d1 and d2 respectively. The actual pen width value is set to w1, w1 = w*pressure, the maximum pen width value is set to max_w, max_w = w1, and the minimum pen width value is set to min_w; The radius of the circle generated with each point in the array as the center is calculated based on the density value between the collected points. The specific calculation process is: The length of the array is 1, the density value of the first point is 0, and the radius is the minimum radius value: min_R = w1 / d1; If the length of the array is greater than 1, traverse the points in the array from the second point. The distance between the current point and the previous point is recorded as I. If I is less than w, the density value of the current point is recorded as I*d2. Loop through the array to obtain the sum of the density values ​​of the current point and all previous points, recorded as sum. Divide sum by the number of points to obtain the average density value, and calculate r. R is equal to w1 minus (the square root of the absolute value of the difference between the average density value of the current point and the average density value of the previous point). Compare r and min_w. If r is less than min_w, the radius of the circle with the current point as the center is min_w; otherwise, the radius of the circle with the current point as the center is r.

5. The method for generating original handwriting strokes according to claim 4, characterized in that: The value range of d1 is 1-w1, the value range of d2 is 5-10, min_w is 2, and the unit of pen width and circle radius is pixel.

6. The method for generating original handwriting strokes according to claim 4, characterized in that: Suppose the coordinates of the centers of three adjacent circles are p2(x2, y2), p1(x1, y1), cp(x0, y0), and their radii are r2, r1, and r0 respectively. Taking p0(x0, y0) as an example, the formula of the circle is (x-x0) 2 +(y-y0) 2 =r0 2 , The process of obtaining the diameter of the connecting line perpendicular to the centers of two adjacent circles or the intersection of the straight line where the diameter lies and the circle is as follows: Calculate the slope k1 of the line connecting the centers of two adjacent circles, k1 = (y2-y1) / (x2-x1); Determine whether k1 exists. If k1 exists and is not 0, then the slope of the line perpendicular to the connecting line is k = -1 / k1; According to the slope k and the coordinates of the centers of the two circles p1(x1, y1) and p2(x2, y2), the equations of the straight lines I1 and I2 passing through the centers of the two circles and perpendicular to the connecting line are obtained respectively. The equation of I1 is: y-y1=k*(x-x1), and the equation of I2 is y-y2=k*(x-x2); Solve the first set of equations to obtain the values ​​of x and y, and you can get the coordinates of the intersection of the straight line I1 and the circle with the center p1(x1, y1). The first set of equations includes y-y1=[-(x2-x1) / (y2-y1)]*(x-x1) and (x-x1) 2 +(y-y1) 2 =r1 2 ; Solving the second set of equations to obtain the values ​​of x and y, we can get the coordinates of the intersection of the straight line I2 and the circle with the center p2(x2, y2). The second set of equations includes y-y2=[-(x2-x1) / (y2-y1)]*(x-x2) and (x-x2) 2 +(y-y2) 2 =r2 2 ; If k1 does not exist, the equations of the straight lines I1 and I2 passing through the centers of the two circles and perpendicular to the connecting line are y=y1 and y=y2 respectively. Substitute y=y1 into (x-x1) 2 +(y-y1) 2 =r1 2 , solve for the value of x, and you can get the coordinates of the intersection of the straight line I1 and the circle with center p1(x1, y1); substitute y=y2 into (x-x2) 2 +(y-y2) 2 =r2 2 , solve for the value of x, and you can get the coordinates of the intersection of the straight line I2 and the circle with the center at p2(x2, y2); If k1 is 0, the equations of the straight lines I1 and I2 passing through the centers of the two circles and perpendicular to the connecting line are x=x1 and x=x2 respectively. Substitute x=x1 into (x-x1) 2 +(y-y1) 2 =r1 2 , solve for the value of y, and you can get the coordinates of the intersection of the straight line I1 and the circle with center p1(x1, y1); substitute x=x2 into (x-x2) 2 +(y-y2) 2 =r2 2 , solve the value of y and you can get the coordinates of the intersection of straight line I2 and the circle with center p2(x2, y2).

7. The method for generating original handwriting strokes according to claim 6, characterized in that: Bezier curves are used to connect all the intermediate points generated during the handwriting process to form a closed polygonal area.

8. The method for generating original handwriting strokes according to claim 7, characterized in that: Let the straight line passing through the center of the circle cp(x0, y0) and perpendicular to the line connecting p1(x1, y1) and cp(x0, y0) be I0, and the straight line passing through the center of the circle p1(x1, y1) and perpendicular to the line connecting p1(x1, y1) and cp(x0, y0) be I1', Suppose the coordinates of the two intersection points of the straight line I2 and the circle with center p2(x2, y2) are A2_1(x2_1, y2_1) and A2_2(x2_2, y2_2); the coordinates of the two intersection points of the straight line I1 and the circle with center p1(x1, y1) are A1_1(x1_1, y1_1) and A1_2(x1_2, y1_2); the coordinates of the two intersection points of the straight line I1' and the circle with center p1(x1, y1) are A1_3(x1_3, y1_3) , A1_4(x1_4, y1_4); the coordinates of the two intersection points of the straight line I0 and the circle with the center cp(x0, y0) are A0_1(x0_1, y0_1) and A0_2(x0_2, y0_2); the midpoint of the line connecting A2_1 and A1_1 is mid1_1, the midpoint of the line connecting A1_3 and A0_1 is mid0_1, the midpoint of the line connecting A2_2 and A1_2 is mid1_2, the midpoint of the line connecting A1_4 and A0_2 is mid0_2, The specific process of using Bezier curves to connect all the intermediate points generated during handwriting to form a closed polygonal area is as follows: Starting from point mid1_1, draw a Bezier curve to point mid0_1. The control point of the Bezier curve is A1_1 (x1_1, y1_1). Then go to point mid1_2, and draw a Bezier curve from point mid1_2 to mid0_2. The control point of the Bezier curve is A1_2 (x1_2, y1_2). In this way, draw Bezier curves for all the intermediate points generated during the handwriting process to form a closed polygonal area.

9. A system using a method for generating original handwriting strokes, characterized in that: The system includes a handwriting collection unit, a calculation unit, a frame forming unit, a filling unit, a storage unit and a main control unit, and the handwriting collection unit, the calculation unit, the frame forming unit, the filling unit and the storage unit are all connected to the main control unit, wherein: The master control unit is used to coordinate the work of other units connected to it; The storage unit is used to store the parameters for setting the pen stroke effect coefficient, other data information generated during the execution of the method for generating the original handwriting pen stroke, and the pen stroke; The handwriting collection unit is connected to the screen and is used to collect the position information of the points generated during handwriting, generate an array, and put the position information of the points into the array; The calculation unit is used to calculate the radius of the circle with each point in the array as the center, the diameter of the connecting line perpendicular to the centers of the two circles on two adjacent circles or the intersection point of the straight line where the diameter lies and the circle, and the middle point of the line segment formed by connecting the intersection points on the same side of the connecting line on two adjacent circles; The frame forming unit is used to sequentially connect all the intermediate points generated in the handwriting process to form a closed polygonal area; The fill unit is used to fill the polygonal area to form a pen tip.

10. The system according to claim 9, characterized in that It also includes an editing unit, which is connected to the main control unit and is used to modify the set pen width value, pen stroke parameters, and effect coefficient stored in the storage unit.

Citation Information

Patent Citations

  • Handwriting display method and device

    CN105405159A

  • Method and device of determining pressure sensing handwriting area

    CN107526526A

  • Writing brush handwriting drawing method, device and equipment and readable storage medium

    CN110321054A

  • Method for realizing curve smoothing of original handwriting

    CN111857380A

  • Generation method of original handwriting handwriting stroke

    CN116092095A