A handwriting display method and related device
By calculating and filling the handwriting trajectory on the display screen, the handwriting with the pen tip characteristics is generated, which solves the problem that the existing electronic whiteboard cannot display the traditional stylus pen tip characteristics, and achieves a more realistic electronic handwriting experience.
Patent Information
- Application Number
- CN202111179590.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-09
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2041-10-09
AI Technical Summary
The existing electronic whiteboards cannot achieve the effect of traditional handwriting, lack the characteristics of the pen tip, and cannot effectively display the characteristics of the user's personal calligraphy.
By obtaining the moving track of the target object on the display screen and multiple coordinate points, the starting point, control point, and handwriting area are calculated, and the handwriting area is filled to generate handwriting with the brush tip feature and displayed on the display screen.
It realizes the display of handwriting with brush tip characteristics on the electronic whiteboard, enhances the user experience and better displays the user's personal calligraphy style.
Smart Images

Figure CN113963361B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of screen writing technology, and in particular to a handwriting display method and related devices, wherein the related devices include a handwriting display device, a computer device, and a computer-readable storage medium. Background Art
[0002] With the development of science and technology, electronic conference equipment has been applied to work. Electronic conference equipment provides a handwritten electronic whiteboard, but this electronic whiteboard cannot achieve the effect of traditional handwriting, that is, after the user writes on the electronic whiteboard, the handwriting on the electronic whiteboard lacks the characteristics of personal calligraphy, such as lack of pen strokes. Summary of the invention
[0003] The embodiment of the present application provides a handwriting display method and related devices, which include a handwriting display device, a computer device and a computer-readable storage medium, and can make the handwriting have pen stroke characteristics.
[0004] A handwriting display method, comprising:
[0005] Obtaining a moving track of the target object on the display screen, and obtaining a plurality of coordinate points located on the moving track;
[0006] According to multiple coordinate points, calculate the starting point and control point of the target object movement;
[0007] Determine the handwriting area where the target object moves according to the starting point, the control point and the coordinate point, the handwriting area includes the handwriting area formed by the movement of the target object;
[0008] The pen tip handwriting area is filled to obtain the pen tip handwriting, and the pen tip handwriting is displayed.
[0009] Accordingly, an embodiment of the present application provides a handwriting display device, comprising:
[0010] An acquisition unit may be used to acquire a moving track of a target object on a display screen and acquire a plurality of coordinate points on the moving track;
[0011] A first calculation unit may be used to calculate a starting point and a control point of the target object movement according to a plurality of coordinate points;
[0012] A determination unit may be used to determine a handwriting area where the target object moves according to the starting point, the control point and the coordinate point, wherein the handwriting area includes a handwriting area formed by the movement of the target object;
[0013] The filling unit can be used to fill the pen tip handwriting area to obtain the pen tip handwriting and display the pen tip handwriting.
[0014] In some embodiments, the coordinate points include a first coordinate point, a second coordinate point, a third coordinate point and a fourth coordinate point; the first calculation unit can be specifically used to calculate the starting point of the target object's movement based on the first coordinate point and the second coordinate point; calculate the control point of the target object's movement based on the first coordinate point, the second coordinate point and the third coordinate point; determine the handwriting area of the target object's movement based on the starting point, the control point and the fourth coordinate point.
[0015] In some embodiments, the first calculation unit can be specifically used to calculate the distance between the first coordinate point and the second coordinate point based on the first coordinate point and the second coordinate point; calculate the first target curvature of the line segment between the first coordinate point and the second coordinate point on the coordinate axis based on the distance between the first coordinate point and the second coordinate point, and the coordinate axes of the coordinate points; calculate the starting point of the target object's movement based on the first target curvature, the drawing width of the target object on the display screen, and the first coordinate point.
[0016] In some embodiments, the first calculation unit can be specifically used to calculate a first difference point based on a first target curvature and a drawing width of the target object on a display screen; calculate a first starting point for the movement of the target object based on the first difference point and the first coordinate point; calculate a second starting point for the movement of the target object based on the first starting point and the first coordinate point; and generate a starting point for the movement of the target object based on the first starting point and the second starting point.
[0017] In some embodiments, the first calculation unit can be specifically used to calculate the distance between the first coordinate point and the second coordinate point, and the distance between the second coordinate point and the third coordinate point based on the first coordinate point, the second coordinate point and the third coordinate point; calculate the second difference point based on the first coordinate point, the second coordinate point, the third coordinate point, the distance between the first coordinate point and the second coordinate point, and the distance between the second coordinate point and the third coordinate point; calculate the control point for the movement of the target object based on the second difference point and the second coordinate point.
[0018] In some embodiments, the first calculation unit can be specifically used to calculate the distance between the second difference point and the origin of the coordinate axis of the coordinate point based on the second difference point and the origin of the coordinate axis of the coordinate point; calculate the third difference point based on the distance between the second difference point and the origin of the coordinate axis of the coordinate point and the pressure applied by the target object on the display screen; calculate the control point of the movement of the target object based on the third difference point and the second coordinate point.
[0019] In some embodiments, the handwriting display device also includes a second calculation unit, which can be used to calculate the center point of the movement of the target object based on the second coordinate point and the third coordinate point; form a handwriting area based on the starting point, the control point and the center point, and the handwriting area includes a non-pen tip handwriting area; fill the non-pen tip handwriting area to obtain non-pen tip handwriting, and display the non-pen tip handwriting.
[0020] In some embodiments, the second calculation unit can be specifically used to calculate the initial center point of the target object's movement based on the second coordinate point and the third coordinate point; calculate the candidate center point of the target object's movement based on the initial center point, the second coordinate point and the third coordinate point; calculate the center point of the target object's movement based on the initial center point and the candidate center point.
[0021] In some embodiments, the second calculation unit can be specifically used to calculate the distance between the second coordinate point and the third coordinate point based on the second coordinate point and the third coordinate point; calculate the second target curvature of the line segment between the second coordinate point and the third coordinate point on the coordinate axis based on the distance between the second coordinate point and the third coordinate point, and the coordinate axes of the coordinate points; calculate the initial center point of the target object's movement based on the second target curvature, the drawing width of the target object on the display screen, and the second coordinate point.
[0022] In addition, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to perform operations in any handwriting display method provided in the embodiment of the present application.
[0023] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for loading by a processor to execute any handwriting display method provided in the embodiment of the present application.
[0024] The embodiment of the present application can obtain the moving trajectory of the target object on the display screen, and obtain multiple coordinate points located on the moving trajectory; calculate the starting point and control point of the target object's movement based on the multiple coordinate points; determine the handwriting area of the target object's movement based on the starting point, the control point and the coordinate point, the handwriting area includes the pen tip handwriting area formed by the movement of the target object; fill the pen tip handwriting area to obtain the pen tip handwriting, and display the pen tip handwriting; because the embodiment of the present application can calculate the starting point, the control point and the fourth coordinate point that can form the pen tip handwriting area through the coordinate points of the moving trajectory of the target object on the display screen, thus handwriting with pen tip characteristics can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 Schematic diagram of a scene of a handwriting display method provided in an embodiment of the present application;
[0027] Figure 2 It is a flowchart of the handwriting display method provided in the embodiment of the present application;
[0028] Figure 3 is a schematic diagram of obtaining a starting point for movement of a target object provided in an embodiment of the present application;
[0029] Figure 4 is a schematic diagram of obtaining a starting point for movement of a target object provided in an embodiment of the present application;
[0030] Figure 5 is a schematic diagram of forming pen strokes provided in an embodiment of the present application;
[0031] Figure 6 A schematic diagram of obtaining a center point provided in an embodiment of the present application;
[0032] Figure 7 is a schematic diagram of forming non-pen tip handwriting provided by an embodiment of the present application;
[0033] Figure 8 is a structural schematic diagram of a handwriting display device provided in an embodiment of the present application;
[0034] Fig. 9 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0036] The embodiment of the present application provides a handwriting display method, device, computer equipment and computer readable storage medium. The handwriting display device can be integrated in a computer equipment, which can be a server or a terminal.
[0037] Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0038] For example, see Figure 1 Taking a handwriting display device integrated in a computer device, which is a smart TV as an example, the smart TV obtains a moving trajectory of a target object on a display screen and obtains a plurality of coordinate points on the moving trajectory; calculates a starting point and a control point of the target object according to the plurality of coordinate points; determines a handwriting area where the target object moves according to the starting point, the control point and the coordinate point, the handwriting area includes a pen tip handwriting area formed by the movement of the target object; fills the pen tip handwriting area to obtain the pen tip handwriting, and displays the pen tip handwriting.
[0039] The target object refers to an object used to move on the display screen to generate handwriting, and the target object can be a finger, a brush, etc.
[0040] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0041] This embodiment will be described from the perspective of a handwriting display device, which can be specifically integrated into a computer device, which can be a server or a terminal. The terminal can include a smart TV, a tablet computer, a laptop computer, a personal computer (PC), a wearable device, a virtual reality device, or other smart devices that can acquire data.
[0042] like Figure 2 As shown, the specific process of the handwriting display method is as follows:
[0043] 101. Obtain a moving trajectory of a target object on a display screen, and obtain a plurality of coordinate points on the moving trajectory.
[0044] The target object refers to an object used to move on the display screen to generate handwriting, and the target object can be a finger, a brush, etc.
[0045] 102. Calculate the starting point and control point of the target object movement according to the multiple coordinate points.
[0046] 103. Determine the handwriting area where the target object moves according to the starting point, the control point and the coordinate point.
[0047] The handwriting area includes the pen tip handwriting area formed by the movement of the target object.
[0048] 104. Fill the pen tip handwriting area to obtain the pen tip handwriting, and display the pen tip handwriting.
[0049] The embodiment of the present application can obtain the moving trajectory of the target object on the display screen, and obtain multiple coordinate points located on the moving trajectory; calculate the starting point and control point of the target object's movement based on the multiple coordinate points; determine the handwriting area of the target object's movement based on the starting point, the control point and the coordinate point, the handwriting area includes the pen tip handwriting area formed by the movement of the target object; fill the pen tip handwriting area to obtain the pen tip handwriting, and display the pen tip handwriting; because the embodiment of the present application can calculate the starting point, the control point and the fourth coordinate point that can form the pen tip handwriting area through the coordinate points of the moving trajectory of the target object on the display screen, thus handwriting with pen tip characteristics can be obtained.
[0050] According to the method described in the above embodiment, the following is further described in detail with examples.
[0051] In this embodiment, the handwriting display device is specifically integrated into a computer device, which may be a server or a terminal.
[0052] like Figure 2 As shown, a handwriting display method, the specific process is as follows:
[0053] 101. Obtain a moving trajectory of a target object on a display screen, and obtain a plurality of coordinate points on the moving trajectory.
[0054] The target object refers to an object used to move on the display screen to generate handwriting, and the target object can be a finger, a brush, etc.
[0055] Wherein, if the handwriting area is a pen tip handwriting area, the coordinate points may include a first coordinate point, a second coordinate point, a third coordinate point and a fourth coordinate point, and the first coordinate point, the second coordinate point, the third coordinate point and the fourth coordinate point may be arranged in sequence according to the moving direction of the moving track. If the handwriting area is a non-pen tip handwriting area, that is, the handwriting area is a general handwriting area, the coordinate points may include the above-mentioned first coordinate point, the above-mentioned second coordinate point and the above-mentioned third coordinate point.
[0056] The distance between each two adjacent coordinate points in the first coordinate point, the second coordinate point, the third coordinate point and the fourth coordinate point may be the same or different. The first coordinate point, the second coordinate point, the third coordinate point and the fourth coordinate point may be determined according to the pressure value applied by the target object on the display screen. For example, when the pressure value applied by the target object on the display screen reaches a preset threshold, the coordinate point corresponding to the pressure value may be determined. The pressure value applied by the target object on the display screen may be obtained by setting a pressure sensor on the display screen.
[0057] Among them, the first coordinate point may be P1 (x1, y1), the second coordinate point may be P2 (x2, y2), the third coordinate point may be P3 (x3, y3), and the fourth coordinate point may be P (x, y).
[0058] Of course, the embodiment of the present application is not limited to the first coordinate point, the second coordinate point, the third coordinate point and the fourth coordinate point, and the coordinate points can be selected according to specific needs.
[0059] 102. Calculate the starting point and control point of the target object movement according to the multiple coordinate points.
[0060] Specifically, the process of the computer device calculating the starting point and the control point of the target object movement according to the multiple coordinate points can be as follows:
[0061] The computer device can calculate the starting point of the target object's movement according to the first coordinate point and the second coordinate point; and calculate the control point of the target object's movement according to the first coordinate point, the second coordinate point and the third coordinate point.
[0062] The computer device may calculate the starting point of the target object's movement according to the first coordinate point and the second coordinate point as follows:
[0063] The computer device calculates the distance between the first coordinate point and the second coordinate point based on the first coordinate point and the second coordinate point; calculates the first target curvature of the line segment between the first coordinate point and the second coordinate point on the coordinate axis based on the distance between the first coordinate point and the second coordinate point and the coordinate axes of the coordinate points; calculates the starting point of the target object's movement based on the first target curvature, the drawing width of the target object on the display screen, and the first coordinate point.
[0064] Among them, Figure 3 As shown, the distance between the first coordinate point and the second coordinate point is dist0=|P1P2|.
[0065] Among them, the embodiment of the present application can calculate the cosine value between dist0 and the x-axis based on dist0 and the x-axis of the coordinate axis, and then process the cosine value with the inverse cosine to obtain the radian α, and then rotate the radian α 90 degrees to obtain the first target radian β = α + π / 2.
[0066] Among them, in the embodiment of the present application, there are multiple ways to calculate the starting point of the target object's movement according to the first target arc, the drawing width of the target object on the display screen, and the first coordinate point.
[0067] For example, the computer device calculates a first difference point based on the first target curvature and the drawing width of the target object on the display screen; calculates a first starting point for the movement of the target object based on the first difference point and the first coordinate point; calculates a second starting point for the movement of the target object based on the first starting point and the first coordinate point; and generates a starting point for the movement of the target object based on the first starting point and the second starting point.
[0068] The drawing width of the target object on the display screen is represented by stroke, and the first difference point is represented by DP (dx, dy). The first difference point DP (dx, dy) is calculated by the first target arc β and the drawing width stroke, specifically: dx = cos (β) * stroke = -sin (α) * stroke, dy = sin (β) * stroke = -sin (α) * stroke.
[0069] Among them, Figure 3 As shown, the first starting point is represented by SP1 (spx1, spy1), which can be calculated by the first difference point DP (dx, dy) and the first coordinate point P1 (x1, y1), specifically: spx1 = x1 + dx, spy1 = y1 + dy.
[0070] Among them, Figure 3 As shown, the second starting point is represented by SP2 (spx2, spy2), which can be calculated by the first difference point (dx, dy) and the first coordinate point P1 (x1, y1), specifically: spx2 = x1*2-spx1, spy2 = y1*2-spy1.
[0071] For example, the computer device calculates a first difference point based on the first target curvature and the drawing width of the target object on the display screen; calculates a first starting point for the movement of the target object based on the first difference point, the first coordinate point and the default initial value; calculates a second starting point for the movement of the target object based on the first starting point, the first coordinate point and the default initial value; and generates a starting point for the movement of the target object based on the first starting point and the second starting point.
[0072] The drawing width of the target object on the display screen is represented by stroke, and the first difference point is represented by DP (dx, dy). The first difference point DP (dx, dy) is calculated by the first target arc β and the drawing width stroke, specifically: dx = cos (β) * stroke = -sin (α) * stroke, dy = sin (β) * stroke = -sin (α) * stroke.
[0073] Among them, the first starting point is represented by SP1 (spx1, spy1), which can be calculated by the first difference point DP (dx, dy), the first coordinate point P1 (x1, y1) and the default initial value n, specifically: spx1 = x1 + dx + n, spy1 = y1 + dy + n.
[0074] Among them, the second starting point is represented by SP2 (spx2, spy2), which can be calculated by the first difference point (dx, dy), the first coordinate point P1 (x1, y1) and the default initial value n, specifically: spx2 = x1*2-spx1-n, spy2 = y1*2-spy1-n.
[0075] The process of the computer device calculating the control point for moving the target object according to the first coordinate point, the second coordinate point and the third coordinate point may be as follows:
[0076] The computer device calculates the distance between the first coordinate point and the second coordinate point, and the distance between the second coordinate point and the third coordinate point based on the first coordinate point, the second coordinate point, the third coordinate point, the distance between the first coordinate point and the second coordinate point, and the distance between the second coordinate point and the third coordinate point to obtain a second difference point; and calculates a control point for the movement of the target object based on the second difference point and the second coordinate point.
[0077] Among them, Figure 4 As shown, the computer device calculates the distance between the first coordinate point and the second coordinate point dist=|P1P2|, and the distance between the second coordinate point and the third coordinate point dist2=|P2P3| through the first coordinate point P1 (x1, y1), the second coordinate point P2 (x2, y2) and the third coordinate point P3 (x3, y3).
[0078] Among them, the computer device calculates the second difference point DP2 (dx2, dy2) based on the first coordinate point P1 (x1, y1), the second coordinate point P2 (x2, y2), the third coordinate point P3 (x3, y3), the distance between the first coordinate point and the second coordinate point dist = |P1P2|, and the distance between the second coordinate point and the third coordinate point dist2 = |P2P3|. The calculation process can be: dx2 = (x3–x2) / dist2+(x1–x2) / dist, dy2 = (y3–y2) / dist2+(y1–y2) / dist.
[0079] There are multiple methods for the computer device to calculate the control point for moving the target object according to the second difference point and the second coordinate point:
[0080] For example, the computer device calculates the distance between the second difference point and the origin of the coordinate axis of the coordinate point based on the second difference point and the origin of the coordinate axis of the coordinate point; calculates the third difference point based on the distance between the second difference point and the origin of the coordinate axis of the coordinate point and the pressure applied by the target object on the display screen; and calculates the control point for the movement of the target object based on the third difference point and the second coordinate point.
[0081] Among them, Figure 4 As shown, the computer device obtains the distance dist3 between the second difference point and the origin of the coordinate axis of the coordinate point based on the second difference point DP2 (dx2, dy2) and the origin of the coordinate axis O (0, 0).
[0082] Among them, the computer device calculates the third difference point DP3 (dx3, dy3) based on the distance dist3 between the second difference point and the origin of the coordinate axis of the coordinate point, and the pressure press applied by the target object on the display screen. The calculation process can be: dx3=dx2*press / dist3, dy3=dy2*press / dist3.
[0083] Among them, Figure 4 As shown, the computer device calculates the control points for the movement of the target object according to the third difference point DP3 (dx3, dy3) and the second coordinate point P2 (x2, y2), and the control points include the first control point C1 (cx1, cy1) and the second control point C2 (cx2, cy2). The calculation process may be: cx1 = x2-dx3, cy1 = y2-dy3, cx2 = x2+dx3, cy2 = y2+dy3.
[0084] Specifically, the process of the computer device calculating the starting point and the control point of the target object movement according to the multiple coordinate points can be as follows:
[0085] For example, the computer device takes coordinate points according to the moving trajectory, and the lines between each adjacent coordinate point are equal. The starting point and the control point are calculated based on the initial value g and the coordinate point. For example, any coordinate point on the moving trajectory is (a, b), and the starting point may include multiple groups, and a group of starting points includes two starting points, namely the first sub-starting point G1 (g1, g2) and the second sub-starting point G2 (g3, g4). The calculation process of the first sub-starting point G1 (g1, g2) and the second sub-starting point G2 (g3, g4) can be g1 = a + g, g2 = b + g, g3 = ag, g4 = bg. The control point may include multiple groups, and a group of control points includes two control points. The calculation process of the control point can be the same as the calculation of the starting point, which will not be repeated here.
[0086] 103. Determine the handwriting area where the target object moves according to the starting point, the control point and the coordinate point.
[0087] The handwriting area includes the pen tip handwriting area formed by the movement of the target object.
[0088] Specifically, the computer device can determine the handwriting area where the target object moves according to the starting point, the control point and the fourth coordinate point.
[0089] For example, the computer device connects the starting point, the control point and the coordinate point to obtain the handwriting area where the target object moves.
[0090] Among them, the embodiment of the present application can set the fourth coordinate point P (x, y) to two end points, namely the first end point EP1 (epx1, epy1) and the second end point EP2 (epx2, epy2), epx1=epx2=x, epy1=epy2=y.
[0091] Among them, Figure 5 As shown, the embodiment of the present application can draw a Bezier curve through the first starting point SP1 (spx1, spy1), the first control point C1 (cx1, cy1) and the first end point EP1 (epx1, epy1); connect the first end point EP1 (epx1, epy1) and the second end point EP2 (epx2, epy2); draw a Bezier curve through the second starting point SP2 (spx2, spy2), the second control point C2 (cx2, cy2) and the second end point EP2 (epx2, epy2); connect the first starting point SP1 (spx1, spy1) and the second starting point SP2 (spx2, spy2), so as to form a pen tip handwriting area. Drawing the pen tip handwriting area here is only an example, and the starting point, control point and end point can also be connected in other sequences.
[0092] Of course, the embodiment of the present application may not need to set the fourth coordinate point as the first end point and the second end point, and can directly draw a Bezier curve through the first starting point SP1 (spx1, spy1), the first control point C1 (cx1, cy1) and the fourth coordinate point P (x, y); draw a Bezier curve through the second starting point SP2 (spx2, spy2), the second control point C2 (cx2, cy2) and the fourth coordinate point P (x, y); connect the first starting point SP1 (spx1, spy1) and the second starting point SP2 (spx2, spy2) to form a pen tip handwriting area.
[0093] Specifically, the computer device can determine the handwriting area where the target object moves according to the starting point, the control point and the last coordinate point on the moving track.
[0094] For example, a computer device draws a Bezier curve through a first starting point SP1 (spx1, spy1), a first control point C1 (cx1, cy1) and a last coordinate point; draws a Bezier curve through a second starting point SP2 (spx2, spy2), a second control point C2 (cx2, cy2) and a last coordinate point; connects the first starting point SP1 (spx1, spy1) and the second starting point SP2 (spx2, spy2), thereby forming a pen tip handwriting area.
[0095] 104. Fill the pen tip handwriting area to obtain the pen tip handwriting, and display the pen tip handwriting.
[0096] The pen strokes are displayed on a display screen of a computer device.
[0097] In addition, after step 102, the embodiment of the present application may further include the following contents:
[0098] The computer device calculates the center point of the target object's movement based on the second coordinate point and the third coordinate point; forms a handwriting area based on the starting point, the control point and the center point, and the handwriting area includes a non-pen tip handwriting area; fills the non-pen tip handwriting area to obtain the non-pen tip handwriting, and displays the non-pen tip handwriting.
[0099] In this way, the embodiment of the present application can obtain non-pen tip handwriting through the above method.
[0100] Among them, the non-pen tip handwriting area refers to the general handwriting area, and correspondingly, the non-pen tip handwriting refers to the general handwriting.
[0101] Specifically, the process of the computer device calculating the center point of the target object's movement according to the second coordinate point and the third coordinate point may be as follows:
[0102] The computer device calculates the initial center point of the target object's movement based on the second coordinate point and the third coordinate point; calculates the candidate center point of the target object's movement based on the initial center point, the second coordinate point and the third coordinate point; and calculates the center point of the target object's movement based on the initial center point and the candidate center points.
[0103] Among them, Figure 6 As shown, the embodiment of the present application can determine two initial center points based on the second coordinate point P2 (x2, y2) and the third coordinate point P3 (x3, y3), and the two initial center points are respectively the first initial center point R1 (rx1, ry1) and the second initial center point R2 (rx2, ry2).
[0104] Among them, the embodiment of the present application calculates two candidate center points for the movement of the target object through the initial center point, the second coordinate point and the third coordinate point. The two candidate center points are the first candidate center point R3 (rx3, ry3) and the second candidate center point R4 (rx4, ry4). The calculation process can be: rx3=rx1-x2+x3, ry3=ry1-y2+y3, rx4=rx2-x2+x3, ry4=ry2-y2+y3.
[0105] Among them, the present application calculates the two center points of the target object's movement based on the initial center point and the candidate center point. The two center points are the first center point CT1 (ctx1, cty1) and the second center point CT2 (ctx2, cty2). The calculation process can be: ctx1 = (rx1 + rx3) / 2, cty1 = (ry1 + ry3) / 2, ctx2 = (rx2 + rx4) / 2, cty2 = (ry2 + ry4) / 2.
[0106] In addition, the first center point CT1 (ctx1, cty1) and the second center point CT2 (ctx2, cty2) can be used as the first starting point and the second starting point for drawing the next curve or the stroke, respectively.
[0107] Among them, Figure 7 As shown, the embodiment of the present application draws a Bezier curve through the first starting point SP1, the first control point C1, and the first center point CT1; connects the first center point CT1 and the second center point CT2; draws a Bezier curve through the second control point C2, the second center point CT2, and the second starting point SP2; connects the first starting point SP1 and the second starting point SP2, thereby forming a non-pen handwriting area.
[0108] The process of calculating the initial center point of the target object movement by the computer device according to the second coordinate point P2 (x2, y2) and the third coordinate point P3 (x3, y3) may be as follows:
[0109] The computer device calculates the distance between the second coordinate point and the third coordinate point based on the second coordinate point and the third coordinate point; calculates the second target curvature of the line segment between the second coordinate point and the third coordinate point on the coordinate axis based on the distance between the second coordinate point and the third coordinate point and the coordinate axes of the coordinate points; and calculates the initial center point of the target object's movement based on the second target curvature, the drawing width of the target object on the display screen, and the second coordinate point.
[0110] Among them, the distance between the second coordinate point and the third coordinate point is dist2=|P2P3|.
[0111] Among them, the embodiment of the present application calculates the cosine value between dist2 and the x-axis through the distance dist2 = |P2P3| between the second coordinate point P2 (x2, y2) and the third coordinate point P3 (x3, y3), and the x-axis, and then uses the inverse cosine to obtain the radian α1, rotates 90 degrees, and obtains the second target radian β1 = α1 + π / 2.
[0112] Among them, the embodiment of the present application calculates the initial center points R1 (rx1, ry1), R2 (rx2, ry2) of the target object movement according to the second target arc β1, the drawing width stroke of the target object on the display screen, and the second coordinate point P2 (x2, y2). The specific process can be:
[0113] The computer device calculates the initial difference point DN(nx1, ny2) according to the second target arc β1 and the drawing width stroke of the target object on the display screen, nx1=cos(β1)*stroke=-sin(α1)*stroke, ny1=sin(β1)*stroke=-sin(α1)*stroke. Then, the computer device calculates the first initial center point R1(rx1, ry1) by using the second coordinate point P2(x2, y2) and the initial difference point DN(nx1, ny2), rx1=x2+nx1, ry1=y2+ny2.
[0114] The computer device calculates the second initial center point R2 (rx2, ry2) by using the second coordinate point P2 (x2, y2) and the initial difference point DN (nx1, ny2), where rx2 = x2*2-rx1, ry2 = y2*2-ry1.
[0115] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0116] The embodiment of the present application can obtain the moving trajectory of the target object on the display screen, and obtain multiple coordinate points located on the moving trajectory; calculate the starting point and control point of the target object's movement based on the multiple coordinate points; determine the handwriting area of the target object's movement based on the starting point, the control point and the coordinate point, the handwriting area includes the pen tip handwriting area formed by the movement of the target object; fill the pen tip handwriting area to obtain the pen tip handwriting, and display the pen tip handwriting; because the embodiment of the present application can calculate the starting point, the control point and the fourth coordinate point that can form the pen tip handwriting area through the coordinate points of the moving trajectory of the target object on the display screen, thus handwriting with pen tip characteristics can be obtained.
[0117] In order to better implement the above method, an embodiment of the present application also provides a handwriting display device, which can be integrated into a computer device, such as a server or a terminal, and the terminal may include a tablet computer, a laptop computer and / or a personal computer.
[0118] For example, Figure 8 As shown, the handwriting display device may include an acquisition unit 301, a first calculation unit 302, a determination unit 303, a filling unit 304, and a second calculation unit 305, as follows:
[0119] (1) Acquisition unit 301;
[0120] The acquisition unit 301 may be used to acquire a moving track of a target object on a display screen, and acquire a plurality of coordinate points on the moving track.
[0121] (2) a first computing unit 302;
[0122] The first calculation unit 302 may be configured to calculate a starting point and a control point of the target object's movement according to a plurality of coordinate points.
[0123] In some embodiments, the first calculation unit 302 can be specifically used to calculate the starting point of the target object's movement based on the first coordinate point and the second coordinate point; calculate the control point of the target object's movement based on the first coordinate point, the second coordinate point and the third coordinate point; determine the handwriting area of the target object's movement based on the starting point, the control point and the coordinate point, including: determining the handwriting area of the target object's movement based on the starting point, the control point and the fourth coordinate point.
[0124] In some embodiments, the first calculation unit 302 can be specifically used to calculate the distance between the first coordinate point and the second coordinate point based on the first coordinate point and the second coordinate point; calculate the first target curvature of the line segment between the first coordinate point and the second coordinate point on the coordinate axis based on the distance between the first coordinate point and the second coordinate point, and the coordinate axes of the coordinate points; calculate the starting point of the target object's movement based on the first target curvature, the drawing width of the target object on the display screen, and the first coordinate point.
[0125] In some embodiments, the first calculation unit 302 can be specifically used to calculate a first difference point based on the first target curvature and the drawing width of the target object on the display screen; calculate a first starting point for the movement of the target object based on the first difference point and the first coordinate point; calculate a second starting point for the movement of the target object based on the first starting point and the first coordinate point; and generate a starting point for the movement of the target object based on the first starting point and the second starting point.
[0126] In some embodiments, the first calculation unit 302 can be specifically used to calculate the distance between the first coordinate point and the second coordinate point, and the distance between the second coordinate point and the third coordinate point based on the first coordinate point, the second coordinate point, and the third coordinate point; calculate the second difference point based on the first coordinate point, the second coordinate point, the third coordinate point, the distance between the first coordinate point and the second coordinate point, and the distance between the second coordinate point and the third coordinate point; calculate the control point for the movement of the target object based on the second difference point and the second coordinate point.
[0127] In some embodiments, the first calculation unit 302 can be specifically used to calculate the distance between the second difference point and the origin of the coordinate axis of the coordinate point based on the second difference point and the origin of the coordinate axis of the coordinate point; calculate the third difference point based on the distance between the second difference point and the origin of the coordinate axis of the coordinate point and the pressure applied by the target object on the display screen; calculate the control point for the movement of the target object based on the third difference point and the second coordinate point.
[0128] (3) determining unit 303;
[0129] The determination unit 303 may be used to determine the handwriting area where the target object moves according to the starting point, the control point and the coordinate point. The handwriting area includes the pen tip handwriting area formed by the movement of the target object.
[0130] (4) Filling unit 304;
[0131] The filling unit 304 can be used to fill the pen stroke area to obtain the pen stroke and display the pen stroke.
[0132] (5) a second calculation unit 305;
[0133] The second calculation unit 305 can be used to calculate the center point of the target object's movement based on the second coordinate point and the third coordinate point; form a handwriting area based on the starting point, the control point and the center point, and the handwriting area includes a non-pen tip handwriting area; fill the non-pen tip handwriting area to obtain non-pen tip handwriting, and display the non-pen tip handwriting.
[0134] The second calculation unit 305 can be specifically used to calculate the initial center point of the target object's movement based on the second coordinate point and the third coordinate point; calculate the candidate center point of the target object's movement based on the initial center point, the second coordinate point and the third coordinate point; calculate the center point of the target object's movement based on the initial center point and the candidate center point.
[0135] As can be seen from the above, the acquisition unit 301 of the embodiment of the present application can acquire the moving trajectory of the target object on the display screen, and acquire multiple coordinate points located on the moving trajectory; the first calculation unit 302 can calculate the starting point and control point of the target object's movement based on the multiple coordinate points; the determination unit 303 can determine the handwriting area of the target object's movement based on the starting point, the control point and the coordinate point, and the handwriting area includes the pen tip handwriting area formed by the movement of the target object; the filling unit 304 can be used to fill the pen tip handwriting area to obtain the pen tip handwriting, and display the pen tip handwriting; because the embodiment of the present application calculates the starting point, the control point and the fourth coordinate point that can form the pen tip handwriting area through the coordinate points of the moving trajectory of the target object on the display screen, so that handwriting with pen tip characteristics can be obtained.
[0136] The present application also provides a computer device, such as Fig. 9 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0137] The computer device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Fig. 9 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0138] The processor 401 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 402 and calling data stored in the memory 402, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and computer programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0139] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0140] The computer device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0141] The computer device may further include an input unit 404, which may be used to receive input digital or character information communications and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0142] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the computer device will load the executable files corresponding to the processes of one or more computer programs into the memory 402 according to the following instructions, and the processor 401 will run the computer programs stored in the memory 402, thereby realizing various functions, as follows:
[0143] The moving trajectory of the target object on the display screen is obtained, and a plurality of coordinate points located on the moving trajectory are obtained; based on the plurality of coordinate points, a starting point and a control point of the moving target object are calculated; based on the starting point, the control point and the coordinate point, a handwriting area of the moving target object is determined, the handwriting area includes a pen tip handwriting area formed by the moving target object; the pen tip handwriting area is filled to obtain the pen tip handwriting, and the pen tip handwriting is displayed.
[0144] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0145] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0146] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program can be loaded by a processor to execute any handwriting display method provided in the embodiment of the present application.
[0147] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0148] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0149] Since the instructions stored in the computer-readable storage medium can execute the steps in any one of the handwriting display methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the handwriting display methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0150] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementations provided in the above embodiments.
[0151] The above is a detailed introduction to a handwriting display method and related devices provided in an embodiment of the present application, which include a handwriting display device, a computer device and a computer-readable storage medium. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A handwriting display method, characterized in that: include: Acquire a moving track of the target object on the display screen, and acquire a plurality of coordinate points located on the moving track; Calculating a starting point and a control point for movement of the target object according to the plurality of coordinate points; Determine a handwriting area where the target object moves according to the starting point, the control point and the coordinate point, wherein the handwriting area includes a handwriting area formed by the movement of the target object; Filling the pen tip handwriting area to obtain the pen tip handwriting, and displaying the pen tip handwriting; Calculating a center point of movement of the target object; According to the starting point, the control point and the center point, the handwriting area is formed, wherein the handwriting area includes a non-pen tip handwriting area; The non-pen tip handwriting area is filled to obtain the non-pen tip handwriting, and the non-pen tip handwriting is displayed.
2. The handwriting display method according to claim 1, characterized in that: The coordinate points include a first coordinate point, a second coordinate point, a third coordinate point and a fourth coordinate point; and calculating the starting point and the control point of the target object movement according to the plurality of coordinate points includes: Calculating a starting point of movement of the target object according to the first coordinate point and the second coordinate point; Calculating a control point for moving the target object according to the first coordinate point, the second coordinate point and the third coordinate point; Determining the handwriting area where the target object moves according to the starting point, the control point and the coordinate point includes: determining the handwriting area where the target object moves according to the starting point, the control point and the fourth coordinate point.
3. The handwriting display method according to claim 2, characterized in that: The step of calculating the starting point of the target object's movement according to the first coordinate point and the second coordinate point includes: Calculating a distance between the first coordinate point and the second coordinate point according to the first coordinate point and the second coordinate point; Calculate a first target arc of a line segment between the first coordinate point and the second coordinate point on the coordinate axis according to the distance between the first coordinate point and the second coordinate point and the coordinate axis of the coordinate point; The starting point of the movement of the target object is calculated according to the first target arc, the drawing width of the target object on the display screen, and the first coordinate point.
4. The handwriting display method according to claim 3, characterized in that: The step of calculating the starting point of the target object movement according to the first target arc, the drawing width of the target object on the display screen, and the first coordinate point includes: Calculating a first difference point according to the first target arc and the drawing width of the target object on the display screen; Calculating a first starting point for movement of the target object according to the first difference point and the first coordinate point; Calculating a second starting point for movement of the target object according to the first starting point and the first coordinate point; The starting point of movement of the target object is generated according to the first starting point and the second starting point.
5. The handwriting display method according to claim 2, characterized in that: The step of calculating the control point for moving the target object according to the first coordinate point, the second coordinate point and the third coordinate point includes: According to the first coordinate point, the second coordinate point and the third coordinate point, calculate the distance between the first coordinate point and the second coordinate point, and the distance between the second coordinate point and the third coordinate point; Calculate a second difference point according to the first coordinate point, the second coordinate point, the third coordinate point, the distance between the first coordinate point and the second coordinate point, and the distance between the second coordinate point and the third coordinate point; A control point for moving the target object is calculated according to the second difference point and the second coordinate point.
6. The handwriting display method according to claim 5, characterized in that: The step of calculating the control point for moving the target object according to the second difference point and the second coordinate point includes: Calculating the distance between the second difference point and the origin of the coordinate axis of the coordinate point according to the second difference point and the origin of the coordinate axis of the coordinate point; Calculating a third difference point according to the distance between the second difference point and the origin of the coordinate axis of the coordinate point and the pressure applied by the target object on the display screen; A control point for moving the target object is calculated based on the third difference point and the second coordinate point.
7. The handwriting display method according to claim 2, characterized in that: After calculating the starting point and the control point of the target object movement according to the multiple coordinate points, the method further includes: The center point of movement of the target object is calculated based on the second coordinate point and the third coordinate point.
8. The handwriting display method according to claim 7, characterized in that: The step of calculating the center point of movement of the target object according to the second coordinate point and the third coordinate point includes: Calculating an initial center point of movement of the target object according to the second coordinate point and the third coordinate point; Calculating a candidate center point of movement of the target object according to the initial center point, the second coordinate point and the third coordinate point; The moving center point of the target object is obtained by calculation according to the initial center point and the candidate center point.
9. A handwriting display device, characterized in that: include: An acquisition unit, used to acquire a moving track of the target object on the display screen, and acquire a plurality of coordinate points located on the moving track; A first calculation unit, configured to calculate a starting point and a control point for movement of the target object according to the plurality of coordinate points; A determination unit, configured to determine a handwriting area where the target object moves according to the starting point, the control point and the coordinate point, wherein the handwriting area includes a handwriting area formed by the movement of the target object; A filling unit, used for filling the pen tip handwriting area to obtain the pen tip handwriting and display the pen tip handwriting; A second calculation unit is used to calculate the center point of the target object movement; form the handwriting area according to the starting point, the control point and the center point, and the handwriting area includes a non-pen tip handwriting area; The non-pen tip handwriting area is filled to obtain the non-pen tip handwriting, and the non-pen tip handwriting is displayed.
10. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the handwriting display method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the handwriting display method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method for realizing curve smoothing of original handwriting
CN111857380A