Method for tiling and deduplication of random textures

By segmenting the texture image into polygon texture blocks and performing random rotation and offset, combining curve function and exponential weight mixing, the repetition problem during texture tiling is solved, and the scene's realism and detailing is improved.

CN119399343APending Publication Date: 2025-02-07四川易方智慧科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411372069.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the prior art, when textures are repeated on the rendering surface, it is easy to lead to visual discontinuity and obvious sense of repetition, destroying the realism and nature of the scene, while limiting the details and complexity of the scene.

Method used

By segmenting the texture image into polygon texture blocks, and generating a rotation matrix at the center of the texture block for random rotation, introducing hash hash value for random offset, using the brightness value as weight for point multiplication, and introducing a curve function for weight interpolation and deduction Integrate, and finally deduplication is performed through exponential weight mixing.

Benefits of technology

Effectively eliminate the sense of repetition after large-scale tiling of textures, improve the realism and naturalness of the scene, while increasing the details and complexity of the scene, reducing ghosting and artifacts in the mixed areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399343A_ABST
    Figure CN119399343A_ABST
Patent Text Reader

Abstract

The invention discloses a random texture tiling de-duplication method, which comprises the following steps of S1, texture segmentation: segmenting a texture image into areas with equal sizes and shapes; s2, introducing a Hash value, and performing random offset and rotation on the center coordinate of the hexagon so as to reduce the repeatability of the whole texture; s3, introducing a curvilinear function, and performing curve constraint on the weight value by using the curvilinear function before texture mixing; and S4, introducing an index mixed weight. According to the method, a hexagonal grid concept is introduced, and a texture image is segmented into multiple deformations for three-primary color mixing. The concept of index mixed weight is introduced, the mixed weight value is improved to the power of the index, the index is limited in the range, and ghosting and artifacts between mixed areas are obviously reduced. An image feature transition function is provided, transition is carried out according to image data to influence the weight, and the problem of contrast loss of a mixed region is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer three-dimensional graphic texture mapping, and in particular is a random texture tiling deduplication method. Background Art

[0002] Procedural texture generation is a computer graphics technology that is mainly favored by 3D modelers and film and television production practitioners because it uses different algorithms to create more natural and complex texture images. These texture images can add more details to 3D models and can be rendered quickly, which improves image quality while also improving creative efficiency.

[0003] When large-scale tiling of textures is required in a 3D scene, the same texture tiles will be generated on the surface of the model. In contrast, the materials of objects in the real world are relatively random, such as grass and terrain textures. In order to simulate a more natural and realistic 3D scene, it is necessary to provide a method to eliminate the repetitive textures generated when random textures are tiled.

[0004] There are technical problems in the prior art, such as the patent with publication number CN110120089A: 1. When the texture is repeated on the rendered surface, it may produce visual discontinuity and obvious repetition. This may destroy the realism and naturalness of the scene, making the final effect appear unnatural or too artificial; 2. The repetition of texture may limit the details and complexity of the scene. Since the texture needs to be repeated on multiple surfaces, the designer may be forced to choose a simpler texture or a smaller size to avoid obvious repetition. This will limit the visual richness and depth of the scene. Summary of the invention

[0005] The purpose of the present invention is to provide a random texture tiling deduplication method to solve the problems in the prior art proposed in the background technology, that is, the noise-based texture deduplication algorithm has sensitivity to noise intensity, loss of image details, high computational complexity, dependence on parameter selection and limited generalization ability when processing texture deduplication tasks.

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

[0007] A random texture tiling deduplication method comprises the following steps:

[0008] Step S1, texture segmentation, the texture image is segmented into a number of polygonal texture blocks of equal size and shape; the vertex of each texture block is taken as the center, and then the associated weights of the vertex coordinates of the texture block and the center of the texture block are calculated, and a rotation matrix is ​​generated at the center of the texture block for random rotation of the texture block, and finally the rotated texture block center is remapped;

[0009] Step S2, introducing a hash value, generating a random offset at the center coordinate of the texture block according to the hash value, obtaining the rotated and offset texture block, and performing dot multiplication with multiple texture blocks using the brightness value as a weight;

[0010] Step S3, introducing a curve function, performing interpolation calculation on the weights with the curve function, and then normalizing the weights;

[0011] Step S4, exponentially weighted mixing is performed on the texture blocks to complete deduplication.

[0012] According to the above technical solution, in step S1, texture segmentation is specifically as follows:

[0013] Step S101, firstly divide the random texture image into equilateral triangles, and tile the entire texture image with hexagons; then mark the vertex of each triangle in the texture as the center point of the regular hexagon and recalculate to obtain the grid coordinates of the texture block;

[0014] Step S102, define a 2x2 transformation matrix to transform the grid coordinates of the texture block into triangle coordinates:

[0015] Step S103, calculating the coordinates and base position of scale in the triangle mesh, and calculating the triangle step length according to the coordinates;

[0016] Step S104: Finally, the weight value and vertex coordinates of the triangle are calculated.

[0017] According to the above technical solution, in step S2, the hash value is introduced to randomly shift and rotate the center coordinates of the hexagon as follows:

[0018] Step S201, input the coordinates of the center point of the hexagon and define a 2x2 matrix;

[0019] Step S202, using matrix multiplication to calculate the hash value of the center point coordinates;

[0020] Step S203: Obtain a pseudo-random value for the hash value.

[0021] According to the above technical solution, a sample metric value is introduced to influence the weight value. The sample metric value transitions the mixing effect between texture blocks according to the image data. The formula is as follows:

[0022]

[0023] In the formula, the parameter β∈[0,1] is used to control the range of the metric value. Represents the image texture color information, A, B, C are the brightness value matrix coefficients.

[0024] According to the above technical solution, in step S3, the curve function is used to perform curve constraint on the weight value as follows:

[0025] The curve formula is as follows:

[0026]

[0027] Wherein, parameter k is the constraint condition of the curve, r is the influencing factor of the curve k value, where r∈[0,1]. When r=0.5, the curve will not have any effect on the weight value. When r>0.5, the obtained weight will lead to increased sharpness between texture blocks. Therefore, it is necessary to divide the weight value by the sum to renormalize the weight before mixing.

[0028] According to the above technical solution, in step S4, the exponential mixing weight is used to reduce texture ghosting and retain more structural details in the source texture, and its formula is as follows:

[0029]

[0030] Among them, w i is the weight value of the triangle vertex; γ is the exponential influence factor, which is a positive integer.

[0031] According to the above technical solution, the brightness function modulation is introduced to increase the weight of the γ value, and its formula is as follows:

[0032]

[0033] Among them, w i is the weight value of the triangle vertex, γ is an exponent ranging from 1 to 15, δ(x i ) is the metric value of sample x.

[0034] Compared with the prior art, the present invention has the following beneficial effects:

[0035] In the present invention, by introducing the concept of hexagonal grid, the texture image is divided into multiple deformations for three primary color mixing. The concept of exponential mixing weight is introduced, the weight value of the mixing is increased to the exponential power, the exponent is limited to a range, and the ghosting and artifacts between the mixed areas are significantly reduced. An image feature transition function is proposed, and the weight is affected by the transition according to the image data, which effectively solves the problem of contrast loss in the mixed area. The curve function constraint condition is designed to keep the output texture consistent with the histogram distribution of the source texture image, and the target texture has no visible "wrong" color. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a flow chart of the random texture tiling deduplication algorithm of the present invention;

[0037] Figure 2 Schematic diagram of texture segmentation of the present invention;

[0038] Figure 3 This is a schematic diagram of the results of the curve function affecting the weight value of the present invention;

[0039] Figure 4 It is the exponential mixing weight curve diagram and example diagram of the present invention;

[0040] Figure 5 The experimental results and histogram of the present invention;

[0041] Figure 6 This is a graph showing the experimental results comparing the linear mixing and histogram mixing algorithms of the present invention with the algorithm in this paper. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] Embodiment 1

[0044] like Figure 1 As shown, a random texture tiling deduplication method includes the following steps:

[0045] Step S1, texture segmentation, the texture image is segmented into a number of polygonal texture blocks of equal size and shape; the vertex of each texture block is taken as the center, and then the associated weights of the vertex coordinates of the texture block and the center of the texture block are calculated, and a rotation matrix is ​​generated at the center of the texture block for random rotation of the texture block, and finally the rotated texture block center is remapped (such as Figure 2 shown);

[0046] Step S2, introducing a hash value, generating a random offset at the center coordinate of the texture block according to the hash value, obtaining the rotated and offset texture block, and performing dot multiplication with multiple texture blocks using the brightness value as a weight;

[0047] Step S3, introduce a curve function, the curve function performs interpolation calculation on the weight, and then normalizes the weight (such as Figure 3 shown);

[0048] Step S4, exponentially weighted mixing is performed on the texture blocks to complete deduplication.

[0049] In the present invention, by introducing the concept of hexagonal grid, the texture image is divided into multiple deformations for three primary color mixing. The concept of exponential mixing weight is introduced, the weight value of the mixing is increased to the exponential power, the exponent is limited to a range, and the ghosting and artifacts between the mixed areas are significantly reduced. An image feature transition function is proposed, and the weight is affected by the transition according to the image data, which effectively solves the problem of contrast loss in the mixed area. The curve function constraint condition is designed to keep the output texture consistent with the histogram distribution of the source texture image, and the target texture has no visible "wrong" color.

[0050] Embodiment 2

[0051] This embodiment is a further refinement of the first embodiment.

[0052] In step S1, texture segmentation is specifically as follows:

[0053] Step S101, as Figure 2 As shown, the random texture image is first divided into equilateral triangles, and the entire texture image is tiled with hexagons; then the vertex of each triangle in the texture is marked as the center point of the regular hexagon and recalculated to obtain the grid coordinates of the texture block;

[0054] Step S102, defining a 2x2 transformation matrix to transform the grid coordinates of the texture block into triangle coordinates;

[0055] Step S103, calculating the coordinates and base position of scale in the triangle mesh, and calculating the triangle step length according to the coordinates;

[0056] Step S104: Finally, the weight value and vertex coordinates of the triangle are calculated.

[0057] In step S2, the hash value is introduced to randomly shift and rotate the center coordinates of the hexagon as follows:

[0058] Step S201, input the coordinates of the center point of the hexagon and define a 2x2 matrix;

[0059] Step S202, using matrix multiplication to calculate the hash value of the center point coordinates;

[0060] Step S203: Obtain a pseudo-random value for the hash value.

[0061] A sample metric is introduced to affect the weight value. The sample metric transitions the mixing effect between texture blocks according to the image data. The formula is as follows:

[0062]

[0063] In the formula, the parameter β∈[0,1] is used to control the range of the metric value. Represents the image texture color information, A, B, C are the brightness value matrix coefficients.

[0064] In step S3, Figure 3 As shown, the curve function is used to constrain the weight value as follows:

[0065] The curve formula is as follows:

[0066]

[0067] Wherein, parameter k is the constraint condition of the curve, r is the influencing factor of the curve k value, where r∈[0,1]. When r=0.5, the curve will not have any effect on the weight value. When r>0.5, the obtained weight will lead to increased sharpness between texture blocks. Therefore, it is necessary to divide the weight value by the sum to renormalize the weight before mixing.

[0068] In step S4, the exponential mixing weight is expressed by the following formula:

[0069]

[0070] Among them, w i is the weight value of the triangle vertex; γ is the exponential influence factor, which is a positive integer.

[0071] The brightness function is introduced to modulate the weight of the γ value, and the formula is as follows:

[0072]

[0073] Among them, w i is the weight value of the triangle vertex, γ is an exponent ranging from 1 to 15, δ(x i ) is the measurement value of sample x, and the result is as follows Figure 4 shown.

[0074] Embodiment 3

[0075] This embodiment provides a specific implementation method.

[0076] The algorithm design steps are:

[0077] (1) First, the source texture is divided into a regular triangle grid, with each triangle vertex as the center of a hexagon. Then, the association weights between the hexagon vertex coordinates and the vertex center are calculated. Then, a 2*2 rotation matrix is ​​generated at the hexagon center for random rotation of the texture block. Finally, the rotated hexagon center is remapped.

[0078] (2) Generate a random offset at the center coordinate of the hexagon according to the hash, obtain the rotated and offset texture block, and use the brightness value as the weight to perform dot multiplication with the three texture blocks;

[0079] (3) Apply the S-curve function to interpolate the weights and then normalize the weights;

[0080] (4) Perform exponential weighted mixing on the texture blocks.

[0081] The pseudo code is as follows:

[0082] Table 1 Pseudo code of random texture deduplication algorithm

[0083]

[0084]

[0085] Step 1: Texture segmentation.

[0086] In order to better perform random rotation and offset on texture blocks, the texture image is divided into areas of equal size and shape. Figure 2 As shown, in order to perform a reasonable texture segmentation operation, the random texture is first segmented into equilateral triangles, and the entire texture image is tiled with hexagons; then the vertex of each triangle in the texture is marked as the center point of the regular hexagon, and the repeated area is mixed according to the three-side principle.

[0087] The steps of algorithm design are:

[0088] (1) Adjust the image size to a size suitable for an equilateral triangle and recalculate to obtain the grid coordinates of the image;

[0089] (2) Define a 2x2 transformation matrix to convert image grid coordinates into triangle coordinates;

[0090] (3) Calculate the coordinates and base position of scale in the triangle mesh, and calculate the triangle step length based on the coordinates;

[0091] (4) Finally, the weight value and vertex coordinates of the triangle are calculated.

[0092] Table 2 Texture image segmentation algorithm

[0093]

[0094] Step 2: Add image brightness features.

[0095] The hash value is introduced to randomly shift and rotate the center coordinates of the hexagon to reduce the repetitiveness of the entire texture. The pseudo code of the algorithm is shown in Table 3 below.

[0096] The steps of algorithm design are:

[0097] (1) Input the coordinates of the center point of the hexagon and define a 2x2 matrix;

[0098] (2) Use matrix multiplication to calculate the hash value of the center point coordinates;

[0099] (3) Obtain a pseudo-random value for the hash value.

[0100] Table 3 Hash random value algorithm

[0101]

[0102] Using exponential blending weights can solve the ghosting problem, but it is also necessary to consider the contrast loss after blending. To address this problem, a sample metric is introduced to affect the weight value. This value can transition the blending effect between texture blocks based on image data. The formula is as follows:

[0103]

[0104] The above formula uses the parameter β∈[0, 1] to control the range of the metric value. It represents the image texture color information. A, B, and C are the brightness value matrix coefficients, and the corresponding values ​​are 0.299, 0.587, and 0.114. These three values ​​are the standard coefficients for calculating the image brightness value. The calculated white is the standard lighting body color.

[0105] Step 3: Design curve constraints.

[0106] After solving the ghosting problem and contrast loss problem of texture blending, a curve function was introduced with reference to the blending method that preserves the histogram. Before texture blending, the weight value is constrained by using this curve to solve the color value distribution problem between the target texture map and the source texture. The curve formula is as follows:

[0107]

[0108] The parameter k is used as the constraint of the curve, and r is the influencing factor of the curve k value. Among them, r∈[0,1], when r=0.5, the curve will not have any effect on the weight value. For r>0.5, the obtained weight will increase the sharpness between texture blocks, so it is necessary to divide the weight value by the sum to re-normalize the weight before mixing.

[0109] Figure 3The results of the influence of the curve function introduced by the present invention on the weight value are shown. The first row shows the effect of real texture mixing, and the second row shows the degree of mask mixing. The upper right corner is the material ball representation of the input texture, and the lower right corner is the visualized curve graph of the curve function, where yellow represents the curve segment when r is 0.5, blue represents the curve segment when r is 0.75, and red represents the curve segment when r is 0.95. Similarly, (a), (b), and (c) also represent the influence on the weight and image when r is 0.5, 0.75, and 0.95, respectively. As can be seen from the figure, when r = 0.5, the mixing at the edge of the image is relatively fuzzy and the boundary is slightly less obvious; when r = 0.75, the boundary of the image is more obvious; when r = 0.95, the boundary of the image is already very obvious, but the color value of the neighboring pixels is also retained. Experimental results show that when r takes a value of about 0.7, the overlapping area of ​​adjacent texture blocks has a better mixing effect.

[0110] Step 4: Introduce exponential mixing weights.

[0111] Using a histogram-preserving blending method to restore image contrast, the blending area of ​​the random texture will produce some image ghosting, and there will be texture overlap between texture blocks. The exponential blending weight provides a simple and effective way to reduce texture ghosting and retain more structural details in the source texture. The formula is as follows:

[0112]

[0113] Among them, w i is the weight value of the triangle vertex; γ is the exponential influence factor, which is a positive integer. When γ is different, different mixing effects will appear. The curve is as follows Figure 4 shown.

[0114] Different γ values ​​affect the degree and effect of mixing in the overlapping area. The larger the γ value, the clearer the mixing boundary. In short, increasing the weight to an exponential power can effectively solve the ghosting problem when the texture blocks are mixed. However, when the weight is calculated exponentially, the color value of the texture image will also be affected, and the target texture may have a large number of color pixels that do not exist in the source texture. Therefore, the present invention adjusts the original weight value of the texture block based on the weight with an exponent, introduces a brightness function to modulate the weight increased to the γ value, and the formula is as follows:

[0115]

[0116] Among them, w i is the weight value of the triangle vertex, γ is an exponent ranging from 1 to 15, δ(x i ) is the metric value of sample x.

[0117] The present invention conducts comparative experiments on different algorithms by combining the algorithm results with linear mixing and histogram-preserving mixing methods. The experimental results are as follows: Figure 5 As shown, Figure (a) represents the input texture of the algorithm, Figure (b) represents the output result of the noise-based deduplication algorithm, Figure (c) represents the output result of the feature matching deduplication algorithm, and Figure (d) represents the output result of the random texture deduplication algorithm of the present invention. According to the experimental results, the algorithm of the present invention can better eliminate the repeated texture blocks after large-scale tiling of the texture, while maintaining the histogram distribution of the source texture.

[0118] At the same time, in order to verify that the image output by the patented algorithm can better maintain the quality of the input image, the following experiment was conducted. The comparison of this experiment is mainly displayed through the RGB three-channel histogram, the purpose is to compare whether the pixel value distribution of the input texture and the output texture is consistent.

[0119] Figure 6 The histogram in represents the color value data distribution of the RGB primary colors of the corresponding texture, where the horizontal axis represents the brightness level of the texture image, from 0 to 255, representing a standard interval of brightness from low to high from black to white; the vertical axis represents the number of pixels corresponding to the RGB primary colors of the image that needs to be processed, and from bottom to top it means that the number of pixels changes from small to large.

[0120] According to the experimental results, the curve distribution of the input and output histograms of most random textures is roughly the same. Only some textures have a small deviation because the color value difference of the input texture itself is too large. Therefore, the algorithm in this paper can better maintain the contrast of the input texture, proving that the new method proposed in this paper can improve the quality of the output image, while retaining the histogram distribution of the original image, so that there are no visible artifacts and ghosting in the output image.

[0121] It should be noted that, in the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0122] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A random texture tiling deduplication method, characterized by: The following steps are involved: Step S1, texture segmentation, the texture image is segmented into a number of polygonal texture blocks of equal size and shape; the vertex of each texture block is taken as the center, and then the associated weights of the vertex coordinates of the texture block and the center of the texture block are calculated, and a rotation matrix is ​​generated at the center of the texture block for random rotation of the texture block, and finally the rotated texture block center is remapped; Step S2, introducing a hash value, generating a random offset at the center coordinate of the texture block according to the hash value, obtaining the rotated and offset texture block, and performing dot multiplication with multiple texture blocks using the brightness value as a weight; Step S3, introducing a curve function, performing interpolation calculation on the weights with the curve function, and then normalizing the weights; Step S4, exponentially weighted mixing is performed on the texture blocks to complete deduplication.

2. The random texture tiling deduplication method according to claim 1, characterized in that: In step S1, texture segmentation is specifically as follows: Step S101, firstly divide the random texture image into equilateral triangles, and tile the entire texture image with hexagons; then mark the vertex of each triangle in the texture as the center point of the regular hexagon and recalculate to obtain the grid coordinates of the texture block; Step S102, defining a 2x2 transformation matrix to transform the grid coordinates of the texture block into triangle coordinates; Step S103, calculating the coordinates and base position of scale in the triangle mesh, and calculating the triangle step length according to the coordinates; Step S104: Finally, the weight value and vertex coordinates of the triangle are calculated.

3. The random texture tiling deduplication method according to claim 1, characterized in that: In step S2, the hash value is introduced to randomly shift and rotate the center coordinates of the hexagon as follows: Step S201, input the coordinates of the center point of the hexagon and define a 2x2 matrix; Step S202, using matrix multiplication to calculate the hash value of the center point coordinates; Step S203: Obtain a pseudo-random value for the hash value.

4. The random texture tiling deduplication method according to claim 3, characterized in that: A sample metric is introduced to affect the weight value. The sample metric transitions the mixing effect between texture blocks according to the image data. The formula is as follows: In the formula, the parameter β∈[0,1] is used to control the range of the metric value. Represents the image texture color information, A, B, C are the brightness value matrix coefficients.

5. The random texture tiling deduplication method according to claim 1, characterized in that: In step S3, the curve function is used to constrain the weight value by the curve: The curve formula is as follows: Wherein, parameter k is the constraint condition of the curve, r is the influencing factor of the curve k value, where r∈[0,1]. When r=0.5, the curve will not have any effect on the weight value. When r>0.5, the obtained weight will lead to increased sharpness between texture blocks. Therefore, it is necessary to divide the weight value by the sum to renormalize the weight before mixing.

6. The random texture tiling deduplication method according to claim 1, characterized in that: In step S4, the exponential blending weight is used to reduce texture ghosting and retain more structural details in the source texture. The formula is as follows: Among them, w i is the weight value of the triangle vertex; γ is the exponential influence factor, which is a positive integer.

7. The random texture tiling deduplication method according to claim 6, characterized in that: The brightness function is introduced to modulate the weight of the γ value, and the formula is as follows: Among them, w i is the weight value of the triangle vertex, γ is an exponent ranging from 1 to 15, δ(x i ) is the metric value of sample x.

Citation Information

Patent Citations

  • Seamless texture automatic generation method based on cutting boundary optimization

    CN110120089A