A method and terminal for reorganizing character strokes

By converting the strokes of characters into 3D models and dragging them in Chinese character teaching software, the problems of insufficient spatial dimensions and interest of Chinese character teaching software in a 2D environment are solved, achieving higher scalability and interest.

CN115756291BActive Publication Date: 2025-09-26FUJIAN TQ DIGITAL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211153477.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2025-09-26
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

Existing Chinese character teaching software lacks spatial dimension and fun in a 2D environment and is not scalable enough.

Method used

By pre-storing animated images of text writing, determining the difference images between adjacent frames, deciding whether to merge the difference images, converting them into 3D models, and moving the strokes according to the drag path, the strokes of Chinese characters can be reorganized.

Benefits of technology

Allowing users to drag the three-dimensional strokes of Chinese characters in a 3D environment improves the spatial dimension and fun of text teaching and expands more teaching methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115756291B_ABST
    Figure CN115756291B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and terminal for reorganizing the strokes of a character. The method determines the difference images of adjacent frames in a dynamic image according to the writing dynamic image of the character. After obtaining the difference images, it is determined in sequence whether to merge the difference images according to the spacing between adjacent difference images, thereby splicing out each stroke of the character; the strokes of the character are converted into a 3D model, and the 3D model of the strokes is moved according to the dragging path of the strokes. Therefore, in a 3D environment, users can drag the three-dimensional strokes of Chinese characters to experience the operation process of reorganizing the strokes into Chinese characters, thereby improving the spatial dimension and interest of character teaching. In addition, by identifying each stroke of the character and operating each stroke, it is convenient to subsequently expand more teaching methods based on 3D strokes, thereby improving the scalability of character teaching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a method and a terminal for reorganizing character strokes. Background Art

[0002] Current Chinese character teaching software mainly recognizes the stroke order of Chinese characters, and then allows users to write the entire Chinese character from beginning to end like writing Chinese characters in a copybook, and then receive scores.

[0003] However, it currently mainly runs in a 2D environment, and Chinese character teaching software is lacking in spatial dimension, fun and scalability. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and terminal for reorganizing the strokes of a character, which can improve the spatial dimension, interest and scalability of character teaching.

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

[0006] A method for reorganizing the strokes of a character, comprising the steps of:

[0007] Pre-store a text writing animation, and determine difference images of adjacent frames in the writing animation;

[0008] determining whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character;

[0009] Each stroke of the character is converted into a 3D model, a drag path of the stroke to be moved is received, the 3D model of the stroke to be moved is moved according to the drag path, and a reconstructed character is obtained based on the movement result of the stroke.

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

[0011] A terminal for recombining strokes of a character includes 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:

[0012] Pre-store a text writing animation, and determine difference images of adjacent frames in the writing animation;

[0013] determining whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character;

[0014] Convert each stroke of the text into a 3D model, receive the drag path of the stroke to be moved, move the 3D model of the stroke to be moved according to the drag path, and obtain the reorganized text through the movement result of the stroke.

[0015] The beneficial effects of the present invention are as follows: Determine the difference image between adjacent frames in the animation based on the writing animation of the text. After obtaining the difference image, sequentially judge whether to merge the difference images according to the distance between adjacent difference images, so as to splice each stroke of the text; Convert the strokes of the text into 3D models, and move the 3D models of the strokes according to the drag paths of the strokes. Therefore, in a 3D environment, users can drag the three-dimensional strokes of Chinese characters manually to experience the operation process of reorganizing strokes into Chinese characters, improving the spatial dimension and interest of character teaching. And by identifying each stroke of the text and operating on each stroke, it is convenient to expand more teaching methods based on 3D strokes in the future, improving the expandability of character teaching. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a flowchart of a method for reorganizing strokes of a text according to an embodiment of the present invention;

[0017] Figure 2 It is a schematic diagram of a terminal for reorganizing strokes of a text according to an embodiment of the present invention;

[0018] Figure 3 It is a specific step flowchart of a method for reorganizing strokes of a text according to an embodiment of the present invention;

[0019] Figure 4 It is a schematic diagram of obtaining a difference image according to an embodiment of the present invention;

[0020] Figure 5 It is a schematic diagram of calculating the shortest distance from each pixel in a stroke to a third edge coordinate set according to an embodiment of the present invention;

[0021] Figure 6 It is a front view of the "horizontal" stroke of the character "beautiful" according to an embodiment of the present invention;

[0022] Figure 7 It is a side view of the "horizontal" stroke of the character "beautiful" with the Z coordinate calculated by a linear algorithm according to an embodiment of the present invention;

[0023] Figure 8 It is a side view of the "horizontal" stroke of the character "beautiful" with the Z coordinate calculated by a non-linear algorithm according to an embodiment of the present invention;

[0024] Reference numeral description:

[0025] 1. A terminal for reorganizing strokes of a text; 2. A memory; 3. A processor. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0026] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.

[0027] Please refer to Figure 1 , an embodiment of the present invention provides a method for reorganizing the strokes of a character, comprising the steps of:

[0028] Pre-store a text writing animation, and determine difference images of adjacent frames in the writing animation;

[0029] determining whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character;

[0030] Each stroke of the character is converted into a 3D model, a drag path of the stroke to be moved is received, the 3D model of the stroke to be moved is moved according to the drag path, and a reconstructed character is obtained based on the movement result of the stroke.

[0031] From the above description, it can be seen that the beneficial effects of the present invention are: determining the difference images of adjacent frames in the animation based on the writing animation of the text, and after obtaining the difference images, judging whether to merge the difference images in sequence according to the spacing between adjacent difference images, thereby splicing out each stroke of the text; converting the strokes of the text into a 3D model, and moving the 3D model of the stroke according to the dragging path of the stroke, so that in a 3D environment, users can drag the three-dimensional strokes of Chinese characters to experience the operation process of recombining the strokes into Chinese characters, thereby improving the spatial dimension and fun of text teaching, and by identifying each stroke of the text and operating each stroke, it is convenient to expand more teaching methods based on 3D strokes in the future, thereby improving the scalability of text teaching.

[0032] Furthermore, the pre-stored text writing animation and determining the difference images of adjacent frames in the writing animation include:

[0033] Reading a written image of a text, and storing the written image in a memory;

[0034] Traversing each frame of the written animation and converting each frame into a three-dimensional tensor;

[0035] Determine the difference image between each frame and the next frame.

[0036] As can be seen from the above description, a set of difference images between each frame of the animated image and the next frame is obtained, and the difference images are stored in the form of a three-dimensional tensor, which facilitates subsequent processing of the difference images to synthesize the strokes of the text.

[0037] Furthermore, the step of determining whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character includes:

[0038] Obtain the first edge coordinate set of each difference image and the second edge coordinate set of the subsequent difference image in sequence, and determine whether the minimum distance between the first edge coordinate set and the second edge coordinate set is lower than a preset spacing. If so, merge the difference image with the subsequent difference image, and use the merged image to replace the difference image and the subsequent difference image; otherwise, use the difference image as the strokes of the text.

[0039] From the above description, it can be seen that by merging the adjacent difference images based on the spacing between them, the strokes of the characters can be quickly obtained.

[0040] Furthermore, converting each stroke of the character into a 3D model includes:

[0041] Get the first pixel coordinate set in each stroke;

[0042] Obtaining a third edge coordinate set for each stroke, calculating the shortest distance from each pixel in the stroke to the third edge coordinate set, determining a Z value for each pixel in the stroke based on the shortest distance, and obtaining a second pixel coordinate set for each stroke;

[0043] The first pixel coordinate set and the second pixel coordinate set are combined to obtain a three-dimensional coordinate set, and a 3D model of the stroke is established based on the three-dimensional coordinate set.

[0044] From the above description, it can be seen that the first pixel coordinate set in the stroke is obtained, where the Z value of each coordinate in the first pixel coordinate set is 0; the Z value of each pixel in the stroke is determined according to the shortest distance from each pixel in the stroke to the edge, and the second pixel coordinate set is obtained. Therefore, by merging the first pixel coordinate set and the second pixel coordinate set, a closed three-dimensional stroke coordinate set can be obtained.

[0045] Furthermore, the receiving a drag path of the stroke to be moved and moving the 3D model of the stroke to be moved according to the drag path includes:

[0046] Receive the drag path of the stroke to be moved, and obtain a first pixel coordinate set of the stroke to be moved after the stroke is moved;

[0047] It is determined whether the distance between the first pixel coordinate set and the target position is less than a preset distance. If so, the stroke to be moved is adsorbed to the target position.

[0048] From the above description, it can be seen that after dragging a stroke, if the distance between the first pixel coordinate set after the stroke is dragged and the target position is less than the preset distance, the stroke is adsorbed to the target position to improve the user experience.

[0049] Please refer to Figure 2Another embodiment of the present invention provides a terminal for recombining strokes of a character, comprising 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:

[0050] Pre-store a text writing animation, and determine difference images of adjacent frames in the writing animation;

[0051] determining whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character;

[0052] Each stroke of the character is converted into a 3D model, a drag path of the stroke to be moved is received, the 3D model of the stroke to be moved is moved according to the drag path, and a reconstructed character is obtained based on the movement result of the stroke.

[0053] From the above description, it can be seen that the beneficial effects of the present invention are: determining the difference images of adjacent frames in the animation based on the writing animation of the text, and after obtaining the difference images, judging whether to merge the difference images in sequence according to the spacing between adjacent difference images, thereby splicing out each stroke of the text; converting the strokes of the text into a 3D model, and moving the 3D model of the stroke according to the dragging path of the stroke, so that in a 3D environment, users can drag the three-dimensional strokes of Chinese characters to experience the operation process of recombining the strokes into Chinese characters, thereby improving the spatial dimension and fun of text teaching, and by identifying each stroke of the text and operating each stroke, it is convenient to expand more teaching methods based on 3D strokes in the future, thereby improving the scalability of text teaching.

[0054] Furthermore, the pre-stored text writing animation and determining the difference images of adjacent frames in the writing animation include:

[0055] Reading a written image of a text, and storing the written image in a memory;

[0056] Traversing each frame of the written animation and converting each frame into a three-dimensional tensor;

[0057] Determine the difference image between each frame and the next frame.

[0058] As can be seen from the above description, a set of difference images between each frame of the animated image and the next frame is obtained, and the difference images are stored in the form of a three-dimensional tensor, which facilitates subsequent processing of the difference images to synthesize the strokes of the text.

[0059] Furthermore, the step of determining whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character includes:

[0060] Obtain the first edge coordinate set of each difference image and the second edge coordinate set of the subsequent difference image in sequence, and determine whether the minimum distance between the first edge coordinate set and the second edge coordinate set is lower than a preset spacing. If so, merge the difference image with the subsequent difference image, and use the merged image to replace the difference image and the subsequent difference image; otherwise, use the difference image as the strokes of the text.

[0061] From the above description, it can be seen that by merging the adjacent difference images based on the spacing between them, the strokes of the characters can be quickly obtained.

[0062] Furthermore, converting each stroke of the character into a 3D model includes:

[0063] Get the first pixel coordinate set in each stroke;

[0064] Obtaining a third edge coordinate set for each stroke, calculating the shortest distance from each pixel in the stroke to the third edge coordinate set, determining a Z value for each pixel in the stroke based on the shortest distance, and obtaining a second pixel coordinate set for each stroke;

[0065] The first pixel coordinate set and the second pixel coordinate set are combined to obtain a three-dimensional coordinate set, and a 3D model of the stroke is established based on the three-dimensional coordinate set.

[0066] From the above description, it can be seen that the first pixel coordinate set in the stroke is obtained, where the Z value of each coordinate in the first pixel coordinate set is 0; the Z value of each pixel in the stroke is determined according to the shortest distance from each pixel in the stroke to the edge, and the second pixel coordinate set is obtained. Therefore, by merging the first pixel coordinate set and the second pixel coordinate set, a closed three-dimensional stroke coordinate set can be obtained.

[0067] Furthermore, the receiving a drag path of the stroke to be moved and moving the 3D model of the stroke to be moved according to the drag path includes:

[0068] Receive the drag path of the stroke to be moved, and obtain a first pixel coordinate set of the stroke to be moved after the stroke is moved;

[0069] It is determined whether the distance between the first pixel coordinate set and the target position is less than a preset distance. If so, the stroke to be moved is adsorbed to the target position.

[0070] From the above description, it can be seen that after dragging a stroke, if the distance between the first pixel coordinate set after the stroke is dragged and the target position is less than the preset distance, the stroke is adsorbed to the target position to improve the user experience.

[0071] The above-mentioned method for stroke recombination of a character and a terminal according to the present invention are applicable to the process of Chinese character teaching. In a 3D or even XR environment, users can manually drag the three-dimensional strokes of Chinese characters to experience the operation process of stroke recombination into Chinese characters. The following will be described through specific embodiments:

[0072] Embodiment 1

[0073] Please refer to Figure 1 and Figure 3 , a method for stroke recombination of a character, including the steps:

[0074] S1. Pre-store the writing animation of the character and determine the difference images between adjacent frames of the writing animation.

[0075] S11. Read the writing animation of the character and store the writing animation in the memory.

[0076] In this embodiment, prepare the writing animation GIF corresponding to each Chinese character in advance. The writing process of each stroke of the Chinese character contains at least 1 frame or more in the GIF file. For each Chinese character, use the PIL library of Python to read its GIF file into the memory through the Image.open interface.

[0077] In some embodiments, the GIF file can be downloaded from the Internet or crawled from some free websites without copyright disputes through a web crawler.

[0078] S12. Traverse each frame of the writing animation and convert each frame of the picture into a three-dimensional tensor.

[0079] In this embodiment, continue to use the PIL library, use ImageSequence.Iterator to obtain an iterator, traverse and disassemble each frame of the picture in the GIF file. Use the asarray interface of the Numpy library of Python to convert each frame of the picture into a three-dimensional tensor of the array type of Numpy.

[0080] S13. Determine the difference image between each frame of the picture and the next frame of the picture.

[0081] Specifically, use the cv2.absdiff interface of the OpenCV library of Python to obtain a set of difference images of each frame of the GIF file compared with the next frame. Each set of difference images is still stored in the form of a three-dimensional tensor.

[0082] Please refer to Figure 4 , taking the horizontal stroke of the character "美" as an example, three difference images are obtained.

[0083] S2. Determine whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character.

[0084] Specifically, step S2 includes:

[0085] Obtain the first edge coordinate set of each difference image and the second edge coordinate set of the subsequent difference image in sequence, and determine whether the minimum distance between the first edge coordinate set and the second edge coordinate set is lower than a preset spacing. If so, merge the difference image with the subsequent difference image, and use the merged image to replace the difference image and the subsequent difference image; otherwise, use the difference image as the strokes of the text.

[0086] In this embodiment, the coordinate set of the edge non-empty pixels of the three-dimensional tensor of the front and back difference images is obtained through the cv2.Canny interface of the Python OpenCV library.

[0087] Judge each coordinate in the above two coordinate sets. If there are more than 2% non-empty pixels in the two three-dimensional tensors, and the minimum distance between the first edge coordinate set and the second edge coordinate set is less than the square root of 2, then it can be determined that the two three-dimensional tensors actually belong to the same stroke of the Chinese character. It can be regarded as a stroke being split into multiple frames in a GIF file, resulting in the pixel points being split into multiple three-dimensional tensors. For the two three-dimensional tensors that meet the conditions, merge them. Finally, by traversing all the three-dimensional tensors and merging them, each stroke corresponds to a three-dimensional tensor.

[0088] Therefore, when a Chinese character has fewer strokes, the number of frames in the GIF file will also be fewer, so the corresponding processing amount will also be less, and thus the processing efficiency will be higher.

[0089] S3. Convert each stroke of the text into a 3D model, receive a drag path of the stroke to be moved, move the 3D model of the stroke to be moved according to the drag path, and obtain a reconstructed text based on the movement result of the stroke.

[0090] S31. Obtain the first pixel coordinate set in each stroke.

[0091] Specifically, the coordinate set of each pixel point on the edge of the stroke is obtained through the cv2.Canny interface of the Python OpenCV library.

[0092] Converting 2D pixels to 3D coordinates: Originally, each pixel in a stroke resides on a 2D plane and therefore only has X and Y coordinate information. First, a Z coordinate value of 0 is added to all pixels. This transforms these pixels into the first pixel coordinate set in 3D space, while still remaining within the same 2D plane. Therefore, the first pixel coordinate set is also called "Pixel Set 1-Plane."

[0093] S32. Obtain a third edge coordinate set for each stroke, calculate the shortest distance from each pixel in the stroke to the third edge coordinate set, determine the Z value of each pixel in the stroke based on the shortest distance, and obtain a second pixel coordinate set in each stroke.

[0094] For details, please refer to Figure 5 and Figure 6 Calculate the minimum distance between each pixel in the stroke and each pixel on the edge; after conversion through a linear or nonlinear function, use it as the coordinate value of each pixel on the Z axis. Figure 7 If you want the stroke to be sharp, like a mountain peak, select a linear function, such as multiplying by a constant; see Figure 8 If you want a smoother stroke shape, use the atan or sqrt functions in the C# math library. The farther away from the edge, the larger the Z coordinate, and the more prominent the visual effect.

[0095] The resulting trace of all pixels is a three-dimensional "shell", ie, a second pixel coordinate set, also called a "pixel set 2-stereo".

[0096] S33: Merge the first pixel coordinate set and the second pixel coordinate set to obtain a three-dimensional coordinate set, and establish a 3D model of the stroke based on the three-dimensional coordinate set.

[0097] Specifically, the aforementioned "Pixel Set 1 - Plane" and "Pixel Set 2 - Stereo" are combined into a single, larger pixel set. This set forms a closed space, essentially a three-dimensional stroke. This creates a more visually appealing rendering experience in 3D space, even in XR environments. Furthermore, we can assign different material shapes to these complete, closed 3D objects, such as wood grain, metal, and marble, adding a level of interest to the teaching process and facilitating the development of additional teaching methods.

[0098] In the 3D engine, the pixel set of each stroke is constructed into a three-dimensional object. The 3D engine used in this embodiment is Unity. The coordinates of these pixels are input through the Mesh.RecalculateNormals interface provided by Unity to create a three-dimensional mesh and turn it into a three-dimensional object.

[0099] S34: Receive the drag path of the stroke to be moved, and obtain a first pixel coordinate set after the stroke to be moved is moved.

[0100] Specifically, three-dimensional strokes can be dragged in 3D / XR: in the Unity engine, custom MonoBehaviours are mounted for these three-dimensional strokes, which respond to the OnMouseDrag interface to support operations such as dragging, rotating, and scaling. In some embodiments, each stroke can be customized into various preset shapes.

[0101] S35: Determine whether the distance between the first pixel coordinate set and the target position is less than a preset distance. If so, adsorb the stroke to be moved to the target position.

[0102] Specifically, in the process of dragging the three-dimensional strokes and re-spelling them into Chinese characters, the correctness is judged: Since the coordinates of each valid pixel in the stroke have been obtained in the previous steps. Therefore, in this step, when the user drags the three-dimensional strokes in the 3D / XR environment, the system can obtain the spatial position of the three-dimensional strokes in each frame, and subtract the pixel coordinates of the bottom surface of the three-dimensional stroke, that is, all pixels in the "pixel set 1-plane", from the coordinates of the target pixel being dragged. When it is judged that the difference after subtracting all pixels is within a certain threshold range, for example, 10 pixels, it is considered that the user has basically dragged to the correct position, and the three-dimensional stroke is adsorbed to the target position. On the contrary, it is judged that the user has not dragged to the correct position, and a prompt is given when feedback is received that the user has released the button.

[0103] Example 2

[0104] Please refer to Figure 2 A character stroke reorganization terminal 1 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, each step of a character stroke reorganization method of embodiment 1 is implemented.

[0105] In summary, the present invention provides a method and terminal for reorganizing the strokes of a character. The method determines the difference images of adjacent frames in a dynamic image based on the writing dynamic image of the character. After obtaining the difference images, the method determines whether to merge the difference images in sequence according to the spacing between adjacent difference images, thereby splicing out each stroke of the character; the strokes of the character are converted into a 3D model, and the 3D model of the stroke is moved according to the dragging path of the stroke. Therefore, in a 3D environment, the user can drag the three-dimensional strokes of Chinese characters to experience the operation process of reorganizing the strokes into Chinese characters, thereby improving the spatial dimension and fun of character teaching, and by identifying each stroke of the character and operating each stroke, it is convenient to subsequently expand more teaching methods based on 3D strokes, thereby improving the scalability of character teaching.

[0106] 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 description 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 reorganizing the strokes of a character, characterized in that: Including steps: Pre-store a text writing animation, and determine difference images of adjacent frames in the writing animation; determining whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character; Converting each stroke of the character into a 3D model, receiving a drag path of the stroke to be moved, moving the 3D model of the stroke to be moved according to the drag path, and obtaining a reconstructed character based on the movement result of the stroke; Converting each stroke of the text into a 3D model includes: Get the first pixel coordinate set in each stroke; Obtaining a third edge coordinate set for each stroke, calculating the shortest distance from each pixel in the stroke to the third edge coordinate set, determining a Z value for each pixel in the stroke based on the shortest distance, and obtaining a second pixel coordinate set for each stroke; The first pixel coordinate set and the second pixel coordinate set are combined to obtain a three-dimensional coordinate set, and a 3D model of the stroke is established based on the three-dimensional coordinate set.

2. The method for reorganizing strokes of a character according to claim 1, wherein: The pre-stored text writing animation, and determining the difference images of adjacent frames in the writing animation comprises: Reading a written image of a text, and storing the written image in a memory; Traversing each frame of the written animation and converting each frame into a three-dimensional tensor; Determine the difference image between each frame and the next frame.

3. The method for reorganizing strokes of a character according to claim 1, wherein: The step of determining whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character includes: Obtain the first edge coordinate set of each difference image and the second edge coordinate set of the subsequent difference image in sequence, and determine whether the minimum distance between the first edge coordinate set and the second edge coordinate set is lower than a preset spacing. If so, merge the difference image with the subsequent difference image, and use the merged image to replace the difference image and the subsequent difference image; otherwise, use the difference image as the strokes of the text.

4. The method for reorganizing strokes of a character according to claim 1, wherein: The receiving a drag path of the stroke to be moved and moving the 3D model of the stroke to be moved according to the drag path includes: Receive the drag path of the stroke to be moved, and obtain a first pixel coordinate set of the stroke to be moved after the stroke is moved; It is determined whether the distance between the first pixel coordinate set and the target position is less than a preset distance. If so, the stroke to be moved is adsorbed to the target position.

5. A character stroke reorganization terminal, 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: Pre-store a text writing animation, and determine difference images of adjacent frames in the writing animation; determining whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character; Converting each stroke of the character into a 3D model, receiving a drag path of the stroke to be moved, moving the 3D model of the stroke to be moved according to the drag path, and obtaining a reconstructed character based on the movement result of the stroke; Converting each stroke of the text into a 3D model includes: Get the first pixel coordinate set in each stroke; Obtaining a third edge coordinate set for each stroke, calculating the shortest distance from each pixel in the stroke to the third edge coordinate set, determining a Z value for each pixel in the stroke based on the shortest distance, and obtaining a second pixel coordinate set for each stroke; The first pixel coordinate set and the second pixel coordinate set are combined to obtain a three-dimensional coordinate set, and a 3D model of the stroke is established based on the three-dimensional coordinate set.

6. The character stroke recombination terminal according to claim 5, characterized in that: The pre-stored text writing animation, and determining the difference images of adjacent frames in the writing animation comprises: Reading a written image of a text, and storing the written image in a memory; Traversing each frame of the written animation and converting each frame into a three-dimensional tensor; Determine the difference image between each frame and the next frame.

7. The character stroke recombination terminal according to claim 5, characterized in that: The step of determining whether to merge adjacent difference images according to the spacing between adjacent difference images to obtain the strokes of the character includes: Obtain the first edge coordinate set of each difference image and the second edge coordinate set of the subsequent difference image in sequence, and determine whether the minimum distance between the first edge coordinate set and the second edge coordinate set is lower than a preset spacing. If so, merge the difference image with the subsequent difference image, and use the merged image to replace the difference image and the subsequent difference image; otherwise, use the difference image as the strokes of the text.

8. The character stroke recombination terminal according to claim 5, characterized in that: The receiving a drag path of the stroke to be moved and moving the 3D model of the stroke to be moved according to the drag path includes: Receive the drag path of the stroke to be moved, and obtain a first pixel coordinate set of the stroke to be moved after the stroke is moved; It is determined whether the distance between the first pixel coordinate set and the target position is less than a preset distance. If so, the stroke to be moved is adsorbed to the target position.

Citation Information

Patent Citations

  • Mechanical arm handwriting simulating method based on feature image self-learning

    CN111523622A

  • Common font Chinese character stroke disassembling method, system and device

    CN112598768A