Writing trace display method, device and equipment and readable storage medium
By interpolating and generating brushes during touchscreen writing, the problem of traditional writing methods failing to highlight pen strokes is solved, achieving smooth and aesthetically pleasing writing trajectories while reducing rendering and storage pressure.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU SHIYUAN ELECTRONICS CO LTD
- Filing Date
- 2024-11-11
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional touchscreen writing methods cannot highlight the beauty of traditional calligraphy's pauses and endings, and the rendering effect is poor, resulting in an uneven writing trajectory, increasing rendering pressure and storage space.
Multiple interpolation points are generated by interpolating between adjacent trajectory points. Brushes are generated for each trajectory point and interpolation point. The writing trajectory is displayed according to the brush. The Bezier algorithm is used for interpolation, and the brush width is adjusted by the speed-width model to highlight the brush stroke effect.
It improves the display effect of writing trajectory, highlights the strokes, reduces rendering pressure and storage requirements, and avoids lag.
Smart Images

Figure CN122018770A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of touch technology, and in particular to a writing trajectory display method, apparatus, device, and readable storage medium. Background Technology
[0002] With the rapid development of technology, writing methods have gradually shifted from traditional pen and paper writing to touch screen writing.
[0003] During touchscreen writing, the electronic device acquires a series of trajectory points based on the user's writing operation, connects each trajectory point in sequence, and renders and displays the writing trajectory based on these trajectory points.
[0004] However, traditional writing uses a round brush, resulting in a consistent writing path width and rounded brush tips at the beginning and end of strokes. This fails to highlight the beauty of the pauses and endings in traditional calligraphy, leading to poor display quality. Summary of the Invention
[0005] This application provides a writing trajectory display method, apparatus, device, and readable storage medium. By interpolating between any two adjacent trajectory points to obtain multiple interpolation points, a brush is generated for each trajectory point and interpolation point. The writing trajectory is displayed according to the brushes of each trajectory point and each interpolation point, which highlights the pen stroke effect to a certain extent and achieves the purpose of improving the display effect.
[0006] In a first aspect, embodiments of this application provide a method for displaying writing trajectories, including:
[0007] In response to a writing operation, the trajectory points generated by the writing operation on the screen of the electronic device are acquired;
[0008] Interpolate between every two adjacent trajectory points to obtain multiple interpolation points;
[0009] Determine the brush for each of two adjacent trajectory points, and determine the brush for each interpolation point between the two adjacent trajectory points to obtain multiple brushes. The brushes for the trajectory points are used to indicate the rendering effect of the trajectory points.
[0010] The pen segment outline between two adjacent trajectory points is determined based on the plurality of brushes;
[0011] The writing trajectory is displayed based on the outline of the strokes.
[0012] Secondly, embodiments of this application provide a writing trajectory display device, comprising:
[0013] A response module is used to respond to a writing operation and acquire the trajectory points generated by the writing operation on the screen of the electronic device;
[0014] The interpolation module is used to interpolate between every two adjacent trajectory points to obtain multiple interpolation points;
[0015] The determination module is used to determine the brush of each of two adjacent trajectory points and the brush of each interpolation point between the two adjacent trajectory points to obtain multiple brushes. The brush of the trajectory point is used to indicate the rendering effect of the trajectory point.
[0016] The processing module is used to determine the stroke outline between two adjacent trajectory points based on the plurality of brushes;
[0017] The display module is used to display the writing trajectory according to the outline of the pen segment.
[0018] Thirdly, embodiments of this application provide an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it causes the electronic device to implement the method described in the first aspect or various possible implementations of the first aspect.
[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to implement the method described in the first aspect or various possible implementations of the first aspect.
[0020] Fifthly, embodiments of this application provide a computer program product comprising a computing program, wherein when the computer program is executed by a processor, it implements the method described in the first aspect or various possible implementations of the first aspect.
[0021] The writing trajectory display method, apparatus, device, and readable storage medium provided in this application embodiment involve an electronic device acquiring trajectory points generated by a writing operation on the screen of the electronic device, interpolating between any two adjacent trajectory points to obtain multiple interpolation points, determining the brush for each of the two adjacent trajectory points and the brush for each interpolation point between the two adjacent trajectory points, thereby obtaining multiple brushes. Then, the electronic device determines the stroke outline between two adjacent trajectory points based on the multiple brushes and displays the writing trajectory. Using this scheme, the electronic device obtains multiple interpolation points by interpolating between any two adjacent trajectory points, generates brushes for each trajectory point and interpolation point, and the brushes for each trajectory point and interpolation point are different, resulting in a writing trajectory that varies in thickness and thickness, highlighting the stroke effect to a certain extent and achieving the purpose of improving the display effect. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a comparison image showing the rendering effects without brushstrokes and with brushstrokes.
[0024] Figure 2A This is a schematic diagram of the tangent line obtained from the trajectory points;
[0025] Figure 2B It is a schematic diagram of the stroke outline;
[0026] Figure 3 This is a schematic diagram of a scenario for the writing trajectory display method provided in an embodiment of this application;
[0027] Figure 4 This is a flowchart of the writing trajectory display method provided in the embodiments of this application;
[0028] Figure 5 This is a schematic diagram of the preset brush in the handwriting display method provided in the embodiments of this application;
[0029] Figure 6 This is another flowchart of the writing trajectory display method provided in the embodiments of this application;
[0030] Figure 7 This is a schematic diagram of the velocity width model in the writing trajectory display method provided in the embodiments of this application;
[0031] Figure 8A This is a schematic diagram of the lines connecting trajectory points when no interpolation is performed between them;
[0032] Figure 8B This is a schematic diagram of the interpolated connection in the writing trajectory display method provided in the embodiments of this application;
[0033] Figure 9A This is a schematic diagram of the brush for the trajectory point and the brush for the interpolation point in the writing trajectory display method provided in the embodiments of this application;
[0034] Figure 9B This is a schematic diagram of the broken line phenomenon in the writing trajectory display method provided in the embodiments of this application;
[0035] Figure 9C This is a schematic diagram of the bounding box in the writing trajectory display method provided in the embodiments of this application;
[0036] Figure 10AIt is a schematic diagram of the first intersection point and the second intersection point in the writing trajectory display method provided by an embodiment of the present application;
[0037] Figure 10B It is a schematic diagram of the spliced contour after deleting redundant contour points in the writing trajectory display method provided by an embodiment of the present application;
[0038] Figure 10C It is a schematic diagram of the determination process of the first intersection point and the second intersection point in the writing trajectory display method provided by an embodiment of the present application;
[0039] Figure 11 It is a schematic diagram of a writing trajectory display device provided by an embodiment of the present application;
[0040] Figure 12 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0041] With the popularization of various electronic products, users often need to write or draw on electronic products with writing functions. For example, signing, teaching blackboard writing, or taking notes, etc. Each manufacturer often improves the writing experience by enhancing the writing smoothness and writing aesthetics. For the writing aesthetics, the rendering effect with pen strokes is more vivid and more beautiful than the rendering effect without pen strokes. Exemplarily, please refer to Figure 1 .
[0042] Figure 1 It is a comparison diagram of the rendering effect without pen strokes and the rendering effect with pen strokes. Please refer to Figure 1 , the character "Xia" on the left is the rendering effect without pen strokes, and the character "Xia" on the right is the rendering effect with pen strokes. Obviously, the character "Xia" with the rendering effect of pen strokes is more beautiful than the character "Xia" with the rendering effect without pen strokes, with the thickness of the font strokes alternating and well-proportioned, and the display effect is better.
[0043] To render pen strokes to enhance the display effect of writing strokes, the inventor found that the tangent calculation method is used in the related art. This method includes the following steps:
[0044] Step 1: Obtain the handwriting points written by the user.
[0045] Step 2: Take a circle at each handwriting point according to the preset width and the writing speed between adjacent handwriting points, and calculate the tangent of the circles of adjacent handwriting points. Exemplarily, please refer to Figure 2A and Figure 2B .
[0046] Figure 2A It is a schematic diagram of the tangent obtained from the trajectory points, Figure 2B It is a schematic diagram of the stroke contour. Please refer to Figure 2A, the electronic device successively obtains the trajectory points 21, trajectory point 22, and trajectory point 23. For each trajectory point, a circle is determined according to a preset width and writing speed. For example, the radius of the circle corresponding to the trajectory point 22 is related to the preset width and the writing speed between the trajectory point 21 and the trajectory point 22. After determining the circle for each trajectory point, calculate the tangents of the circles of adjacent two trajectory points.
[0047] Step 3: Take the contour formed by the tangent and the circle as the stroke contour of the three trajectory points.
[0048] Please refer to Figure 2B , the electronic device takes the contour formed by the tangent and the circle as the stroke contour, fills the stroke contour with a predetermined color or pattern, etc., and renders and displays it.
[0049] However, in the above rendering and display method, using a circle as a brush, the beginning and end of the rendered stroke are relatively rigid, that is, the pen tip at the start and end of writing shows a round shape, which cannot highlight the beauty of the traditional calligraphy's pause and retraction of the pen, and cannot achieve Figure 1 the display effect of the character "Xia" shown on the right.
[0050] In addition, directly connecting the circles of adjacent trajectory points with a straight line results in a broken line feeling in the rendered writing trace, that is, the stroke contour is not smooth but jerky, which is not beautiful.
[0051] In addition, the above rendering method results in extra arcs inside the stroke contour, as shown by the dotted line in Figure 2B . The extra arcs increase the pressure of interface rendering. When the number of strokes is large, the number of trajectory points increases sharply, resulting in a sharp increase in the rendering pressure, and then leading to a lag phenomenon. If the writing trace needs to be stored, it will increase additional storage space.
[0052] Based on this, the embodiments of the present application provide a writing trajectory display method, device, equipment, and readable storage medium. By interpolating between any two adjacent trajectory points to obtain multiple interpolation points, generating brushes for each trajectory point and interpolation point, and displaying the writing trajectory according to the brushes of each trajectory point and the brushes of each interpolation point, the pen tip effect is highlighted to a certain extent, and the purpose of improving the display effect can be achieved.
[0053] Figure 3 is a schematic diagram of a scenario of the writing trajectory display method provided by the embodiments of the present application. Please refer to Figure 3The scenario includes an electronic device 300 with a touchscreen. This electronic device 300 can be, for example, a smart interactive flat panel, a mobile phone, a tablet computer, a computer, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, a personal digital assistant (PDA), in-vehicle equipment, wearable devices, etc. Figure 3 The example shown is an electronic device 300, which is a smart interactive flat panel. In meeting or teaching scenarios, electronic device 300 is a large-sized interactive flat panel or electronic blackboard, such as 55 inches, 60 inches, or even larger.
[0054] Writing software is installed on the electronic device 300. After the writing software is launched, a canvas is displayed on the touch screen. The user writes on the canvas using a stylus 31, finger 32, etc., and the electronic device renders and displays the writing trajectory. The canvas color is white by default and can be adjusted to other colors as needed. The writing software can be software that comes pre-installed on the electronic device 300 at the factory, or software that the user installs on the electronic device 300, etc. It is a writing or drawing application software, and this embodiment does not limit the source of the writing software.
[0055] During writing or drawing, the electronic device collects a series of trajectory points and interpolates between any two adjacent trajectory points to obtain multiple interpolation points. For example, after collecting the current trajectory point, the electronic device interpolates between the current trajectory point and the previous trajectory point. Then, the electronic device determines a brush for each of the two adjacent trajectory points and a brush for each interpolation point, thus obtaining multiple brushes. Finally, the electronic device displays the writing trajectory based on these multiple brushes, highlighting the brushstroke effect to some extent and improving the display quality.
[0056] Below, based on Figure 3 The illustrated scenario will be used to provide a detailed description of the writing trajectory display method described in the embodiments of this application. For example, please refer to... Figure 4 .
[0057] Figure 4It is a flowchart of the writing trajectory display method provided by an embodiment of the present application. The execution subject of this embodiment is an electronic device with a touch screen. This embodiment includes:
[0058] 401. In response to a writing operation, obtain the trajectory points generated on the screen of the electronic device by the writing operation.
[0059] During the writing or drawing process, the electronic device collects a series of trajectory points. The number of trajectory points is related to the sampling rate of the electronic device and the writing speed. The higher the sampling rate, the more trajectory points are collected in one second. For example, if the sampling rate is 50 Hz, 50 trajectory points are collected in one second. The slower the writing speed, the more trajectory points are collected in one second. For instance, when drawing 1 cm in 1 second and the sampling rate is 100 Hz, the electronic device collects 100 trajectory points in 1 second.
[0060] 402. Interpolate between every two adjacent trajectory points to obtain multiple interpolation points.
[0061] Generally, the writing speed is often relatively fast, far greater than 1 cm / s. The faster the writing speed, if the sampling rate is very high, the more trajectory points are collected in one second, but the cost of the electronic device is very high; if the sampling rate is relatively low, the fewer trajectory points are collected in one second. In this case, if only rendering the writing trajectory based on the collected trajectory points, there will be a broken line phenomenon.
[0062] To save costs and兼顾普适性, this embodiment of the present application does not need to use an electronic device with a very high sampling rate. Instead, it interpolates between every two adjacent trajectory points to obtain multiple interpolation points. For example, every time the electronic device collects the current trajectory point, it interpolates between the current trajectory point and the previous trajectory point to obtain multiple interpolation points. The interpolation algorithm can adopt the Bezier algorithm, etc., and this embodiment of the present application does not limit it. The Bezier algorithm is an equidistant node interpolation algorithm. Each time interpolation is performed, the interpolation points are located in the middle of the interpolation interval.
[0063] 403. Determine the brush of each of two adjacent trajectory points and determine the brush of each interpolation point between the two adjacent trajectory points to obtain multiple brushes.
[0064] In this embodiment of the present application, the brush refers to the effect rendered by the trajectory point or interpolation point, including the contour shape, texture, filling color, size, etc. As an example, the contour of the preset brush is the contour of the regular script stroke "丶", and the filling color is black or white, etc. Additionally, the contour of the preset brush can also be a circle, an ellipse, a square, etc., and this embodiment of the present application does not limit it. After calculating the width of the trajectory point, the electronic device scales the preset brush according to this width to obtain the brush of the trajectory point. Similarly, after calculating the width of the interpolation point, the preset brush is scaled according to this width to obtain the brush of the interpolation point. It should be noted that there may be an incorrect expression "兼顾普适性" in the original text. It is recommended to check and correct it according to the actual situation. The above translation is based on the existing text.
[0065] Figure 5 It is a schematic diagram of a preset brush in the writing stroke display method provided by an embodiment of the present application. Please refer to Figure 5 , the outline of the preset brush is the outline of the regular script stroke "丶", that is, the outline passing through the first dot of the character. When the outline of the preset brush is the outline of the regular script stroke "丶", the shapes of the brushes of all the track points and the interpolation points are the shapes of the regular script stroke "丶", only the sizes are different, which can make the writing track have the effect of the brush tip of a writing brush and achieve the effect of improving the aesthetics of the writing track.
[0066] In an embodiment of the present application, one factor affecting the display effect is the preset brush, and the other is the speed of each track point. Different speeds make the widths of the brushes of each track point different, and further make the brushes of each track point different and the brushes of each interpolation point different. The preset brush affects the thickness at the start, end and turning points, etc.; the different brushes of each track point and interpolation point make the writing track show the effect of changing from thick to thin and from thin to thick.
[0067] 404. Determine the pen segment outline between two adjacent track points according to the multiple brushes.
[0068] The electronic device obtains the pen segment outline between two adjacent track points by determining the convex hull enclosing multiple brushes, making two tangents between the outlines of every two adjacent brushes, etc. The outline of the brush of the track point is located at both ends of the pen segment outline, and the outline of the brush of the interpolation point is located between the outlines of the brushes of the handwriting points.
[0069] 405. Display the writing track according to the pen segment outline.
[0070] After the electronic device obtains the current track point each time, it determines the pen segment outline between the current track point and the previous track point. After obtaining a new current track point again, the old pen segment outline becomes a part of the overall outline, and the new pen segment outline is continuously displayed on the basis of the overall outline, so as to continuously update the overall outline until the writing operation ends, and the electronic device displays the writing track of this writing operation. The writing tracks of multiple writing operations can be accumulated to obtain the writing track of a character. For example, when the user writes the Chinese character "car" stroke by stroke, a total of four writing operations occur, and each writing operation generates the overall outline of a stroke. In addition, the user can also write connected characters, write English, Arabic numerals, etc., which are not limited in the embodiments of the present application.
[0071] The writing trajectory display method provided in this application involves an electronic device acquiring trajectory points generated by a writing operation on its screen. Interpolation is performed between any two adjacent trajectory points to obtain multiple interpolation points. The brushes for each pair of adjacent trajectory points and the brushes for each interpolation point between adjacent trajectory points are determined, resulting in multiple brushes. Then, the electronic device determines the stroke outline between adjacent trajectory points based on these multiple brushes and displays the writing trajectory. Using this method, the electronic device obtains multiple interpolation points by interpolating between any two adjacent trajectory points, generates brushes for each trajectory point and interpolation point, and the brushes for each trajectory point and interpolation point are different, causing the writing trajectory to exhibit effects of varying thickness and thickness, highlighting the stroke effect to a certain extent and improving the display effect.
[0072] Figure 6 This is another flowchart of the writing trajectory display method provided in this application embodiment. This embodiment includes:
[0073] 601. Obtain the trajectory points of the writing operation.
[0074] In this step, the electronic device continuously collects trajectory points based on the user's writing operations.
[0075] 602. Determine the writing speed of each trajectory point based on the distance and time difference between two adjacent trajectory points.
[0076] For example, each time an electronic device acquires the current trajectory point, it determines the instantaneous velocity of the current trajectory point based on the distance and time difference between the current trajectory point and the previous trajectory point, and uses this instantaneous velocity as the writing speed of the current trajectory point.
[0077] The electronic device uses the following formula (1) to calculate the writing speed of the current trajectory point.
[0078] speed=dist / delta_t formula (1)
[0079] Where speed is the writing speed of the current trajectory point, dist is the distance between the current trajectory point and the previous trajectory point, delta_t is the time interval between the previous trajectory point and the current trajectory point collected by the electronic device, and speed is the writing speed of the current trajectory point.
[0080] 603. Electronic devices determine the width of the brush at each trajectory point.
[0081] For example, the electronic device inputs the writing speed of each trajectory point into the speed width model so that the speed width model outputs the width of each trajectory point.
[0082] In this embodiment, a speed-width model is pre-deployed on the electronic device, and calculating the width based on the speed-width model is one of the keys to brush aesthetics. The speed-width model is embodied, for example, by the following formula (2):
[0083] w = max_w - max_w × (-exp(-alpha× speed) + 1) Formula (2)
[0084] Where w is the width of the trajectory point, max_w is the preset maximum width, alpha is a parameter that controls the stroke effect, with a value range of 0.5-6 and a default value of 1.8. The larger the parameter is, the more obvious the stroke effect will be, and speed is the writing speed of the current trajectory point.
[0085] Figure 7 This is a schematic diagram of the velocity width model in the writing trajectory display method provided in this application embodiment. Please refer to... Figure 7 The x-axis represents speed, and the y-axis represents brush width. To achieve aesthetically pleasing strokes, the brush width at trajectory points or interpolation points should be wider when writing at a slower speed, and narrower when writing at a faster speed. Furthermore, the slope of the speed-width model is initially larger and gradually decreases. This results in a dramatic change in stroke width at the beginning, creating a very noticeable stroke effect.
[0086] 604. Interpolate between every two adjacent trajectory points to obtain multiple interpolation points. At the same time, interpolate the width to obtain the width of each interpolation point.
[0087] For example, electronic devices use algorithms such as Bezier to interpolate between every two adjacent trajectory points to obtain multiple interpolation points, thereby supplementing a sufficient number of points between adjacent trajectory points. When the line formed by connecting the trajectory points and interpolation points in sequence is smooth, the final calculated stroke outline will also be very smooth.
[0088] Figure 8A This is a schematic diagram of the lines connecting trajectory points when no interpolation is performed. Figure 8B This is a schematic diagram of the interpolated connection in the writing trajectory display method provided in the embodiments of this application.
[0089] Please refer to Figure 8A and Figure 8B There are three adjacent trajectory points, namely trajectory point 81, trajectory point 82 and trajectory point 83. Figure 8A In the diagram, trajectory points 81, 82, and 83 are connected sequentially. Clearly, without interpolation, directly connecting adjacent trajectory points will result in a broken line. Figure 8BIn the process, interpolation is performed between trajectory points 81 and 82, and between trajectory points 82 and 83. Then, the interpolated points between trajectory points 81, 81 and 82, 82, 82 and 83, and finally trajectory point 83 are connected sequentially. Clearly, the interpolated lines are smoother and have a better visual effect.
[0090] The electronic device uses the Bezier algorithm to interpolate the coordinates of adjacent trajectory points to determine the positions of multiple interpolation points. Simultaneously, it interpolates the width based on the widths of two adjacent trajectory points to determine the width of each interpolation point.
[0091] During the interpolation process, when the program is initialized, the electronic device loads a preset brush. The x and y coordinates of the preset brush outline are in the range of -1 to 1, and the geometric center of the brush outline is at the origin (0, 0). The coordinates of any outline point on the preset brush outline are represented by (xi, yi), and the coordinates of the trajectory point are represented by (xc, yc). The width of the brush at the trajectory point is w. Then, the coordinates (xj, yj) of any outline point on the brush outline of the interpolation point can be obtained according to the following formula (3):
[0092]
[0093] This approach uses a speed-width model to determine the brush width at each trajectory point, ensuring that the brush width at each stroke point is matched with the writing speed, thereby highlighting the brushstroke effect.
[0094] 605. For each trajectory point, the electronic device scales the preset brush according to the width of the trajectory point to generate the brush of the trajectory point; for each interpolation point, the electronic device scales the preset brush according to the width of the interpolation point to obtain the brush of the interpolation point.
[0095] After obtaining the width of the brush at each trajectory point, the electronic device scales the preset brush according to that width to obtain the brush for each stroke point. For example, the electronic device determines the ratio of the width of the trajectory point to the preset width of the preset brush. When the ratio is greater than 1, the preset brush is enlarged proportionally; when the ratio is less than 1, the preset brush is reduced proportionally.
[0096] Similarly, the electronic device scales the preset brush according to the width of the interpolation point to obtain the brush of the interpolation point.
[0097] Figure 9A This is a schematic diagram of the brush for the trajectory point and the brush for the interpolation point in the writing trajectory display method provided in the embodiments of this application.
[0098] Please refer to Figure 9A, the outlines of the brushes at two adjacent trajectory points are respectively outline 91 and outline 92 in the figure, and outlines 93 to 97 are the outlines of the brushes at the interpolation points. These brush outlines are all obtained by scaling the brush outline of a preset brush.
[0099] 606. Determine the convex hull enclosing the multiple brushes, and the brushes at each interpolation point in the convex hull are located between the brushes at two adjacent trajectory points.
[0100] In the embodiment of the present application, the convex hull is a figure enclosing the brushes at each interpolation point, and this image is a convex polygon. That is to say, if any side of the convex hull is infinitely extended in both directions to obtain a straight line, the other sides of the convex hull are all on the same side of the straight line. Please refer to Figure 9A , the convex hull of the multiple brushes is shown by the dashed line. This convex hull encloses the brushes at two adjacent trajectory points respectively and the brushes at each interpolation point, that is, the multiple brushes are located within the convex hull, and the brushes at each interpolation point are located between the brushes at two adjacent trajectory points.
[0101] If the convex hull is directly used as the pen segment outline between two trajectory points, since there is a straight line in the convex hull that directly connects two handwriting points, it will cause a broken line phenomenon in the writing trajectory. Exemplarily, please refer to Figure 9B .
[0102] Figure 9B is a schematic diagram of the broken line phenomenon in the writing trajectory display method provided by the embodiment of the present application. Please refer to Figure 9A and Figure 9B , since Figure 9A the straight line on the right side of the convex hull in directly connects two trajectory points, resulting in Figure 9B a broken line phenomenon appears on the right side of the second stroke "撇" of the character "夏" in. The red line in the figure is only to highlight the broken line phenomenon and does not mean that the writing trajectory has two colors at the same time.
[0103] It should be noted that Figure 9A and Figure 9B take the case where the straight line on the right side of the convex hull directly connects two trajectory points as an example to illustrate the broken line phenomenon. However, the embodiment of the present application is not limited thereto. In other optional implementation manners, it may also be that the straight line on the left side of the convex hull directly connects two trajectory points, resulting in the broken line phenomenon.
[0104] In order to avoid the broken line phenomenon in the writing trajectory and further improve the pen tip beautification effect, in the embodiment of the present application, the electronic device executes step 606 to repair the convex hull.
[0105] 607. For each brush among the multiple brushes, determine a target point from the outline of each brush among the multiple brushes. The target point is the point with the shortest distance from the multiple points included in the outline of each brush among the multiple brushes to the target line segment, and the target line segment is the side of the convex hull that is far from the brush.
[0106] In this application, each brush outline contains multiple outline points, which are connected sequentially to form the brush outline. Please refer to... Figure 9A The brush outlines of two adjacent trajectory points are outlines 91 and 92 in the figure, respectively. Outlines 93 to 97 are the brush outlines of the interpolation points. The line segment to the right of the convex hull is the target line segment. For each outline from 93 to 97, the electronic device determines the distance between each outline point on that outline and the target line segment. The outline point with the smallest distance is taken as the target point. Since there are a total of 5 interpolation points, the electronic device determines a total of 5 target points.
[0107] 608. Connect the target points of each brush in sequence according to the order of the interpolation points to correct the convex hull and obtain the bounding box, and use the bounding box as the stroke outline between the two adjacent trajectory points.
[0108] Figure 9C This is a schematic diagram of the bounding box in the writing trajectory display method provided in this application embodiment. Please refer to... Figure 9C The electronic device sequentially connects contour 91, five target points, and contour 92, thereby correcting the straight line directly connecting the trajectory points into a line segment sequentially connecting contours 91 to 97. Then, the electronic device replaces the straight line previously connecting two trajectory points with the corrected line segment, thus achieving the purpose of correcting the convex hull.
[0109] This approach uses a bounding box obtained by correcting the convex hull. The bounding box does not have edges that directly connect two trajectory points, resulting in a smoother and more aesthetically pleasing pen outline without any broken lines, thus improving the display effect.
[0110] 609. Determine whether there is a historical trajectory before two adjacent trajectory points. If there is a historical trajectory before two adjacent trajectory points, proceed to step 610; if there is no historical trajectory before two adjacent trajectory points, proceed to step 613.
[0111] For example, assuming two adjacent trajectory points are the current trajectory point and the previous trajectory point, if there are no other historical trajectory points before the previous trajectory point, meaning the two adjacent trajectory points are the two trajectory points initially acquired by the electronic device, it means that the electronic device did not display any writing trajectory before acquiring the current trajectory point. Therefore, the electronic device executes step 613 to display the writing trajectory. If there are other historical trajectory points before the previous trajectory point, it means that the electronic device has already displayed part of the writing trajectory before acquiring the current trajectory point. Therefore, the electronic device executes step 610 to stitch the current pen segment outline and the overall outline to obtain the stitched outline.
[0112] 610. Determine the first and second intersection points of the pen segment outline and the overall outline. The overall outline is generated based on the historical trajectory points of the pen segment outline. The first and second intersection points are located on the two opposite sides of the pen segment outline, respectively.
[0113] In this embodiment, the writing trajectory formed by the trajectory points before two adjacent trajectory points is called the overall contour, and the writing trajectory formed by the current trajectory point and the previous trajectory point after the current trajectory point is collected is called the stroke contour. Since the last trajectory point of the overall contour is the previous trajectory point in the stroke contour, the overall contour and the stroke contour must intersect at two points, which are referred to as the first intersection point and the second intersection point below.
[0114] Figure 10A This is a schematic diagram of the first and second intersection points in the writing trajectory display method provided in this application embodiment. Please refer to... Figure 10A The dotted circle on the left represents the overall outline, and the dotted circle on the right represents the outline of a stroke segment. The intersection of the overall outline and the stroke segment outline is the first intersection point and the second intersection point. The first intersection point and the second intersection point are the splicing points of the stroke segment outline and the overall outline.
[0115] 611. Based on the first intersection point and the second intersection point, the outline of the pen segment and the overall outline are spliced together to obtain the spliced outline.
[0116] After each stroke outline is generated, the electronic device splices the stroke outline and the overall outline together based on their intersection points to obtain a spliced outline. When a stroke outline is generated again, the previously obtained spliced outline becomes the overall outline, thus continuously updating the overall outline until the current writing operation ends.
[0117] 612. Display the writing trajectory based on the spliced outline.
[0118] The electronic device fills the spliced outline with preset colors or patterns to obtain the writing trajectory and render it. It's understandable that when the current trajectory point is captured, the electronic device has already displayed the handwriting corresponding to the overall outline. Therefore, after obtaining the spliced outline, the electronic device only needs to fill the stroke outlines within the spliced outline with colors or patterns and render it.
[0119] By sampling this method, the electronic device continuously splices together the outline of the pen segment and the overall outline, thereby continuously updating and displaying the overall outline until the writing operation is completed, achieving the goal of quickly and accurately displaying the writing trajectory.
[0120] 613. Use the outline of the stroke segment as the overall outline and render it.
[0121] When there are no historical trajectory points, it means that the outline of the stroke is the original writing trajectory. The electronic device will treat the outline of that stroke as the whole outline, fill it with color or pattern, and render and display it.
[0122] Optionally, in the process of updating the overall contour by splicing the segment outline and the overall contour based on the first intersection point and the second intersection point, the electronic device first determines a first set from the segment outline based on the first intersection point and the second intersection point, and then determines a second set from the overall contour based on the first intersection point and the second intersection point. The contour points in the first set are located within the region corresponding to the overall contour, and the contour points in the second set are located within the region corresponding to the segment outline. Then, the electronic device deletes the contour points from the first set from the segment outline and deletes the contour points from the second set from the overall contour, and then splices the remaining contour points of the segment outline and the remaining contour points of the overall contour to update the overall contour.
[0123] For example, the above can be used Figure 10A The overall outline and the segment outlines are used as the spliced outline, which is the updated overall outline. If electronic devices directly... Figure 10A The overall outline shown serves as the basis for displaying the writing trajectory. Filling in colors and other elements on this basis creates the writing trajectory. However, the presence of extra arcs within the strokes increases the rendering load on the interface. This is especially true when there are many strokes, leading to a sharp increase in rendering pressure and causing stuttering. For example, the extra arcs are the outlines within the circles in 10A.
[0124] To avoid this drawback, in this embodiment, the electronic device determines a first set from the stroke outline based on the first intersection point and the second intersection point. The outline points in the first set are located within the region corresponding to the overall outline. That is, the outline points in the first set satisfy conditions 1 and 2. Condition 1: These outline points are outline points on the stroke outline; Condition 2: These outline points are located inside the region formed by the overall outline.
[0125] Simultaneously, the electronic device determines a second set from the overall contour based on the first and second intersection points. The contour points in this second set are located within the region corresponding to the stroke contour. In other words, the contour points in the second set satisfy conditions 3 and 4. Condition 3: These contour points are contour points on the overall contour; Condition 4: These contour points are located inside the region formed by the stroke contour.
[0126] After the electronic device identifies the first and second sets, it deletes the contour points within these two sets. Then, it combines the remaining contour points of the segment contours with the remaining contour points of the overall contour to obtain the combined contour.
[0127] Figure 10B This is a schematic diagram of the stitched outline after deleting redundant outline points in the writing trajectory display method provided in this application embodiment. Figure 10B In the process, redundant contour points were removed, resulting in a spliced contour that does not contain extra arcs, and the spliced contour is consistent with... Figure 10A The shapes of the spliced outlines are the same.
[0128] This approach removes redundant outline points from the spliced outline, thus seamlessly splicing the outlines of individual segments and the overall outline. This reduces the pressure on interface rendering while simultaneously reducing storage space and preventing lag.
[0129] In this embodiment, since the last trajectory point of the overall contour is the previous trajectory point in the segment contour, the overall contour and the segment contour must have an overlapping area, that is, the segment contour and the overall contour must have two intersection points. The following is a detailed explanation of how to determine the first and second intersection points of the segment contour and the overall contour in step 610 above.
[0130] When two adjacent trajectory points have a historical trajectory point before them, it is determined whether there is a first pair of contour points and a second pair of contour points on the pen segment contour that satisfy a first preset condition. The first preset condition means that one of the two adjacent contour points on the pen segment contour is located outside the overall contour, and the other contour point is located on or inside the overall contour. If there are no two pairs of contour points on the pen segment contour that simultaneously satisfy the first preset condition, it indicates that the writing operation has failed. When there are a first pair of contour points and a second pair of contour points on the pen segment contour that satisfy the first preset condition, the electronic device determines a first intersection point and a second intersection point based on the first pair of contour points and the second pair of contour points.
[0131] Figure 10C This is a schematic diagram illustrating the process of determining the first intersection point and the second intersection point in the writing trajectory display method provided in this application embodiment.
[0132] Please refer to Figure 10C The closed dashed line on the left represents the overall outline, and the closed dashed line on the right represents the segment outline. In determining the first and second intersection points, the electronic device takes all two adjacent outline points on the segment outline, for example... Figure 10C Contour points B and D are selected. The system then determines whether these two contour points satisfy a first preset condition. The determination shows that contour point B is located outside the overall contour, while contour point D is located inside the overall contour. Therefore, contour points B and D are the first pair of contour points that satisfy the first preset condition. If contour points B and D do not satisfy the first preset condition, the electronic device continues to select two other adjacent contour points on the contour of the segment to continue searching for contour point pairs that satisfy the first preset condition. The electronic device can use methods such as ray casting to determine whether a contour point is located outside the overall contour.
[0133] After the electronic device determines the first pair of contour points, it uses the same method to determine the second pair of contour points from the adjacent contour points contained in the stroke contour. The second pair of contour points is not marked in the figure.
[0134] After the electronic device determines the first pair of contour points and the second pair of contour points, the intersection of the line connecting the first pair of contour points and the overall contour is taken as the first intersection point. The intersection of the line connecting the second pair of contour points and the overall contour is taken as the second intersection point.
[0135] It should be noted that, Figure 10C The example described uses the intersection of the line connecting the first pair of contour points and the overall contour as the first intersection point, that is, the intersection of the line connecting contour point B and contour point D with the overall contour as the first intersection point. However, the embodiments of this application are not limited to this. When the first intersection point and contour point D are the first pair of contour points, since the first intersection point is also a contour point on the overall contour, the contour point on the overall contour among the first pair of contour points can be used as the first intersection point.
[0136] Furthermore, it should be noted that although in the above embodiments, the electronic device determines the first intersection point and the second intersection point based on the first pair of contour points and the second pair of contour points on the outline of the pen segment that satisfy the first preset condition, this application embodiment is not limited thereto. In other feasible implementations, the electronic device may also determine the first intersection point and the second intersection point based on the third pair of contour points and the fourth pair of contour points on the overall outline that satisfy the second preset condition.
[0137] Please refer to Figure 10C The closed dashed line on the left represents the overall outline, and the closed dashed line on the right represents the segment outline. In determining the first and second intersection points, the electronic device takes all two adjacent outline points on the overall outline, for example... Figure 10C Contour point A and contour point C are identified. Next, it is determined whether these two contour points satisfy the second preset condition. The determination reveals that contour point A is located outside the contour of the stroke segment, while contour point C is located inside the contour of the stroke segment. Therefore, contour points A and C are the third pair of contour points that satisfy the second preset condition.
[0138] Subsequently, the electronic device uses the same method to determine the fourth pair of contour points from the adjacent contour points contained in the overall contour. The fourth pair of contour points is not marked in the figure.
[0139] After the electronic device determines the third pair of contour points and the fourth pair of contour points, the intersection of the line connecting the third pair of contour points and the overall contour is taken as the first intersection point. The intersection of the line connecting the fourth pair of contour points and the overall contour is taken as the second intersection point.
[0140] After the electronic device determines the first and second intersection points, it deletes redundant points in between based on the positions of the first and second intersection points, thus obtaining the final overall stroke outline, such as... Figure 10B As shown.
[0141] Using this approach, the electronic device traverses adjacent contour points on the line segment outline and determines whether the adjacent contour points meet the first preset condition, thereby achieving the goal of accurately and quickly determining the first intersection point and the second intersection point.
[0142] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0143] Figure 11 This is a schematic diagram of a writing trajectory display device provided in an embodiment of this application. The writing trajectory display device 1100 includes: a response module 111, an interpolation module 112, a determination module 113, a processing module 114, and a display module 114.
[0144] The response module 111 is used to respond to a writing operation and acquire the trajectory points generated by the writing operation on the screen of the electronic device;
[0145] Interpolation module 112 is used to interpolate between every two adjacent trajectory points to obtain multiple interpolation points;
[0146] The determining module 113 is used to determine the brush of each of two adjacent trajectory points and the brush of each interpolation point between the two adjacent trajectory points to obtain multiple brushes. The brush of the trajectory point is used to indicate the rendering effect of the trajectory point.
[0147] Processing module 114 is used to determine the stroke outline between two adjacent trajectory points based on the plurality of brushes;
[0148] Display module 114 is used to display the writing trajectory according to the outline of the pen segment.
[0149] In one feasible implementation, the processing module 114 is used to determine the convex hull surrounding the plurality of brushes, wherein each interpolation point of the brush in the convex hull is located between two adjacent trajectory points of the brushes. For each of the plurality of brushes, a target point is determined from the contour of each of the plurality of brushes. The target point is the point with the shortest distance to the target line segment among the multiple contour points contained in the contour of each of the plurality of brushes. The target line segment is the edge away from the brush among the edges contained in the convex hull. The target points of each brush are connected sequentially according to the order of the interpolation points to correct the convex hull to obtain a bounding box. The bounding box is used as the stroke contour between the two adjacent trajectory points.
[0150] In a feasible implementation, the processing module 114 is further configured to determine a first intersection point and a second intersection point of the pen segment contour and the overall contour when there are historical trajectory points before the two adjacent trajectory points. The overall contour is generated based on the historical trajectory points before the pen segment contour. The first intersection point and the second intersection point are respectively located on two opposite sides of the pen segment contour. The pen segment contour and the overall contour are spliced according to the first intersection point and the second intersection point to obtain a spliced contour.
[0151] The display module 114 is configured to display the writing trajectory according to the spliced contour.
[0152] In a feasible implementation, when the processing module 114 splices the pen segment contour and the overall contour according to the first intersection point and the second intersection point to update the overall contour, it is configured to determine a first set from the pen segment contour according to the first intersection point and the second intersection point, and a second set determined from the overall contour according to the first intersection point and the second intersection point. The contour points in the first set are located in the area corresponding to the overall contour, and the contour points in the second set are located in the area corresponding to the pen segment contour. The contour points in the first set are deleted from the pen segment contour, and the contour points in the second set are deleted from the overall contour. The remaining contour points of the pen segment contour and the remaining contour points of the overall contour are spliced to obtain the spliced contour.
[0153] In a feasible implementation, when the determination module 113 determines the pen brushes of two adjacent trajectory points respectively, it is configured to determine the writing speed corresponding to each of the two adjacent trajectory points. The writing speeds of each trajectory point are input into a speed-width model, so that the speed-width model outputs the width of each trajectory point. For each trajectory point, the preset pen brush is scaled according to the width of the trajectory point to generate the pen brush of the trajectory point.
[0154] In a feasible implementation, the contour of the preset pen brush is the contour of the regular script stroke "丶".
[0155] The writing=16]]The writing trajectory display device provided by the embodiments of the present application can perform the actions of the electronic device in the above embodiments, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0156] Figure 12 It is a schematic structural diagram of the electronic device provided by the embodiments of the present application. The electronic device is, for example, the above intelligent interactive flat panel, etc. Please refer to Figure 12 The electronic device 1200 described in the embodiments of the present application includes: at least one processor 121, at least one communication bus 122, a user interface 123, at least one network interface 124, and a memory 125.
[0157] The communication bus 122 is used to enable communication between these components.
[0158] The user interface 123 may include a display screen and a camera. Optionally, the user interface 123 may also include a standard wired interface and a wireless interface.
[0159] The network interface 124 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0160] The processor 121 may include one or more processing cores. The processor 121 connects to various parts within the electronic device 1200 using various interfaces and lines, and performs various functions and processes data of the electronic device 1200 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 125, and by calling data stored in the memory 125. Optionally, the processor 121 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 121 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the panoramic sphere required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 121 and may be implemented as a separate chip.
[0161] The memory 125 may include random access memory (RAM) or read-only memory. Optionally, the memory 125 may include a non-transitory computer-readable storage medium. The memory 125 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 125 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 125 may also be at least one storage device located remotely from the aforementioned processor 121. Figure 12 As shown, the memory 125, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and operating applications for electronic devices.
[0162] This application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to implement the writing trajectory display method described above.
[0163] This application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the writing trajectory display method described above.
[0164] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0165] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0166] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0167] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0168] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0169] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0170] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0171] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0172] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for displaying writing trajectories, characterized in that, Applied to electronic devices, the method includes: In response to a writing operation, the trajectory points generated by the writing operation on the screen of the electronic device are acquired; Interpolate between every two adjacent trajectory points to obtain multiple interpolation points; Determine the brush for each of two adjacent trajectory points, and determine the brush for each interpolation point between the two adjacent trajectory points to obtain multiple brushes. The brushes for the trajectory points are used to indicate the rendering effect of the trajectory points. The pen segment outline between two adjacent trajectory points is determined based on the plurality of brushes; The writing trajectory is displayed based on the outline of the strokes.
2. The method according to claim 1, characterized in that, Determining the stroke outline between two adjacent trajectory points based on the plurality of brushes includes: Determine the convex hull that surrounds the plurality of brushes, wherein the brush at each interpolation point in the convex hull is located between brushes at two adjacent trajectory points; For each of the plurality of brushes, a target point is determined from the contour of each of the plurality of brushes. The target point is the point with the shortest distance to the target line segment among the multiple contour points contained in the contour of each of the plurality of brushes. The target line segment is the edge that is far away from the brush among the edges contained in the convex hull. Connect the target points of each brush sequentially according to the interpolation points to correct the convex hull and obtain the bounding box. Use the bounding box as the stroke outline between two adjacent trajectory points.
3. The method according to claim 1, characterized in that, The step of displaying the writing trajectory based on the outline of the strokes includes: When there are historical trajectory points before the two adjacent trajectory points, the first intersection point and the second intersection point of the stroke outline and the overall outline are determined. The overall outline is generated based on the historical trajectory points before the stroke outline. The first intersection point and the second intersection point are located on two opposite sides of the stroke outline, respectively. By splicing the pen segment outline and the overall outline based on the first intersection point and the second intersection point, a spliced outline is obtained; The writing trajectory is displayed based on the spliced outline.
4. The method according to claim 3, characterized in that, The step of splicing the segment outline and the overall outline based on the first intersection point and the second intersection point to obtain the spliced outline includes: A first set is determined from the stroke outline based on the first intersection point and the second intersection point, and a second set is determined from the overall outline based on the first intersection point and the second intersection point. The outline points in the first set are located within the region corresponding to the overall outline, and the outline points in the second set are located within the region corresponding to the stroke outline. Delete the contour points in the first set from the stroke contour, and delete the contour points in the second set from the overall contour; The remaining contour points of the stroke outline and the remaining contour points of the overall outline are spliced together to obtain the spliced outline.
5. The method according to any one of claims 1 to 4, characterized in that, The process of determining the brush for each of two adjacent trajectory points includes: Determine the writing speed corresponding to each of two adjacent trajectory points; The writing speed of each trajectory point is input into the speed width model so that the speed width model outputs the width of each trajectory point; For each trajectory point, a preset brush is scaled according to the width of the trajectory point to generate the brush for that trajectory point.
6. The method according to claim 5, characterized in that, The outline of the preset brush is the outline of the regular script stroke "丶".
7. A writing trajectory display device, characterized in that, The device includes: a response module, configured to obtain the trajectory points generated on the screen of the electronic device in response to a writing operation; an interpolation module, configured to interpolate between every two adjacent trajectory points to obtain a plurality of interpolation points; a determination module, configured to determine the brush of each of two adjacent trajectory points and determine the brush of each interpolation point between the two adjacent trajectory points, so as to obtain a plurality of brushes, where the brush of the trajectory point is used to indicate the rendering effect of the trajectory point; a processing module, configured to determine the pen segment outline between the two adjacent trajectory points according to the plurality of brushes; a display module, configured to display the writing trajectory according to the pen segment outline.
8. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the method according to any one of claims 1 to 6 is implemented.