A rule-based periodic paving-based print pattern intelligent generation method and device

By combining integer representation and text-to-image diffusion model, the polygon tiling structure is reconstructed and a global seamless periodic texture is generated, which solves the pixel discontinuity problem at the polygon splicing boundary and achieves efficient seamless periodic layout and color coordination.

CN123160708APending Publication Date: 2026-11-24ZHEJIANG SCI-TECH UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611128667.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing image generation algorithms struggle to automatically meet the requirements of seamless periodic layout in polygon tiling structures, and pixel discontinuities are prone to occur at polygon splicing boundaries.

Method used

The regular polygon paving structure is reconstructed using integer representation, periodically copied using translation vectors, and a text-to-image diffusion model is combined to generate a globally seamless periodic texture. A local mapping coordinate system is constructed for the polygon patches, and texture color sampling and edge blending are performed to ensure color consistency.

Benefits of technology

It achieves seamless features and overall color consistency under polygon tiling composition, improves the generation efficiency and continuity of digital art patterns in specific geometric layout scenarios, and reduces subsequent manual image retouching operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160708A_ABST
    Figure CN123160708A_ABST
Patent Text Reader

Abstract

The application provides a rule-based periodic paving intelligent generation method and device for printed patterns, and relates to the technical field of digital image processing and computer graphics. The method uses integer representation to reconstruct a regular polygon paving structure, obtains a basic unit geometry skeleton and performs periodic translation and replication to construct a layout structure; uses a text-to-image diffusion model to generate an initial texture image, and performs a translation mixing process under a forced periodicity condition to generate a global seamless periodic texture; then constructs a local mapping coordinate system for a polygon patch to obtain a color value; finally, performs edge fusion processing based on a weighted average value of adjacent patch colors on a splicing boundary, and performs global color coordination, and fills data into the patch to generate an image. The application can effectively improve the edge continuity and overall composition aesthetics of digital art patterns under complex geometric layouts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of digital image processing and computer graphics technology, and in particular to a method and apparatus for intelligent generation of printed patterns based on regular periodic tiling. Background Technology

[0002] With the development of digital art and computer graphics technology, the automatic generation technology of pattern images has been applied in many design stages.

[0003] In existing pattern generation processes, it is common to rely on manually designed layout rules or basic procedural texture synthesis algorithms to generate patterns. Currently, image generation algorithms such as diffusion models exhibit high flexibility in feature extraction and pixel filling, and are gradually being introduced into digital art creation. In such applications, image results containing specific styles or elements can be obtained simply by inputting corresponding text prompts. In some layout designs requiring specific geometric topological constraints, such as regular polygon tiling compositions, specific requirements are placed on the continuity of images at physical splicing boundaries and the seamless layout of the overall composition. Current image diffusion generation processes typically output single images from independent perspectives. When directly processing scenes with strictly periodic layout structures and complex polygonal local coordinate mappings, it is difficult to automatically adapt to the geometric skeleton of the basic tiling units. This makes it easy for seams or pixel mismatches to appear at the boundaries after translation, copying, and polygonal patch splicing of the generated images. Furthermore, subsequent adjustments are needed to ensure color coordination and visual smoothness of the overall composition. Summary of the Invention

[0004] The present invention aims to provide a method and apparatus for intelligent generation of printed patterns based on regular periodic paving, in order to solve the technical problems that existing image generation algorithms are difficult to automatically meet the requirements of seamless periodic layout when applied to polygon paving structures, and that pixel discontinuities are easy to occur at the polygon splicing boundaries.

[0005] In a first aspect, the present invention provides a method for intelligently generating printed patterns based on regular periodic tiling, comprising the following steps:

[0006] The regular polygon paving structure is reconstructed using integer representation to obtain the geometric skeleton of the paving basic unit. The basic unit is periodically translated and copied in a preset space using a preset first translation vector and a preset second translation vector to construct a seamless and non-overlapping layout structure.

[0007] An initial texture image is generated using a text-to-image diffusion model. A translation blending process with forced periodicity conditions is then performed on the initial texture image to generate a globally seamless periodic texture. The translation blending process includes: performing mean blending on the initial texture image and its copy images that have been translated by half an image period in the horizontal, vertical, and diagonal directions respectively. The blended image is forced to exhibit a half-period repeating attribute in the horizontal and vertical directions. A blurring process with a preset radius is applied to the blending result to smooth out residual seams.

[0008] For each polygonal facet in the regular polygonal paving structure, a local mapping coordinate system is constructed for texture color sampling. The specific sampling mechanism is as follows: the displacement vector of any point inside the polygonal facet relative to the origin of the basic unit is calculated, a two-dimensional spatial basis matrix is ​​constructed consisting of the first translation vector and the second translation vector as column vectors, and the displacement vector is accurately projected onto the non-orthogonal basis by solving the inverse matrix of the basis matrix to obtain normalized local texture coordinates; the fractional part of the local texture coordinates is extracted as local texture affine coordinates, and the color value of the corresponding coordinates is obtained from the global seamless periodic texture through an interpolation algorithm, so that adjacent polygonal faces automatically obtain the same color at the shared boundary.

[0009] Edge blending is performed on the splicing boundaries of each polygonal facet based on the weighted average of the colors of adjacent polygons, and global color coordination is performed on the overall composition based on the target histogram;

[0010] The sampled and coordinated color data is filled into each polygonal facet of the regular polygonal paving structure to generate and output the final paving pattern image.

[0011] Optionally, the reconstruction of the regular polygon paving structure using integer representation includes:

[0012] An integer seed matrix is ​​constructed to describe the relative positional relationship of seed points within a basic unit, and the coordinate values ​​in the integer seed matrix are converted into Cartesian coordinates according to a preset geometric transformation to determine the vertex position.

[0013] The translation vector supports non-orthogonal direction vectors, and the vertex type of the basic unit is composed of at least two of the following: equilateral triangle, square, hexagon, octagon, and dodecagon, and satisfies that the sum of the interior angles of the polygons surrounding a single vertex is 360 degrees.

[0014] Optionally, in the process of generating the initial texture image using the text-to-image diffusion model:

[0015] Embed constraint keywords indicating seamless and periodic patterns in the model's prompt text;

[0016] The inference steps and guidance strength of the text-to-image diffusion model are set to preset values, and the random seed change function that destroys periodic features is disabled.

[0017] Optionally, the process of generating a globally seamless periodic texture further includes a mapping correction step:

[0018] To address the anisotropic stretching distortion caused by non-orthogonal translation vectors, an affine transformation is used to map a seamless periodic texture with a preset square resolution onto a parallelogram region that matches the shape of the basic unit. The transformation matrix and translation vector of the affine transformation are determined as follows: three non-collinear vertices of the basic unit are extracted as the target two-dimensional coordinate point set, and three initial vertices corresponding to the preset square texture region are extracted as the source two-dimensional coordinate point set. A system of linear equations is constructed and solved for the three corresponding point pairs in the target two-dimensional coordinate point set and the source two-dimensional coordinate point set.

[0019] Optionally, when obtaining the color value of the corresponding coordinates from the global seamless periodic texture using an interpolation algorithm, an adaptive sampling strategy is adopted:

[0020] When the display size of the polygonal patch in the screen space is less than a preset threshold, multiple samples are collected from the texture area and averaged to perform oversampling processing to avoid anti-aliasing.

[0021] When the display size of the polygonal patch in the screen space is greater than or equal to the preset threshold, the multi-level asymptotic texture technology is invoked to dynamically select the appropriate resolution level for color sampling based on the size of the texture area covered by the pixel.

[0022] Optionally, after constructing a seamless and non-overlapping typographic structure, an alignment process is also included:

[0023] Obtain the centroid coordinates of the polygon within the basic unit;

[0024] Each basic unit is rotated around the centroid by a preset angle so that one side of the polygon is aligned with the coordinate axis, thereby constraining the orientation consistency of the local coordinate system of each polygon during subsequent mapping.

[0025] Optionally, the edge fusion processing performed on the splicing boundary of each polygon patch based on the weighted average of the colors of adjacent polygons specifically includes: identifying and extracting a region of a preset pixel width near the polygon boundary as the boundary pixel to be processed; replacing the original color value of the boundary pixel to be processed with the weighted average of the color data of adjacent polygons, wherein the fusion weight coefficient of the weighted average is calculated by linearly attenuating the normal vertical distance of the boundary pixel to be processed from the boundary of its polygon.

[0026] Optionally, after outputting the final paving pattern image, the method further includes a step of performing an automatic aesthetic scoring mechanism:

[0027] The color difference between the left and right edges and the color difference between the top and bottom edges of the paving pattern image are calculated respectively, and the average value of the two is used to construct a joint error index.

[0028] The similarity between the left-right and top-bottom mirror images is calculated to obtain the symmetry index, the color harmony index is extracted based on the uniformity of hue distribution, and the detail complexity index is extracted based on the image gradient variance.

[0029] The seam error index is introduced into the square of the maximum possible pixel value of the current image and processed to be dimensionless. The dimensionless seam-related terms, detail complexity index, symmetry index and color harmony index are assigned decreasing weight ratios, and the weighted sum is obtained and output to obtain a comprehensive aesthetic score.

[0030] Optionally, the step of generating and outputting the final paving pattern image further includes the step of generating a comparison and verification image:

[0031] Extract the polygonal boundary outline from the geometric skeleton;

[0032] The polygonal boundary outline is directly superimposed onto the final paving pattern image as a black or white line, generating and displaying a comparison verification image for visually verifying the continuity of the paving pattern mapping.

[0033] In a second aspect, the present invention provides an intelligent printing pattern generation device based on regular periodic paving, comprising a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it implements the intelligent printing pattern generation method based on regular periodic paving as described in any of the first aspects.

[0034] The present invention has achieved the following beneficial effects:

[0035] This invention reconstructs a regular polygon tiling structure using integer representation and combines it with a text-to-image diffusion model. After generating an initial texture image, it performs translation blending to generate a globally seamless periodic texture. Based on this, a local mapped coordinate system is constructed for the polygonal faces to sample texture colors, and edge blending and global color coordination are performed on the splicing boundaries of each polygonal face. This technical solution combines geometric network topology rules with image generation algorithms, automatically adapting to the layout requirements of the tiling basic units and outputting periodically arranged pattern data. By constraining the periodicity of the texture and smoothing the polygon splicing boundaries, it reduces the edge discontinuity that may occur at the splicing points of faces and improves the naturalness of the color transition between adjacent polygons. Simultaneously, this method ensures the seamless features and overall color unity of the output pattern under the polygonal tiling composition while reducing subsequent manual image editing, improving the generation efficiency and continuity of digital art patterns in specific geometric layout scenarios.

[0036] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.

[0037] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0038] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0039] Figure 1 This is a flowchart illustrating an intelligent method for generating printed patterns based on regular periodic paving, provided in an embodiment of the present invention.

[0040] Figure 2 This is a schematic diagram of the regular polygon paving structure, geometric skeleton, and its corresponding integer seed matrix in an embodiment of the present invention;

[0041] Figure 3 This is a schematic diagram illustrating local details of polygonal local coordinate mapping, texture sampling, and edge blending processing in an embodiment of the present invention.

[0042] Figure 4 This is a schematic diagram illustrating the effect of a digital art paving pattern image generated according to an embodiment of the present invention;

[0043] Figure 5 A schematic diagram illustrating the effect of another digital art paving pattern image generated according to an embodiment of the present invention;

[0044] Figure 6 This is a schematic diagram of a comparison and verification image of a polygonal boundary outline overlaid in an embodiment of the present invention.

[0045] Figure 7 A side-by-side comparison diagram of a set of final paving pattern images (left) and corresponding comparison and verification images (right) provided for an embodiment of the present invention;

[0046] Figure 8 This is a side-by-side comparison diagram of another set of final paving pattern images (left) and corresponding comparison verification images (right) provided for an embodiment of the present invention. Detailed Implementation

[0047] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0048] This invention provides a method and apparatus for intelligent generation of printed patterns based on regular periodic tiling. The method outputs periodically arranged pattern data through the collaborative processing of geometric network topology rules and an image diffusion generation algorithm. In a specific implementation environment, this method relies on an electronic computing device with data processing capabilities. The electronic computing device includes a processor, memory, input / output interfaces, and an internal communication bus. The processor can be a central processing unit (CPU), a graphics processing unit (GPU), or an application-specific integrated circuit (ASIC). The memory is used to store program instructions, intermediate computation data, and image matrix data.

[0049] Please see Figure 1 In this embodiment, the intelligent generation method for digital art patterns based on regular polygon tiling composition includes the following steps:

[0050] Step S100: The regular polygon paving structure is reconstructed using integer representation to obtain the geometric skeleton of the paving basic unit. The basic unit is periodically translated and copied in a preset space using a preset first translation vector and a preset second translation vector to construct a seamless and non-overlapping layout structure.

[0051] Specifically, the processor of the electronic computing device obtains the paving type identifier and related configuration parameters through an input interface. It then obtains the seed coordinates and direction vectors of the basic paving unit based on predefined vertex type combinations. These predefined vertex type combinations are stored in the system database using the Archimedes paving vertex arrangement encoding method (e.g., ...). This represents a single vertex surrounded by six equilateral triangles. (Representing 4 squares). Based on the user-selected encoding, the system directly reads the initial seed relative coordinates of the basic unit and the fixed parameters of the corresponding regular polygon's side length ratio from a preset relational lookup table. The vertex type of the paving structure is composed of at least two combinations of equilateral triangles, squares, hexagons, octagons, and dodecagons. To ensure the legality of polygon splicing at vertices, the system has built-in interior angle sum constraint verification logic. For regular polygons with a specific number of sides, their interior angle calculations and combinations at the same vertex must satisfy the following interior angle sum formula conditions:

[0052] ;

[0053] ;

[0054] In the above formula, This indicates the number of sides of a regular polygon; Indicates the number of edges. The interior angle measures of a regular polygon; A variable representing the number of sides of a polygon sharing the same vertex; This indicates the number of edges surrounding that particular vertex. The number of regular polygons; Indicates the number of edges. The formula defines the interior angles of a regular polygon. It sets a geometric constraint that, when multiple regular polygons around a vertex are joined, the sum of their interior angles must be exactly 360 degrees to avoid overlapping or gaps between faces.

[0055] like Figure 2 As shown, further, the regular polygon tiling structure is reconstructed using integer representation, and a seed matrix is ​​used to describe the relative positions between regular polygons in the plane. The seed matrix is ​​an integer matrix with the following form:

[0056] ;

[0057] In the above formula, Represents an integer seed matrix used to describe the relative positional relationships of seed points within a basic unit; This represents the total number of seed points within a basic unit; Indicates the first unit within the basic unit The horizontal dimension integer coordinates of each seed point in the logical coordinate system; Indicates the first unit within the basic unit The vertical dimension integer coordinates of each seed point in the logical coordinate system; Represents a set of integers.

[0058] After obtaining the integer seed matrix, the processor transforms the integer coordinates in the logical coordinate system into Cartesian coordinates through coordinate transformation. For each vertex, its Cartesian coordinates are calculated from the integer vector according to the geometric transformation rules corresponding to the paving type, thereby reconstructing the topology of all vertices, edges, and faces of the paving basic unit.

[0059] The specific geometric transformation rules are as follows: Pre-set spatial basis vectors for different paving types. and The coordinates in the integer seed matrix are transformed into Cartesian coordinates through matrix multiplication. The specific formula is as follows:

[0060] ;

[0061] In the matrix calculation formula above, and These represent the horizontal and vertical components of the Cartesian coordinates in the physical canvas space after mapping and transformation; and They represent the preset first spatial basis vectors respectively. Horizontal and vertical components in the Cartesian coordinate system; and These represent the preset second spatial basis vectors. Horizontal and vertical components in the Cartesian coordinate system; and These represent the nth seeds extracted by the system from the integer seed matrix. The logical horizontal integer coordinates and logical vertical integer coordinates of each vertex.

[0062] For example, in regular hexagonal paving, the base is set as , Finally, it is multiplied by the side length constant of the target regular polygon for global scaling.

[0063] Based on this, the system uses translation vectors to periodically translate and copy the basic units within the canvas space. The coordinate mapping formula for translation and copying is as follows:

[0064] ;

[0065] In the above formula, This represents the new coordinate position of the basic unit in the target two-dimensional plane space after translation transformation; This indicates the initial reference position of the basic unit, usually its seed vertex coordinates; This configuration indicates that the first translation vector in the first direction of the paving layout is defined. This configuration indicates that the second translation vector is used to define the second direction of the paving layout; Represents the integer translation step size of the basic unit along the direction of the first translation vector; This represents the integer translation step size of the basic unit along the direction of the second translation vector. The translation vector supports non-orthogonal states, i.e. and The included angle between them does not have to be 90 degrees.

[0066] After reconstructing the polygon tiling structure and constructing the layout structure, the processor performs an alignment process. The centroid coordinates of the polygons within the basic unit are calculated, and each polygon is rotated around its centroid so that one of its designated edges is aligned with the coordinate axis. The automatic selection logic for the designated edge is as follows: traversing all edges of the polygon in counter-clockwise order, the edge containing the vertex with the smallest vertex index is selected first as the designated edge; this edge is then directly aligned with the horizontal coordinate system (X-axis). The formulas for rotation and translation are as follows:

[0067] ;

[0068] In the above formula, and These represent the horizontal and vertical coordinates of a point on the polygon boundary before the rotation operation; and These represent the new horizontal and vertical coordinates of the point after rotation transformation, respectively. and These represent the horizontal and vertical coordinates of the centroid of the polygonal patch in the Cartesian coordinate system, respectively. This indicates the rotation alignment angle of the polygon's defined edges relative to the reference coordinate axis. This alignment operation is used to unify the orientation of the local coordinate systems of each polygon in subsequent mapping stages, and to ensure that the rotated polygon facets maintain their in-situ spatial topology and do not undergo overall collapse or offset towards the origin.

[0069] Step S200: An initial texture image is generated using a text-to-image diffusion model, and a translation blending process with forced periodic conditions is performed on the initial texture image to generate a globally seamless periodic texture.

[0070] Specifically, the processor inputs the acquired text prompt parameters into the text-to-image diffusion model. The text prompts contain a set sequence of keywords, such as character sequences indicating seamlessness, repetition, or periodic patterns. The system executes an internal text fusion mechanism: the constraint keywords indicating periodic features are hard-coded as prefixes and concatenated to the semantic prompt string input by the user. When passed to the text encoder (CLIP), this prefix token is assigned a self-attention weight 1.5 times that of subsequent user-input tokens, forcing periodic features to dominate the feature matrix generation. The processor sets the inference steps and guidance strength of the text-to-image diffusion model to preset values ​​and disables the random seed setting that alters periodic features. Based on the input prompt feature matrix and noise tensor, the diffusion model, after multiple rounds of denoising iterations, outputs an initial texture image tensor.

[0071] The text-to-image diffusion model employs a U-Net network architecture incorporating a cross-attention mechanism. The specific data flow and internal structure are as follows: First, a text encoder (such as CLIP) extracts cue word sequences to generate a text feature matrix; simultaneously, randomly sampled initial noise tensors are fed into the U-Net encoder for layer-by-layer downsampling. In the cross-attention subunits of each encoding and decoding block, the text feature matrix is ​​used as a key and value, and the image latent features are used as a query to perform dot-product attention calculations to complete feature fusion; finally, the denoised latent space features are reconstructed through layer-by-layer upsampling by the U-Net decoder, and the initial texture image tensor is decoded and output via a variational autoencoder (VAE).

[0072] After obtaining the initial texture image, the processor performs a translation blending process. This process extracts the original image and its copies after translating it by half an image period in each direction, and then performs mean blending to enforce periodicity. The specific half-period translation blending calculation formula is as follows:

[0073]

[0074] In the above formula, This represents the initial texture image generated by the diffusion model in two-dimensional pixel coordinates. The color brightness value at that location; This represents the total pixel width of the initial texture image in the horizontal direction; This represents the total pixel height of the initial texture image in the vertical direction; This represents the translation parameter, and its value is equal to... (When the image is set to a square) ); This indicates a modulo operation, used to handle coordinate folding mappings that extend beyond the image boundaries; This indicates the pixel coordinates of the new image obtained after translation, overlay, and mean mixing. The color brightness value at that location.

[0075] To smooth out any high-frequency seams that may remain after the blending process, the processor applies a Gaussian blur filter to the blended image. The convolution operation formula for Gaussian blur is as follows:

[0076] ;

[0077] In the above formula, This represents the pixel coordinates of the smoothed image after Gaussian blurring. The color brightness value at that location; The standard deviation is expressed as The two-dimensional Gaussian filter kernel function, where This is the preset fuzzy radius parameter; This represents the two-dimensional discrete convolution operator; This represents the color brightness value of the image input to the filter after translation and blending processing at the corresponding coordinates.

[0078] After the above processing, globally seamless periodic texture data is obtained. This texture exhibits consistent color values ​​under integer translation conditions. The periodicity condition can be described by the following mathematical formula:

[0079] ;

[0080] In the above formula, This represents a globally seamless periodic texture in normalized 2D texture coordinates. The color tensor at that location; Represents any integer translation amount in the horizontal texture coordinate dimension; This represents any integer translation along the vertical texture coordinate dimension; the equation indicates that after any integer periodic translation, the pixel color distribution at the corresponding position of the texture image remains exactly the same.

[0081] Since the tiling basic units may appear as parallelograms spanned by non-orthogonal translation vectors, and the initial image generated by the diffusion model is typically square in resolution, the processor needs to map the globally seamless periodic texture of the squares to a region matching the shape of the basic units using an affine transformation. The formula for the affine transformation matrix is ​​as follows:

[0082] ;

[0083] In the above formula, This represents the column vector of target pixel coordinates within the mapped parallelogram region; This represents the column vector of original pixel coordinates within the square texture region before mapping; Represent a A linear transformation matrix, containing scaling, rotation, and shear components, is used to perform spatial stretching deformation; This represents a two-dimensional translation column vector used to adjust the spatial displacement of the mapped image.

[0084] In a specific embodiment, the inference steps of the text-to-image diffusion model are 20 to 50 steps (preferably 30 steps), and the guidance strength is 7.0 to 12.0 (preferably 7.5). The preset blur radius parameter... Values to The affine transformation matrix and translation vector The determination method is as follows: extract three non-collinear vertices of the basic unit as the target two-dimensional coordinate point set, and extract three initial vertices corresponding to the preset square texture region as the source two-dimensional coordinate point set. By constructing and solving a system of two linear equations in two variables about these three pairs of corresponding points, the matrix can be uniquely determined. The four components and vectors The two components.

[0085] Step S300, as follows Figure 3 As shown, a local mapped coordinate system is constructed for each polygonal facet in the regular polygon paving structure to perform texture color sampling.

[0086] Specifically, to establish a data mapping relationship between the physical tiling space and the global texture space, the processor determines the origin of the basic unit. For any point inside each facet in the regular polygon tiling structure, the displacement vector of that point relative to the origin is calculated. The displacement vector is then projected onto the translation vector basis, and normalized local texture coordinates are obtained through modulo operations. The specific displacement decomposition and inverse matrix affine folding formulas are as follows:

[0087] ;

[0088] Expanding into an explicit system of algebraic equations, we get:

[0089] ;

[0090] ;

[0091] In the above formula, This represents the calculated normalized texture coordinates for the horizontal dimension, with a value range of [range missing]. ; This represents the calculated normalized texture coordinates in the vertical dimension, with a value range of [range missing]. ; and Represents the two-dimensional Cartesian coordinate components of any point inside or on the boundary of the currently processed polygon patch; and This represents the two-dimensional Cartesian coordinate components of the local coordinate system origin vector used to define the basic paving unit; , and , These represent the horizontal and vertical components of the first and second translation vectors configured for periodically expanding the paving structure, respectively. This refers to operations that extract the decimal part of the result of floating-point arithmetic; denominator This is the determinant value of the basis matrix. Since the translation vectors are not collinear, this determinant value is strictly non-zero.

[0092] After obtaining the mapped coordinates, the processor retrieves the color value corresponding to those coordinates from the global seamless periodic texture using an interpolation algorithm. To handle non-integer coordinate indices, a bilinear interpolation algorithm is used to calculate the color value. The bilinear interpolation formula is as follows:

[0093] ;

[0094] In the above formula, Represents the floating-point coordinates obtained from the mapping. Approximate texture color value estimated for the location; , , as well as These represent the original color values ​​of the four adjacent integer grid pixels surrounding the floating-point coordinate in the discrete texture matrix, namely the bottom left, bottom right, top left, and top right pixels. This represents the fractional offset of the floating-point coordinate relative to the left grid pixel in the horizontal direction (i.e., ); This represents the fractional offset of the floating-point coordinate relative to the lower grid pixel in the vertical direction (i.e., ).

[0095] To address the mismatch between polygon display size and texture resolution in screen space, the processor also executes an adaptive sampling strategy. The display size of the polygon patch in screen space is determined. If this size is smaller than a set pixel threshold, an oversampling mode is used, which involves texture interpolation of multiple sub-pixel coordinates within a single target pixel region and calculating the arithmetic mean. If the display size is greater than or equal to the set threshold, the processor extracts color data corresponding to the downsampling level based on pixel coverage data through a multi-level asymptotic texture hierarchy, thereby controlling computational overhead during rendering and suppressing anti-aliasing. The specific sampling mode employs... Regular grid sampling. Within the mapped texture area corresponding to a single target pixel, the system divides it into 16 sub-pixel floating-point coordinates at equal intervals, performs bilinear interpolation sampling on each, and then calculates the arithmetic mean. Here, the set pixel threshold is preferably a polygon patch whose bounding box diagonal length on the screen is equal to 32 pixels, or whose polygon coverage area accounts for 0.1% of the total pixel area of ​​the screen.

[0096] The formula for determining the target resolution level is:

[0097] ;

[0098] In this determination formula, This represents the calculated target pyramid level index value for the multi-level asymptotic texture; and These represent the normalized horizontal and vertical texture coordinates mapped onto the current polygon patch, respectively. and These represent the horizontal and vertical pixel coordinates of the current rendering target in the screen's physical space, respectively. and Representing texture coordinates and Along the horizontal direction of the screen The partial derivative of a pixel represents the rate of change of the texture coordinates in the horizontal direction; and Representing texture coordinates and Vertically along the screen The partial derivative of a pixel represents the rate of change of the texture coordinates in the vertical direction; This is a function to extract the maximum value.

[0099] Step S400: Perform edge blending processing on the splicing boundaries of each polygonal facet based on the weighted average of the colors of adjacent polygons, and perform global color coordination on the overall composition based on the target histogram.

[0100] Specifically, although interpolation ensures continuity in most regions, discrete sampling and floating-point truncation result in minute differences at boundaries, prompting the processor to execute an edge blending algorithm. The algorithm extracts a region extending inwards by a specific pixel width from the polygon boundary as the pixel to be processed. It calculates the sampled color of this pixel within its own polygon and the color of its corresponding mapped point within the adjacent polygon domain, weights are assigned according to Euclidean distance, and then summed using a weighted average. The edge color blending formula is as follows:

[0101] ;

[0102] In the above formula, This indicates the pixel after edge blending. The final color value output at the location; Representation based on pixels The original color value calculated by the texture mapping rules inside the current polygon; Representation based on points Extrapolated color values ​​calculated by the texture mapping rules of adjacent polygons; Represents pixels The corresponding fusion weight coefficient, the value of which ranges from 1 to 2. Its specific value depends on the pixel. The normal distance function from the physical stitching boundary. Specifically, the preferred value for the specific pixel width is 3 to 7 pixels (e.g., 5 pixels). The fusion weight coefficient. The normal distance function is calculated using a linear decay formula: ,in For pixels The perpendicular distance from the boundary of the polygon in which it is located. The width of the specific pixel.

[0103] After edge blending, the processor extracts the full-image color channel data and generates a full-image color distribution histogram. Both extraction and processing are performed independently in the CIELAB color space. Specifically, the final RGB image matrix is ​​converted to CIELAB space, and the data sequences of the L (luminance), a, and b channels are extracted independently to generate corresponding one-dimensional distribution histograms for subsequent specification operations. The target histogram parameters are read from memory, and a histogram specification algorithm is applied to establish a luminance and chromaticity mapping lookup table. This lookup table is then used to iterate and replace the color values ​​of all pixels in the image to eliminate global color deviation caused by multi-step denoising in the diffusion model.

[0104] The specific extraction steps and exact correspondences for establishing the lookup table are as follows:

[0105] Statistically calculate the pixel-level cumulative probability distribution functions of the original image and target image histograms for each color channel. and ;

[0106] For all pixels appearing in the original image Apply the minimum absolute difference logic criterion to the target histogram, that is, find the condition that makes the difference between the target and the target histogram. Get the minimum value ;

[0107] Extracted injective correspondences Write it as a key-value pair to the lookup table.

[0108] The target histogram parameters are obtained by pre-extracting full-image color channel statistics from a pre-stored benchmark style comparison verification image (such as a sample of an artist's painting specified by the user).

[0109] Step S500: The sampled and coordinated color data is filled into each polygonal facet of the regular polygonal paving structure to generate and output the final paving pattern image. The generated effect is as follows: Figure 4 , Figure 5 As shown.

[0110] Specifically, the processor converts and encodes the final color matrix into a standard image file format. Simultaneously, while generating the final paving pattern image, the processor calls a graphics rendering interface to extract the edge vector data of the polygons in the geometric skeleton. This edge vector data is rasterized into monochrome lines and rendered overlaid on the generated paving pattern image layer using an alpha blending channel, outputting a comparison verification image (e.g., ...). Figure 5 (As shown). This comparison verification image is used to directly observe the mapping continuity of the pattern at the physical topological boundary. For more intuitive effect verification and observation, the output can be as follows: Figure 7 , Figure 8 The comparison images shown show the final output pattern image on the left and the comparison verification image on the right with the boundary outline overlaid.

[0111] The line width of the monochrome lines processed by rasterization is fixed at 2 to 4 pixels. The calculation formula for the alpha blending channel is:

[0112] ;

[0113] In the above Alpha mixed operation formula, This represents the final composite pixel color value output and displayed on the screen after undergoing semi-transparent overlay processing; This represents the global blending weight coefficient used to control the opacity of the line art layer, which is uniformly fixed at 0.7 in this embodiment; This represents the original solid color pixel color value of the vector contour monochrome line generated during the rasterization step; This represents the background pixel color value of the globally seamless periodic tiling pattern that has been generated at the bottom of the area covered by the line.

[0114] To numerically evaluate the seam quality and composition quality of the generated image, the processor executes automatic aesthetic scoring logic. First, the processor reads the pixel arrays of the four boundary regions (top, bottom, left, and right) of the generated image and calculates the corresponding seam error index. The formula for calculating the seam error index is as follows:

[0115] ;

[0116] ;

[0117] ;

[0118] In the above set of formulas for joint error, This represents the total pixel height of the generated image in the vertical dimension; This represents the total pixel width of the generated image in the horizontal dimension; This indicates the first column of the leftmost edge of the image in the vertical coordinate system. The brightness value at that location; Indicates the rightmost edge of the image. Columns on vertical coordinates The brightness value at that location; This represents the mean square error of the color difference between the left and right edge pixels, calculated accordingly. This indicates the first row of the top edge of the image at the horizontal coordinate. The brightness value at that location; Indicates the bottom edge of the image. Rows on horizontal coordinates The brightness value at that location; This represents the mean square error of the color difference between the upper and lower edge pixels, calculated accordingly. This represents the arithmetic mean of the differences between the left and right edges and the differences between the top and bottom edges, used to characterize the overall seam error.

[0119] Subsequently, the processor uses image processing algorithms to obtain the symmetry, color harmony, and detail complexity indices of the generated image. These are then weighted and calculated using a pre-defined evaluation model to output a comprehensive aesthetic score. The formula for the comprehensive aesthetic score is as follows:

[0120] ;

[0121] In the above formula, This represents the output's quantitative comprehensive aesthetic score; This represents a symmetry index calculated by comparing the similarity of images when flipped horizontally and vertically. This represents the preset weighting coefficients assigned to the symmetry index; This represents the color harmony index calculated by cluster analysis of the number of primary colors and the uniformity of hue distribution in an image. This represents the preset weighting coefficients assigned to the color harmony index; This represents the detail complexity index obtained by calculating the overall pixel gradient variance of the image. This represents the preset weighting coefficients assigned to the detail complexity metric; This represents the average seam error calculated from the edge error; This indicates the maximum possible pixel value for the current image at the corresponding bit depth; in 8-bit color depth, this value is fixed at 255. This is used to make the mean square error of the joint dimensionless and normalize it. The interval ensures that it is consistent with... The indicators are within the same order of magnitude; This represents the preset weighting coefficients assigned to seam-related items.

[0122] Among them, the symmetry index Similarity is determined using the normalized mean square error (MSE). The specific calculation formula derived from this formula is as follows:

[0123] ;

[0124] In this formula, The input image matrix; and Representing images respectively The horizontal left-right mirror matrix and the vertical up-down mirror matrix; The mean square error function represents the pixel brightness between two matrices; This represents the maximum possible pixel value at the current image bit depth (255 for 8-bit color depth).

[0125] To satisfy the decreasing weighting ratio of each indicator, the above weighting coefficients are preferably set as follows: , , , Furthermore, the aforementioned color harmony index The K-means algorithm (with a preset cluster center number of 5) is used to extract the hue of image pixels by clustering. The calculation formula is as follows: ,in For the first The hue variance of each cluster. The detail complexity index. The Sobel operator is used to extract the horizontal and vertical gradient magnitudes of image pixels, and the variance of the combined gradient magnitudes of all pixels in the entire image is calculated as the specific output value of this index.

[0126] This invention also provides an intelligent device for generating printed patterns based on regular periodic tiling. This device is deployed in the aforementioned electronic computing equipment and specifically includes: a tiling structure reconstruction module, a global texture generation module, a UV mapping and sampling module, and an edge blending module.

[0127] When the paving structure reconstruction module is running, it reads the vertex parameters and translation rule instructions from the memory and instantiates the patch node data by performing matrix operations.

[0128] During runtime, the global texture generation module loads the diffusion model weights by calling video memory resources, generates a multidimensional image tensor in response to the input prompt word matrix, and implements the above-mentioned translation blending and Gaussian blur operations through memory data displacement.

[0129] During runtime, the UV mapping and sampling module constructs a mapping index table based on the coordinates of the base grid and the model tensor coordinates, and calculates and allocates pixel data through table lookup and parallel interpolation.

[0130] During runtime, the edge fusion module traverses the aforementioned grid topology boundary coordinate pool and schedules relevant filtering operators to perform weighted operations.

[0131] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for intelligently generating printed patterns based on regular periodic tiling, characterized in that, Includes the following steps: The regular polygon paving structure is reconstructed using integer representation to obtain the geometric skeleton of the paving basic unit. The basic unit is periodically translated and copied in a preset space using a preset first translation vector and a preset second translation vector to construct a seamless and non-overlapping layout structure. An initial texture image is generated using a text-to-image diffusion model. A translation blending process with forced periodicity conditions is then performed on the initial texture image to generate a globally seamless periodic texture. The translation blending process includes: performing mean blending on the initial texture image and its copy images that have been translated by half an image period in the horizontal, vertical, and diagonal directions respectively. The blended image is forced to exhibit a half-period repeating attribute in the horizontal and vertical directions. A blurring process with a preset radius is applied to the blending result to smooth out residual seams. For each polygonal facet in the regular polygonal paving structure, a local mapping coordinate system is constructed for texture color sampling. The specific sampling mechanism is as follows: the displacement vector of any point inside the polygonal facet relative to the origin of the basic unit is calculated, a two-dimensional spatial basis matrix is ​​constructed consisting of the first translation vector and the second translation vector as column vectors, and the displacement vector is accurately projected onto the non-orthogonal basis by solving the inverse matrix of the basis matrix to obtain normalized local texture coordinates; the fractional part of the local texture coordinates is extracted as local texture affine coordinates, and the color value of the corresponding coordinates is obtained from the global seamless periodic texture through an interpolation algorithm, so that adjacent polygonal faces automatically obtain the same color at the shared boundary. Edge blending is performed on the splicing boundaries of each polygonal facet based on the weighted average of the colors of adjacent polygons, and global color coordination is performed on the overall composition based on the target histogram; The sampled and coordinated color data is filled into each polygonal facet of the regular polygonal paving structure to generate and output the final paving pattern image.

2. The method according to claim 1, characterized in that, The method of reconstructing regular polygonal paving structures using integer representation includes: An integer seed matrix is ​​constructed to describe the relative positional relationship of seed points within a basic unit, and the coordinate values ​​in the integer seed matrix are converted into Cartesian coordinates according to a preset geometric transformation to determine the vertex position. The translation vector supports non-orthogonal direction vectors, and the vertex type of the basic unit is composed of at least two of the following: equilateral triangle, square, hexagon, octagon, and dodecagon, and satisfies that the sum of the interior angles of the polygons surrounding a single vertex is 360 degrees.

3. The method according to claim 1, characterized in that, In the process of generating the initial texture image using the text-to-image diffusion model: Embed constraint keywords indicating seamless and periodic patterns in the model's prompt text; The inference steps and guidance strength of the text-to-image diffusion model are set to preset values, and the random seed change function that destroys periodic features is disabled.

4. The method according to claim 1, characterized in that, The process of generating a globally seamless periodic texture also includes a mapping correction step: To address the anisotropic stretching distortion caused by non-orthogonal translation vectors, an affine transformation is used to map a seamless periodic texture with a preset square resolution onto a parallelogram region that matches the shape of the basic unit. The transformation matrix and translation vector of the affine transformation are determined as follows: three non-collinear vertices of the basic unit are extracted as the target two-dimensional coordinate point set, and three initial vertices corresponding to the preset square texture region are extracted as the source two-dimensional coordinate point set. A system of linear equations is constructed and solved for the three corresponding point pairs in the target two-dimensional coordinate point set and the source two-dimensional coordinate point set.

5. The method according to claim 1, characterized in that, When obtaining the color value of the corresponding coordinate from the global seamless periodic texture using an interpolation algorithm, an adaptive sampling strategy is adopted: When the display size of the polygonal patch in the screen space is less than a preset threshold, multiple samples are collected from the texture area and averaged to perform oversampling processing to avoid anti-aliasing. When the display size of the polygonal patch in the screen space is greater than or equal to the preset threshold, the multi-level asymptotic texture technology is invoked to dynamically select the appropriate resolution level for color sampling based on the size of the texture area covered by the pixel.

6. The method according to claim 1, characterized in that, After constructing a seamless and non-overlapping layout structure, the process also includes an alignment step: Obtain the centroid coordinates of the polygon within the basic unit; Each basic unit is rotated around the centroid by a preset angle so that one side of the polygon is aligned with the coordinate axis, thereby constraining the orientation consistency of the local coordinate system of each polygon during subsequent mapping.

7. The method according to claim 1, characterized in that, The edge fusion processing performed on the splicing boundary of each polygon patch based on the weighted average of the colors of adjacent polygons specifically includes: identifying and extracting a region of a preset pixel width near the polygon boundary as the boundary pixel to be processed; replacing the original color value of the boundary pixel to be processed with the weighted average of the color data of adjacent polygons, wherein the fusion weight coefficient of the weighted average is calculated by linearly attenuating the normal vertical distance of the boundary pixel to be processed from the boundary of its polygon.

8. The method according to claim 1, characterized in that, After outputting the final paving pattern image, the process also includes a step of performing an automatic aesthetic scoring mechanism: The color difference between the left and right edges and the color difference between the top and bottom edges of the paving pattern image are calculated respectively, and the average value of the two is used to construct a joint error index. The similarity between the left-right and top-bottom mirror images is calculated to obtain the symmetry index, the color harmony index is extracted based on the uniformity of hue distribution, and the detail complexity index is extracted based on the image gradient variance. The seam error index is introduced into the square of the maximum possible pixel value of the current image and processed to be dimensionless. The dimensionless seam-related terms, detail complexity index, symmetry index and color harmony index are assigned decreasing weight ratios, and the weighted sum is obtained and output to obtain a comprehensive aesthetic score.

9. The method according to claim 1, characterized in that, The step of generating and outputting the final paving pattern image also includes the step of generating a comparison and verification image: Extract the polygonal boundary outline from the geometric skeleton; The polygonal boundary outline is directly superimposed onto the final paving pattern image as a black or white line, generating and displaying a comparison verification image for visually verifying the continuity of the paving pattern mapping.

10. A smart device for generating printed patterns based on regular periodic paving, characterized in that, The device includes a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it implements the intelligent generation method for printed patterns based on rule-based periodic paving as described in any one of claims 1 to 9.