Method and terminal for fast generation of handwritten Chinese character animation

By generating a set of connecting points and connecting data for Chinese characters, the real handwriting process is simulated, solving the problem of inflexible display of Chinese character writing in existing technologies, and providing a realistic and vivid user experience and storage efficiency.

CN119091007BActive Publication Date: 2025-11-28福建天晴在线互动科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411020853.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2025-11-28
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

Existing methods for displaying Chinese character writing cannot simulate the real writing process, and are limited by storage space and complexity, making it difficult to flexibly generate the writing process of Chinese characters, resulting in a poor user experience.

Method used

By acquiring matching data of the target Chinese character, a set of connecting points for each stroke is generated, and connecting data is generated by applying connecting matching rules to simulate the real handwriting process and draw the Chinese character animation stroke by stroke.

Benefits of technology

It provides a realistic and vivid Chinese character writing experience, saves storage space, flexibly meets user needs, and is suitable for a variety of application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091007B_ABST
    Figure CN119091007B_ABST
Patent Text Reader

Abstract

The application discloses a method and a terminal for generating a handwriting Chinese character animation quickly, acquires a target Chinese character for which a handwriting Chinese character animation is to be generated, selects matching data corresponding to the target Chinese character in a Chinese character database, generates a connecting point set of each stroke including a starting vertex and an ending vertex according to the matching data, applies a connecting line matching rule to the connecting points in the connecting point set for connecting line matching to generate connecting line data of the corresponding stroke, and generates a handwriting Chinese character animation of the target Chinese character according to stroke orders of all strokes of the target Chinese character and the connecting line data. The application can acquire connecting line related information corresponding to the target Chinese character more accurately and quickly based on data matching, generates connecting line data of each stroke in real time, simulates real handwriting, realizes strokes of Chinese characters appearing one by one, helps learners to understand and practice Chinese character writing better, has a more real and vivid experience, saves storage space, and is not limited by storage or performance.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of dynamic generation, in particular to a method for quickly generating handwriting Chinese character animation and a terminal. BACKGROUND

[0002] In some existing game development, software development or virtual reality scenes, pre-rendered animation or vector graphics-based methods are used to show the writing process of Chinese characters, which are specifically introduced as follows:

[0003] 1. Pre-rendered animation: In this method, the stroke animation of each Chinese character is created in advance. The animation can be a video file or a sequence of frame-by-frame rendered images, showing the entire process from the beginning to the end of the stroke. However, pre-rendered animation is not flexible enough to generate new Chinese character animation instantly according to user input. The pre-created stroke animation also occupies a large storage space and becomes impractical when extended to a large number of Chinese characters.

[0004] 2. Vector graphics-based method: This method uses SVG or other vector graphics formats to draw Chinese character strokes. This method can generate strokes in real time and supports scaling without distortion. However, although the vector graphics method is more flexible and scalable than pre-rendered animation, it usually does not include complex writing effects such as speed changes, so it may appear mechanical and unnatural.

[0005] In summary, the existing text writing display methods cannot simulate the real writing process, and are affected by factors such as storage space and character complexity, and cannot flexibly generate the writing process of Chinese characters according to user needs, resulting in poor user experience. SUMMARY

[0006] The technical problem to be solved by the present application is to provide a method for quickly generating handwriting Chinese character animation and a terminal, which can generate handwriting animation of Chinese characters in real time, accurately and in a simulated real way, and improve user experience.

[0007] To solve the above technical problems, the technical scheme adopted by the present application is:

[0008] A method for quickly generating handwriting Chinese character animation, comprising the following steps:

[0009] S1. Obtain a target Chinese character for which handwriting animation is to be generated, and select matching data corresponding to the target Chinese character in a Chinese character database;

[0010] S2. Generate a set of connecting points for each stroke according to the matching data, the set of connecting points including connecting points including a starting vertex and an ending vertex;

[0011] S3, apply a connection line matching rule to the connection points in the connection point set to perform connection line matching, and generate connection line data of the corresponding strokes;

[0012] S4, generate a handwritten Chinese character animation of the target Chinese character according to the stroke order of all strokes of the target Chinese character and the connection line data.

[0013] To solve the above technical problems, another technical solution adopted by the present application is:

[0014] A terminal for quickly generating a handwritten Chinese character animation, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0015] S1, obtaining a target Chinese character for which a handwritten Chinese character animation is to be generated, and selecting matching data corresponding to the target Chinese character from a Chinese character database;

[0016] S2, generating a connection point set of each stroke according to the matching data, wherein the connection point set comprises connection points including a starting vertex and an ending vertex;

[0017] S3, applying a connection line matching rule to the connection points in the connection point set to perform connection line matching, and generate connection line data of the corresponding strokes;

[0018] S4, generating a handwritten Chinese character animation of the target Chinese character according to the stroke order of all strokes of the target Chinese character and the connection line data.

[0019] The present application has the advantages of providing a method and a terminal for quickly generating a handwritten Chinese character animation. After obtaining a target Chinese character for which a handwritten Chinese character animation is to be generated by a user, the connection point set of each stroke of the target Chinese character is determined through database matching, and then the connection line data of the strokes is generated in combination with the connection line matching rule. Finally, the handwritten Chinese character animation is generated according to the connection line data of each stroke and the stroke order of all strokes. Based on data matching, the connection line related information of the corresponding target Chinese character can be more accurately and quickly obtained, and then the depiction of each stroke during real handwriting is simulated through the generation of the connection line data of each stroke, so that the Chinese characters appear stroke by stroke, which helps learners better understand and practice Chinese character writing, and has a more realistic and vivid experience. The real-time generation of the animation can save storage space and is not limited by storage or performance, and can flexibly meet the needs of users. BRIEF DESCRIPTION OF DRAWINGS

[0020] Figure 1 A step schematic diagram of a method for quickly generating a handwritten Chinese character animation according to the present application;

[0021] Figure 2A flowchart of a method for quickly generating a handwritten Chinese character animation according to an embodiment of the present application;

[0022] Figure 3 A flowchart of a method for quickly generating a handwritten Chinese character animation according to an embodiment of the present application obtaining vertex data and center point data from the matching data;

[0023] Figure 4 A flowchart of a method for quickly generating a handwritten Chinese character animation according to an embodiment of the present application calculating the corresponding start vertex and end vertex according to the vertex data and center point data of the stroke;

[0024] Figure 5 A flowchart of a method for quickly generating a handwritten Chinese character animation according to an embodiment of the present application generating a set of connecting points for each stroke;

[0025] Figure 6 A flowchart of a method for quickly generating a handwritten Chinese character animation according to an embodiment of the present application generating connecting data according to the set of connecting points;

[0026] Figure 7 A flowchart of a method for quickly generating a handwritten Chinese character animation according to an embodiment of the present application generating a handwritten Chinese character animation.

[0027] Figure 8 A system block diagram of a terminal for quickly generating a handwritten Chinese character animation according to the present application.

[0028] Label explanation:

[0029] 1. A terminal for quickly generating a handwritten Chinese character animation. 2. A memory. 3. A processor. DETAILED DESCRIPTION

[0030] To explain the technical content, purposes and effects of the present application in detail, the following embodiments are described with reference to the accompanying drawings.

[0031] The specific application scenarios of the present application include but are not limited to the following aspects:

[0032] I. Educational software and applications

[0033] Chinese character learning tools: Provide dynamic stroke order display to help learners correctly master the writing method of Chinese characters.

[0034] Language teaching platform: Enhance the understanding of Chinese character structure and writing rules for non-native learners.

[0035] Online classroom and educational games: Increase interactivity through animation to improve learning interest and effectiveness.

[0036] II. Design and Document Processing Software

[0037] Font Design Software: Automatically generates handwritten animation of Chinese characters, assisting designers in creating fonts.

[0038] Document Editing Tool: Embeds handwritten Chinese character animation in documents, enriching display effects.

[0039] III. Media and Entertainment Industry

[0040] Film and Television Post-Production: Adds handwritten Chinese character special effects to film and television works.

[0041] Advertising Design: Uses handwritten Chinese character animation to attract audience attention and improve advertising dissemination effects.

[0042] Game Development:

[0043] Character Interaction Design: Characters write letters or perform other writing behaviors in the game, displaying real handwriting.

[0044] User Interface (UI) Design: Uses handwritten Chinese character animation to enhance the aesthetics and user experience of game interfaces.

[0045] IV. Virtual Reality (VR) and Augmented Reality (AR)

[0046] VR / AR Education Application: Simulates the writing process in a virtual environment, providing an immersive learning experience.

[0047] Cultural Display and Dissemination: Uses handwritten Chinese character animation to introduce Chinese calligraphy art in museums or exhibitions.

[0048] V. Human-Computer Interaction Systems

[0049] Smart Assistants and Chatbots: Respond to user input by generating handwritten handwriting, providing a more natural interaction experience.

[0050] Signature Verification System: Simulates the real signature process for identity verification or intent confirmation.

[0051] Please refer to Figures 1 to 7 A method for quickly generating handwritten Chinese character animation, including the following steps:

[0052] S1, Obtain the target Chinese character for which handwritten Chinese character animation needs to be generated, and select matching data corresponding to the target Chinese character in the Chinese character database;

[0053] S2, Generate a set of connecting points for each stroke based on the matching data, including the connecting points of the starting vertex and the ending vertex;

[0054] S3, apply the connection line matching rule to the connection line points in the connection line point set to generate connection line data of the corresponding strokes;

[0055] S4, generate the handwritten Chinese character animation of the target Chinese character according to the stroke order of all strokes of the target Chinese character and the connection line data.

[0056] From the above description, the beneficial effects of the present application are that after obtaining the target Chinese character that the user wants to generate the handwritten Chinese character animation, the connection point set of each stroke of the target Chinese character is determined through the database matching mode, and then the connection line data of the strokes is generated in combination with the connection line matching rule, and finally the handwritten Chinese character animation is generated according to the connection line data of each stroke and the stroke order of all strokes. Based on data matching, the connection line related information corresponding to the target Chinese character can be more accurately and quickly obtained, and then the connection line data of each stroke is generated to simulate the description of each stroke during real handwriting, so that the Chinese characters appear stroke by stroke, which helps learners better understand and practice Chinese character writing, has a more real and vivid experience, and the real-time animation generation mode can save storage space and is not limited by storage or performance. Flexible to meet user needs.

[0057] Further, the selecting matching data corresponding to the target Chinese character in the Chinese character database specifically comprises:

[0058] Selecting the stroke composition corresponding to the target Chinese character and the vertex data and center point data of each stroke in the stroke composition in the Chinese character database as the matching data.

[0059] From the above description, in the Chinese character database, all strokes of Chinese characters and center point data and vertex data of each stroke are taken as matching data, which not only improves the accuracy and convenience of matching multiple target Chinese characters, but also helps to analyze the connection mode of each stroke subsequently.

[0060] Further, the step S2 specifically comprises:

[0061] S21, calculating the starting vertex and the ending vertex of the corresponding stroke according to the vertex data and the center point data;

[0062] S22, generating connection point data between the starting vertex and the ending vertex to obtain the connection point set.

[0063] From the above description, for each stroke, the set of connecting points from the starting vertex to the ending vertex is divided, so that the stroke is drawn in a more detailed point-by-point drawing manner, which is not prone to errors and helps to introduce stroke speed changes and other factors for simulating real handwritten stroke effects during drawing, making the final handwritten animation effect more realistic and vivid, and improving the viewing experience of users.

[0064] Further, the step S3 comprises:

[0065] S31, selecting a preset number of consecutive connecting points in the set of connecting points according to the connecting order from the starting vertex;

[0066] S32, selecting one of a straight line, a Bezier curve, a quadratic curve or a cubic Bezier curve as a target line segment, fitting the selected connecting points with the target line segment, and determining whether the average or variance of the distances of all the connecting points to the target line segment is greater than or equal to a corresponding threshold value, if yes, determining the target line segment as the connecting mode, otherwise, reselecting the target line segment and determining;

[0067] S33, integrating all the connecting modes belonging to the same set of connecting points to obtain the connecting data.

[0068] From the above description, when studying the drawing of each stroke, the connecting mode is determined from the connecting matching rule according to the connecting order of the divided connecting points and the position relationship between the selected connecting points, which is suitable for accurately analyzing the connecting of more different strokes, so as to generate handwritten stroke animation of each stroke in the subsequent.

[0069] Further, the step S4 comprises:

[0070] S41, generating handwritten stroke animation of the corresponding stroke according to the connecting data;

[0071] S42, generating the handwritten Chinese character animation according to the stroke order of all strokes of the target Chinese character and the handwritten stroke animation.

[0072] From the above description, when generating handwritten animation, handwritten stroke animation of the corresponding stroke is first generated through connecting data, and then handwritten Chinese character animation is generated according to the stroke order of all strokes of the target Chinese character and the handwritten stroke animation, which simulates reality and enhances the viewing effect, especially when applied in calligraphy practice, game development and other scenes, which can significantly improve the interactive experience of users.

[0073] Please refer to Figures 2 to 8The application discloses a terminal 1 for quickly generating handwriting Chinese character animation, which comprises a memory 2, a processor 3 and a computer program stored in the memory 2 and capable of running on the processor 3, and the processor 3 realizes the following steps when executing the computer program:

[0074] S1, obtaining a target Chinese character for which handwriting Chinese character animation needs to be generated, and selecting matching data corresponding to the target Chinese character in a Chinese character database;

[0075] S2, generating a connection point set of each stroke according to the matching data, wherein the connection point set comprises connection points including a starting vertex and an ending vertex;

[0076] S3, applying a connection matching rule to the connection points in the connection point set to generate connection data of the corresponding stroke;

[0077] S4, generating handwriting Chinese character animation of the target Chinese character according to stroke orders of all strokes of the target Chinese character and the connection data.

[0078] As can be seen from the above description, the application has the beneficial effects that after obtaining a target Chinese character for which handwriting Chinese character animation needs to be generated by a user, the connection point set of each stroke of the target Chinese character is determined through database matching, and then the connection data of the stroke is generated in combination with the connection matching rule, and finally the handwriting Chinese character animation is generated according to the connection data of each stroke and the stroke orders of all strokes. Based on data matching, the connection related information of the corresponding target Chinese character can be more accurately and quickly obtained, and then the description of each stroke during real handwriting is simulated through the generation of the connection data of each stroke, the Chinese character appears stroke by stroke, which helps learners better understand and practice Chinese character writing, has a more real and vivid experience, the real-time generation of animation can save storage space, is not limited by storage or performance, and flexibly meets the user demand.

[0079] Further, the selecting of the matching data corresponding to the target Chinese character in the Chinese character database specifically comprises:

[0080] selecting, in the Chinese character database, the stroke composition corresponding to the target Chinese character and the vertex data and center point data of each stroke in the stroke composition as the matching data.

[0081] As can be seen from the above description, in the Chinese character database, all strokes of the Chinese character and the center point data and vertex data of each stroke are taken as the matching data, which not only can improve the accuracy and convenience when multiple target Chinese characters are matched, but also helps to analyze the connection mode of each stroke subsequently.

[0082] Further, the step S2 specifically comprises:

[0083] S21, calculate the start vertex and the end vertex of the corresponding stroke according to the vertex data and the center point data;

[0084] S22, generate the connecting point data between the start vertex and the end vertex to obtain the connecting point set.

[0085] From the above description, for each stroke, the connecting point set from the start vertex to the end vertex is divided, so that the stroke is drawn in a more detailed point-by-point drawing manner, which is not easy to make mistakes, and helps to introduce stroke speed changes and other factors for simulating real handwritten stroke effects during drawing, so that the final handwritten animation effect is more realistic and vivid, and the user's viewing experience is improved.

[0086] Further, the step S3 comprises:

[0087] S31, selecting a preset number of continuous connecting points in the connecting point set from the start vertex according to the connecting order;

[0088] S32, selecting one of a straight line, a Bezier curve, a quadratic curve or a Bezier cubic curve as a target line segment, fitting the selected connecting points with the target line segment, and determining whether the average or variance of the distances of all connecting points to the target line segment is greater than or equal to a corresponding threshold value, if yes, determining the target line segment as the connecting mode, otherwise, reselecting the target line segment and determining;

[0089] S33, integrating all the connecting modes belonging to the same connecting point set to obtain the connecting data.

[0090] From the above description, when studying the drawing of each stroke, the connecting mode is determined from the connecting matching rule according to the connecting order of the divided connecting points and the position relationship between the selected connecting points, which is suitable for accurately analyzing the connecting of more different strokes, so as to generate handwritten stroke animation of each stroke in the subsequent.

[0091] Further, the step S4 comprises:

[0092] S41, generating a handwritten stroke animation of the corresponding stroke according to the connecting data;

[0093] S42, generating the handwritten Chinese character animation according to the stroke order of all strokes of the target Chinese character and the handwritten stroke animation.

[0094] From the above description, in generating a handwriting animation, the handwriting stroke animation of the corresponding stroke is generated through the connection data, and then the handwriting Chinese character animation is generated according to the stroke order of all strokes of the target Chinese character and the handwriting stroke animation, so that the real effect is simulated and the viewing effect is enhanced. Especially when applied to calligraphy practice, game development and other scenes, the interactive experience of users can be significantly improved.

[0095] Please refer to Figures 1 to 7 , the embodiment one of the present application is:

[0096] A method for quickly generating handwriting Chinese character animation, comprising the following steps:

[0097] S1, obtaining a target Chinese character for which handwriting Chinese character animation needs to be generated, and selecting matching data corresponding to the target Chinese character from a Chinese character database;

[0098] In this embodiment, in combination with Figure 2 , the target Chinese character for which handwriting Chinese character animation needs to be generated can be the Chinese character input by the user on the display interface, and the number of target Chinese characters can be one or more. When there are multiple target Chinese characters, the matching data corresponding to each target Chinese character is selected from the Chinese character database one by one. If there is no matching data corresponding to the current target Chinese character, the selection action is continued for the next target Chinese character. The Chinese character database contains various Chinese characters, and each Chinese character has corresponding strokes, and each stroke has vertex data and center point data. In combination with Figure 3 , the stroke composition corresponding to the target Chinese character and the vertex data and center point data of each stroke in the stroke composition are selected as the matching data.

[0099] It should be noted that in this embodiment, based on conventional cognition, the definition of a stroke is that each Chinese character can be written and drawn by one stroke or multiple strokes, and the writing and drawing of each stroke is called a stroke. Furthermore, the vertex data is defined as the set of key vertices of the boundary of the drawing of each stroke, and the center point data is defined as the set of key vertices of the middle position of the writing of each stroke.

[0100] S2, generating a connection point set of each stroke according to the matching data, the connection point set including connection points of starting vertices and ending vertices;

[0101] In this embodiment, as shown in Figure 4 and Figure 5 , step S2 specifically includes:

[0102] S21, calculating the starting vertex and the ending vertex of the corresponding stroke according to the vertex data and the center point data;

[0103] Based on the above definitions of vertex data and center point data, the start vertex and the end vertex correspond to the starting point and the ending point of each stroke when drawing the boundary of the graph and inside the graph, respectively, and the connecting point data is the point between the start vertex and the end vertex; The connecting point data is divided into two parts. Taking the Chinese character "one" (yī) as an example, it is composed of a simple horizontal stroke. If we want to define the vertex data of this stroke, we need to consider it as a graph, drawing from the left start vertex position to the right end vertex position as one part, and drawing from the left start vertex position to the right end vertex position as another part, a total of two connecting lines; The two connecting lines correspond to two parts;

[0104] In this embodiment, the vertex data and center point data corresponding to one stroke type define the shape of the stroke in standard size and position. We displace, rotate, and scale the standard graph so that the center point of the standard graph can better fit the target center point position. The processed vertex data is the calculated vertex data for drawing this stroke, i.e., all connecting point data including the start vertex and the end vertex.

[0105] For example, in the two strokes of the Chinese character "two", we need to displace and scale the standard graph according to the center point positions of the two strokes generated by the AI module, so that the two standard graphs better fit the positions and sizes of the upper and lower strokes. We can obtain the vertex data of the two strokes in the Chinese character "two".

[0106] S22, integrate the connecting point data between the start vertex and the end vertex to obtain a connecting point set.

[0107] At the same time, for each part of the connecting point data, all the vertices and center points on the connecting path from the start vertex to the end vertex are selected to determine it, for example, for a "horizontal fold" stroke, in addition to the start vertex at the end point of the "horizontal" part, it also has vertices at the boundary of the bending part; The vertex data and center point data of each stroke can be obtained by using existing stroke disassembly software such as ChatGPT, ChatGLM, Doubao, Wenxin Yiyang, and Tencent Hunyuan.

[0108] S3, apply the connecting line matching rule to the connecting points in the connecting point set to generate the connecting line data of the corresponding stroke;

[0109] In this embodiment, as shown in Figure 6 , step S3 includes:

[0110] S31, from the start vertex, select a preset number of consecutive connecting points in the connecting point set according to the connecting order;

[0111] S32. Select one of the following as the target line segment: a straight line, a quadratic curve, or a cubic curve: fit the selected connecting point to the target line segment; determine whether the average or variance of the distances from all the connecting points to the target line segment is greater than or equal to the corresponding threshold; if so, determine that the target line segment is the connecting method; otherwise, reselect the target line segment and make a judgment.

[0112] The line matching rules include, but are not limited to, using straight lines, Bézier curves, quadratic curves, or cubic curves to make connections. The line segment fitting process includes the following points:

[0113] First, attempt to fit the connecting point to the next two connecting points using a straight line, calculate the distances from these three connecting points to this straight line, and then calculate the average or variance of these distances. If the average or variance is less than a specified threshold, then these three connecting points can be considered to be matched with a straight line.

[0114] Secondly, if a straight line cannot be used for matching, try fitting the connecting point to the subsequent three connecting points using a quadratic curve. Calculate the distances from these four connecting points to the fitted quadratic curve, and then calculate the average or variance of these distances. If the average or variance is less than a specified threshold, then this set of points can be considered to be matched using a quadratic curve.

[0115] Third, if neither a straight line nor a quadratic curve can be used for matching, then the connecting point and the subsequent three connecting points should be fitted with a cubic curve.

[0116] Fourth, if there is only one connecting point after the connecting point (i.e., the ending vertex), then use a straight line directly.

[0117] Fifth, if a straight line cannot be used for matching, and there are only two connecting points after the connecting point, then a quadratic curve should be used directly.

[0118] Therefore, the preset number of points is generally 3. The positional relationship between the starting point and the next two points is determined according to the connection order. First, it is determined whether it is suitable for line fitting. Then, the connection method is determined by increasing the selected points and other fitting judgment methods.

[0119] S33. Integrate all connection methods belonging to the same set of connection points to obtain connection data.

[0120] S4. Generate a handwritten Chinese character animation based on the stroke order and connection data of all strokes of the target Chinese character.

[0121] In this embodiment, as Figure 7 As shown, step S4 includes:

[0122] S41, generating a handwriting stroke animation of the corresponding stroke according to the connection data;

[0123] In the embodiment, the connection drawing mode includes but is not limited to a mode of generating a mesh model by using a mesh vertex drawing in a game engine, a mode of drawing a connection by using a CSS or SVG connection drawing mode in software development, and the like. In addition, the graphic filling mode of the stroke connection surrounding area includes but is not limited to a mode of drawing by a model material when drawing a mesh model in a game engine, a mode of automatically drawing a connection as a graphic by using a CSS or SVG in software development, and the like.

[0124] S42, generating a handwriting Chinese character animation according to the stroke order of all strokes of the target Chinese character and the handwriting stroke animation.

[0125] Please refer to Figures 2 to 8 , the second embodiment of the present application is:

[0126] A terminal 1 for quickly generating a handwriting Chinese character animation, as Figure 8 shown, includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3, and the processor 3 implements the method for quickly generating a handwriting Chinese character animation of the first embodiment when executing the computer program.

[0127] In the embodiment, as Figure 2 shown, the memory mainly includes a database module; the module is responsible for storing and retrieving matching data of Chinese characters in a local database, including stroke vertex data and center point data of each Chinese character. The module determines whether there is available matching data by looking up the input Chinese character for further processing.

[0128] In the embodiment, the processor mainly includes the following functional modules:

[0129] I. Data analysis module

[0130] The module is used to extract vertex data and center point data in the matching data, and calculate the start vertex and end vertex of each stroke. In addition, the module also divides each stroke vertex data into two sets of connection point data, providing a basis for subsequent connection matching. As Figure 3 shown, the data analysis module extracts the vertex data and center point data of each stroke in the matching data; as Figure 4 shown, the data analysis module calculates the start vertex and end vertex by the center point data and vertex data of each stroke, as Figure 5 shown, the data analysis module divides each stroke vertex data into two sets of connection point data from the start vertex to the end vertex.

[0131] II. Connection matching module

[0132] As Figure 6 shown, the module matches the connection points in the segmented connection point data set according to rules, that is, matches using straight lines, Bezier curves, etc., to generate the final connection data, and specifically matches the connection point data in each set of connection point data using the matching rules of straight lines, Bezier curves, quadratic curves or Bezier cubic curves, etc. to generate connection data.

[0133] III. Stroke drawing module

[0134] As Figure 7 shown, the module uses the connection data generated by the connection matching module to draw each stroke one by one, and combines these stroke animations according to the stroke order of Chinese characters, to finally generate a complete handwritten Chinese character animation. This module is the core part of realizing the handwriting effect display.

[0135] In summary, the present application provides a method and terminal for quickly generating a handwritten Chinese character animation. After obtaining the target Chinese character that the user wants to generate a handwritten Chinese character animation, the method determines the connection point set of each stroke of the target Chinese character by matching the vertex data and center point data of each stroke in the database, and then generates the connection data of the stroke by combining the connection matching rules. Specifically, the connection method is determined by the positional relationship between the connection points of the two connection data of each stroke. Finally, the handwritten Chinese character animation is generated according to the connection data of each stroke and the stroke order of all strokes. Based on data matching, the connection-related information of the corresponding target Chinese character can be more accurately and quickly obtained, and then the connection data of each stroke is generated to simulate the depiction of each stroke during real handwriting, realizing the appearance of Chinese characters stroke by stroke, which helps learners better understand and practice Chinese character writing, and has a more realistic and vivid experience.

[0136] The above description is only an embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent transformation or direct or indirect application in related technical fields based on the content of the present application specification and drawings is also included in the patent protection scope of the present application.

Claims

1. A method for rapidly generating handwritten Chinese character animations, characterized in that, Includes the following steps: S1. Obtain the target Chinese character for which you want to generate a handwritten Chinese character animation, and select matching data corresponding to the target Chinese character from the Chinese character database; S2. Generate a set of connection points for each stroke based on the matching data. The set of connection points includes connection points including the start vertex and the end vertex. S3. Apply the connection matching rules to perform connection matching on the connection points in the connection point set to generate the connection data of the corresponding strokes; S4. Generate a handwritten Chinese character animation of the target Chinese character based on the stroke order of all strokes of the target Chinese character and the connection data; The step of selecting matching data corresponding to the target Chinese character from the Chinese character database specifically includes: The stroke composition corresponding to the target Chinese character and the vertex data and center point data of each stroke in the stroke composition are selected from the Chinese character database as the matching data; Vertex data is a set of key vertices representing the boundary of a graphic drawn for each stroke; center point data is a set of key vertices representing the central position of a graphic within the drawing for each stroke. Step S2 specifically includes: S21. Calculate the start vertex and end vertex of the corresponding stroke based on the vertex data and the center point data; wherein, the start vertex and end vertex correspond to the starting point and ending point of each stroke when drawing the boundary of the graphic and inside the graphic, respectively. The standard graphic is translated, rotated, and scaled so that the center point of the standard graphic is aligned with the target center point. The data of all connecting points used to draw the stroke, including the start and end vertices, are calculated. The standard graphic is defined by the vertex data and center point data corresponding to each stroke type. The connection point data consists of points from the start vertex to the end vertex, divided into two parts according to the two paths that form the boundary of the stroke. S22. Generate the connection point data between the start vertex and the end vertex to obtain the connection point set.

2. The method for rapidly generating handwritten Chinese character animation according to claim 1, characterized in that, Step S3 includes: S31. Starting from the starting vertex, select a preset number of consecutive connection points from the set of connection points according to the connection order; S32. Select one of the following as the target line segment: a straight line, a quadratic curve, or a cubic curve: fit the selected connecting point to the target line segment; determine whether the average or variance of the distances from all the connecting points to the target line segment is greater than or equal to the corresponding threshold; if so, determine that the target line segment is a connecting line; otherwise, reselect the target line segment and make a judgment. S33. Integrate all the connection methods belonging to the same set of connection points to obtain connection data.

3. The method for rapidly generating handwritten Chinese character animation according to claim 1, characterized in that, Step S4 includes: S41. Generate the corresponding handwritten stroke animation based on the connection data; S42. Generate the handwritten Chinese character animation based on the stroke order of all strokes of the target Chinese character and the handwritten stroke animation.

4. A terminal for rapidly generating handwritten Chinese character animations, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it performs the following steps: S1. Obtain the target Chinese character for which you want to generate a handwritten Chinese character animation, and select matching data corresponding to the target Chinese character from the Chinese character database; S2. Generate a set of connection points for each stroke based on the matching data. The set of connection points includes connection points including the start vertex and the end vertex. S3. Apply the connection matching rules to perform connection matching on the connection points in the connection point set to generate the connection data of the corresponding strokes; S4. Generate a handwritten Chinese character animation of the target Chinese character based on the stroke order of all strokes of the target Chinese character and the connection data; The step of selecting matching data corresponding to the target Chinese character from the Chinese character database specifically includes: The stroke composition corresponding to the target Chinese character and the vertex data and center point data of each stroke in the stroke composition are selected from the Chinese character database as the matching data; Vertex data is a set of key vertices representing the boundary of a graphic drawn for each stroke; center point data is a set of key vertices representing the central position of a graphic within the drawing for each stroke. Step S2 specifically includes: S21. Calculate the start vertex and end vertex of the corresponding stroke based on the vertex data and the center point data; wherein, the start vertex and end vertex correspond to the starting point and ending point of each stroke when drawing the boundary of the graphic and inside the graphic, respectively. The standard graphic is translated, rotated, and scaled so that the center point of the standard graphic is aligned with the target center point. The data of all connecting points used to draw the stroke, including the start and end vertices, are calculated. The standard graphic is defined by the vertex data and center point data corresponding to each stroke type. The connection point data consists of points from the start vertex to the end vertex, divided into two parts according to the two paths that form the boundary of the stroke. S22. Generate the connection point data between the start vertex and the end vertex to obtain the connection point set.

5. A terminal for rapid generation of handwritten Chinese character animation according to claim 4, characterized in that, Step S3 includes: S31. Starting from the starting vertex, select a preset number of consecutive connection points from the set of connection points according to the connection order; S32. Select one of the following as the target line segment: a straight line, a quadratic curve, or a cubic curve: fit the selected connecting point to the target line segment; determine whether the average or variance of the distances from all the connecting points to the target line segment is greater than or equal to the corresponding threshold; if so, determine that the target line segment is a connecting line; otherwise, reselect the target line segment and make a judgment. S33. Integrate all the connection methods belonging to the same set of connection points to obtain the connection data.

6. A terminal for rapid generation of handwritten Chinese character animation according to claim 4, characterized in that, Step S4 includes: S41. Generate the corresponding handwritten stroke animation based on the connection data; S42. Generate the handwritten Chinese character animation based on the stroke order of all strokes of the target Chinese character and the handwritten stroke animation.

Citation Information

Patent Citations

  • Method and device for beautifying cursive style of handwritten Chinese characters

    CN102013109A

  • Generation method, generation system and application method of font writing stroke order

    CN113657330A