Method and terminal for automatically generating handwritten Chinese character animation

By analyzing and integrating the strokes, stroke types and center point data of Chinese characters, the handwritten Chinese character animation is automatically generated, which solves the problems of low human resource consumption and resource utilization in the existing technology, and improves user interaction experience and resource utilization efficiency.

CN119091006AActive Publication Date: 2024-12-06FUJIAN TQ ONLINE INTERACTIVE INC

Patent Information

Application Number
CN202411020807.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-12-06
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

When generating a large number of Chinese character animations in the existing technology, the manual creation method of animators consumes a lot of human resources, the resource utilization rate of using fixed stroke animation templates is low, the update and maintenance cost is high, and new Chinese character animations cannot be automatically generated, affecting the user's interactive experience.

Method used

By obtaining the strokes, stroke types and center point data of the target Chinese characters, calculating the vertex data and line data, generating an animation of each stroke, and integrating it into the entire Chinese character animation according to the stroke order, realizing automatic generation.

Benefits of technology

It realizes automatic generation of handwritten Chinese character animations, simulates the real writing process, improves user interaction experience, saves manpower and material resources, and is suitable for a variety of application scenarios such as education, media and entertainment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091006A_ABST
    Figure CN119091006A_ABST
Patent Text Reader

Abstract

The invention discloses a method and terminal for automatically generating a handwritten Chinese character animation, and the method comprises the steps: obtaining a target Chinese character which needs to generate the handwritten Chinese character animation, and analyzing each stroke of the target Chinese character and the corresponding stroke type and center point data; determining corresponding vertex data according to the stroke type of the stroke; calculating connecting line data required for drawing the strokes according to the central point data and the vertex data corresponding to the strokes; generating handwritten stroke animations of the corresponding strokes according to the connection data, and integrating the handwritten stroke animations corresponding to the strokes according to the stroke sequence of the target Chinese character to obtain a handwritten Chinese character animation of the target Chinese character. According to the method, the handwritten Chinese character animation can be automatically generated flexibly according to the requirements of the user, the real writing process is simulated during generation, and manpower and material resources are saved while the interactive experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of dynamic generation technology, and in particular to a method and a terminal for automatically generating handwritten Chinese character animation. Background Art

[0002] In some existing application scenarios such as Chinese character learning, game interaction, signature confirmation, etc., handwritten Chinese character animation is often needed to enhance the interactive effect and improve the user experience; currently, it generally relies on animators to manually create the stroke order and stroke style of each Chinese character, or use a set of fixed stroke animation templates to show the writing process of Chinese characters.

[0003] However, especially when faced with a large number of different Chinese characters that need to show the writing process, the manual creation method by animators consumes a lot of human resources; the method of using stroke animation templates has low resource utilization, high updating and maintenance costs, and cannot automatically generate new Chinese character animations, which will affect the user's interactive experience in corresponding scenarios. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method and a terminal for automatically generating handwritten Chinese character animations, which can automatically generate handwritten Chinese character animations of required Chinese characters, thereby improving the user's interactive experience while saving manpower and material resources.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] A method for automatically generating handwritten Chinese character animation comprises the following steps:

[0007] S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, analyzing each stroke of the target Chinese character, and the stroke type and center point data corresponding to each stroke;

[0008] S2, determining corresponding vertex data according to the stroke type of the stroke;

[0009] S3, calculating the line data required for drawing the stroke according to the center point data and the vertex data corresponding to the stroke;

[0010] S4, generating a handwritten stroke animation corresponding to the stroke according to the connection data, and integrating the handwritten stroke animation corresponding to each stroke according to the stroke sequence of the target Chinese character to obtain the handwritten Chinese character animation of the target Chinese character.

[0011] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0012] A terminal for automatically generating handwritten Chinese character animations, 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:

[0013] S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, analyzing each stroke of the target Chinese character, and the stroke type and center point data corresponding to each stroke;

[0014] S2, determining corresponding center point data and vertex data according to the stroke type of the stroke;

[0015] S3, calculating the line data required for drawing the stroke according to the center point data and the vertex data corresponding to the stroke;

[0016] S4, generating a handwritten stroke animation corresponding to the stroke according to the connection data, and integrating the handwritten stroke animation corresponding to each stroke according to the stroke sequence of the target Chinese character to obtain the handwritten Chinese character animation of the target Chinese character.

[0017] The beneficial effects of the present invention are: providing a method and terminal for automatically generating handwritten Chinese character animations, by analyzing the strokes, stroke types and center point data of the target Chinese character for which the handwritten Chinese character animations need to be generated, determining the vertex data corresponding to each stroke of the target Chinese character, thereby determining the handwritten stroke animation when each stroke is completed, and finally integrating all the handwritten stroke animations according to the stroke sequence to obtain the handwritten Chinese character animation of the entire target Chinese character. In this way, the handwritten Chinese character animation can be automatically generated flexibly according to the needs of the user, and the real writing process can be simulated during the generation, thereby improving the user's interactive experience while saving manpower and material resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of the steps of a method for automatically generating handwritten Chinese character animation according to the present invention;

[0019] Figure 2 A flow chart of the AI ​​module of the method for automatically generating handwritten Chinese character animation of the present invention disassembling target Chinese characters one by one;

[0020] Figure 3 A flow chart of matching vertex data in a database in a method for automatically generating handwritten Chinese character animation according to the present invention;

[0021] Figure 4 A flow chart of calculating the starting vertex and the ending vertex of a method for automatically generating handwritten Chinese character animation according to the present invention;

[0022] Figure 5 A flow chart of performing line segment fitting and determining a connection mode for a method of automatically generating handwritten Chinese character animation according to the present invention;

[0023] Figure 6 A flow chart of generating handwritten Chinese character animation for a method of automatically generating handwritten Chinese character animation according to the present invention;

[0024] Figure 7 The present invention is a system block diagram of a terminal for automatically generating handwritten Chinese character animation.

[0025] Description of labels:

[0026] 1. A terminal for automatically generating handwritten Chinese character animation; 2. A memory; 3. A processor. DETAILED DESCRIPTION

[0027] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

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

[0029] 1. Educational Software and Applications

[0030] Chinese character learning tool: Provides dynamic stroke sequence display to help learners master the correct writing method of Chinese characters.

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

[0032] Online classes and educational games: Increase interactivity through animations to improve learning interest and effectiveness.

[0033] 2. Design and Documentation Software

[0034] Font design software: automatically generates Chinese character handwriting animations to assist designers in font creation.

[0035] Document editing tool: embed handwritten Chinese character animation in documents to enrich the display effect.

[0036] 3. Media and Entertainment Industry

[0037] Film and television post-production: adding handwritten Chinese character special effects to film and television works.

[0038] Advertising design: Use handwritten Chinese character animation to attract audience attention and improve advertising effectiveness.

[0039] Game Development:

[0040] Character interaction design: When characters write letters or perform other writing behaviors in the game, their real handwriting is displayed.

[0041] User Interface (UI) Design: Use handwritten Chinese character animation to enhance the aesthetics and user experience of the game interface.

[0042] 4. Virtual Reality (VR) and Augmented Reality (AR)

[0043] VR / AR educational applications: simulate the writing process in a virtual environment and provide an immersive learning experience.

[0044] Cultural display and communication: Use handwritten Chinese character animation to introduce Chinese calligraphy art in museums or exhibitions.

[0045] 5. Human-computer interaction system

[0046] Intelligent assistants and chatbots: Provide a more natural interaction experience by generating handwritten responses to user input.

[0047] Signature Verification System: simulates the real signing process to verify identity or confirm intent.

[0048] Please refer to Figures 1 to 6 , a method for automatically generating handwritten Chinese character animation, comprising the following steps:

[0049] S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, analyzing each stroke of the target Chinese character, and the stroke type and center point data corresponding to each stroke;

[0050] S2, determining corresponding vertex data according to the stroke type of the stroke;

[0051] S3, calculating the line data required for drawing the stroke according to the center point data and the vertex data corresponding to the stroke;

[0052] S4, generating a handwritten stroke animation corresponding to the stroke according to the connection data, and integrating the handwritten stroke animation corresponding to each stroke according to the stroke sequence of the target Chinese character to obtain the handwritten Chinese character animation of the target Chinese character.

[0053] From the above description, it can be seen that the beneficial effects of the present invention are: by analyzing the strokes and stroke types of the target Chinese characters for which handwritten Chinese character animation needs to be generated, the center point data and vertex data corresponding to each stroke of the target Chinese character are determined, thereby determining the handwritten stroke animation when each stroke is completed, and finally integrating all the handwritten stroke animations according to the stroke sequence to obtain the handwritten Chinese character animation of the entire target Chinese character. In this way, handwritten Chinese character animation can be automatically generated flexibly according to user needs, and the real writing process can be simulated during generation, thereby improving the user's interactive experience while saving manpower and material resources.

[0054] Furthermore, before step S1, the following steps are included:

[0055] S0, storing the vertex data corresponding to the different stroke types in a database;

[0056] The step S2 specifically includes:

[0057] Data matching is performed in the database according to the stroke type of the stroke to obtain the corresponding vertex data.

[0058] From the above description, it can be seen that when determining the vertex data based on the stroke type of the stroke, it is confirmed by matching the data in the database, thereby improving the efficiency and accuracy of determining the vertex data. At the same time, as the data in the database is supplemented and improved, the applicable scope of the handwritten Chinese character animation can be gradually and automatically generated to flexibly meet user needs.

[0059] Furthermore, the step S3 is specifically as follows:

[0060] S31, calculating the starting vertex and the ending vertex of the stroke used to form a graphic boundary according to the center point data and the vertex data corresponding to the stroke;

[0061] Based on the center point data of the stroke, a standard figure formed by the vertex data of the stroke is changed so that the center point of the changed standard figure corresponds to the center of the drawing position of the stroke, and the vertex data of the changed standard figure is used as the drawing point data of the stroke;

[0062] S32: Obtain the line data according to the drawing point data.

[0063] From the above description, it can be seen that when determining the drawing point data, the standard graphics corresponding to the original center point data and vertex data of the stroke are changed to obtain a graphic whose center position is closer to the center of the drawing position, so as to confirm the final effect that should be obtained by the drawing, and then the changed drawing point data is obtained based on the vertex data before the change, and finally the accurate connection data is obtained.

[0064] Furthermore, the step S32 includes:

[0065] S321, dividing the drawing point data into two sets of drawing points from the starting vertex to the ending vertex according to two paths that enclose the boundary of the graphic;

[0066] S322, selecting a preset number of continuous drawing points from the drawing point set according to the connection sequence, and selecting a corresponding connection method from a straight line, a Bezier curve, a quadratic curve, or a Bezier cubic curve according to the selected drawing points;

[0067] S323, integrating the connection methods of the two drawing point sets to obtain the connection data.

[0068] From the above description, it can be seen that based on the idea that two points are surrounded by two line segments to form a graphic boundary, the entire drawing point data is divided into two parts from the starting vertex to the ending vertex, and then each part of the data is analyzed to obtain the corresponding connection method for selecting a preset number of points, and the process distribution of connecting the lines to form the entire graphic boundary is refined to ensure that the final generated connection result is more accurate and reliable.

[0069] Furthermore, the step S322 specifically includes:

[0070] Select one from a straight line, a Bezier curve, a quadratic curve or a Bezier curve as a target line segment, fit the selected drawing point with the target line segment, and determine whether the average value or variance of the distance from all the drawing 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 connection method, otherwise reselect the target line segment and make a judgment.

[0071] From the above description, it can be seen that after determining several drawing points, based on the positions of these drawing points, the appropriate connection method is determined by line segment fitting. When analyzing the fitting results, calculation methods such as average difference are introduced to effectively improve the fitting accuracy. The point selection fitting method itself is flexible and changeable enough to be suitable for different types of strokes, making the confirmation of the connection method fast and accurate.

[0072] Please refer to Figure 7 A terminal 1 for automatically generating handwritten Chinese character animations comprises a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, the following steps are implemented:

[0073] S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, analyzing each stroke of the target Chinese character, and the stroke type and center point data corresponding to each stroke;

[0074] S2, determining corresponding vertex data according to the stroke type of the stroke;

[0075] S3, calculating the line data required for drawing the stroke according to the center point data and the vertex data corresponding to the stroke;

[0076] S4, generating a handwritten stroke animation corresponding to the stroke according to the connection data, and integrating the handwritten stroke animation corresponding to each stroke according to the stroke sequence of the target Chinese character to obtain the handwritten Chinese character animation of the target Chinese character.

[0077] From the above description, it can be seen that the beneficial effects of the present invention are: by analyzing the strokes and stroke types of the target Chinese characters for which handwritten Chinese character animation needs to be generated, the center point data and vertex data corresponding to each stroke of the target Chinese character are determined, thereby determining the handwritten stroke animation when each stroke is completed, and finally integrating all the handwritten stroke animations according to the stroke sequence to obtain the handwritten Chinese character animation of the entire target Chinese character. In this way, handwritten Chinese character animation can be automatically generated flexibly according to user needs, and the real writing process can be simulated during generation, thereby improving the user's interactive experience while saving manpower and material resources.

[0078] Furthermore, before step S1, the following steps are included:

[0079] S0, storing the vertex data corresponding to the different stroke types in a database;

[0080] The step S2 specifically includes:

[0081] Data matching is performed in the database according to the stroke type of the stroke to obtain the corresponding vertex data.

[0082] From the above description, it can be seen that when determining the vertex data based on the stroke type of the stroke, it is confirmed by matching the data in the database, thereby improving the efficiency and accuracy of determining the vertex data. At the same time, as the data in the database is supplemented and improved, the applicable scope of the handwritten Chinese character animation can be gradually and automatically generated to flexibly meet user needs.

[0083] Furthermore, the step S3 is specifically as follows:

[0084] S31, calculating the starting vertex and the ending vertex of the stroke used to form a graphic boundary according to the center point data and the vertex data corresponding to the stroke;

[0085] Based on the center point data of the stroke, a standard figure formed by the vertex data of the stroke is changed so that the center point of the changed standard figure corresponds to the center of the drawing position of the stroke, and the vertex data of the changed standard figure is used as the drawing point data of the stroke;

[0086] S32: Obtain the line data according to the drawing point data.

[0087] From the above description, it can be seen that when determining the drawing point data, the standard graphics corresponding to the original center point data and vertex data of the stroke are changed to obtain a graphic whose center position is closer to the center of the drawing position, so as to confirm the final effect that should be obtained by the drawing, and then the changed drawing point data is obtained based on the vertex data before the change, and finally the accurate connection data is obtained.

[0088] Furthermore, the step S32 includes:

[0089] S321, dividing the drawing point data into two sets of drawing points from the starting vertex to the ending vertex according to two paths that enclose the boundary of the graphic;

[0090] S322, selecting a preset number of continuous drawing points from the drawing point set according to the connection sequence, and selecting a corresponding connection method from a straight line, a Bezier curve, a quadratic curve, or a Bezier cubic curve according to the selected drawing points;

[0091] S323, integrating the connection methods of the two drawing point sets to obtain the connection data.

[0092] From the above description, it can be seen that based on the idea that two points are surrounded by two line segments to form a graphic boundary, the entire drawing point data is divided into two parts from the starting vertex to the ending vertex, and then each part of the data is analyzed to obtain the corresponding connection method for selecting a preset number of points, and the process distribution of connecting the lines to form the entire graphic boundary is refined to ensure that the final generated connection result is more accurate and reliable.

[0093] Furthermore, the step S322 specifically includes:

[0094] Select one from a straight line, a Bezier curve, a quadratic curve or a Bezier curve as a target line segment, fit the selected drawing point with the target line segment, and determine whether the average value or variance of the distance from all the drawing 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 connection method, otherwise reselect the target line segment and make a judgment.

[0095] From the above description, it can be seen that after determining several drawing points, based on the positions of these drawing points, the appropriate connection method is determined by line segment fitting. When analyzing the fitting results, calculation methods such as average difference are introduced to effectively improve the fitting accuracy. The point selection fitting method itself is flexible and changeable enough to be suitable for different types of strokes, making the confirmation of the connection method fast and accurate.

[0096] Please refer to Figures 1 to 6 , Embodiment 1 of the present invention is:

[0097] A method for automatically generating handwritten Chinese character animation, such as Figure 1 As shown, the following steps are included:

[0098] S0, storing the center point data and vertex data corresponding to different stroke types in the database;

[0099] In this embodiment, a stroke is defined as that each Chinese character can be written and drawn with one or more strokes, and the writing and drawing of each stroke is called a stroke. The basic stroke types include, but are not limited to, horizontal (一), vertical (丨), left-falling stroke (丿), dot (丶), right-falling stroke (㇀), etc. Each stroke type has a fixed writing direction and shape characteristics.

[0100] The vertex data corresponding to the stroke type is a set of coordinate points used to define and describe the boundary of the Chinese character stroke graph. These data are usually used in computer graphics to accurately draw the shape of a specific stroke on the screen. Taking the Chinese character "一" (yī) as an example, it consists of a simple horizontal stroke. If we want to define the vertex data of this stroke, we need to regard it as a graph, draw a line from the starting vertex position on the left to the ending vertex position on the right, and draw a line from the starting vertex position on the left down to the ending vertex position on the right. The graph enclosed by the two lines is the connection data of the horizontal stroke of the Chinese character "一", and the set of key vertices in the connection data is the vertex data of the horizontal stroke of the Chinese character "一". And the center point data of the stroke type describes the writing direction of the stroke. For example, in the horizontal stroke (一), there is a center point on the left which is the starting position of writing, and there is a center point on the right which is the ending position of writing; in the vertical stroke (丨), there is a center point on the top which is the starting position of writing, and there is a center point on the bottom which is the ending position of writing; in the right-falling stroke there is a center point at the upper left which is the starting position of writing, there is a center point at the middle turning position, and there is a center point at the lower right which is the ending position of writing.

[0101] S1. Obtain the target Chinese character for which a handwritten Chinese character animation needs to be generated, parse each stroke of the target Chinese character, and the corresponding stroke type and center point data of each stroke;

[0102] In this embodiment, as shown in combination with Figure 2 existing AI technologies such as ChatGPT, ChatGLM, Doubao, Wenxin Yiyan, Tencent Hunyuan, etc. can already disassemble the stroke order, stroke type of each Chinese character and provide the center point data of the stroke.

[0103] S2. Determine the corresponding vertex data according to the stroke type of the stroke. Specifically, as shown in Figure 3 figure, perform data matching in the database according to the stroke type of the stroke to obtain the corresponding vertex data;

[0104] S3. Calculate the connection data required for drawing the stroke according to the center point data and vertex data corresponding to the stroke;

[0105] Step S3 is specifically as follows:

[0106] S31. Calculate the start vertex and end vertex of the stroke for forming the graphic boundary based on the center point data and vertex data corresponding to the stroke;

[0107] Based on the center point data of the stroke, perform graphic transformation on the standard graphic formed by the vertex data of the stroke, so that the center point of the transformed standard graphic corresponds to the center of the drawing position of the stroke, and use the vertex data of the transformed standard graphic as the drawing point data of the stroke;

[0108] S32. Obtain the connection line data according to the drawing point data, specifically as follows:

[0109] S321. Divide the drawing point data into two sets of drawing points from the start vertex to the end vertex corresponding to the two paths enclosing the graphic boundary;

[0110] In this embodiment, taking the Chinese character "一" (yī) as an example, it consists of a simple horizontal stroke. If we want to define the vertex data of this stroke and regard it as a graphic, draw from the start vertex position on the left upward to the end vertex position on the right, and draw from the start vertex position on the left downward to the end vertex position on the right, for a total of two connection lines; the two connection lines correspond to two sets of drawing points from the start vertex to the end vertex.

[0111] S322. Select a preset number of consecutive drawing points from the drawing point set according to the connection line order, and select the corresponding connection line method from a straight line, a quadratic Bezier curve, or a cubic Bezier curve according to the selected drawing points;

[0112] Among them, step S322 specifically includes:

[0113] Select one from a straight line, a quadratic Bezier curve, or a cubic Bezier curve as the target line segment, fit the selected drawing points with the target line segment, and judge whether the average value or variance of the distances from all drawing points to the target line segment is greater than or equal to the corresponding threshold. If so, determine the target line segment as the connection line method; otherwise, reselect the target line segment and make a judgment.

[0114] In this embodiment, the line segment fitting process is as follows:

[0115] First, try to fit the connection points with the subsequent two connection points with a straight line, calculate the distances from these 3 connection points to this straight line, and then calculate the average value or variance of these distances. If the average value or variance is less than the specified threshold, it can be considered that these 3 connection points can be matched with a straight line.

[0116] Secondly, if a straight line cannot be used for matching, then try to fit the connecting point and the next three connecting points with 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 the specified threshold, it can be considered that this set of points can be matched with a quadratic curve.

[0117] Again, if neither a straight line nor a quadratic curve can be used to match, the connecting point and the subsequent three connecting points are fitted with a cubic curve.

[0118] Finally, for some special cases, if there is only one connection point after the connection point, a straight line is used directly; if a straight line cannot be used for matching and there are only two connection points after the connection point, a quadratic curve is used directly.

[0119] It should be noted that the target line segment to be fitted includes but is not limited to a straight line, a Bezier curve, a quadratic curve or a Bezier cubic curve. After the connection method of the currently selected drawing point is determined, a new drawing point is selected from the drawing point set whose connection method has not been determined and a line segment fitting is performed until all the drawing points in the drawing point set are involved in the connection.

[0120] S323. Integrate the connection methods of the two drawing point sets to obtain connection data.

[0121] S4. Generate a handwritten stroke animation of the corresponding stroke according to the connection data, and integrate the handwritten stroke animation corresponding to each stroke according to the stroke sequence of the target Chinese character to obtain the handwritten Chinese character animation of the target Chinese character.

[0122] In this embodiment, methods for drawing lines for handwritten stroke animation and handwritten Chinese character animation include but are not limited to methods for generating mesh models using mesh vertex drawing in game engines, methods for drawing lines using line drawing methods such as CSS or SVG in software development, etc.; and methods for filling graphics in areas enclosed by stroke lines include but are not limited to methods for drawing through model materials when drawing mesh models in game engines, methods for automatically drawing lines as graphics using CSS or SVG in software development, etc.

[0123] Please refer to Figures 2 to 7 , Embodiment 2 of the present invention is:

[0124] A terminal 1 for automatically generating handwritten Chinese character animations comprises a memory 2, a processor 3 and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, a method for quickly generating handwritten Chinese character animations is implemented in real time.

[0125] In this embodiment, a terminal 1 for automatically generating handwritten Chinese character animations includes at least the following contents:

[0126] 1. AI Module

[0127] Combined with Figure 2 As shown in the figure, this module is responsible for receiving the input Chinese characters and breaking down the stroke order and stroke type of each Chinese character one by one, as well as calculating the stroke center point position data. It uses artificial intelligence technologies such as ChatGPT, ChatGLM, Doubao, Wenxinyiyan, Tencent Hunyuan, etc. to recognize and parse the structure of Chinese characters.

[0128] 2. Database Module

[0129] Combination Figure 3 As shown in Figure 1, this module stores vertex data corresponding to various stroke types. It matches and retrieves corresponding vertex data one by one according to the stroke type information provided by the AI ​​module for subsequent data processing.

[0130] 3. Data Analysis Module

[0131] Combination Figure 4 As shown in Figure 1, this module uses the vertex data obtained from the database module and the center point data provided by the AI ​​module to calculate the specific position of each stroke on the screen or page. It determines the start and end vertices of each stroke and divides the vertex data into two sets of connecting point data.

[0132] 4. Connection matching module

[0133] Combination Figure 5 As shown, the module matches the line points in the segmented line point data set according to the rules (straight line, Bezier curve, etc.) to generate the final line data. This is an important step in forming the handwriting animation effect because it determines the shape and smoothness of the stroke animation.

[0134] 5. Stroke drawing module

[0135] Combination Figure 6 As shown in the figure, this 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, and finally generates a complete handwritten Chinese character animation. This module is the core part of realizing the handwriting effect display.

[0136] In summary, the present invention provides a method and terminal for automatically generating handwritten Chinese character animations. The AI ​​module parses the strokes, stroke types, and center point data of the target Chinese character for which the handwritten Chinese character animation is to be generated, determines the vertex data corresponding to each stroke of the target Chinese character, thereby determining the handwritten stroke animation when each stroke is completed, and finally integrates all the handwritten stroke animations according to the stroke sequence to obtain the handwritten Chinese character animation of the entire target Chinese character. In this way, the handwritten Chinese character animation can be automatically generated flexibly according to the needs of the user, and the real writing process can be simulated during the generation, thereby improving the user's interactive experience while saving manpower and material resources.

[0137] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for automatically generating handwritten Chinese character animation, characterized in that: The steps include: S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, analyzing each stroke of the target Chinese character, and the stroke type and center point data corresponding to each stroke; S2, determining corresponding vertex data according to the stroke type of the stroke; S3, calculating the line data required for drawing the stroke according to the center point data and the vertex data corresponding to the stroke; S4, generating a handwritten stroke animation corresponding to the stroke according to the connection data, and integrating the handwritten stroke animation corresponding to each stroke according to the stroke sequence of the target Chinese character to obtain the handwritten Chinese character animation of the target Chinese character.

2. The method for automatically generating handwritten Chinese character animation according to claim 1, characterized in that: The step S1 includes: S0, storing the vertex data corresponding to the different stroke types in a database; The step S2 specifically includes: Data matching is performed in the database according to the stroke type of the stroke to obtain the corresponding vertex data.

3. The method for automatically generating handwritten Chinese character animation according to claim 1, characterized in that: The step S3 is specifically as follows: S31, calculating the starting vertex and the ending vertex of the stroke used to form a graphic boundary according to the center point data and the vertex data corresponding to the stroke; Based on the center point data of the stroke, a standard figure formed by the vertex data of the stroke is changed so that the center point of the changed standard figure corresponds to the center of the drawing position of the stroke, and the vertex data of the changed standard figure is used as the drawing point data of the stroke; S32: Obtain the line data according to the drawing point data.

4. The method for automatically generating handwritten Chinese character animation according to claim 3, characterized in that: The step S32 comprises: S321, dividing the drawing point data into two sets of drawing points from the starting vertex to the ending vertex according to two paths that enclose the boundary of the graphic; S322, selecting a preset number of continuous drawing points from the drawing point set according to the connection sequence, and selecting a corresponding connection method from a straight line, a Bezier curve, a quadratic curve, or a Bezier cubic curve according to the selected drawing points; S323, integrating the connection methods of the two drawing point sets to obtain the connection data.

5. The method for automatically generating handwritten Chinese character animation according to claim 4, characterized in that: The step S322 specifically includes: Select one from a straight line, a Bezier curve, a quadratic curve or a Bezier curve as a target line segment, fit the selected drawing point with the target line segment, and determine whether the average value or variance of the distance from all the drawing 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 connection method, otherwise reselect the target line segment and make a judgment.

6. A terminal for automatically generating handwritten Chinese character animation, 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, the following steps are implemented: S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, analyzing each stroke of the target Chinese character, and the stroke type and center point data corresponding to each stroke; S2, determining corresponding vertex data according to the stroke type of the stroke; S3, calculating the line data required for drawing the stroke according to the center point data and the vertex data corresponding to the stroke; S4, generating a handwritten stroke animation corresponding to the stroke according to the connection data, and integrating the handwritten stroke animation corresponding to each stroke according to the stroke sequence of the target Chinese character to obtain the handwritten Chinese character animation of the target Chinese character.

7. A terminal for automatically generating handwritten Chinese character animation according to claim 6, characterized in that: The step S1 includes: S0, storing the vertex data corresponding to the different stroke types in a database; The step S2 specifically includes: Data matching is performed in the database according to the stroke type of the stroke to obtain the corresponding vertex data.

8. A terminal for automatically generating handwritten Chinese character animation according to claim 6, characterized in that: The step S3 is specifically as follows: S31, calculating the starting vertex and the ending vertex of the stroke used to form a graphic boundary according to the center point data and the vertex data corresponding to the stroke; Based on the center point data of the stroke, a standard figure formed by the vertex data of the stroke is changed so that the center point of the changed standard figure corresponds to the center of the drawing position of the stroke, and the vertex data of the changed standard figure is used as the drawing point data of the stroke; S32: Obtain the line data according to the drawing point data.

9. A terminal for automatically generating handwritten Chinese character animation according to claim 8, characterized in that: The step S32 comprises: S321, dividing the drawing point data into two sets of drawing points from the starting vertex to the ending vertex according to two paths that enclose the boundary of the graphic; S322, selecting a preset number of continuous drawing points from the drawing point set according to the connection sequence, and selecting a corresponding connection method from a straight line, a Bezier curve, a quadratic curve, or a Bezier cubic curve according to the selected drawing points; S323, integrating the connection methods of the two drawing point sets to obtain the connection data.

10. A terminal for automatically generating handwritten Chinese character animation according to claim 9, characterized in that: The step S322 specifically includes: Select one from a straight line, a Bezier curve, a quadratic curve or a Bezier curve as a target line segment, fit the selected drawing point with the target line segment, and determine whether the average value or variance of the distance from all the drawing 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 connection method, otherwise reselect the target line segment and make a judgment.

Citation Information

Patent Citations

  • Personalized Chinese character library generation method and device

    CN107239466A

  • Handwriting drawing method, device and equipment and storage medium

    CN111427499A

  • Chinese character drawing display method and device, electronic equipment and medium

    CN113034649A

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

    CN113657330A

  • On-line hand-written character recognition method and character description method for on-line hand-written character recognition

    JP1997147052A

Cited By

  • Intelligent font generation method and system

    CN120431220A