Three-dimensional Chinese character generation method and device, medium and equipment

By converting the Chinese characters input by the user from two-dimensional to three-dimensional, and performing rotation, expansion and redundant voxel deletion, three-dimensional Chinese character clusters that can present different words at different angles are generated, which solves the complexity of three-dimensional Chinese character design in the existing technology. The problem of high accuracy, low efficiency and high display threshold has been achieved, and an efficient and low-cost three-dimensional Chinese character display has been achieved.

CN118569204APending Publication Date: 2024-08-30厦门工学院
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410507236.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The existing three-dimensional Chinese character design in the cultural and creative field has the problems of flatness, high cost, complicated production and low efficiency. In addition, the display of three-dimensional Chinese characters has the problems of regional restrictions and high exhibition threshold.

Method used

By obtaining two Chinese characters input by the user, the pixel font library is used to perform two-dimensional to three-dimensional conversion, and the voxel set is rotated, copied and expanded, and redundant voxels are deleted to generate three-dimensional Chinese characters that can present different words at different angles. clusters and 3D printed.

Benefits of technology

It realizes the automatic generation of three-dimensional Chinese character clusters, reduces the complexity and cost of manual production, improves efficiency, and presents different Chinese characters at different angles through the principle of optical illusion, solving the regional and threshold limitations of display in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569204A
    Figure CN118569204A
Patent Text Reader

Abstract

The invention relates to a three-dimensional Chinese character generation method and device, a medium and equipment. The method comprises the following steps: acquiring a first Chinese character and a second Chinese character input by a user; obtaining a first two-dimensional pixel set and a second two-dimensional pixel set; preprocessing to obtain a target two-dimensional pixel set of the first Chinese character and a target two-dimensional pixel set of the second Chinese character; performing space conversion to obtain a first voxel set of the first Chinese character and a second voxel set of the second Chinese character; anticlockwise rotating the second voxel set, and aligning the height of the voxels in the first voxel set with the height of the voxels in the second voxel set; taking an intersection between the first three-dimensional voxel space and the second three-dimensional voxel space as a first three-dimensional Chinese character cluster; deleting redundant voxels from the first three-dimensional Chinese character cluster to obtain a second three-dimensional Chinese character cluster; communicating the voxel regions to obtain a target three-dimensional Chinese character cluster; and performing three-dimensional printing according to the target three-dimensional Chinese character cluster to obtain a three-dimensional printing result. Therefore, the three-dimensional Chinese character cluster is automatically generated based on the Chinese characters input by the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional printing, and in particular to a three-dimensional Chinese character generation method, device, medium and equipment. Background Art

[0002] At present, the domestic creative Chinese character cultural design is mainly used in the two fields of cultural and creative products and cultural and creative space display. Among them, most of the products in the cultural and creative field have problems such as flatness, paper, single form, and expensive publications. The main forms include painting books, books, etc., which are relatively lacking in creativity, promotion and inheritance of Chinese character culture. In addition, in the field of cultural and creative space display, 3D Chinese character design has broadened people's horizons, but this kind of three-dimensional space display has problems such as geographical restrictions, high threshold for visiting the exhibition, and high cost. At present, three-dimensional Chinese characters are mainly made by hand, which requires the production staff to have strong spatial imagination. There are problems such as complex production, long time consumption, and low efficiency in the production process. Summary of the invention

[0003] The purpose of the present invention is to provide a three-dimensional Chinese character generation method, device, medium and equipment, which can automatically generate a three-dimensional Chinese character cluster that presents different words from different angles through two Chinese characters.

[0004] In order to achieve the above object, in a first aspect, the present invention provides a method for generating three-dimensional Chinese characters, the method comprising:

[0005] Obtaining a first Chinese character and a second Chinese character input by a user, wherein the first Chinese character and the second Chinese character form a word;

[0006] Acquire a first two-dimensional pixel set of the first Chinese character and a second two-dimensional pixel set of the second Chinese character from a pixel font library;

[0007] Preprocessing the first two-dimensional pixel set and the second two-dimensional pixel set respectively to obtain a target two-dimensional pixel set for the first Chinese character and a target two-dimensional pixel set for the second Chinese character;

[0008] Converting the target two-dimensional pixel set of the first Chinese character from two-dimensional space to three-dimensional space to obtain a first voxel set of the first Chinese character, and converting the target two-dimensional pixel set of the second Chinese character from two-dimensional space to three-dimensional space to obtain a second voxel set of the second Chinese character;

[0009] Rotate the second voxel set counterclockwise by a preset degree, and align the height of the voxel in the first voxel set that meets the specified condition with the height of the voxel in the second voxel set that meets the specified condition, wherein if there is only one voxel at the top in the voxel set, the voxel that meets the specified condition is the top voxel, and if there are multiple voxels at the top in the voxel set, the voxel that meets the specified condition is the leftmost voxel among the multiple voxels at the top;

[0010] The first voxel set is copied and expanded along the z-axis to obtain a first three-dimensional voxel space C1, and the second voxel set is copied and expanded along the x-axis to obtain a second three-dimensional voxel space C2, and the intersection of the first three-dimensional voxel space C1 and the second three-dimensional voxel space C2 is used as a first three-dimensional Chinese character cluster;

[0011] Determine redundant voxels in the first three-dimensional Chinese character cluster, delete the redundant voxels from the first three-dimensional Chinese character cluster, and obtain a second three-dimensional Chinese character cluster;

[0012] Determine a plurality of mutually independent voxel regions in the second three-dimensional Chinese character cluster, determine a global voxel region minimum, connect the plurality of voxel regions to obtain a target three-dimensional Chinese character cluster, so that the number of voxel regions in the target three-dimensional Chinese character cluster is the global voxel region minimum;

[0013] Three-dimensional printing is performed according to the target three-dimensional Chinese character cluster to obtain a three-dimensional printing result, wherein different words are presented at different angles in the three-dimensional printing result.

[0014] In a second aspect, the present invention provides a three-dimensional Chinese character generation device, the device comprising:

[0015] A first acquisition module, used to acquire a first Chinese character and a second Chinese character input by a user, wherein the first Chinese character and the second Chinese character form a word;

[0016] A second acquisition module, configured to acquire a first two-dimensional pixel set of the first Chinese character and a second two-dimensional pixel set of the second Chinese character from a pixel font library;

[0017] a preprocessing module, used to preprocess the first two-dimensional pixel set and the second two-dimensional pixel set respectively to obtain a target two-dimensional pixel set of the first Chinese character and a target two-dimensional pixel set of the second Chinese character;

[0018] a conversion module, configured to convert the target two-dimensional pixel set of the first Chinese character from two-dimensional space to three-dimensional space to obtain a first voxel set of the first Chinese character, and to convert the target two-dimensional pixel set of the second Chinese character from two-dimensional space to three-dimensional space to obtain a second voxel set of the second Chinese character;

[0019] an alignment module, configured to rotate the second voxel set counterclockwise by a preset degree, and align the height of the voxels in the first voxel set that meet the specified condition with the height of the voxels in the second voxel set that meet the specified condition, wherein if there is only one voxel at the top in the voxel set, the voxel that meets the specified condition is the top voxel, and if there are multiple voxels at the top in the voxel set, the voxel that meets the specified condition is the leftmost voxel among the multiple voxels at the top;

[0020] an expansion module, configured to copy and expand the first voxel set along the z-axis to obtain a first three-dimensional voxel space C1, copy and expand the second voxel set along the x-axis to obtain a second three-dimensional voxel space C2, and use the intersection of the first three-dimensional voxel space C1 and the second three-dimensional voxel space C2 as a first three-dimensional Chinese character cluster;

[0021] A first determination module is used to determine redundant voxels in the first three-dimensional Chinese character cluster, and delete the redundant voxels from the first three-dimensional Chinese character cluster to obtain a second three-dimensional Chinese character cluster;

[0022] A second determination module is used to determine a plurality of independent voxel regions in the second three-dimensional Chinese character cluster, determine a global voxel region minimum, connect the plurality of voxel regions to obtain a target three-dimensional Chinese character cluster, so that the number of voxel regions in the target three-dimensional Chinese character cluster is the global voxel region minimum;

[0023] The printing module is used to perform three-dimensional printing according to the target three-dimensional Chinese character cluster to obtain a three-dimensional printing result, wherein different words are presented at different angles in the three-dimensional printing result.

[0024] According to a third aspect, a readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps of the method provided in the first aspect of the present invention are implemented.

[0025] In a fourth aspect, the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a program, and the processor is used to execute the program to implement the steps of the method provided in the first aspect of the present invention.

[0026] Through the above technical solution, the conversion of two-dimensional pixels of Chinese characters to three-dimensional voxels is realized, Chinese characters are converted from two-dimensional space to three-dimensional space, the second voxel set is rotated counterclockwise by a preset degree, and the height of the voxels that meet the specified conditions in the first voxel set is aligned with the height of the voxels that meet the specified conditions in the second voxel set, so that the three-dimensional Chinese character cluster can represent different Chinese characters when orthogonally projected from different angles, and the height of the first voxel set is the same as that of the second voxel set. The voxel set is copied and expanded, and the copied and expanded voxel sets are crossed together, and the intersection between the first three-dimensional voxel space C1 and the second three-dimensional voxel space C2 is used as the first three-dimensional Chinese character cluster, which can meet the effect of viewing and displaying different Chinese characters at different angles. Determine the redundant voxels in the first three-dimensional Chinese character cluster, delete the redundant voxels from the first three-dimensional Chinese character cluster, and obtain the second three-dimensional Chinese character cluster, which can minimize the number of voxels. Then, connect multiple independent voxel regions in the second three-dimensional Chinese character cluster to obtain the target three-dimensional Chinese character cluster. Convert the problem of structural connectivity of the three-dimensional Chinese character cluster into the problem of minimizing the number of regions and the shortest path between regions, which can improve the efficiency of three-dimensional printing. Therefore, based on the two Chinese characters input by the user, a three-dimensional Chinese character cluster can be automatically generated. Using the principle of visual illusion, the Chinese character cluster presents different Chinese characters when viewed from different angles, and can form different words. Compared with artificially produced three-dimensional Chinese characters, this solution can solve the characteristics of high complexity and low efficiency of artificial production. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 The figure is a flowchart showing an exemplary method for generating three-dimensional Chinese characters.

[0028] Figure 2 is a schematic diagram showing an exemplary alignment of a voxel set.

[0029] Figure 3 It is a schematic diagram showing an exemplary method of replicating and expanding a voxel set.

[0030] Figure 4 is a schematic diagram exemplarily showing the intersection between the first three-dimensional voxel space C1 and the second three-dimensional voxel space C2.

[0031] Figure 5 is a schematic diagram showing an exemplary three-dimensional printing result.

[0032] Figure 6 is a flowchart exemplarily showing a method for preprocessing a first two-dimensional pixel set and a second two-dimensional pixel set respectively.

[0033] Figure 7 is a schematic diagram showing an exemplary interval between adjacent two-dimensional pixels.

[0034] Figure 8It is a flowchart of a method for determining redundant voxels in a first three-dimensional Chinese character cluster and deleting the redundant voxels from the first three-dimensional Chinese character cluster to obtain a second three-dimensional Chinese character cluster, which is示例性 shown.

[0035] Fig. 9 It is a schematic diagram of a three-dimensional Chinese character cluster, which is示例性 shown.

[0036] Fig.10 It is a schematic diagram of different regions in a Chinese character cluster, which is示例性 shown.

[0037] Fig.11 It is a schematic diagram of the shortest path of region connection, which is示例性 shown.

[0038] Fig.12 It is a block diagram of a three-dimensional Chinese character generation device, which is示例性 shown. Detailed implementation manners

[0039] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0040] Figure 1 It is a flowchart of a three-dimensional Chinese character generation method, which is示例性 shown. As Figure 1 shown, the method may include Step 11 to Step 19.

[0041] Step 11: Obtain a first Chinese character and a second Chinese character input by a user. Wherein, the first Chinese character and the second Chinese character form a word.

[0042] Step 12: Obtain a first two-dimensional pixel set of the first Chinese character and a second two-dimensional pixel set of the second Chinese character from a pixel font library.

[0043] Exemplarily, for example, if the word input by the user is "China", then "中" is the first Chinese character and "国" is the second Chinese character; for example, if the word input by the user is "involution", then "内" is the first Chinese character and "卷" is the second Chinese character.

[0044] In the present invention, Founder Pixel Font 15 is adopted. The pixel font can be stored through a TTF (TrueType Font) file. Wherein, the font can be composed of pixels, and the pixel sets of each font can be stored in the TTF file, and the total data volume of the stored pixel information exceeds 2 million.

[0045] According to the first Chinese character and the second Chinese character input by the user, the first two-dimensional pixel set of the first Chinese character and the second two-dimensional pixel set of the second Chinese character can be found from the pixel font library.

[0046] Step 13: Preprocess the first two-dimensional pixel set and the second two-dimensional pixel set respectively to obtain a target two-dimensional pixel set for the first Chinese character and a target two-dimensional pixel set for the second Chinese character.

[0047] Step 14: Convert the target two-dimensional pixel set of the first Chinese character from two-dimensional space to three-dimensional space to obtain the first voxel set of the first Chinese character, and convert the target two-dimensional pixel set of the second Chinese character from two-dimensional space to three-dimensional space to obtain the second voxel set of the second Chinese character.

[0048] In the present invention, the front-right orthogonal projection matrix F α This can be shown as follows:

[0049]

[0050] Among them, the front view projection matrix is ​​the xoy plane projection matrix, the right view projection matrix is ​​the yoz plane projection matrix, α∈{0,1}, when α=1, F1 represents the xoy plane orthogonal projection matrix, when α=0, F0 represents the yoz plane orthogonal projection matrix.

[0051] The conversion formula between pixels and voxels is as follows:

[0052] P α =F α ·v j

[0053] Among them, v j represents a 3D voxel, P α represents the corresponding two-dimensional pixel. Different values ​​of α mean that the voxel v j Projecting onto different planes has different projection points.

[0054] Step 15: Rotate the second voxel set counterclockwise by a preset number of degrees, and align the height of the voxels in the first voxel set that meet the specified conditions with the height of the voxels in the second voxel set that meet the specified conditions, wherein if there is only one voxel at the top in the voxel set, the voxel that meets the specified conditions is the top voxel; if there are multiple voxels at the top in the voxel set, the voxel that meets the specified conditions is the leftmost voxel among the multiple top voxels.

[0055] The preset degree may be 90 degrees, that is, the second voxel set is rotated 90 degrees counterclockwise so that the first voxel set and the second voxel set are perpendicular to each other. Then, translation alignment is performed to align the height of the voxels in the first voxel set that meet the specified conditions with the height of the voxels in the second voxel set that meet the specified conditions. Figure 2 is a schematic diagram showing an exemplary alignment of a voxel set, such as Figure 2As shown, taking "中" as the first Chinese character and "国" as the second Chinese character as an example, rotate the set of second voxels corresponding to the second Chinese character "国" counterclockwise by 90 degrees. There is only one voxel at the top of the set of first voxels corresponding to the first Chinese character "中". Then, the voxel that meets the specified condition is the voxel at the top of the first Chinese character "中" pointed by the arrow. There are multiple voxels at the top of the set of second voxels corresponding to the second Chinese character "国", so the voxel that meets the specified condition is the leftmost voxel among the multiple voxels at the top of the second Chinese character "国" pointed by the arrow.

[0056] Step 16: Copy and expand the set of first voxels along the z-axis to obtain the first three-dimensional voxel space C1, copy and expand the set of second voxels along the x-axis to obtain the second three-dimensional voxel space C2, and take the intersection between the first three-dimensional voxel space C1 and the second three-dimensional voxel space C2 as the first three-dimensional Chinese character cluster.

[0057] Figure 3 It is a schematic diagram exemplarily showing the copy and expansion of the voxel set. Taking the first Chinese character as "内" and the second Chinese character as "卷" as an example, as Figure 3 shown, copy and expand the set of first voxels corresponding to the first Chinese character "内" along the z-axis to obtain the first three-dimensional voxel space C1, and copy and expand the set of second voxels corresponding to the second Chinese character "卷" along the x-axis to obtain the second three-dimensional voxel space C2. Figure 4 It is a schematic diagram exemplarily showing the intersection between the first three-dimensional voxel space C1 and the second three-dimensional voxel space C2. As Figure 4 shown, taking the first Chinese character as "内" and the second Chinese character as "卷" as an example, the Chinese character cluster C obtained by the intersection r is the first three-dimensional Chinese character cluster.

[0058] Step 17: Determine the redundant voxels in the first three-dimensional Chinese character cluster, and delete the redundant voxels from the first three-dimensional Chinese character cluster to obtain the second three-dimensional Chinese character cluster.

[0059] Step 18: Determine multiple independent voxel regions in the second three-dimensional Chinese character cluster, and determine the global minimum voxel region value. Connect the multiple voxel regions to obtain the target three-dimensional Chinese character cluster, so that the number of voxel regions in the target three-dimensional Chinese character cluster is the global minimum voxel region value.

[0060] Step 19: Perform three-dimensional printing according to the target three-dimensional Chinese character cluster to obtain the three-dimensional printing result. Among them, different words are presented at different angles in the three-dimensional printing result.

[0061] Figure 5 It is a schematic diagram exemplarily showing the three-dimensional printing result. Figure 5Taking the first Chinese character as "中" and the second Chinese character as "国" as an illustration, "中国" and "卯兔" are presented from different angles respectively, that is, different words are presented at different angles in the 3D printing result.

[0062] Through the above technical solution, the conversion of two-dimensional pixels of Chinese characters to three-dimensional voxels is realized, the Chinese characters are converted from a two-dimensional space to a three-dimensional space, the second voxel set is rotated counterclockwise by a preset degree, and the heights of the voxels that meet the specified conditions in the first voxel set are aligned with the heights of the voxels that meet the specified conditions in the second voxel set. Thus, when orthographic projection is performed from different angles, the three-dimensional Chinese character cluster can represent different Chinese characters, and the heights of the first voxel set and the second voxel set are the same. The voxel set is copied and expanded, and the copied and expanded voxel sets will intersect. The intersection between the first three-dimensional voxel space C1 and the second three-dimensional voxel space C2 is used as the first three-dimensional Chinese character cluster, which can meet the effect of displaying different Chinese characters when viewed from different angles. Determine the redundant voxels in the first three-dimensional Chinese character cluster, delete the redundant voxels from the first three-dimensional Chinese character cluster to obtain the second three-dimensional Chinese character cluster, which can minimize the number of voxels. Then, connect multiple independent voxel regions in the second three-dimensional Chinese character cluster to obtain the target three-dimensional Chinese character cluster. Converting the problem of the connectivity of the three-dimensional Chinese character cluster structure into the problem of minimizing the number of regions and the shortest path of connectivity between regions can improve the efficiency of 3D printing. Therefore, based on two Chinese characters input by the user, a three-dimensional Chinese character cluster can be automatically generated. Using the principle of visual illusion, the Chinese character cluster presents different Chinese characters when viewed from different angles and can form different words. Compared with manually making three-dimensional Chinese characters, this solution can solve the problems of high complexity and low efficiency in manual production.

[0063] Figure 6 It is a flowchart of a method for preprocessing the first two-dimensional pixel set and the second two-dimensional pixel set respectively, as Figure 6 shown, including steps 61 to 63.

[0064] Step 61: Remove the redundant pixel points in the first two-dimensional pixel set and the redundant pixel points in the second two-dimensional pixel set respectively.

[0065] Among them, the redundant pixel points are the pixel points outside the Chinese characters. There may be redundant pixel points in the pixels of the Chinese character pixel library. First, delete the redundant pixel points to avoid the influence of redundant pixel points on the subsequent 3D effect.

[0066] Step 62: For the first two-dimensional pixel set after removing the redundant pixel points, remove the interval information between adjacent two-dimensional pixels. For the second two-dimensional pixel set after removing the redundant pixel points, remove the interval information between adjacent two-dimensional pixels.

[0067] Figure 7It is a schematic diagram of the intervals between adjacent two-dimensional pixels shown exemplarily. Figure 7 Taking the Chinese character "国" as an illustration, each square in the figure represents the pixels that make up this Chinese character. For example, there is an interval between adjacent pixel 0 and pixel 1, and there is an interval between adjacent pixel 1 and pixel 2. During the preprocessing process, the interval information between adjacent two-dimensional pixels can be removed.

[0068] Step 63: For the two-dimensional pixel set with a smaller bounding box among the first two-dimensional pixel set and the second two-dimensional pixel set after removing the interval information, insert pixel points into this two-dimensional pixel set so that the size of the bounding box of the two-dimensional pixel set after inserting the pixel points is the same as the size of the bounding box of the other two-dimensional pixel set, where the bounding box of the two-dimensional pixel set is the smallest quadrilateral that contains the two-dimensional pixel set.

[0069] Among them, the minimum value of the number of inserted pixel points is determined by the following formula:

[0070] L = min card(G * - G)

[0071] Among them, L represents the minimum value of the number of inserted pixel points, card represents the quantity calculation function, G * represents the adjacency matrix of the pixel set after conversion, and G represents the adjacency matrix of the pixel set before conversion.

[0072] Among them, for two different Chinese characters that form a word, some Chinese characters may be relatively shorter. In order to make the heights of the two Chinese characters consistent, size preprocessing can be performed. Pixel points need to be inserted into the Chinese character pixel set with a smaller bounding box to convert the Chinese character pixel set with a smaller bounding box into the largest bounding box, and the largest bounding box is the bounding box of the relatively larger Chinese character, so that the sizes of the two Chinese characters are consistent. In order to insert the fewest pixel points, the minimum value of the number of inserted pixel points is calculated. Among them, G * represents the adjacency matrix of the pixel set after being converted into a larger bounding box, and G represents the adjacency matrix of the pixel set before being converted into a larger bounding box. It is necessary to traverse G to insert adjacent rows or columns to minimize the total number of pixels after conversion.

[0073] Figure 8 It is a flowchart of a method for exemplarily showing determining redundant voxels in the first three-dimensional Chinese character cluster and deleting the redundant voxels from the first three-dimensional Chinese character cluster to obtain the second three-dimensional Chinese character cluster, as Figure 8 shown, including steps 81 to step 88.

[0074] Step 81: For each voxel in the first three-dimensional Chinese character cluster, determine the union of the orthogonal projection of the voxel in the xoy plane and the orthogonal projection of the voxel in the yoz plane. Based on the union, the pixel set of the first three-dimensional Chinese character cluster projected in the xoy plane, and the pixel set of the first three-dimensional Chinese character cluster projected in the yoz plane, determine whether the voxel is a redundant voxel. If it is a redundant voxel, it is used as the first redundant voxel.

[0075] The purpose of step 81 is to treat the voxels that do not meet the global constraint as redundant voxels and delete them. The global constraint is to ensure that the user sees the correct Chinese character information at different angles, that is, the result of the projection on the xoy plane is the first word, and the result of the projection on the yoz plane is the second word.

[0076] Wherein, determining the union of the orthogonal projection of the voxel on the xoy plane and the orthogonal projection on the yoz plane includes: determining the union by the following formula:

[0077]

[0078]

[0079] The step of determining whether the voxel is a redundant voxel according to the union, the pixel set of the first three-dimensional Chinese character cluster projected on the xoy plane, and the pixel set of the first three-dimensional Chinese character cluster projected on the yoz plane includes:

[0080] Determine the quantization parameter of the voxel. If the quantization parameter belongs to [0.5, 1], it is determined that the voxel is not a redundant voxel. If the quantization parameter is 0, it is determined that the voxel is a redundant voxel. The quantization parameter is determined by the following formula:

[0081]

[0082] in, represents the kth voxel in the first three-dimensional Chinese character cluster, Representing voxels The union of the orthogonal projection on the xoy plane and the orthogonal projection on the yoz plane, F α represents the orthogonal projection matrix, α∈{0,1}, when α=1, F1 represents the orthogonal projection matrix of the xoy plane, when α=0, F0 represents the orthogonal projection matrix of the yoz plane, Representing voxels quantization parameters, P1 represents the pixel set of the first three-dimensional Chinese character cluster projected on the xoy plane, and P2 represents the pixel set of the first three-dimensional Chinese character cluster projected on the yoz plane.

[0083] Among them, the two-dimensional projection point If it is a sub-element of set P1 or set P2, use Quantify, two-dimensional projection points If it is a sub-element of set P1 and set P2, that is, it belongs to both set P1 and set P2, use Quantify, two-dimensional projection points When it does not belong to either set P1 or set P2, use Quantization is performed. If the quantization parameter of a voxel is 0, the voxel is determined to be a redundant voxel. In this way, the voxel needs to meet the global constraint condition, and the quantization parameter needs to be [0.5, 1].

[0084] Step 82: Delete the first redundant voxel from the first three-dimensional Chinese character cluster to obtain a third three-dimensional Chinese character cluster.

[0085] Step 83: For each voxel in the third three-dimensional Chinese character cluster, determine the voxel's movement freedom information in the xoy plane and the movement freedom information in the yoz plane respectively; based on the voxel's movement freedom information in the xoy plane and the movement freedom information in the yoz plane, determine whether the voxel is a redundant voxel; if it is a redundant voxel, it is used as the second redundant voxel.

[0086] Among them, step 83 may include:

[0087] For each pixel in the projection of the third three-dimensional Chinese character cluster on the xoy plane, if there is only one voxel projected to the pixel, the movement freedom information of the voxel on the xoy plane is determined to be only movable along the z-axis; if there are multiple voxels projected to the pixel, the movement freedom information of each of the multiple voxels on the xoy plane is determined to be arbitrarily movable or immovable through a digital dictionary algorithm;

[0088] For each pixel in the projection of the third three-dimensional Chinese character cluster on the yoz plane, if there is only one voxel projected to the pixel, the freedom of movement information of the voxel on the yoz plane is determined to be only movable along the x-axis; if there are multiple voxels projected to the pixel, the digital dictionary algorithm is used to determine whether the freedom of movement information of each of the multiple voxels on the yoz plane is arbitrarily movable or immovable;

[0089] Determining whether the voxel is the redundant voxel according to the movement degree of freedom information of the voxel in the xoy plane and the movement degree of freedom information of the voxel in the yoz plane includes:

[0090] If the movement freedom information of the voxel in the xoy plane is arbitrary movement and the movement freedom information in the yoz plane is arbitrary movement, the voxel is determined to be a redundant voxel.

[0091] The voxels of the three-dimensional Chinese character clusters in the present invention are 26-connected under strict global constraints, and often have degrees of freedom of movement in the x-axis or z-axis direction, called X-Z degrees of freedom. In addition, the movement supported by the X-Z degrees of freedom is also restricted by range and boundaries. After all the voxels of the third three-dimensional Chinese character cluster are projected onto the xoy plane, a dictionary Dxoy is obtained. The keys of the dictionary Dxoy are related to the x-coordinate and y-coordinate, and the values are the sets of voxels with the same x-coordinate and y-coordinate in the projection. Fig. 9 is a schematic diagram of an exemplary three-dimensional Chinese character cluster, such as Fig. 9 shown, taking the first Chinese character as "中" and the second Chinese character as "国" as an example. The projection of the voxel point set Va (such as Fig. 9 the set of black voxel points in the three-dimensional structure in the figure, that is, the set of voxels that are connected to the voxels referred to by Va on the z-axis and have the same color) on the xoy plane is Pa, and all the voxels in the voxel point set Va have the same x-coordinate and y-coordinate. The projection of the voxel point set Vb (such as Fig. 9 the set of white voxel points in the three-dimensional structure in the figure, that is, the set of voxels that are connected to the voxels referred to by Vb on the x-axis and have the same color) on the yoz plane is Pb, and all the voxels in the voxel point set Vb have the same x-coordinate and y-coordinate. After all the voxels of the third three-dimensional Chinese character cluster are projected onto the yoz plane, a dictionary Dyoz is obtained. The keys of the dictionary Dyoz are related to the y-coordinate and z-coordinate, and the values are the sets of voxels with the same y-coordinate and z-coordinate in the projection.

[0092] If there are multiple voxels projected onto a certain pixel, the digital dictionary algorithm is used to determine whether the degrees of freedom of movement of these multiple voxels on the xoy plane are arbitrary movement or immovable. The degrees of freedom of movement information for arbitrary movement can be represented as inf, and the degrees of freedom of movement information for immovable can be represented as!inf. On the premise of meeting the boundary conditions, the degrees of freedom on the xoy plane and yoz plane are denoted as D of (v k ) = T(Dxoy, Dyoz), which is further simplified into the following several situations:

[0093] D of (v k ) = T(inf, inf), indicating that the voxel v k has an arbitrary movement degree of freedom information on the xoy plane and an arbitrary movement degree of freedom information on the yoz plane, and this voxel can be deleted as a redundant voxel;

[0094] D of (v k ) = T(!inf,!inf), indicating that the voxel v kThe freedom of movement information in the xoy plane is immovable, and the freedom of movement information in the yoz plane is immovable. This voxel is very important to the structure and cannot be deleted;

[0095] D of (v k ) = T(inf, x), indicating that voxel v k It can be moved along the x-axis, and the range of movement is the voxel position in Dxoy with the same y coordinate as the voxel;

[0096] D of (v k )=T(z,inf), indicating that voxel v k It can be moved along the z-axis, and the range of movement is the voxel position in Dyoz that has the same y coordinate as the voxel.

[0097] Step 84: Delete the second redundant voxel from the third three-dimensional Chinese character cluster to obtain a fourth three-dimensional Chinese character cluster.

[0098] Step 85: construct a three-dimensional matrix corresponding to the fourth three-dimensional Chinese character cluster, and determine the minimum number of Chinese character clusters based on the three-dimensional matrix.

[0099] The step of constructing a three-dimensional matrix corresponding to the fourth three-dimensional Chinese character cluster includes:

[0100] According to the hexahedron corresponding to the fourth three-dimensional Chinese character cluster, for each position in the hexahedron, if there is a Chinese character pixel at the position, the element value in the three-dimensional matrix corresponding to the position is the index information K of the Chinese character pixel; if there is no Chinese character pixel at the position, the element value in the three-dimensional matrix corresponding to the position is -1.

[0101] There are Chinese characters in the position of the hexahedron, that is, the mapping relationship exists, and the element value a in the corresponding three-dimensional matrix ijl = K. There is no Chinese character pixel at this position, that is, the mapping relationship does not exist, and the element value a in the corresponding three-dimensional matrix ijl =-1.

[0102] Determining the minimum number of Chinese character clusters according to the three-dimensional matrix includes:

[0103] According to the three-dimensional matrix, a three-dimensional mapping relationship is determined, and according to the three-dimensional mapping relationship, a minimum number of Chinese character clusters is determined;

[0104] The three-dimensional mapping relationship is determined by the following formula:

[0105]

[0106] The minimum number of Chinese character clusters is determined by the following formula:

[0107]

[0108] Among them, I(a ijl ) represents a three-dimensional mapping relationship, F min represents the minimum value of the number of Chinese character clusters, m represents the number of elements on the x-axis in the three-dimensional matrix, n represents the number of elements on the y-axis in the three-dimensional matrix, and o represents the number of elements on the z-axis in the three-dimensional matrix.

[0109] Step 86: Take the number of Chinese character clusters in the first three-dimensional Chinese character cluster as the maximum value of the number of Chinese character clusters.

[0110] The first three-dimensional Chinese character cluster is the Chinese character cluster with the largest number of Chinese character clusters. Denote the maximum value of the number of Chinese character clusters as F max , and the optimal number F* of Chinese character clusters solved by the redundancy simplification process is between the minimum value F min and F max , as shown in the following formula:

[0111] F min ≤F*≤F max

[0112] Step 87: Determine the central voxel in the fourth three-dimensional Chinese character cluster. For each voxel in the fourth three-dimensional Chinese character cluster, determine whether the voxel is a redundant voxel according to the distance between the voxel and the central voxel, the minimum distance between the set of voxels having the same projection point as the voxel in the xoy plane and the central voxel, and the minimum distance between the set of voxels having the same projection point as the voxel in the yoz plane and the central voxel. If it is a redundant voxel, then it is used as the third redundant voxel.

[0113] Step 88: Delete the third redundant voxel from the fourth three-dimensional Chinese character cluster to obtain the second three-dimensional Chinese character cluster, where the number of Chinese character clusters in the second three-dimensional Chinese character cluster is between the minimum value and the maximum value of the number of Chinese character clusters.

[0114] The minimization of the 3D Chinese character cluster divergence can be further decomposed into the minimization problem of the divergence of all sub-planes. Fig. 9 In the i-th sub-plane A jl ( Fig. 9 in A jl the plane where the voxel referred to is located, that is, the set of voxels having the same color as the voxel referred to by A jl in the horizontal plane), the projections on P1 and P2 are respectively the pixel sets ( Fig. 9 the set of pixel points corresponding to the second horizontal line from top to bottom of the Chinese character "中" projected on the xoy plane in, that is, the set of pixels having the same color as the referred pixel) and ( Fig. 9 in the Chinese character "国" projected on the yoz plane and refers to a set of pixels with the same pixel color), Fig. 9 P1 represents the pixel set of the front view, i.e. the projection of the xoy plane, and P2 represents the pixel set of the right view, i.e. the projection of the yoz plane. is obviously true, so subplane A jl is necessarily redundant. Therefore, solve A jl When the global condition is met and the divergence minimization condition is met, it is the above-mentioned sub-plane divergence minimization problem. The present invention uses distance weighting to achieve divergence minimization, defining voxel Vc as the central voxel in the fourth three-dimensional Chinese character cluster, defining E(v β ) is the voxel v β The distance to the center voxel Vc.

[0115] This step 87 may include:

[0116] Determine the redundant feature information D of the voxel t , if the redundant feature information D of the voxel t is 0, then the voxel is determined to be the redundant voxel. If the redundant characteristic information D t is 1, it is determined that the voxel is not the redundant voxel, where the redundancy feature information D t Used to indicate whether the voxel is a redundant voxel;

[0117] The redundant characteristic information D of the voxel is determined by the following formula: t :

[0118]

[0119] Among them, D t Represents the redundant feature information of voxels, v β represents voxel, E(v β ) represents the voxel v β The distance from the center voxel, V g Represents the relationship between the yoz plane and the voxel v β The set of voxels with the same projection point, E m (V g ) represents the relationship between the yoz plane and the voxel v β The minimum distance between the voxel set with the same projection point and the central voxel, V o Represents the relationship between the xoy plane and the voxel v β The set of voxels with the same projection point, E m (V o ) represents the relationship between the xoy plane and the voxel v β The minimum distance between the set of voxels with the same projection point and the central voxel, ω β Represents voxel vβ The normalized value of the distance from the central voxel, λ represents the preset threshold parameter.

[0120] Among them, if the voxel v β The distance to the central voxel Vc is less than or equal to the set of all other voxels (with the voxel v β The distance from the center voxel to the same projection point on the xoy plane or yoz plane. β is the core voxel, redundant feature information D t is 1. β The smaller the voxel v β The closer the voxel is to the center, the lower the possibility of being removed. λ represents the preset threshold parameter, which is a threshold parameter that can be manually adjusted to control the size of the distance weight. When the λ value is smaller, the retained voxel is closer to the center voxel. When the λ value is larger, the retained voxel is farther away from the center voxel.

[0121] The redundant feature information can be used to simplify the redundancy of the three-dimensional Chinese character cluster. When λ is 0, only when E(v β )∈{E m (V g ), E m (V o ) are retained, and the number of simplified three-dimensional Chinese character clusters is F min , when λ is 1, ω is satisfied β ∈[0,λ] are also retained, and the number of simplified three-dimensional Chinese character clusters is F max .

[0122] In one embodiment, λ is a preset parameter. In another embodiment, the threshold λ can be determined by a redundant voxel set, wherein the threshold parameter λ is a hyperparameter and further parameter threshold adaptation is required. The present invention adopts an algorithm based on maximizing inter-class variance, regards redundant voxels as a set H1, and forms another set H2 with voxels to be retained, and uses the distance of the voxel from the mean point as the intensity data to calculate the threshold λ when the two sets H1 and H2 obtain the maximum inter-class variance.

[0123] Fig.10 is a schematic diagram showing different regions in a Chinese character cluster, such as Fig.10 As shown in the figure, it contains several large regions, which are characterized by large number and large proportion, which indirectly shows that the voxel simplification algorithm retains a large connected area. After the redundant simplification process, the number of voxels has been greatly optimized, but there are too many regions, and some voxels are too scattered and isolated. Next, regional fusion is performed. The goal of regional fusion is to minimize the number of global regions and connect the scattered regions with the shortest path.

[0124] In the present invention, the step 18 of determining the global voxel region minimum value includes:

[0125] The global voxel area minimum is determined by the following formula:

[0126]

[0127] Among them, R represents the global voxel area minimum, card represents the quantity calculation function, Represents the three-dimensional space connected domain analysis function, C * Represents the second three-dimensional Chinese character cluster, C r represents the first three-dimensional Chinese character cluster;

[0128] The connecting the multiple voxel regions to obtain a target three-dimensional Chinese character cluster includes:

[0129] Through the K-nearest neighbor algorithm, a preset number of voxel areas of the nearest neighbors are connected, and through the breadth-first search algorithm, the shortest path between the voxel areas that need to be connected is determined, and the voxels that need to be added to the second three-dimensional Chinese character cluster are determined based on the shortest path. The multiple voxel areas are connected through the added voxels to obtain the target three-dimensional Chinese character cluster.

[0130] In the present invention, the regional connectivity processing needs to solve the following problems.

[0131] First, because there are multiple regions and the connectivity between them is unknown, it is a typical NP-hard problem and theoretically the answer cannot be found within the polynomial time complexity.

[0132] Second, the connectivity at this time is constrained connectivity. When connecting separate areas, the added voxels are not random, but must meet global constraints.

[0133] Third, is there an optimal algorithm for regional fusion processing to obtain the optimal path?

[0134] In order to solve the above problems and reduce calculations, the present invention makes full use of the existing "prior knowledge", such as Fig.10 As shown, the “wireframe” voxels, i.e. Fig.10 The voxels without color in the wireframe represented by the wireframe are the voxels removed after redundant simplification, and are also the sub-elements of the first three-dimensional Chinese character cluster in the intersection operation. The "wireframe" voxels provide a "path" for the connectivity between regions.

[0135] For the first problem, two "adjacent" regions must be connected, and the possibility of connecting two "closer" regions is the greatest. The present invention adopts the "K nearest neighbor" algorithm to search for K nearest neighbor regions to connect with the current region to solve the combinatorial explosion problem.

[0136] For the second problem, two elements are needed to achieve connectivity between two adjacent regions: a connectivity path and connected voxels that satisfy global constraints. Both of these elements can be obtained from the first three-dimensional Chinese character cluster of the intersection result, which greatly reduces the amount of calculation compared to the traditional search algorithm based on 26-connectivity.

[0137] For the third problem, after finding two areas that need to be connected, each area contains multiple voxels, and voxels belonging to different areas can be connected to each other, which can be simplified to the optimal path problem between voxels. There is also an optimal connectivity problem between different areas, that is, the optimal path problem between areas. The optimal path problem here can actually be converted into the minimum number of steps required to achieve connectivity, that is, the shortest path problem.

[0138] In order to solve the shortest path, the breadth-first search algorithm is first used for the shortest path problem between voxels. Fig.11 is a schematic diagram showing the shortest path of regional connectivity, such as Fig.11 The figure shows the path problem from node voxel A to node voxel B and the two problems of the shortest path. Secondly, after solving the shortest path problem between voxels, the optimal path between regions can be the shortest path between "global" voxels. Finally, the shortest path is obtained through the backtracking algorithm, and then the newly added voxel set is determined.

[0139] Through the above technical solution, a three-dimensional Chinese character cluster can be automatically generated based on two Chinese characters input by the user. By utilizing the principle of optical illusion, the Chinese character cluster presents different Chinese characters when viewed from different angles and can form different words. Compared with manually produced three-dimensional Chinese characters, this solution can solve the characteristics of high complexity and low efficiency of manual production.

[0140] Fig.12 is a block diagram of an exemplary three-dimensional Chinese character generation device, such as Fig.12 As shown, the device 120 may include:

[0141] A first acquisition module 121 is used to acquire a first Chinese character and a second Chinese character input by a user, wherein the first Chinese character and the second Chinese character form a word;

[0142] A second acquisition module 122, configured to acquire a first two-dimensional pixel set of the first Chinese character and a second two-dimensional pixel set of the second Chinese character from a pixel font library;

[0143] A preprocessing module 123, configured to preprocess the first two-dimensional pixel set and the second two-dimensional pixel set respectively to obtain a target two-dimensional pixel set of the first Chinese character and a target two-dimensional pixel set of the second Chinese character;

[0144] a conversion module 124, configured to convert the target two-dimensional pixel set of the first Chinese character from two-dimensional space to three-dimensional space to obtain a first voxel set of the first Chinese character, and to convert the target two-dimensional pixel set of the second Chinese character from two-dimensional space to three-dimensional space to obtain a second voxel set of the second Chinese character;

[0145] an alignment module 125, configured to rotate the second voxel set counterclockwise by a preset degree, and align the height of the voxel in the first voxel set that meets the specified condition with the height of the voxel in the second voxel set that meets the specified condition, wherein if there is only one voxel at the top in the voxel set, the voxel that meets the specified condition is the top voxel, and if there are multiple voxels at the top in the voxel set, the voxel that meets the specified condition is the leftmost voxel among the multiple voxels at the top;

[0146] An expansion module 126 is used to copy and expand the first voxel set along the z-axis to obtain a first three-dimensional voxel space C1, copy and expand the second voxel set along the x-axis to obtain a second three-dimensional voxel space C2, and use the intersection of the first three-dimensional voxel space C1 and the second three-dimensional voxel space C2 as a first three-dimensional Chinese character cluster;

[0147] A first determination module 127, configured to determine redundant voxels in the first three-dimensional Chinese character cluster, and delete the redundant voxels from the first three-dimensional Chinese character cluster to obtain a second three-dimensional Chinese character cluster;

[0148] A second determination module 128 is used to determine a plurality of independent voxel regions in the second three-dimensional Chinese character cluster, determine a global voxel region minimum, connect the plurality of voxel regions to obtain a target three-dimensional Chinese character cluster, so that the number of voxel regions in the target three-dimensional Chinese character cluster is the global voxel region minimum;

[0149] The printing module 129 is used to perform three-dimensional printing according to the target three-dimensional Chinese character cluster to obtain a three-dimensional printing result, wherein different words are presented at different angles in the three-dimensional printing result.

[0150] Optionally, the preprocessing module 123 includes:

[0151] a removal submodule, used to remove redundant pixel points in the first two-dimensional pixel set and redundant pixel points in the second two-dimensional pixel set respectively;

[0152] a removing submodule, configured to remove interval information between adjacent two-dimensional pixels for the first two-dimensional pixel set after removing redundant pixels, and to remove interval information between adjacent two-dimensional pixels for the second two-dimensional pixel set after removing redundant pixels;

[0153] an inserting submodule, for inserting pixels into the two-dimensional pixel set with a smaller bounding box in the first two-dimensional pixel set and the second two-dimensional pixel set after removing the spacing information, so that the size of the bounding box of the two-dimensional pixel set after the insertion of the pixels is the same as the size of the bounding box of the other two-dimensional pixel set, wherein the bounding box of the two-dimensional pixel set is a minimum quadrilateral containing the two-dimensional pixel set;

[0154] The minimum number of inserted pixels is determined by the following formula:

[0155] L=min card(G * -G)

[0156] Among them, L represents the minimum number of inserted pixels, card represents the number calculation function, and G * represents the adjacency matrix of the pixel set after transformation, and G represents the adjacency matrix of the pixel set before transformation.

[0157] Optionally, the first determining module 127 includes:

[0158] A first determination submodule is used to determine, for each voxel in the first three-dimensional Chinese character cluster, a union of the orthogonal projection of the voxel in the xoy plane and the orthogonal projection of the voxel in the yoz plane, and determine whether the voxel is the redundant voxel based on the union, the pixel set of the first three-dimensional Chinese character cluster projected in the xoy plane, and the pixel set of the first three-dimensional Chinese character cluster projected in the yoz plane, and if it is the redundant voxel, use it as the first redundant voxel;

[0159] A first deletion submodule is used to delete the first redundant voxel from the first three-dimensional Chinese character cluster to obtain a third three-dimensional Chinese character cluster;

[0160] A second determination submodule is used to determine, for each voxel in the third three-dimensional Chinese character cluster, the movement degree of freedom information of the voxel in the xoy plane and the movement degree of freedom information of the voxel in the yoz plane, and determine whether the voxel is the redundant voxel according to the movement degree of freedom information of the voxel in the xoy plane and the movement degree of freedom information of the voxel in the yoz plane, and if it is the redundant voxel, use it as the second redundant voxel;

[0161] A second deletion submodule is used to delete the second redundant voxel from the third three-dimensional Chinese character cluster to obtain a fourth three-dimensional Chinese character cluster;

[0162] A construction submodule, used to construct a three-dimensional matrix corresponding to the fourth three-dimensional Chinese character cluster, and determine the minimum number of Chinese character clusters according to the three-dimensional matrix;

[0163] A third determining submodule is used to take the number of Chinese character clusters in the first three-dimensional Chinese character clusters as the maximum number of Chinese character clusters;

[0164] a fourth determination submodule, for determining a central voxel in the fourth three-dimensional Chinese character cluster, and for each voxel in the fourth three-dimensional Chinese character cluster, determining whether the voxel is the redundant voxel according to the distance between the voxel and the central voxel, the minimum distance between the voxel set having the same projection point with the voxel in the xoy plane and the central voxel, and the minimum distance between the voxel set having the same projection point with the voxel in the yoz plane and the central voxel, and if the voxel is the redundant voxel, determining the voxel as the third redundant voxel;

[0165] The third deletion submodule is used to delete the third redundant voxel from the fourth three-dimensional Chinese character cluster to obtain the second three-dimensional Chinese character cluster, wherein the number of Chinese character clusters in the second three-dimensional Chinese character cluster is between the minimum number of Chinese character clusters and the maximum number of Chinese character clusters.

[0166] Optionally, the first determining submodule is used to:

[0167] The union is determined by the following formula:

[0168]

[0169]

[0170] The first determination submodule is used to determine the quantization parameter of the voxel. If the quantization parameter belongs to [0.5, 1], it is determined that the voxel is not the redundant voxel. If the quantization parameter is 0, it is determined that the voxel is the redundant voxel. The quantization parameter is determined by the following formula:

[0171]

[0172] in, represents the kth voxel in the first three-dimensional Chinese character cluster, Representing voxels The union of the orthogonal projection on the xoy plane and the orthogonal projection on the yoz plane, F α represents the orthogonal projection matrix, α∈{0,1}, when α=1, F1 represents the orthogonal projection matrix of the xoy plane, when α=0, F0 represents the orthogonal projection matrix of the yoz plane, Representing voxels quantization parameters, P1 represents the pixel set of the first three-dimensional Chinese character cluster projected on the xoy plane, and P2 represents the pixel set of the first three-dimensional Chinese character cluster projected on the yoz plane.

[0173] Optionally, the second determining submodule includes:

[0174] A fifth determination submodule is used for, for each pixel in the projection of the third three-dimensional Chinese character cluster on the xoy plane, if there is only one voxel projected to the pixel, determining the movement freedom information of the voxel on the xoy plane as being able to move only along the z-axis; if there are multiple voxels projected to the pixel, determining the movement freedom information of each of the multiple voxels on the xoy plane as being arbitrarily movable or immovable by a digital dictionary algorithm;

[0175] a sixth determination submodule, for each pixel in the projection of the third three-dimensional Chinese character cluster on the yoz plane, if there is only one voxel projected to the pixel, determining the freedom of movement information of the voxel on the yoz plane as being able to move only along the x-axis; if there are multiple voxels projected to the pixel, determining the freedom of movement information of each of the multiple voxels on the yoz plane as being arbitrarily movable or immovable by using the digital dictionary algorithm;

[0176] The second determining submodule is used for:

[0177] If the movement freedom information of the voxel in the xoy plane is arbitrary movement and the movement freedom information in the yoz plane is arbitrary movement, it is determined that the voxel is the redundant voxel.

[0178] Optionally, the construction submodule is used to:

[0179] According to the hexahedron corresponding to the fourth three-dimensional Chinese character cluster, for each position in the hexahedron, if a Chinese character pixel exists at the position, the element value in the three-dimensional matrix corresponding to the position is the index information K of the Chinese character pixel; if the Chinese character pixel does not exist at the position, the element value in the three-dimensional matrix corresponding to the position is -1;

[0180] The building block is used to:

[0181] Determine a three-dimensional mapping relationship according to the three-dimensional matrix, and determine the minimum number of Chinese character clusters according to the three-dimensional mapping relationship;

[0182] The three-dimensional mapping relationship is determined by the following formula:

[0183]

[0184] The minimum number of Chinese character clusters is determined by the following formula:

[0185]

[0186] Among them, I(a ijl ) represents the three-dimensional mapping relationship, F min Represents the minimum number of Chinese character clusters, m represents the number of elements on the x-axis in the three-dimensional matrix, n represents the number of elements on the y-axis in the three-dimensional matrix, and o represents the number of elements on the z-axis in the three-dimensional matrix.

[0187] Optionally, the fourth determining submodule is used to:

[0188] Determine the redundant feature information D of the voxel t , if the redundant feature information D of the voxel t is 0, then the voxel is determined to be the redundant voxel. If the redundant characteristic information D t is 1, it is determined that the voxel is not the redundant voxel, where the redundancy feature information D t Used to indicate whether the voxel is a redundant voxel;

[0189] The redundant characteristic information D of the voxel is determined by the following formula: t :

[0190]

[0191] Among them, D t Represents the redundant feature information of voxels, v β represents voxel, E(v β ) represents the voxel v β The distance from the center voxel, V g Represents the relationship between the yoz plane and the voxel v β The set of voxels with the same projection point, E m (V g ) represents the relationship between the yoz plane and the voxel v β The minimum distance between the voxel set with the same projection point and the central voxel, V o Represents the relationship between the xoy plane and the voxel v β The set of voxels with the same projection point, E m (V o ) represents the relationship between the xoy plane and the voxel v β The minimum distance between the set of voxels with the same projection point and the central voxel, ω β Represents voxel v β The normalized value of the distance from the central voxel, λ represents the preset threshold parameter.

[0192] Optionally, the second determining module 128 is used to:

[0193] The global voxel region minimum is determined by the following formula:

[0194]

[0195] Among them, R represents the global voxel area minimum, card represents the quantity calculation function, Represents the three-dimensional space connected domain analysis function, C * Represents the second three-dimensional Chinese character cluster, C r represents the first three-dimensional Chinese character cluster;

[0196] The second determining module 128 is used for:

[0197] Through the K-nearest neighbor algorithm, a preset number of voxel areas of the nearest neighbors are connected, and through the breadth-first search algorithm, the shortest path between the voxel areas that need to be connected is determined, and the voxels that need to be added to the second three-dimensional Chinese character cluster are determined based on the shortest path. The multiple voxel areas are connected through the added voxels to obtain the target three-dimensional Chinese character cluster.

[0198] The present embodiment discloses a readable storage medium, on which a program is stored, and when the program is executed by a processor, each step of the three-dimensional Chinese character generation method as described above is implemented. If the module / unit integrated in the three-dimensional Chinese character generation device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a program. The program can be stored in a readable storage medium, and when the program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the program includes a program code, and the program code can be in the form of source code, object code, executable file or some intermediate form, etc. The readable medium may include: any entity or device capable of carrying a program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-OnlyMemory), a random access memory (RAM, Random Access Memory) and a software distribution medium, etc.

[0199] This embodiment also discloses an electronic device, including a memory and a processor, wherein the memory is used to store a program, and the processor is used to execute the program to implement each step of the above-mentioned three-dimensional Chinese character generation method.

[0200] Further, as an executable solution, the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor is the control center of the three-dimensional Chinese character generation device, and uses various interfaces and lines to connect various parts of the entire three-dimensional Chinese character generation device.

[0201] The memory can be used to store programs and / or modules. The processor realizes various functions of the three-dimensional Chinese character generation method by running or executing the programs and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required for a function; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0202] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for generating three-dimensional Chinese characters, characterized in that: The method comprises: Obtaining a first Chinese character and a second Chinese character input by a user, wherein the first Chinese character and the second Chinese character form a word; Acquire a first two-dimensional pixel set of the first Chinese character and a second two-dimensional pixel set of the second Chinese character from a pixel font library; Preprocessing the first two-dimensional pixel set and the second two-dimensional pixel set respectively to obtain a target two-dimensional pixel set for the first Chinese character and a target two-dimensional pixel set for the second Chinese character; Converting the target two-dimensional pixel set of the first Chinese character from two-dimensional space to three-dimensional space to obtain a first voxel set of the first Chinese character, and converting the target two-dimensional pixel set of the second Chinese character from two-dimensional space to three-dimensional space to obtain a second voxel set of the second Chinese character; Rotate the second voxel set counterclockwise by a preset degree, and align the height of the voxel in the first voxel set that meets the specified condition with the height of the voxel in the second voxel set that meets the specified condition, wherein if there is only one voxel at the top in the voxel set, the voxel that meets the specified condition is the top voxel, and if there are multiple voxels at the top in the voxel set, the voxel that meets the specified condition is the leftmost voxel among the multiple voxels at the top; The first voxel set is copied and expanded along the z-axis to obtain a first three-dimensional voxel space C1, and the second voxel set is copied and expanded along the x-axis to obtain a second three-dimensional voxel space C2, and the intersection of the first three-dimensional voxel space C1 and the second three-dimensional voxel space C2 is used as a first three-dimensional Chinese character cluster; Determine redundant voxels in the first three-dimensional Chinese character cluster, delete the redundant voxels from the first three-dimensional Chinese character cluster, and obtain a second three-dimensional Chinese character cluster; Determine a plurality of mutually independent voxel regions in the second three-dimensional Chinese character cluster, determine a global voxel region minimum, connect the plurality of voxel regions to obtain a target three-dimensional Chinese character cluster, so that the number of voxel regions in the target three-dimensional Chinese character cluster is the global voxel region minimum; Three-dimensional printing is performed according to the target three-dimensional Chinese character cluster to obtain a three-dimensional printing result, wherein different words are presented at different angles in the three-dimensional printing result.

2. The method according to claim 1, characterized in that The preprocessing the first two-dimensional pixel set and the second two-dimensional pixel set respectively includes: Respectively removing redundant pixel points in the first two-dimensional pixel set and redundant pixel points in the second two-dimensional pixel set; For the first two-dimensional pixel set after removing redundant pixels, remove the interval information between adjacent two-dimensional pixels; for the second two-dimensional pixel set after removing redundant pixels, remove the interval information between adjacent two-dimensional pixels; For the two-dimensional pixel set with the smaller bounding box in the first two-dimensional pixel set and the second two-dimensional pixel set after removing the spacing information, insert pixels into the two-dimensional pixel set so that the size of the bounding box of the two-dimensional pixel set after the insertion of the pixels is the same as the size of the bounding box of the other two-dimensional pixel set, wherein the bounding box of the two-dimensional pixel set is a minimum quadrilateral containing the two-dimensional pixel set; The minimum number of inserted pixels is determined by the following formula: L=min card(G * -G) Among them, L represents the minimum number of inserted pixels, card represents the number calculation function, and G * represents the adjacency matrix of the pixel set after transformation, and G represents the adjacency matrix of the pixel set before transformation.

3. The method according to claim 1, characterized in that: The step of determining redundant voxels in the first three-dimensional Chinese character cluster and deleting the redundant voxels from the first three-dimensional Chinese character cluster to obtain a second three-dimensional Chinese character cluster includes: For each voxel in the first three-dimensional Chinese character cluster, determine the union of the orthogonal projection of the voxel on the xoy plane and the orthogonal projection of the voxel on the yoz plane, and determine whether the voxel is the redundant voxel based on the union, the pixel set of the first three-dimensional Chinese character cluster projected on the xoy plane, and the pixel set of the first three-dimensional Chinese character cluster projected on the yoz plane. If it is the redundant voxel, it is used as the first redundant voxel; Deleting the first redundant voxel from the first three-dimensional Chinese character cluster to obtain a third three-dimensional Chinese character cluster; For each voxel in the third three-dimensional Chinese character cluster, respectively determine the movement degree of freedom information of the voxel in the xoy plane and the movement degree of freedom information of the voxel in the yoz plane, and determine whether the voxel is the redundant voxel according to the movement degree of freedom information of the voxel in the xoy plane and the movement degree of freedom information of the voxel in the yoz plane, and if it is the redundant voxel, use it as the second redundant voxel; Deleting the second redundant voxel from the third three-dimensional Chinese character cluster to obtain a fourth three-dimensional Chinese character cluster; Constructing a three-dimensional matrix corresponding to the fourth three-dimensional Chinese character cluster, and determining the minimum number of Chinese character clusters according to the three-dimensional matrix; Taking the number of Chinese character clusters in the first three-dimensional Chinese character clusters as the maximum number of Chinese character clusters; Determine the central voxel in the fourth three-dimensional Chinese character cluster, and for each voxel in the fourth three-dimensional Chinese character cluster, determine whether the voxel is the redundant voxel according to the distance between the voxel and the central voxel, the minimum distance between the voxel set having the same projection point with the voxel on the xoy plane and the central voxel, and the minimum distance between the voxel set having the same projection point with the voxel on the yoz plane and the central voxel, and if the voxel is the redundant voxel, use it as the third redundant voxel; The third redundant voxel is deleted from the fourth three-dimensional Chinese character cluster to obtain the second three-dimensional Chinese character cluster, wherein the number of Chinese character clusters in the second three-dimensional Chinese character cluster is between the minimum number of Chinese character clusters and the maximum number of Chinese character clusters.

4. The method according to claim 3, characterized in that Determining the union of the orthogonal projection of the voxel on the xoy plane and the orthogonal projection of the voxel on the yoz plane includes: The union is determined by the following formula: Determining whether the voxel is the redundant voxel according to the union, the pixel set of the first three-dimensional Chinese character cluster projected on the xoy plane, and the pixel set of the first three-dimensional Chinese character cluster projected on the yoz plane includes: Determine the quantization parameter of the voxel. If the quantization parameter belongs to [0.5, 1], determine that the voxel is not the redundant voxel. If the quantization parameter is 0, determine that the voxel is the redundant voxel. The quantization parameter is determined by the following formula: in, represents the kth voxel in the first three-dimensional Chinese character cluster, Representing voxels The union of the orthogonal projection on the xoy plane and the orthogonal projection on the yoz plane, F α represents the orthogonal projection matrix, α∈{0,1}, when α=1, F1 represents the orthogonal projection matrix of the xoy plane, when α=0, F0 represents the orthogonal projection matrix of the yoz plane, Representing voxels quantization parameters, P1 represents the pixel set of the first three-dimensional Chinese character cluster projected on the xoy plane, and P2 represents the pixel set of the first three-dimensional Chinese character cluster projected on the yoz plane.

5. The method according to claim 3, characterized in that: For each voxel in the third three-dimensional Chinese character cluster, respectively determining the movement freedom information of the voxel in the xoy plane and the movement freedom information in the yoz plane, including: For each pixel in the projection of the third three-dimensional Chinese character cluster on the xoy plane, if there is only one voxel projected to the pixel, the movement freedom information of the voxel on the xoy plane is determined to be only movable along the z-axis; if there are multiple voxels projected to the pixel, the movement freedom information of each of the multiple voxels on the xoy plane is determined to be arbitrarily movable or immovable through a digital dictionary algorithm; For each pixel in the projection of the third three-dimensional Chinese character cluster on the yoz plane, if there is only one voxel projected to the pixel, the freedom of movement information of the voxel on the yoz plane is determined to be only movable along the x-axis; if there are multiple voxels projected to the pixel, the digital dictionary algorithm is used to determine whether the freedom of movement information of each of the multiple voxels on the yoz plane is arbitrarily movable or immovable; Determining whether the voxel is the redundant voxel according to the movement degree of freedom information of the voxel in the xoy plane and the movement degree of freedom information of the voxel in the yoz plane includes: If the movement freedom information of the voxel in the xoy plane is arbitrary movement and the movement freedom information in the yoz plane is arbitrary movement, it is determined that the voxel is the redundant voxel.

6. The method according to claim 3, characterized in that The step of constructing a three-dimensional matrix corresponding to the fourth three-dimensional Chinese character cluster includes: According to the hexahedron corresponding to the fourth three-dimensional Chinese character cluster, for each position in the hexahedron, if a Chinese character pixel exists at the position, the element value in the three-dimensional matrix corresponding to the position is the index information K of the Chinese character pixel; if the Chinese character pixel does not exist at the position, the element value in the three-dimensional matrix corresponding to the position is -1; Determining the minimum number of Chinese character clusters according to the three-dimensional matrix includes: Determine a three-dimensional mapping relationship according to the three-dimensional matrix, and determine the minimum number of Chinese character clusters according to the three-dimensional mapping relationship; The three-dimensional mapping relationship is determined by the following formula: The minimum number of Chinese character clusters is determined by the following formula: Among them, I(a ijl ) represents the three-dimensional mapping relationship, F min Represents the minimum number of Chinese character clusters, m represents the number of elements on the x-axis in the three-dimensional matrix, n represents the number of elements on the y-axis in the three-dimensional matrix, and o represents the number of elements on the z-axis in the three-dimensional matrix.

7. The method according to claim 3, characterized in that The determining whether the voxel is the redundant voxel according to the distance between the voxel and the central voxel, the minimum distance between the voxel set having the same projection point with the voxel on the xoy plane and the central voxel, and the minimum distance between the voxel set having the same projection point with the voxel on the yoz plane and the central voxel comprises: Determine the redundant feature information D of the voxel t , if the redundant feature information D of the voxel t is 0, then the voxel is determined to be the redundant voxel. If the redundant characteristic information D t is 1, it is determined that the voxel is not the redundant voxel, where the redundancy feature information D t Used to indicate whether the voxel is a redundant voxel; The redundant characteristic information D of the voxel is determined by the following formula: t : Among them, D t Represents the redundant feature information of voxels, v β represents voxel, E(v β ) represents the voxel v β The distance from the center voxel, V g Represents the relationship between the yoz plane and the voxel v β The set of voxels with the same projection point, E m (V g ) represents the relationship between the yoz plane and the voxel v β The minimum distance between the voxel set with the same projection point and the central voxel, V o Indicates the relationship between the xoy plane and the voxel v β The set of voxels with the same projection point, E m (V o ) represents the relationship between the xoy plane and the voxel v β The minimum distance between the set of voxels with the same projection point and the central voxel, ω β Represents voxel v β The normalized value of the distance from the central voxel, λ represents the preset threshold parameter.

8. The method according to claim 1, characterized in that The determining of the global voxel region minimum value comprises: The global voxel region minimum is determined by the following formula: Among them, R represents the global voxel area minimum, card represents the quantity calculation function, Represents the three-dimensional space connected domain analysis function, C * Represents the second three-dimensional Chinese character cluster, C r represents the first three-dimensional Chinese character cluster; The connecting the multiple voxel regions to obtain a target three-dimensional Chinese character cluster includes: Through the K-nearest neighbor algorithm, a preset number of voxel areas of the nearest neighbors are connected, and through the breadth-first search algorithm, the shortest path between the voxel areas that need to be connected is determined, and the voxels that need to be added to the second three-dimensional Chinese character cluster are determined based on the shortest path. The multiple voxel areas are connected through the added voxels to obtain the target three-dimensional Chinese character cluster.

9. A three-dimensional Chinese character generation device, characterized in that: The device comprises: A first acquisition module, used to acquire a first Chinese character and a second Chinese character input by a user, wherein the first Chinese character and the second Chinese character form a word; A second acquisition module, used for acquiring a first two-dimensional pixel set of the first Chinese character and a second two-dimensional pixel set of the second Chinese character from a pixel font library; a preprocessing module, used to preprocess the first two-dimensional pixel set and the second two-dimensional pixel set respectively to obtain a target two-dimensional pixel set of the first Chinese character and a target two-dimensional pixel set of the second Chinese character; a conversion module, configured to convert the target two-dimensional pixel set of the first Chinese character from two-dimensional space to three-dimensional space to obtain a first voxel set of the first Chinese character, and to convert the target two-dimensional pixel set of the second Chinese character from two-dimensional space to three-dimensional space to obtain a second voxel set of the second Chinese character; an alignment module, configured to rotate the second voxel set counterclockwise by a preset degree, and align the height of the voxel in the first voxel set that meets the specified condition with the height of the voxel in the second voxel set that meets the specified condition, wherein if there is only one voxel at the top in the voxel set, the voxel that meets the specified condition is the top voxel, and if there are multiple voxels at the top in the voxel set, the voxel that meets the specified condition is the leftmost voxel among the multiple voxels at the top; an expansion module, configured to copy and expand the first voxel set along the z-axis to obtain a first three-dimensional voxel space C1, copy and expand the second voxel set along the x-axis to obtain a second three-dimensional voxel space C2, and use the intersection of the first three-dimensional voxel space C1 and the second three-dimensional voxel space C2 as a first three-dimensional Chinese character cluster; A first determination module is used to determine redundant voxels in the first three-dimensional Chinese character cluster, and delete the redundant voxels from the first three-dimensional Chinese character cluster to obtain a second three-dimensional Chinese character cluster; A second determination module is used to determine a plurality of independent voxel regions in the second three-dimensional Chinese character cluster, determine a global voxel region minimum, connect the plurality of voxel regions to obtain a target three-dimensional Chinese character cluster, so that the number of voxel regions in the target three-dimensional Chinese character cluster is the global voxel region minimum; The printing module is used to perform three-dimensional printing according to the target three-dimensional Chinese character cluster to obtain a three-dimensional printing result, wherein different words are presented at different angles in the three-dimensional printing result.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

11. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store a program, and the processor is used to execute the program to implement the steps of the method according to any one of claims 1 to 8.