National costume image recognition method and system based on tie-dyeing process

By performing specific transformation and brightness adjustment on the grayscale images of ethnic clothing, identifying tie-dye areas, the problem of difficult traditional technology to identify subtle differences in tie-dye patterns is solved, and efficient and accurate tie-dye pattern recognition is achieved.

CN119942116APending Publication Date: 2025-05-06GUANGDONG VOCATIONAL & TECHNICAL COLLEGE
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510031613.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

Traditional technology is difficult to accurately identify subtle differences in tie-dye patterns, which affects the quality of mass production of ethnic clothing.

Method used

By converting the color images of ethnic clothing into grayscale images, and performing gradient transformation and distance transformation, the image is adjusted brightness based on the average brightness, identifying tie-dye areas, and improving the recognition accuracy through area segmentation and image fusion.

Benefits of technology

It significantly improves the recognition accuracy of tie-dye patterns, ensures accurate capture of details under different brightness conditions, and enhances the robustness and practicality of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942116A_ABST
    Figure CN119942116A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, in particular to a ethnic costume image recognition method and system based on a tie-dyeing process, and the method comprises the steps: obtaining a color image of ethnic costume, and converting the color image into a grayscale image; wherein the color image comprises a tie-dyeing pattern with symmetry; performing gradient transformation and distance transformation on the grayscale image to obtain a first transformed image and a second transformed image; brightness adjustment is carried out on the first transformation image and the second transformation image based on the average brightness of the gray level image to obtain a first Lab image and a second Lab image, and a tie-dye area in the gray level image is identified based on the first Lab image and the second Lab image; carrying out region segmentation and image fusion on pixels in the tie-dyeing region image to obtain a national costume image; the ethnic costume image recognition precision can be effectively improved, and the visual effect is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a method and system for recognizing an image of ethnic clothing based on tie-dyeing technology. Background Art

[0002] Tie-dyeing is an ancient textile dyeing technique that forms unique patterns and color effects with traditional ethnic characteristics by tying, sewing, folding and dyeing the fabric. Due to the different tying methods and strengths, the pattern of each tie-dyed fabric is unique. In particular, the symmetrical tie-dye pattern not only gives people a sense of balance and harmony visually, but also contains rich cultural connotations and artistic value.

[0003] With the development of large-scale industrialization, it has become possible to mass-produce ethnic costumes with unique patterns, but traditional recognition methods are difficult to accurately distinguish the subtle differences in tie-dye patterns, which affects the quality of subsequent mass-produced ethnic costumes. With the development of digital technology, how to effectively use computer vision technology to perform image recognition of ethnic costumes with tie-dye craftsmanship and efficiently identify symmetrical tie-dye patterns has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] In order to solve the above problems, the present invention provides a method and system for recognizing ethnic clothing images based on tie-dyeing technology, aiming to improve the quality of mass-produced clothing by accurately recognizing the subtle features of tie-dyeing patterns.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] On the one hand, an embodiment of the present invention provides a method for recognizing an image of ethnic clothing based on tie-dyeing technology, the method comprising the following steps:

[0007] S100, acquiring a color image of ethnic costumes, and converting the color image into a grayscale image; wherein the color image includes a symmetrical tie-dye pattern;

[0008] S200, performing gradient transformation and distance transformation on the grayscale image to obtain a first transformed image and a second transformed image;

[0009] S300, adjusting the brightness of the first transformed image and the second transformed image respectively based on the average brightness of the grayscale image to obtain a first Lab image and a second Lab image, and identifying a tie-dye area in the grayscale image based on the first Lab image and the second Lab image;

[0010] S400, performing region segmentation and image fusion on pixels in the tie-dye region image to obtain a national costume image.

[0011] Optionally, in S300, the step of adjusting the brightness of the first transformed image and the second transformed image based on the average brightness of the grayscale image to obtain a first Lab image and a second Lab image, and identifying the tie-dye area in the grayscale image based on the first Lab image and the second Lab image includes:

[0012] S310, converting the grayscale image from the RGB color space to the Lab color space, and determining the average brightness of the grayscale image in the Lab color space;

[0013] S320, determining an adaptive adjustment factor based on the average brightness, and establishing a brightness adjustment function based on the adaptive adjustment factor;

[0014] S330, using a brightness adjustment function in a Lab color space to adjust the brightness of the first transformed image and the second transformed image respectively, to obtain a first Lab image and a second Lab image;

[0015] S340, performing grayscale processing on the first Lab image and the second Lab image respectively and then performing a bitwise OR operation to obtain a Lab fused image;

[0016] S350, performing threshold segmentation and opening operations on the Lab fusion image in sequence to obtain a tie-dye area image.

[0017] Optionally, the formula of the brightness adjustment function is:

[0018] L1=c×log(V1 (1+c) +(1-V1)(1-c)+V1 (2-c) );

[0019]

[0020] Wherein, L1 represents the first Lab image, V1 represents the first transformed image, L represents the average brightness of the grayscale image, and c represents the adaptive adjustment factor.

[0021] Optionally, in S400, performing region segmentation and image fusion on pixels in the tie-dye region image to obtain a national costume image includes:

[0022] S410, acquiring a tie-dye region image, extracting image features of each pixel in the tie-dye region image in the Lab space, and dividing the tie-dye region image into a plurality of superpixels based on the image features of each pixel; wherein the image features include color features and texture features;

[0023] S420, determining the overall feature of the superpixel based on the image feature of each pixel in the superpixel, quantizing the overall feature of the superpixel and the image feature of each pixel in the superpixel to obtain a feature vector of each superpixel, and establishing a feature matrix based on the feature vector of each superpixel; wherein the overall feature includes color feature, texture feature and shape feature;

[0024] S430, sequentially selecting each superpixel in the feature matrix, taking the selected superpixel as the target superpixel, and performing similarity measurement on the target superpixel and each remaining superpixel in the feature matrix based on the feature vector to obtain a first similarity of each superpixel, and arranging each superpixel in descending order according to the first similarity from high to low to obtain a similarity sequence of the target superpixel;

[0025] S440, for each superpixel in the similar sequence, performing a similarity measurement on an image feature of each pixel in the superpixel and an image feature of each pixel in the target superpixel to obtain a second similarity of the superpixel;

[0026] S450, determining the overall similarity of the superpixel based on the first similarity and the second similarity of the superpixel, performing dynamic threshold division on the superpixels in the similar sequence based on the overall similarity, and forming the final sequence of the target superpixels with the overall similarity greater than the dynamic threshold;

[0027] S460, marking the target superpixel and the superpixels in the final sequence as selected, determining whether there are unselected superpixels in the feature matrix, if so, executing S430, otherwise executing S470;

[0028] S470, fusing the target superpixel and the superpixels in the final sequence of the target superpixel to obtain a standard superpixel, and smoothing the edges of each standard superpixel to obtain a national costume image.

[0029] Optionally, in S420, the overall feature of the superpixel and the image feature of each pixel in the superpixel are quantized to obtain a feature vector of each superpixel, and a feature matrix is ​​established based on the feature vector of each superpixel, including:

[0030] S421, comprehensively encoding the color feature, texture feature and shape feature of each superpixel to form a multi-dimensional quantized feature vector;

[0031] S422, using principal component analysis to perform dimension reduction processing on the quantized feature vector, normalizing the feature vector after dimension reduction, storing the normalized feature vector in a feature matrix and establishing a corresponding index.

[0032] Optionally, in S440, the performing similarity measurement on the image feature of each pixel in the superpixel and the image feature of each pixel in the target superpixel to obtain the second similarity of the superpixel includes:

[0033] S441, for each pixel in the superpixel, establish a square window with the pixel as the center as the grid corresponding to the pixel, and calculate the pixels in each grid by weighted average to obtain the feature vector of the grid;

[0034] S442, for each grid, respectively calculating the chi-square distance between the grid and each pixel in the target superpixel based on the feature vector, and taking the pixel with the smallest chi-square distance as the target pixel corresponding to the grid;

[0035] S443, taking the target pixel corresponding to each grid as the center, dividing each pixel in the target superpixel to obtain multiple local areas corresponding to the multiple grids, constructing matching pixel pairs between the superpixel and the target superpixel, and using the RANSAC algorithm to eliminate mismatched pixel pairs to obtain multiple matching pixel pairs;

[0036] S444, obtaining an index of a pixel in each of the matching pixel pairs, and determining a second similarity of the superpixel based on the index of the pixel in each of the matching pixel pairs and image features.

[0037] Optionally, the second similarity of the superpixel is calculated by the following formula:

[0038] C=exp|x j -y j |×(α×Scj+(1-α)×Stj);

[0039] Among them, j represents the number of the matching pixel pair, x j represents the index of the pixel in the matching pixel pair j in the superpixel, y j represents the index of the target pixel in the matching pixel pair j in the target superpixel, Scj represents the color similarity of the matching pixel pair j, Stj represents the texture similarity of the matching pixel pair j, α is the weight of the color feature, (1-α) is the weight of the texture feature, and α is between 0 and 1.

[0040] Optionally, in S450, determining the overall similarity of the superpixel based on the first similarity and the second similarity of the superpixel, performing dynamic threshold division on the superpixels in the similar sequence based on the overall similarity, and forming the final sequence of the target superpixels with the overall similarity greater than the dynamic threshold includes:

[0041] S451, respectively determining the center coordinates of each superpixel in the feature matrix, obtaining the distance values ​​between the target superpixel and each of the superpixels, normalizing the distance values, and obtaining the distance weights of each of the superpixels;

[0042] S452, multiplying the first similarity of the superpixel and the distance weight, and adding the second similarity of the superpixel to obtain the overall similarity of the superpixel;

[0043] S453, after arranging the overall similarities of each of the superpixels in descending order, calculate the difference between the overall similarities of two adjacent superpixels, determine the maximum difference among the differences, and use the maximum difference as a boundary to extract the top-ranked superpixels to form a final sequence of the target superpixels.

[0044] On the other hand, an embodiment of the present invention provides a national costume image recognition system based on tie-dyeing technology, comprising:

[0045] at least one processor;

[0046] at least one memory for storing at least one program;

[0047] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0048] The beneficial effects of the present invention are as follows: the present invention discloses a method and system for recognizing an image of ethnic costumes based on tie-dyeing technology, wherein the grayscale image is subjected to gradient transformation and distance transformation respectively to obtain a first transformed image and a second transformed image; the first transformed image and the second transformed image are subjected to brightness adjustment respectively based on the average brightness of the grayscale image to obtain a first Lab image and a second Lab image, and the tie-dye area in the grayscale image is recognized based on the first Lab image and the second Lab image; by optimizing the brightness of the grayscale image in the Lab color space, the recognition accuracy of the tie-dye pattern is significantly improved, ensuring that the details can be accurately captured under different brightness conditions, and further enhancing the robustness and practicality of image processing. By analyzing the multi-dimensional similarity of superpixels, the characteristics of the tie-dye pattern are accurately captured, and the recognition accuracy is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0050] Figure 1It is a flow chart of a method for recognizing an image of ethnic clothing based on tie-dyeing technology according to an embodiment of the present invention;

[0051] Figure 2 It is a structural schematic diagram of a national costume image recognition system based on tie-dyeing technology according to an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects disclosed in the present invention, so as to fully understand the purpose, scheme and effect disclosed in the present invention. It should be noted that the embodiments and features in the embodiments in this application can be combined with each other without conflict.

[0053] Existing technologies often have difficulty accurately capturing the complex patterns and color gradients on tie-dyed clothing, which affects the recognition accuracy and efficiency of clothing images.

[0054] With the popularity of ethnic costumes and the widespread application of tie-dyeing technology, the demand for the recognition of ethnic costume images is increasing. Existing image recognition technology has shortcomings in processing complex patterns and color gradients, resulting in low recognition accuracy and efficiency, and cannot meet the requirements of industrial production. Especially when identifying tie-dye clothing, since the tie-dyeing process itself has complex patterns and rich color gradients, existing technologies are difficult to accurately capture these details, affecting the recognition effect.

[0055] In order to solve this problem, the present invention proposes a method and system for recognizing ethnic clothing images based on tie-dyeing technology. The clothing images are processed and analyzed through a specific algorithm, and the subtle features of the tie-dye patterns are efficiently identified, ensuring that mass-produced clothing meets the precision requirements of industrialized production while maintaining a unique ethnic style.

[0056] refer to Figure 1 ,like Figure 1 The figure shows a method for recognizing an image of ethnic clothing based on tie-dyeing technology provided by an embodiment of the present invention, the method comprising the following steps:

[0057] S100, acquiring a color image of ethnic costumes, and converting the color image into a grayscale image; wherein the color image includes a symmetrical tie-dye pattern;

[0058] Specifically, a national costume is selected as a template, and an image of the national costume is collected to obtain a color image; then the color image is segmented to obtain a tie-dye region image and a background image. Specifically, the color image is first converted from a BGR color space to a Lab color space, and then a color threshold range is defined to create a mask, and the foreground region in the color image is extracted through the mask to obtain a tie-dye region image.

[0059] S200, performing gradient transformation and distance transformation on the grayscale image to obtain a first transformed image and a second transformed image;

[0060] S300, adjusting the brightness of the first transformed image and the second transformed image respectively based on the average brightness of the grayscale image to obtain a first Lab image and a second Lab image, and identifying a tie-dye area in the grayscale image based on the first Lab image and the second Lab image;

[0061] There is a deviation in the color area segmentation of the first transformed image and the second transformed image, which leads to color deviation of pixels in the edge area; by generating the first Lab image and the second Lab image respectively, the color of the pixels is comprehensively processed to reduce the color deviation and identify the tie-dye area in the grayscale image.

[0062] S400, performing region segmentation and image fusion on pixels in the tie-dye region image to obtain a national costume image.

[0063] By integrating multi-dimensional features, the present invention significantly improves the accuracy of ethnic costume image recognition. Through fine processing of tie-dye patterns and color space conversion, the accuracy and efficiency of image recognition are effectively improved, solving the problem that traditional technologies are difficult to capture complex patterns.

[0064] As an improvement of the above embodiment, in S300, the brightness of the first transformed image and the second transformed image are adjusted based on the average brightness of the grayscale image to obtain a first Lab image and a second Lab image, and the tie-dye area in the grayscale image is identified based on the first Lab image and the second Lab image, including:

[0065] S310, converting the grayscale image from the RGB color space to the Lab color space, and determining the average brightness of the grayscale image in the Lab color space;

[0066] S320, determining an adaptive adjustment factor based on the average brightness, and establishing a brightness adjustment function based on the adaptive adjustment factor;

[0067] S330, using a brightness adjustment function in a Lab color space to adjust the brightness of the first transformed image and the second transformed image respectively, to obtain a first Lab image and a second Lab image;

[0068] S340, performing grayscale processing on the first Lab image and the second Lab image respectively and then performing a bitwise OR operation to obtain a Lab fused image;

[0069] S350, performing threshold segmentation and opening operations on the Lab fusion image in sequence to obtain a tie-dye area image.

[0070] It should be noted that the opening operation is a combination of two basic operations, dilation and erosion. The opening operation first performs an erosion operation on the image after threshold segmentation, and then performs a dilation operation. After the opening operation, the isolated points in the image after threshold segmentation can be eliminated, and the burrs on the boundary can also be removed to smooth the edge contour.

[0071] By fine-tuning the first transformed image and the second transformed image in the Lab color space, the color restoration and detail expression of the tie-dye pattern are ensured. The color levels of the tie-dye pattern are richer and the details are more delicate, which greatly enhances the visual effect of the digital display of ethnic costumes.

[0072] As an improvement of the above embodiment, the formula of the brightness adjustment function is:

[0073] L1=c×log(V1 (1+c) +(1-V1)(1-c)+V1 (2-c) );

[0074]

[0075] Wherein, L1 represents the first Lab image, V1 represents the first transformed image, L represents the average brightness of the grayscale image, and c represents the adaptive adjustment factor.

[0076] It should be noted that L in the Lab color space represents brightness, and a and b represent color opposition dimensions. By optimizing the brightness of grayscale images in the Lab color space, the recognition accuracy of tie-dye patterns is significantly improved, ensuring that details can be accurately captured under different brightness conditions, further enhancing the robustness and practicality of image processing.

[0077] As an improvement of the above embodiment, in S400, the pixel in the tie-dye region image is segmented and image-fused to obtain the ethnic costume image, including:

[0078] S410, acquiring a tie-dye region image, extracting image features of each pixel in the tie-dye region image in the Lab space, and dividing the tie-dye region image into a plurality of superpixels based on the image features of each pixel; wherein the image features include color features and texture features;

[0079] Specifically, a local window (such as a 3x3 window) is defined for each pixel, and the border pixels are processed using a filling technique. Color features are extracted in each color channel, and the color features of the local window in the Lab space are calculated as the color features of the corresponding pixels; wherein the color features include a color histogram and a color moment. Then, the SLIC algorithm (Simple Linear Iterative Clustering) is used to segment the color image to obtain multiple superpixels, and feature matching is performed on the pixels in each superpixel to obtain multiple standard superpixels.

[0080] S420, determining the overall feature of the superpixel based on the image feature of each pixel in the superpixel, quantizing the overall feature of the superpixel and the image feature of each pixel in the superpixel to obtain a feature vector of each superpixel, and establishing a feature matrix based on the feature vector of each superpixel; wherein the overall feature includes color feature, texture feature and shape feature;

[0081] In the Lab color space, the overall features of superpixels include color features, texture features, and shape features. The color features of superpixels are quantified according to the average Lab value; the texture features are quantified using Local Binary Patterns (LBP) or Gray-Level Co-occurrence Matrix (GLCM); the shape features are quantified by the geometric properties of superpixels, including the complexity, area, perimeter, and aspect ratio of the boundary. Next, the image features are encoded into feature vectors, and machine learning or deep learning methods are used to learn the high-level representation of the image from the feature vectors. Specifically, the image features are extracted through convolutional neural networks, and the features are fused using fully connected layers, and finally a quantitative feature vector containing rich semantic information is obtained, which improves the accuracy of subsequent similarity measurements.

[0082] S430, sequentially selecting each superpixel in the feature matrix, taking the selected superpixel as the target superpixel, and performing similarity measurement on the target superpixel and each remaining superpixel in the feature matrix based on the feature vector to obtain a first similarity of each superpixel, and arranging each superpixel in descending order according to the first similarity from high to low to obtain a similarity sequence of the target superpixel;

[0083] The first similarity obtained by calculating the feature vector of the target superpixel and the feature vector of the superpixel can reflect the degree of similarity between the superpixels as a whole and preliminarily determine the similarity between the superpixels.

[0084] S440, for each superpixel in the similar sequence, performing a similarity measurement on an image feature of each pixel in the superpixel and an image feature of each pixel in the target superpixel to obtain a second similarity of the superpixel;

[0085] By measuring the similarity of the image features of each pixel, the local similarity relationship between superpixels can be further refined, and the visual information of superpixels can be fully captured. This ensures that each feature dimension is balanced when measuring similarity, which can improve the accuracy of subsequent feature matching.

[0086] S450, determining the overall similarity of the superpixel based on the first similarity and the second similarity of the superpixel, performing dynamic threshold division on the superpixels in the similar sequence based on the overall similarity, and forming the final sequence of the target superpixels with the overall similarity greater than the dynamic threshold;

[0087] By integrating pixel-level features and regional-level features, the accuracy of similarity evaluation between superpixels is effectively improved, the delicacy and coherence of image processing is ensured, and the accuracy of ethnic costume image recognition is improved. It should be noted that if the overall similarity is less than or equal to the dynamic threshold, the superpixel is judged to have a low similarity with the target superpixel. If there is no superpixel with an overall similarity greater than the dynamic threshold, it means that the target superpixel is relatively isolated and needs to be processed separately later.

[0088] S460, marking the target superpixel and the superpixels in the final sequence as selected, determining whether there are unselected superpixels in the feature matrix, if so, executing S430, otherwise executing S470;

[0089] S470, fusing the target superpixel and the superpixels in the final sequence of the target superpixel to obtain a standard superpixel, and smoothing the edges of each standard superpixel to obtain a national costume image.

[0090] Through the fusion process, the edges of the standard superpixels are smoother, which enhances the overall visual effect of the image. The final generated ethnic costume image is rich in details and clear in texture.

[0091] As an improvement of the above embodiment, in S420, the overall feature of the superpixel and the image feature of each pixel in the superpixel are quantized to obtain a feature vector of each superpixel, and a feature matrix is ​​established based on the feature vector of each superpixel, including:

[0092] S421, comprehensively encoding the color feature, texture feature and shape feature of each superpixel to form a multi-dimensional quantized feature vector;

[0093] S422, using principal component analysis to perform dimension reduction processing on the quantized feature vector, normalizing the feature vector after dimension reduction, storing the normalized feature vector in a feature matrix and establishing a corresponding index.

[0094] The main information is retained through dimensionality reduction processing to reduce computational complexity; the feature scale is ensured to be consistent through normalization processing to improve the fairness of subsequent similarity measurement. By constructing a feature matrix, it is convenient for rapid retrieval and comparison, further optimizing the efficiency of similarity measurement, improving the speed of superpixel feature retrieval, and enhancing the reliability of similarity measurement.

[0095] As an improvement of the above embodiment, in S440, the similarity measurement of the image feature of each pixel in the superpixel and the image feature of each pixel in the target superpixel to obtain the second similarity of the superpixel includes:

[0096] S441, for each pixel in the superpixel, establish a square window with the pixel as the center as the grid corresponding to the pixel, and calculate the pixels in each grid by weighted average to obtain the feature vector of the grid;

[0097] S442, for each grid, respectively calculating the chi-square distance between the grid and each pixel in the target superpixel based on the feature vector, and taking the pixel with the smallest chi-square distance as the target pixel corresponding to the grid;

[0098] S443, taking the target pixel corresponding to each grid as the center, dividing each pixel in the target superpixel to obtain multiple local areas corresponding to the multiple grids, constructing matching pixel pairs between the superpixel and the target superpixel, and using the RANSAC algorithm to eliminate mismatched pixel pairs to obtain multiple matching pixel pairs;

[0099] It can be understood that each matching pixel pair includes a pixel in the superpixel and a pixel in the target superpixel. After the matching pixel pair is constructed, the RANSAC algorithm is used for iteration to remove outliers and ensure the robustness of the final matching result. After the matching pixel pair is optimized, it will more accurately reflect the similarity between the superpixel and the target superpixel. It effectively improves the accuracy of ethnic costume image recognition and lays a solid foundation for subsequent image processing and analysis.

[0100] S444, obtaining an index of a pixel in each of the matching pixel pairs, and determining a second similarity of the superpixel based on the index of the pixel in each of the matching pixel pairs and image features.

[0101] The second similarity of the superpixel is calculated by the following formula:

[0102] C=exp|xj -y j |×(α×Scj+(1-α)×Stj);

[0103] Among them, j represents the number of the matching pixel pair, x j represents the index of the pixel in the matching pixel pair j in the superpixel, y j represents the index of the target pixel in the matching pixel pair j in the target superpixel, Scj represents the color similarity of the matching pixel pair j, Stj represents the texture similarity of the matching pixel pair j, α is the weight of the color feature, (1-α) is the weight of the texture feature, and α is between 0 and 1.

[0104] Image features include color features and texture features. The similarity of texture features and the similarity of color histograms can be calculated using cosine similarity or Pearson similarity. A comprehensive evaluation is performed based on the similarity of texture features and color histograms to obtain the second similarity of superpixels. Through multi-level similarity fusion, the comprehensive capture of image features is ensured, further improving the accuracy and stability of image recognition. By accurately adjusting the value of α, the best balance can be found between color features and texture features, thereby comprehensively considering multiple visual elements in similarity calculation. Through the index of pixels, the corresponding relationship between pixels in spatial positions is obtained, and weighted processing is performed based on the difference of the index to ensure the comprehensiveness and accuracy of similarity calculation.

[0105] As an improvement of the above embodiment, in S450, the overall similarity of the superpixel is determined based on the first similarity and the second similarity of the superpixel, the superpixels in the similar sequence are divided by dynamic thresholds based on the overall similarity, and the superpixels having an overall similarity greater than the dynamic threshold form the final sequence of the target superpixel, including:

[0106] S451, respectively determining the center coordinates of each superpixel in the feature matrix, obtaining the distance values ​​between the target superpixel and each of the superpixels, normalizing the distance values, and obtaining the distance weights of each of the superpixels;

[0107] S452, multiplying the first similarity of the superpixel and the distance weight, and adding the second similarity of the superpixel to obtain the overall similarity of the superpixel;

[0108] S453, after arranging the overall similarities of each of the superpixels in descending order, calculate the difference between the overall similarities of two adjacent superpixels, determine the maximum difference among the differences, and use the maximum difference as a boundary to extract the top-ranked superpixels to form a final sequence of the target superpixels.

[0109] Through this dynamic threshold division method, the accuracy of the target superpixel sequence is effectively improved, the comprehensiveness and accuracy of the similarity calculation is ensured, and the overall effect of image recognition is further optimized.

[0110] refer to Figure 2 The embodiment of the present invention further provides a national costume image recognition system based on tie-dyeing technology, comprising:

[0111] at least one processor;

[0112] at least one memory for storing at least one program;

[0113] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0114] The contents of the above method embodiments are all applicable to this embodiment. The functions specifically implemented by this embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments, which will not be repeated here.

[0115] Although the description of the present disclosure has been quite detailed and specifically describes several described embodiments, it is not intended to be limited to any of these details or embodiments or any particular embodiment, but should be regarded as providing a broad possible interpretation of these claims by reference to the appended claims, taking into account the prior art, so as to effectively cover the intended scope of the present disclosure. In addition, the above description of the present disclosure is based on the embodiments foreseeable by the inventor, and its purpose is to provide a useful description, and those non-substantial changes to the present disclosure that have not yet been foreseen may still represent equivalent changes to the present disclosure.

Claims

1. A method for recognizing ethnic clothing images based on tie-dyeing technology, characterized in that: The method comprises the following steps: S100, acquiring a color image of ethnic costumes, and converting the color image into a grayscale image; wherein the color image includes a symmetrical tie-dye pattern; S200, performing gradient transformation and distance transformation on the grayscale image to obtain a first transformed image and a second transformed image; S300, adjusting the brightness of the first transformed image and the second transformed image respectively based on the average brightness of the grayscale image to obtain a first Lab image and a second Lab image, and identifying a tie-dye area in the grayscale image based on the first Lab image and the second Lab image; S400, performing region segmentation and image fusion on pixels in the tie-dye region image to obtain a national costume image.

2. The method for recognizing ethnic costume images based on tie-dyeing technology according to claim 1, characterized in that: In S300, the brightness of the first transformed image and the second transformed image are adjusted based on the average brightness of the grayscale image to obtain a first Lab image and a second Lab image, and the tie-dye area in the grayscale image is identified based on the first Lab image and the second Lab image, including: S310, converting the grayscale image from the RGB color space to the Lab color space, and determining the average brightness of the grayscale image in the Lab color space; S320, determining an adaptive adjustment factor based on the average brightness, and establishing a brightness adjustment function based on the adaptive adjustment factor; S330, using a brightness adjustment function in a Lab color space to adjust the brightness of the first transformed image and the second transformed image respectively, to obtain a first Lab image and a second Lab image; S340, performing grayscale processing on the first Lab image and the second Lab image respectively and then performing a bitwise OR operation to obtain a Lab fused image; S350, performing threshold segmentation and opening operations on the Lab fusion image in sequence to obtain a tie-dye area image.

3. The method for recognizing ethnic costume images based on tie-dyeing technology according to claim 2, characterized in that: The formula of the brightness adjustment function is: L1=c×log(V1 (1+c) +(1-V1)(1-c)+V1 (2-c) ); Wherein, L1 represents the first Lab image, V1 represents the first transformed image, L represents the average brightness of the grayscale image, and c represents the adaptive adjustment factor.

4. The method for recognizing ethnic costume images based on tie-dyeing technology according to claim 1, characterized in that: In S400, the pixels in the tie-dye area image are segmented and image-fused to obtain the ethnic clothing image, including: S410, acquiring a tie-dye region image, extracting image features of each pixel in the tie-dye region image in the Lab space, and dividing the tie-dye region image into a plurality of superpixels based on the image features of each pixel; wherein the image features include color features and texture features; S420, determining the overall feature of the superpixel based on the image feature of each pixel in the superpixel, quantizing the overall feature of the superpixel and the image feature of each pixel in the superpixel to obtain a feature vector of each superpixel, and establishing a feature matrix based on the feature vector of each superpixel; wherein the overall feature includes color feature, texture feature and shape feature; S430, sequentially selecting each superpixel in the feature matrix, taking the selected superpixel as the target superpixel, and performing similarity measurement on the target superpixel and each remaining superpixel in the feature matrix based on the feature vector to obtain a first similarity of each superpixel, and arranging each superpixel in descending order according to the first similarity from high to low to obtain a similarity sequence of the target superpixel; S440, for each superpixel in the similar sequence, performing a similarity measurement on an image feature of each pixel in the superpixel and an image feature of each pixel in the target superpixel to obtain a second similarity of the superpixel; S450, determining the overall similarity of the superpixel based on the first similarity and the second similarity of the superpixel, performing dynamic threshold division on the superpixels in the similar sequence based on the overall similarity, and forming the final sequence of the target superpixels with the overall similarity greater than the dynamic threshold; S460, marking the target superpixel and the superpixels in the final sequence as selected, determining whether there are unselected superpixels in the feature matrix, if so, executing S430, otherwise executing S470; S470, fusing the target superpixel and the superpixels in the final sequence of the target superpixel to obtain a standard superpixel, and smoothing the edges of each standard superpixel to obtain a national costume image.

5. The method for recognizing ethnic costume images based on tie-dyeing technology according to claim 4, characterized in that: In S420, the overall feature of the superpixel and the image feature of each pixel in the superpixel are quantified to obtain a feature vector of each superpixel, and a feature matrix is ​​established based on the feature vector of each superpixel, including: S421, comprehensively encoding the color feature, texture feature and shape feature of each superpixel to form a multi-dimensional quantized feature vector; S422, using principal component analysis to perform dimension reduction processing on the quantized feature vector, normalizing the feature vector after dimension reduction, storing the normalized feature vector in a feature matrix and establishing a corresponding index.

6. The method for recognizing ethnic costume images based on tie-dyeing technology according to claim 5, characterized in that: In S440, the similarity measurement of the image feature of each pixel in the superpixel and the image feature of each pixel in the target superpixel to obtain the second similarity of the superpixel includes: S441, for each pixel in the superpixel, establish a square window with the pixel as the center as the grid corresponding to the pixel, and calculate the pixels in each grid by weighted average to obtain the feature vector of the grid; S442, for each grid, respectively calculating the chi-square distance between the grid and each pixel in the target superpixel based on the feature vector, and taking the pixel with the smallest chi-square distance as the target pixel corresponding to the grid; S443, taking the target pixel corresponding to each grid as the center, dividing each pixel in the target superpixel to obtain multiple local areas corresponding to the multiple grids, constructing matching pixel pairs between the superpixel and the target superpixel, and using the RANSAC algorithm to eliminate mismatched pixel pairs to obtain multiple matching pixel pairs; S444, obtaining an index of a pixel in each of the matching pixel pairs, and determining a second similarity of the superpixel based on the index of the pixel in each of the matching pixel pairs and image features.

7. The method for recognizing ethnic costume images based on tie-dyeing technology according to claim 6, characterized in that: The second similarity of the superpixel is calculated by the following formula: C=exp|x j -y j |×(α×Scj+(1-α)×Stj); Among them, j represents the number of the matching pixel pair, x j represents the index of the pixel in the matching pixel pair j in the superpixel, y j represents the index of the target pixel in the matching pixel pair j in the target superpixel, Scj represents the color similarity of the matching pixel pair j, Stj represents the texture similarity of the matching pixel pair j, α is the weight of the color feature, (1-α) is the weight of the texture feature, and α is between 0 and 1.

8. The method for recognizing ethnic costume images based on tie-dyeing technology according to claim 7, characterized in that: In S450, the determining of the overall similarity of the superpixel based on the first similarity and the second similarity of the superpixel, performing dynamic threshold division on the superpixels in the similar sequence based on the overall similarity, and forming the final sequence of the target superpixels with the overall similarity greater than the dynamic threshold includes: S451, respectively determining the center coordinates of each superpixel in the feature matrix, obtaining the distance values ​​between the target superpixel and each of the superpixels, normalizing the distance values, and obtaining the distance weights of each of the superpixels; S452, multiplying the first similarity of the superpixel and the distance weight, and adding the second similarity of the superpixel to obtain the overall similarity of the superpixel; S453, after arranging the overall similarities of each of the superpixels in descending order, calculate the difference between the overall similarities of two adjacent superpixels, determine the maximum difference among the differences, and use the maximum difference as a boundary to extract the top-ranked superpixels to form a final sequence of the target superpixels.

9. A national costume image recognition system based on tie-dyeing technology, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Chromatic aberration threshold-based black pig counting method, device and equipment

    CN120708166A