Method and terminal for quickly generating handwritten Chinese character animation
By obtaining the collection of connection points of strokes from the Chinese character database and applying the connection matching rules to generate Chinese character animation, the problem that the existing technology cannot simulate the real writing process is solved, and efficient and flexible Chinese character animation generation is achieved, improving user experience and application Diversity of scenes.
Patent Information
- Application Number
- CN202411020853.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
Pre-rendered animations and vector graphics-based methods used in existing game development, software development or virtual reality scenarios cannot simulate the real Chinese character writing process, and cannot flexibly generate Chinese characters according to user needs, resulting in poor user experience.
By obtaining the matching data of the target Chinese characters, selecting the link point set of strokes from the Chinese character database, and applying the link matching rules to generate the link data of strokes, and generating handwritten Chinese character animations based on the stroke order and connection data to achieve stroke-by-stroke appearance Effect.
It realizes real-time and accurate generation of real handwritten Chinese characters animations, improves user experience, saves storage space, adapts to user needs, and is suitable for a variety of application scenarios such as education, media and virtual reality.
Smart Images

Figure CN119091007A_ABST
Abstract
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 quickly generating handwritten Chinese character animation. Background Art
[0002] In some existing game development, software development or virtual reality scenarios, pre-rendered animation or vector graphics-based methods are used to display the writing process of Chinese characters. The specific introduction is 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 images rendered frame by frame, showing the entire process of the stroke from start to finish. However, pre-rendered animation is not flexible enough to generate new Chinese character animations instantly based on user input. Pre-created stroke animations also take up a lot of storage space and become impractical when expanding to a large number of Chinese characters.
[0004] 2. Vector graphics-based methods: 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 vector graphics methods are more flexible and scalable than pre-rendered animations, they usually do not include complex writing effects such as speed changes, so they may look mechanical and unnatural.
[0005] In summary, the existing methods of displaying written text cannot simulate the real writing process. At the same time, they are affected by factors such as storage space and the complexity of the font, and cannot flexibly generate the writing process of Chinese characters according to user needs, which brings a poor user experience. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a method and a terminal for quickly generating handwritten Chinese character animations, which can generate handwritten animations of Chinese characters in real time and accurately in a way that simulates reality, thereby improving user experience.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0008] A method for quickly generating handwritten Chinese character animations comprises the following steps:
[0009] S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, and selecting matching data corresponding to the target Chinese character in a Chinese character database;
[0010] S2. Generate a connection point set for each stroke according to the matching data, wherein the connection point set includes connection points including a start vertex and an end vertex;
[0011] S3, applying a line matching rule to perform line matching on the line points in the line point set to generate line data of corresponding strokes;
[0012] S4. Generate a handwritten Chinese character animation of the target Chinese character according to the stroke sequence of all the strokes of the target Chinese character and the connection data.
[0013] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0014] A terminal for quickly generating handwritten Chinese character animations comprises a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0015] S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, and selecting matching data corresponding to the target Chinese character in a Chinese character database;
[0016] S2. Generate a connection point set for each stroke according to the matching data, wherein the connection point set includes connection points including a start vertex and an end vertex;
[0017] S3, applying a line matching rule to perform line matching on the line points in the line point set to generate line data of corresponding strokes;
[0018] S4. Generate a handwritten Chinese character animation of the target Chinese character according to the stroke sequence of all the strokes of the target Chinese character and the connection data.
[0019] The beneficial effects of the present invention are as follows: a method and a terminal for quickly generating handwritten Chinese character animations are provided. After obtaining the target Chinese character for which the user wants to generate the handwritten Chinese character animation, the line point set of each stroke of the target Chinese character is determined by database matching, and then the line data of the strokes is generated in combination with the line matching rules. Finally, the handwritten Chinese character animation is generated according to the line data of each stroke and the stroke sequence of all strokes. Based on data matching, the line-related information of the corresponding target Chinese character can be obtained more accurately and quickly, and then the line data of each stroke is generated to simulate the depiction of each stroke during real handwriting, so that the Chinese characters appear stroke by stroke, which helps learners to better understand and practice Chinese character writing, and has a more realistic and vivid experience. The real-time animation generation method can save storage space, is not limited by storage or performance, and flexibly meets user needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of the steps of a method for quickly generating handwritten Chinese character animations according to the present invention;
[0021] Figure 2A flowchart of obtaining matching data in a Chinese character database in a method for quickly generating handwritten Chinese character animations according to an embodiment of the present invention;
[0022] Figure 3 A flowchart of a method for quickly generating handwritten Chinese character animations according to an embodiment of the present invention for obtaining vertex data and center point data from matching data;
[0023] Figure 4 A flowchart of a method for quickly generating handwritten Chinese character animation according to an embodiment of the present invention, which calculates corresponding starting vertices and ending vertices according to vertex data and center point data of a stroke;
[0024] Figure 5 A flowchart of a method for quickly generating handwritten Chinese character animations according to an embodiment of the present invention for generating a set of connection points for each stroke;
[0025] Figure 6 A method for quickly generating handwritten Chinese character animations according to an embodiment of the present invention is a flow chart of generating connection data according to a set of connection points;
[0026] Figure 7 The present invention relates to a method for quickly generating handwritten Chinese character animations, and a flowchart for generating manual Chinese character animations.
[0027] Figure 8 The present invention is a system block diagram of a terminal for quickly generating handwritten Chinese character animation.
[0028] Description of labels:
[0029] 1. A terminal for quickly generating handwritten Chinese character animations; 2. Memory; 3. Processor. DETAILED DESCRIPTION
[0030] 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.
[0031] The specific application scenarios of the present invention include but are not limited to the following aspects:
[0032] 1. Educational Software and Applications
[0033] Chinese character learning tool: Provides dynamic stroke sequence display to help learners master the correct writing method of Chinese characters.
[0034] Language teaching platform: Enhance non-native learners’ understanding of Chinese character structure and writing rules.
[0035] Online classes and educational games: Increase interactivity through animations to improve learning interest and effectiveness.
[0036] 2. Design and Documentation Software
[0037] Font design software: automatically generates Chinese character handwriting animations to assist designers in font creation.
[0038] Document editing tool: embed handwritten Chinese character animation in documents to enrich the display effect.
[0039] 3. Media and Entertainment Industry
[0040] Film and television post-production: adding handwritten Chinese character special effects to film and television works.
[0041] Advertising design: Use handwritten Chinese character animation to attract audience attention and improve advertising effectiveness.
[0042] Game Development:
[0043] Character interaction design: When characters write letters or perform other writing behaviors in the game, their real handwriting is displayed.
[0044] User Interface (UI) Design: Use handwritten Chinese character animation to enhance the aesthetics and user experience of the game interface.
[0045] 4. Virtual Reality (VR) and Augmented Reality (AR)
[0046] VR / AR educational applications: simulate the writing process in a virtual environment and provide an immersive learning experience.
[0047] Cultural display and communication: Use handwritten Chinese character animation to introduce Chinese calligraphy art in museums or exhibitions.
[0048] 5. Human-computer interaction system
[0049] Intelligent assistants and chatbots: Provide a more natural interaction experience by generating handwritten responses to user input.
[0050] Signature Verification System: simulates the real signing process to verify identity or confirm intent.
[0051] Please refer to Figures 1 to 7 , a method for quickly generating handwritten Chinese character animation, comprising the following steps:
[0052] S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, and selecting matching data corresponding to the target Chinese character in a Chinese character database;
[0053] S2. Generate a connection point set for each stroke according to the matching data, wherein the connection point set includes connection points including a start vertex and an end vertex;
[0054] S3, applying a line matching rule to perform line matching on the line points in the line point set to generate line data of corresponding strokes;
[0055] S4. Generate a handwritten Chinese character animation of the target Chinese character according to the stroke sequence of all the strokes of the target Chinese character and the connection data.
[0056] From the above description, it can be seen that the beneficial effects of the present invention are: after obtaining the target Chinese character that the user wants to generate a handwritten Chinese character animation, the set of connection points of each stroke of the target Chinese character is determined by database matching, and then the connection data of the strokes is generated in combination with the connection matching rules. Finally, the handwritten Chinese character animation is generated based on 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 obtained more accurately and quickly, and then the description of each stroke during real handwriting is simulated by generating the connection data of each stroke, so that the Chinese characters appear stroke by stroke, which helps learners to better understand and practice Chinese character writing, and has a more realistic and vivid experience. The real-time animation generation method can save storage space, is not limited by storage or performance, and flexibly meets user needs.
[0057] Furthermore, the selecting matching data corresponding to the target Chinese character in the Chinese character database specifically includes:
[0058] 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.
[0059] From the above description, it can be seen that in the Chinese character database, using all the strokes of Chinese characters and the center point data and vertex data of each stroke as matching data can not only improve the accuracy and convenience of matching multiple target Chinese characters, but also help in the subsequent analysis of the connection method of each stroke.
[0060] Furthermore, the step S2 specifically includes:
[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: Generate connection point data between the starting vertex and the ending vertex to obtain the connection point set.
[0063] From the above description, it can be seen that each stroke is divided into a set of connecting points from the starting vertex to the ending vertex, so that the stroke can be drawn in a more detailed point-by-point manner. This is not only less prone to errors, but also helps to introduce factors such as pen speed changes during drawing to simulate real handwritten stroke effects, making the final handwriting animation effect more realistic and vivid, thereby enhancing the user's viewing experience.
[0064] Furthermore, the step S3 comprises:
[0065] S31, starting from the starting vertex, selecting a preset number of continuous connection points from the connection point set according to the connection sequence;
[0066] S32, selecting one from a straight line, a Bezier curve, a quadratic curve, or a Bezier curve as a target line segment, fitting the selected line points with the target line segment, and determining whether the average value or variance of the distances from all the line points to the target line segment is greater than or equal to a corresponding threshold value, if so, determining that the target line segment is the line connection mode, otherwise reselecting the target line segment and making a determination;
[0067] S33, integrating all the connection modes belonging to the same connection point set to obtain the connection data.
[0068] From the above description, it can be seen that when studying and drawing each stroke, the connection method is determined from the connection matching rules based on the connection order of the divided connection points and the positional relationship between the selected connection points. This is suitable for carefully and accurately analyzing the connections of more different strokes, so as to facilitate the subsequent generation of handwritten stroke animations for each stroke.
[0069] Furthermore, the step S4 comprises:
[0070] S41, generating a handwritten stroke animation of a corresponding stroke according to the connection data;
[0071] S42: Generate 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, it can be seen that when generating a handwriting animation, the handwriting stroke animation of the corresponding strokes is first generated through the connection data, and then the handwriting Chinese character animation is generated according to the stroke order and handwriting stroke animation of all the strokes of the target Chinese character to simulate the reality and enhance the viewing effect, especially when applied to calligraphy practice, game development and other scenarios, it can significantly improve the user's interactive experience.
[0073] Please refer to Figures 2 to 8A terminal 1 for quickly 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:
[0074] S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, and selecting matching data corresponding to the target Chinese character in a Chinese character database;
[0075] S2. Generate a connection point set for each stroke according to the matching data, wherein the connection point set includes connection points including a start vertex and an end vertex;
[0076] S3, applying a line matching rule to perform line matching on the line points in the line point set to generate line data of corresponding strokes;
[0077] S4. Generate a handwritten Chinese character animation of the target Chinese character according to the stroke sequence of all the strokes of the target Chinese character and the connection data.
[0078] From the above description, it can be seen that the beneficial effects of the present invention are: after obtaining the target Chinese character that the user wants to generate a handwritten Chinese character animation, the set of connection points of each stroke of the target Chinese character is determined by database matching, and then the connection data of the strokes is generated in combination with the connection matching rules. Finally, the handwritten Chinese character animation is generated based on 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 obtained more accurately and quickly, and then the description of each stroke during real handwriting is simulated by generating the connection data of each stroke, so that the Chinese characters appear stroke by stroke, which helps learners to better understand and practice Chinese character writing, and has a more realistic and vivid experience. The real-time animation generation method can save storage space, is not limited by storage or performance, and flexibly meets user needs.
[0079] Furthermore, the selecting matching data corresponding to the target Chinese character in the Chinese character database specifically includes:
[0080] 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.
[0081] From the above description, it can be seen that in the Chinese character database, using all the strokes of Chinese characters and the center point data and vertex data of each stroke as matching data can not only improve the accuracy and convenience of matching multiple target Chinese characters, but also help in the subsequent analysis of the connection method of each stroke.
[0082] Furthermore, the step S2 specifically includes:
[0083] S21, calculating the starting vertex and the ending vertex of the corresponding stroke according to the vertex data and the center point data;
[0084] S22: Generate connection point data between the starting vertex and the ending vertex to obtain the connection point set.
[0085] From the above description, it can be seen that each stroke is divided into a set of connecting points from the starting vertex to the ending vertex, so that the stroke can be drawn in a more detailed point-by-point manner. This is not only less prone to errors, but also helps to introduce factors such as pen speed changes during drawing to simulate real handwritten stroke effects, making the final handwriting animation effect more realistic and vivid, thereby enhancing the user's viewing experience.
[0086] Furthermore, the step S3 comprises:
[0087] S31, starting from the starting vertex, selecting a preset number of continuous connection points from the connection point set according to the connection sequence;
[0088] S32, selecting one from a straight line, a Bezier curve, a quadratic curve, or a Bezier curve as a target line segment, fitting the selected line points with the target line segment, and determining whether the average value or variance of the distances from all the line points to the target line segment is greater than or equal to a corresponding threshold value, if so, determining that the target line segment is the line connection mode, otherwise reselecting the target line segment and making a determination;
[0089] S33, integrating all the connection modes belonging to the same connection point set to obtain the connection data.
[0090] From the above description, it can be seen that when studying and drawing each stroke, the connection method is determined from the connection matching rules based on the connection order of the divided connection points and the positional relationship between the selected connection points. This is suitable for carefully and accurately analyzing the connections of more different strokes, so as to facilitate the subsequent generation of handwritten stroke animations for each stroke.
[0091] Furthermore, the step S4 comprises:
[0092] S41, generating a handwritten stroke animation of a corresponding stroke according to the connection data;
[0093] S42: Generate 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, it can be seen that when generating a handwriting animation, the handwriting stroke animation of the corresponding strokes is first generated through the connection data, and then the handwriting Chinese character animation is generated according to the stroke order and handwriting stroke animation of all the strokes of the target Chinese character to simulate the reality and enhance the viewing effect, especially when applied to calligraphy practice, game development and other scenarios, it can significantly improve the user's interactive experience.
[0095] Please refer to Figures 1 to 7 , Embodiment 1 of the present invention is:
[0096] A method for quickly generating handwritten Chinese character animations comprises the following steps:
[0097] S1, obtaining the target Chinese character for which handwritten Chinese character animation needs to be generated, and selecting matching data corresponding to the target Chinese character in the Chinese character database;
[0098] In this embodiment, combined with Figure 2 As shown, obtaining the target Chinese characters for generating handwritten Chinese character animations can specifically be obtaining the Chinese characters input by the user on the display interface. The number of target Chinese characters can be one or more. When there are multiple target Chinese characters, the matching data corresponding to the target Chinese characters are selected one by one from the Chinese character database. If there is no matching data corresponding to the current target Chinese character, the selection action is continued for the next target Chinese character. Among them, 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. Combined with Figure 3 As shown, the above steps select the stroke composition of the corresponding target Chinese character and the vertex data and center point data of each stroke in the stroke composition as matching data.
[0099] It should be noted that in this embodiment, based on conventional knowledge, the definition of strokes is that each Chinese character can be written and drawn by one or more strokes, and each stroke is called a stroke. Furthermore, vertex data is defined as a set of key vertices at the boundary of each stroke drawing; center point data is defined as a set of key vertices at the middle position of each stroke drawing when the pen is put down.
[0100] S2. Generate a connection point set for each stroke according to the matching data, wherein the connection point set includes connection points including a start vertex and an end vertex;
[0101] In this embodiment, if Figure 4 and Figure 5 As shown, 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 starting vertex and the ending vertex respectively correspond to the starting point and the ending point of each stroke when drawing the boundary and the interior of the graphic, while the connection point data are the points between the starting vertex and the ending vertex; the connection point data are divided into two parts. 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 graphic. Drawing from the starting vertex position on the left upward to the ending vertex position on the right is one part, and drawing from the starting vertex position on the left downward to the ending vertex position on the right is one part, with a total of two connections; the two connections correspond to two parts;
[0104] In this embodiment, the vertex data and center point data corresponding to a stroke type define the shape of the stroke at the standard size and position. We perform displacement, rotation, and scaling on the standard graphic so that the center point of the standard graphic can better fit the target center point position. The vertex data after processing is the vertex data calculated for this stroke to be drawn, that is, all the connection point data including the starting vertex and the ending vertex.
[0105] For example: For the two horizontal strokes (一) in the Chinese character "二", we need to perform different displacements and scalings on the standard graphics according to the center point positions of the two horizontal strokes (一) generated by the AI module so that the two standard graphics can better fit the positions and sizes of the two horizontal strokes (一) above and below, and then we can obtain the vertex data of the two strokes in the Chinese character "二".
[0106] S22. Integrate the connection point data between the starting vertex and the ending vertex to obtain a connection point set.
[0107] Meanwhile, for each part of the connection point data, it is determined by selecting all the vertices and the center point on the connection path from the starting vertex to the ending vertex. For example, for a "horizontal fold" stroke, in addition to the starting vertex at the graphic endpoint of the "horizontal" part, there are also vertices at the boundary of the bent part; the vertex data and center point data of each stroke can be obtained by relying on existing stroke disassembling software such as ChatGPT, ChatGLM, Doubao, Wenxin Yiyan, Tencent Hunyuan, etc.
[0108] S3. Apply the connection matching rule to match the connection points in the connection point set to generate the connection data of the corresponding stroke;
[0109] In this embodiment, as Figure 6 shown, step S3 includes:
[0110] S31. Starting from the starting vertex, select a preset number of consecutive connection points in the connection point set according to the connection order;
[0111] S32, selecting one from a straight line, a Bezier curve, a quadratic curve, or a Bezier curve as a target line segment, fitting the selected line points with the target line segment, and determining whether the average value or variance of the distances from all the line points to the target line segment is greater than or equal to a corresponding threshold value, if so, determining that the target line segment is the line connection mode, otherwise reselecting the target line segment and making a determination;
[0112] The line matching rules include but are not limited to using straight lines, Bezier curves, quadratic curves, or Bezier cubic curves to connect lines. The line segment fitting process has the following points:
[0113] First, try to fit the connection point and the next two connection points with a straight line, calculate the distances from the three connection points to the straight line, 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 the three connection points can be matched with a straight line.
[0114] Second, 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 the 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.
[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 are fitted with a cubic curve.
[0116] Fourth, if there is only one connection point after the connection point (i.e. the end vertex), the straight line is used directly.
[0117] Fifth, if a straight line cannot be used for matching, and there are only two connecting points after the connecting point, then the quadratic curve is used directly.
[0118] Therefore, the preset number of selections is generally 3 points. The positional relationship between the starting point and the next two points is determined according to the connection sequence. First, it is determined whether it is suitable for straight line fitting, and 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 connection point set to obtain connection data.
[0120] S4. Generate a handwritten Chinese character animation of the target Chinese character according to the stroke sequence and connection data of all the strokes of the target Chinese character.
[0121] In this embodiment, if Figure 7 As shown, step S4 includes:
[0122] S41, generating a handwritten stroke animation of a corresponding stroke according to the connection data;
[0123] In this embodiment, the line drawing method includes but is not limited to the method of generating a mesh model by drawing mesh vertices in a game engine; the method of drawing lines by using line drawing methods such as CSS or SVG in software development, etc. Moreover, the graphic filling method of the area surrounded by the stroke line includes but is not limited to the method of drawing by model material when drawing a mesh model in a game engine; the method of automatically drawing lines as graphics by using CSS or SVG in software development, etc.
[0124] S42: Generate a handwritten Chinese character animation according to the stroke sequence of all strokes of the target Chinese character and the handwritten stroke animation.
[0125] Please refer to Figures 2 to 8 , Embodiment 2 of the present invention is:
[0126] A terminal 1 for quickly generating handwritten Chinese character animations, such as Figure 8 As shown, it includes 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 a handwritten Chinese character animation according to the first embodiment is implemented.
[0127] In this embodiment, if Figure 2 As shown, the memory mainly includes a database module; this module is responsible for storing and retrieving matching data of Chinese characters in the local database, including the stroke vertex data and center point data of each Chinese character. This module determines whether there is available matching data by searching the input Chinese characters for further processing.
[0128] In this embodiment, the processor mainly includes the following functional modules:
[0129] 1. Data analysis module
[0130] This module is used to extract the vertex data and center point data from the matching data, and calculate the start vertex and end vertex of each stroke. In addition, this module also divides each stroke vertex data into two sets of connection point data to provide a basis for subsequent connection matching. Figure 3 As shown, the data parsing module extracts the vertex data and center point data of each stroke in the matching data; Figure 4 As shown, the data analysis module calculates the starting vertex and the ending vertex through the center point data and vertex data of each stroke, such as Figure 5 As shown, the data parsing module divides each stroke vertex data into two sets of line point data from the start vertex to the end vertex.
[0131] 2. Connection matching module
[0132] like Figure 6 As shown, the module matches the connection points in the segmented connection point data set according to the rules, that is, using straight lines, Bezier curves, etc., to generate the final connection data. Specifically, the connection point data in each set of connection point data is matched using the matching rules of straight lines, Bezier curves, quadratic curves or Bezier cubic curves to generate connection data.
[0133] 3. Stroke drawing module
[0134] like Figure 7 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.
[0135] In summary, the present invention provides a method and terminal for quickly generating handwritten Chinese character animations. After obtaining the target Chinese character that the user wants to generate a handwritten Chinese character animation for, the set of connecting points of each stroke of the target Chinese character is determined by matching the vertex data and center point data of each stroke in a database, and then the connecting line data of the strokes is generated in combination with the connecting line matching rules. Specifically, the connection method is determined by the positional relationship between the connecting points of the two connecting line data of each stroke. Finally, the handwritten Chinese character animation is generated according to the connecting line data of each stroke and the stroke order of all strokes. Based on data matching, the connecting line related information of the corresponding target Chinese character can be obtained more accurately and quickly, and then the description of each stroke in real handwriting is simulated by generating the connecting 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.
[0136] 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 quickly generating handwritten Chinese character animations. It is characterized in that The steps include: S1, obtaining a target Chinese character for which a handwritten Chinese character animation needs to be generated, and selecting matching data corresponding to the target Chinese character in a Chinese character database; S2. Generate a connection point set for each stroke according to the matching data, wherein the connection point set includes connection points including a start vertex and an end vertex; S3, applying a line matching rule to perform line matching on the line points in the line point set to generate line data of corresponding strokes; S4. Generate a handwritten Chinese character animation of the target Chinese character according to the stroke sequence of all the strokes of the target Chinese character and the connection data.
2. A method for quickly generating handwritten Chinese character animation according to claim 1, It is characterized in that The selecting of matching data corresponding to the target Chinese character in 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.
3. A method for quickly generating handwritten Chinese character animation according to claim 2, It is characterized in that The step S2 specifically includes: S21, calculating the starting vertex and the ending vertex of the corresponding stroke according to the vertex data and the center point data; S22: Generate connection point data between the starting vertex and the ending vertex to obtain the connection point set.
4. The method for quickly generating handwritten Chinese character animation according to claim 1, It is characterized in that The step S3 comprises: S31, starting from the starting vertex, selecting a preset number of continuous connection points from the connection point set according to the connection sequence; S32, selecting one from a straight line, a Bezier curve, a quadratic curve, or a Bezier curve as a target line segment, fitting the selected line points with the target line segment, and determining whether the average value or variance of the distances from all the line points to the target line segment is greater than or equal to a corresponding threshold value, if so, determining that the target line segment is the line connection mode, otherwise reselecting the target line segment and making a determination; S33, integrating all the connection modes belonging to the same connection point set to obtain connection data.
5. The method for quickly generating handwritten Chinese character animation according to claim 1, It is characterized in that The step S4 comprises: S41, generating a handwritten stroke animation of a corresponding stroke according to the connection data; S42: Generate the handwritten Chinese character animation according to the stroke order of all strokes of the target Chinese character and the handwritten stroke animation.
6. A terminal for quickly generating handwritten Chinese character animation, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is 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, and selecting matching data corresponding to the target Chinese character in a Chinese character database; S2. Generate a connection point set for each stroke according to the matching data, wherein the connection point set includes connection points including a start vertex and an end vertex; S3, applying a line matching rule to perform line matching on the line points in the line point set to generate line data of corresponding strokes; S4. Generate a handwritten Chinese character animation of the target Chinese character according to the stroke sequence of all the strokes of the target Chinese character and the connection data.
7. A terminal for quickly generating handwritten Chinese character animation according to claim 6, It is characterized in that The selecting of matching data corresponding to the target Chinese character in 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.
8. A terminal for quickly generating handwritten Chinese character animation according to claim 7, It is characterized in that The step S2 specifically includes: S21, calculating the starting vertex and the ending vertex of the corresponding stroke according to the vertex data and the center point data; S22: Generate connection point data between the starting vertex and the ending vertex to obtain the connection point set.
9. A terminal for quickly generating handwritten Chinese character animation according to claim 6, It is characterized in that The step S3 comprises: S31, starting from the starting vertex, selecting a preset number of continuous connection points from the connection point set according to the connection sequence; S32, selecting one from a straight line, a Bezier curve, a quadratic curve, or a Bezier curve as a target line segment, fitting the selected line points with the target line segment, and determining whether the average value or variance of the distances from all the line points to the target line segment is greater than or equal to a corresponding threshold value, if so, determining that the target line segment is the line connection mode, otherwise reselecting the target line segment and making a determination; S33, integrating all the connection modes belonging to the same connection point set to obtain the connection data.
10. A terminal for quickly generating handwritten Chinese character animation according to claim 6, It is characterized in that The step S4 comprises: S41, generating a handwritten stroke animation of a corresponding stroke according to the connection data; S42: Generate the handwritten Chinese character animation according to 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
A method for generating dynamic writing animations from images of calligraphic Chinese characters.
CN102289838A
Method and device for automatically generating Chinese character stroke order animation and related components thereof
CN113436298A
Generation method, generation system and application method of font writing stroke order
CN113657330A
Smoothing and GPU-enabled rendering of digital ink
US20160078649A1
