Search

CN-122023556-A - Automatic mosaic texture clothing flower pattern generation method

CN122023556ACN 122023556 ACN122023556 ACN 122023556ACN-122023556-A

Abstract

The invention discloses an automatic generation method of mosaic texture clothing pattern patterns, which comprises the steps of (1) carrying out edge detection on an entire image by utilizing a Sobel operator, obtaining edge pixel points according to a preset block granularity value, (2) dividing the entire image into 8 multiplied by 8 blocks, dividing the blocks into blocks with different texture complexity according to the number of the edge pixel points in each block, (3) setting a starting point of each block on 4 edges of the entire image, (4) carrying out mosaic blocking on the entire image from the upper left, and setting a color scheme of each block, and (5) carrying out color matching on each mosaic according to the preset color scheme. The invention can convert any pattern into mosaic texture style and be applied to the pattern printing and dyeing of various non-jean fabrics, so as to assist a designer in solving the problem in pattern generation, meet the personalized requirements of users and have good convenience and flexibility.

Inventors

  • LIN XIANGYU
  • ZHANG HUAXIONG
  • HU JIE
  • HE LILI

Assignees

  • 浙江理工大学

Dates

Publication Date
20260512
Application Date
20251215

Claims (10)

  1. 1. The automatic mosaic texture clothing flower pattern generation method is characterized by comprising the following steps of: (1) Performing edge detection on the flower type image by utilizing a Sobel operator, and obtaining edge pixel points of the image according to a preset block granularity; (2) Dividing the whole image into a plurality of blocks with the size of 8 multiplied by 8, and determining the texture complexity of each block according to the number of edge pixel points in the block; (3) Determining the starting points of the blocks on 4 edges of the whole image according to the texture complexity of the blocks; (4) Performing mosaic blocking on the whole image according to the blocking starting point, and presetting a color scheme for each mosaic; (5) And matching colors for the mosaic according to the color matching scheme, so as to generate the mosaic texture clothing flower pattern.
  2. 2. The method for automatically generating mosaic texture clothes pattern according to claim 1, wherein the specific implementation manner of the step (3) is that four vertexes of the whole image are set as block starting points, and for a horizontal edge, a left side vertex is started, and for a vertical edge, an upper vertex is started, and a starting point distance L is set according to texture complexity of a block B to which the current block starting point belongs: Wherein L 1 ~L 3 is a preset value; Then, an integer value L r is randomly generated from the interval [ L-2, L+2], for a horizontal edge, the current block starting point is shifted by L r pixels to the right to obtain the next block starting point, for a vertical edge, the current block starting point is shifted by L r pixels to obtain the next block starting point, and accordingly, all the block starting points are determined from 4 edges of the whole image.
  3. 3. The method for automatically generating mosaic texture clothes pattern according to claim 1, wherein the specific implementation manner of the step (4) is as follows: s41, starting from the top left vertex of the image, dividing the whole image into a plurality of mosaic blocks from left to right in the order from top to bottom; S42, determining the shape of the mosaic in the mosaic block according to the probability, and outlining the corresponding mosaic; s43, setting a color scheme for each mosaic by adopting a neighborhood brightness self-adaptive color scheme.
  4. 4. The method according to claim 3, wherein the step S41 is specifically implemented by first marking the top left corner vertex of the image as P 11 , marking the nearest existing block starting point on the right side of P 11 as P 12 , marking the nearest existing block starting point under P 11 as P 21 , extracting a new block starting point P 22 from the image with P 11 、P 12 、P 21 、P 22 as the vertex to form a mosaic block given P 11 、P 12 、P 21 , then marking the nearest existing block starting point on the right side of P 12 as P 13 , extracting a new block starting point P 23 from the image with P 12 、P 13 、P 22 、P 23 as the vertex to form the next mosaic block given P 12 、P 13 、P 22 , completing the division of the first row of mosaic blocks in left-right order, and the obtained new block starting point P 22 ,P 23 ,P 24 .
  5. 5. The method for automatically generating a mosaic texture costume pattern according to claim 4, wherein the new block starting point P 22 is extracted by setting a block side length S according to the texture complexity of a block B to which an existing block starting point P 11 , i.e., an upper left corner vertex of a mosaic block, belongs: s 1 ~S 3 is a preset value; And then marking the point with the distance S below the P 12 as A, marking the point with the distance S on the right side of the P 21 as B, finding out the edge pixel point P closest to the A or B, if the distance A or B is smaller than the S, determining that the P is the right lower corner vertex of the mosaic block, namely a new block starting point P 22 , and if the distances A and B are both larger than the S, randomly selecting one pixel point from two square pixel blocks with the central side of the A and the B as the central side of the S as a new block starting point P 22 .
  6. 6. The method for automatically generating the mosaic texture costume pattern according to claim 3, wherein the specific implementation manner of the step S42 is that the probability R that the mosaic is triangle in the mosaic block is determined according to the texture complexity of the block B to which the top left corner vertex of the mosaic block belongs: R 1 ~R 3 is a preset value, otherwise the probability of the mosaic in the mosaic block being quadrilateral is 1-R; And if the mosaic is triangular, connecting the four vertexes of the mosaic block with adjacent pixel points, thereby outlining the edge of the mosaic block, and then randomly selecting a diagonal line, connecting two vertexes of the diagonal line with adjacent pixel points, and forming two triangular mosaics by the rest pixel points except the edge and the diagonal line in the mosaic block.
  7. 7. The method for automatically generating mosaic texture clothing pattern according to claim 3, wherein the specific implementation manner of the step S43 is that, firstly, for any block with texture complexity, several sets of color schemes are allocated to the block, each set of color schemes includes a blue color value and a red color value, then, for any block a, the average brightness Y a of all pixels is calculated, meanwhile, the average brightness Y a1 of all pixels of a mosaic a 1 adjacent to the left side of a is calculated, the average brightness Y a2 of all pixels of a mosaic a 2 adjacent to the top of a is calculated, if the differences between Y a and Y a1 and Y a2 are smaller than the threshold value and a 1 and a 2 belong to the blocks with texture complexity of the same kind, then, the mosaic a is made to use the adjacent mosaic with smaller differences, and if the above condition is not satisfied, a set of color schemes as a is randomly selected from the color schemes of the block to which the mosaic a belongs.
  8. 8. The method for automatically generating the mosaic texture clothing pattern according to claim 6, wherein the specific implementation manner of the step (5) is that the color matching process is performed in a YCbCr color space, only the chrominance component of each pixel point is changed, the luminance component is not changed, the original blue chrominance component and the original red chrominance component of the pixels points are replaced by preset values Cb e and Cr e for the pixels points at the edges and the diagonals in the mosaic block, random values are generated within the ranges of [ Cb m -3, Cb m +3] and [ Cr m -3, Cr m +3] for the pixels points in the mosaic block according to the color matching scheme, and Cb m and Cr m are respectively the blue chrominance value and the red chrominance value in the corresponding color matching scheme of the mosaic.
  9. 9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the method for automatically generating mosaic texture garment pattern according to any one of claims 1 to 8.
  10. 10. A computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the mosaic texture garment pattern automatic generation method according to any one of claims 1 to 8.

Description

Automatic mosaic texture clothing flower pattern generation method Technical Field The invention belongs to the technical field of digital image processing, and particularly relates to an automatic mosaic texture clothing flower pattern generation method. Background The design of the pattern of the dress flower belongs to the traditional field of art, plays an important role in fashion culture, and is one of the important means for representing artistic beauty by human beings. The artistic creation mainly aims at creating subjects in the large natural and human society, reflects beautiful things of the nature and the human society life through the fabric decorative pattern, and reflects appreciation hobbies and psychological pursuits of people adapting to the trend of the age, the social background and the geomantic omen condition. At present, the production mode is limited by the development level of production technology, mainly manual design is adopted, and a longer period is often needed from the completion of creation design to the production of finished products. With the progress of computer technology, some automatic flower pattern generating technologies are generated, but the generated flower patterns have larger randomness and cannot meet the requirements of designers in a directional way, but the work efficiency of the designers is improved by utilizing the computer technology to assist the artistic design, which is a necessary trend of future development of the design industry. The design method of the pattern of the clothing aims at solving the problems of how to improve the efficiency of pattern design for designers, especially how to carry out secondary processing for the existing works, improving the multiplexing rate of the works and how to obtain pattern patterns meeting the aesthetic requirements of users in the current pattern design process of the clothing. In the current design of clothes and decorative pictures, mosaic textures are a popular artistic style, but because the user groups are relatively popular, few special designers are involved in the design of flower patterns in the style, and how to convert the existing flower patterns into mosaic patterns is a subject with great research significance and practical value. The existing automatic flower pattern generation and artistic style migration research have achieved a certain result, and some algorithm models are formed. In the aspect of theoretical research, the application of the document [ Lanxinhui. simple analysis mosaic element in clothing design [ J ]. Western leather, 2024,46 (23): 125-127] develops the application of the mosaic element in clothing design, the article traces the provenance and development history of the mosaic element, and the application situation of the mosaic element in different artistic fields such as clothing design is particularly focused, namely the diversified application of the mosaic element in clothing design shows the unique aesthetic value and creative potential of the mosaic element, the clothing design is optimized, the fashion of the clothing is improved, and a new thought is provided for the development of the clothing design. The method comprises the steps of developing fabric flower pattern color migration research based on the streamline color according to literature [ Wang Jianhui, zhang Huaxiong, golden, a fabric flower pattern color migration method based on the streamline color [ J ]. Textile school, 2025,46 (07): 144-153], firstly generating a popular color palette taking design characteristics of the flower pattern into consideration through the current streamline color according to the streamline color trend and color theory, then constructing a streamline flower pattern data set by combining the generated popular color palette with different types of flower patterns through a K-means clustering algorithm, and finally designing a color migration model to optimize a network architecture of the CycleGAN model. In the aspect of patent application, the Chinese patent application with the publication number of CN115115729A provides a textile pattern single-pattern generation method based on spherical harmonic, firstly, a three-dimensional curved surface is generated according to an explicitly expressed spherical harmonic, then the curved surface is divided and colored by using a contour line dividing method, and finally, a two-dimensional pattern is generated by using a vertical projection method as a single-pattern. However, the theoretical research and the patent technology are not combined with the practical application of the textile industry, and an artistic style generating method specially oriented to mosaic textures is not provided. Disclosure of Invention Aiming at the actual application demands faced in the design of the patterns of the clothes, the invention provides the automatic generation method of the patterns of the mosaic texture clothes, which can convert any patt