An adaptive extraction method for theme color of clothing images in sequence
By employing visual saliency detection and adaptive cluster center update methods, the subjectivity and accuracy issues in extracting theme colors from clothing images are resolved. This enables fast and accurate extraction of theme colors from clothing images, conforming to human visual perception and improving the precision and immediacy of design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-18
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies for extracting theme colors from clothing images suffer from high subjectivity, inaccuracy, slow speed, and difficulty in adapting to batch image color extraction. Furthermore, traditional methods struggle to maintain consistency with human visual perception.
By employing visual saliency detection and iterative updating of cluster centers, the theme color of clothing images is extracted through image preprocessing, visual saliency detection, generation of focus fusion map and adaptive clustering, forming a color system that conforms to the human visual attention mechanism.
It enables the rapid and accurate extraction of theme colors from batches of clothing images, conforms to human visual perception, simplifies the operation process, and improves the accuracy and immediacy of design.
Smart Images

Figure CN115496816B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of clothing image processing, and specifically relates to a method for adaptive extraction of theme color from sequential clothing images. Background Technology
[0002] As crucial components of the fashion industry, apparel, accessories, and home textiles rely heavily on intelligent decision-making, smart design, and supply chain collaboration in their product development processes. The persistent problems of product homogenization, supply-demand mismatch, and slow design decisions have become bottlenecks hindering the industry's high-quality development. Color is a vital attribute for expressing the visual appeal of products, conveying design concepts, and highlighting product style.
[0003] The construction of a brand color system requires a highly recognizable theme color. Designers typically perceive theme colors from imagery scenarios and use them in product color design. However, due to subjective perception and individual differences, color extraction is inaccurate, unstable, and slow, especially regarding the difficulty in effectively controlling the color rules of imagery scenarios. Therefore, there is an urgent need for a method that can automatically extract and analyze colors from batches of scene images to improve the accuracy and immediacy of design, and to empower the intelligent design of fashion products, high-quality industrial development, and the cultivation of new growth drivers.
[0004] Thematic color analysis mainly includes three parts: batch image preprocessing, color composition analysis, and interpretation of color association rules. Image preprocessing, depending on the quality of the scene images, generally includes basic processes such as image denoising, illumination equalization, and content segmentation. For color extraction, current methods primarily employ instrumental methods and image analysis methods. Instrumental methods, such as using colorimeters to sample objects or images to extract colors, suffer from limited applicability due to point-like and microscopic sampling; they cannot reflect the overall color of the image or quickly aggregate batch images. Image methods are widely used for color extraction from scene images, often employing K-means color clustering. This iterative clustering method clusters color values in the image into K cluster centers. Setting the K value requires the user to determine the number of dominant colors in the image. Furthermore, the cluster centers of batch images may not be consistent; forcing clustering to K centers easily leads to color distortion. Additionally, methods such as GMM (Gaussian Mixture Model) and FCM (Fuzzy C-Means) also require specifying cluster centers. Mean-shift uses a probability density function to determine cluster categories, while the Quick-shift algorithm improves classification speed on top of that. Imagery scene color extraction differs from conventional image color clustering; it requires quantifying image colors while maintaining a degree of consistency with human visual perception. The human eye exhibits visual selectivity and pays more attention to areas with significant color contrast, making it difficult for the aforementioned methods to extract thematic colors from batches of imagery scene images. Furthermore, the inherent rules governing scene color usage are crucial and serve as an important basis for color reuse and revitalization, enabling the transfer of the scene's color style.
[0005] Existing color extraction technologies require users to set cluster centers or loss function metrics. Since images contain information such as texture, structure, and color, clustering can lead to overly uniform color distribution, resulting in a loss of color hierarchy features and causing information loss in subsequent color transfer. Furthermore, by detaching from visually significant relational structures, clustering differs considerably from human visual perception, making it difficult to effectively guide designers in color selection and application. Summary of the Invention
[0006] The purpose of this invention is to provide an adaptive extraction method for theme colors of sequential clothing images. In view of the deficiencies in the prior art, this method integrates the human visual attention mechanism to extract scene theme colors for batch scene images, forming a color system exclusive to the image scene.
[0007] To solve the above technical problems, the following technical solution is adopted:
[0008] A method for adaptive extraction of theme color from a sequence of clothing images, characterized by the following steps:
[0009] (1) Batch image preprocessing: a. Denoise the images one by one; b. Convert the images from RGB color space to HSV color space;
[0010] (2) Visual saliency detection: Extract the visual saliency region of each image one by one, divide the saliency into layers, divide each saliency layer into separate regions, and obtain the visual saliency brightness map of each image.
[0011] (3) Generate a focused fusion map: Multiply the significant weight matrix with the HSV color map matrix to form a focused fusion map;
[0012] (4) Focus on color-adaptive clustering of the fusion graph: The cluster center is updated iteratively to obtain the number of clusters and the value of each cluster center;
[0013] (5) Image color and its proportion output: Extract the main color of each batch of scene images and merge them into a color composite image. Extract the main color of the color composite image to obtain the theme color of the scene and count the number of pixels of the theme color. Finally, output the HSV value of the theme color of the sequence scene and the color proportion.
[0014] After optimization, in step (1)a: Gaussian filtering is performed on each image to eliminate Gaussian noise. Bilateral filtering is used to preserve the edge gradient, and its calculation formula is as follows:
[0015]
[0016] In equation (1), g(i,j) represents the pixel value of the output point; f(k,l) represents the pixel value of the template center point (k,l); ω(i,j,k,l) is the template weight of the bilateral filter, which is obtained by multiplying the two templates in the spatial domain kernel and the value domain kernel. The calculation formula is as follows:
[0017]
[0018] In equation (2), σ d σ r These are the standard deviations of the Gaussian functions of the distance template and the range template, respectively.
[0019] After optimization, in step (1)b: the initial RGB color space of the image is converted to HSV space according to formula (1), and the calculation method is as shown in formulas (3) to (5):
[0020]
[0021]
[0022] v = C max (5)
[0023] In the above formula, r, g, and b are the normalized values of the R, G, and B channels of any pixel, respectively; C max Δ is the maximum value in [rgb]; Δ is the difference between the maximum and minimum values in [rgb]; h, s, and v are the HSV values of the pixel after conversion.
[0024] After optimization, the visual saliency detection method for a single image in step (2) is as follows: First, taking any pixel as a connection point, calculate the weight between adjacent connection points, and the calculation formula is as follows:
[0025]
[0026] In equation (6), θ ij c is the weight value. i c j These are the RGB mean values of two adjacent nodes, σ θ ε is the weighting coefficient, and ε is the adjustment coefficient, with a value range of 0 to 1; Formula (6) calculates the weight, which represents the association weight between adjacent nodes. Based on this, the significance value and association of each node are calculated:
[0027]
[0028]
[0029] In equation (7), p0 is the RGB mean of the window center point, and the significance value of the iterative process at the center is calculated; in equation (8), S i 0 S is the initial significance value. i S j , where are the iterative significance values of the two join points, and λ is the regularization parameter. L s The loss function value is calculated by iteratively calculating formula (8) until it converges to the minimum value, thereby calculating the correlation between any two connection points; by calculating the correlation between adjacent connection pairs point by point, the visual saliency value of the image is obtained.
[0030] After selection, the visual saliency detection method is applied to other images to obtain the visual saliency value of each image. The value is normalized to 0 to 1 to form a visual saliency brightness map. The ratio of brightness to pixel count of each salient region is calculated to generate a saliency weight matrix.
[0031] After optimization, step (4) involves: first calculating the initial cluster centers, and then focusing and fusing the images. Figure 3 The channel values are normalized, and the mean values of H, S, and V of the image are calculated and set as the initial cluster centers.
[0032] Secondly, calculate the Euclidean distance between each point and the initial center, and determine whether the points are similar to or different from the cluster center based on the decision threshold;
[0033]
[0034] In equation (9), H0, S0, and V0 are the HSV channel values of point i in the focused fusion image, respectively; H0, S0, and V0 are the HSV values of the cluster centers, respectively; the initial cluster centers are the mean values of the three HSV channels of the image; μ is the adjustment coefficient; and θ(t) is the threshold for the t-th judgment.
[0035] Next, determine the θ(t) value at each point. If it is less than the threshold, it is classified into category 1 and no longer participates in the calculation; if it is greater than the threshold, it is temporarily classified into other categories.
[0036] Following the above method, recalculate the cluster centers for pixels in other classes, determine whether each point falls into class 2 or other classes, iteratively update the cluster centers until they are inseparable, and obtain the number of clusters and the value of each cluster center.
[0037] The above technical solution has the following beneficial effects:
[0038] 1. It satisfies the human eye's visual focusing mechanism by optimizing the weights of the original color image, making it more consistent with subjective perception compared to traditional color extraction methods.
[0039] Specifically, such as Figure 7 and 8 As shown, if we use the existing representative K-means clustering for comparison, the clustering result of the main color of the original image is as follows: Figure 7 As shown, the first primary color corresponds to the coat, and the third primary color corresponds to the decorative bag and boots. The improved method effectively adjusts the proportion of the two types of colors, optimizes the color values accordingly, maintains good consistency with the original image, and takes into account the selectivity of human visual focus.
[0040] 2. It does not rely on manually set cluster numbers, but adaptively extracts the number and type of colors based on the color information of the image itself.
[0041] Specifically, methods such as K-means, GMM (Gaussian Mixture Model), and FCM (Fuzzy C-Means) also require specifying cluster centers. Methods like Mean-shift require manually determining the number of dominant colors of objects before feeding the data to the algorithm for clustering. The method presented in this paper does not require inputting the number of clusters. It dynamically determines the similarity of each cluster center through a fixed threshold and divides the number of clusters accordingly, greatly simplifying the operation and making color enhancement faster and more accurate.
[0042] 3. Enable comprehensive color analysis, extraction, and output for batch scenes, not just the analysis of single scene images.
[0043] Specifically, this method targets a batch of photos or videos taken by designers during field trips. By analyzing a large number of scene images one by one and then summarizing them a second time, the imagery colors are obtained. Based on this, the inherent relationships of the scene are output. Attached Figure Description
[0044] The present invention will be further described below with reference to the accompanying drawings:
[0045] Figure 1 This is a flowchart of the extraction method of the present invention;
[0046] Figure 2 The original image used for visual saliency testing;
[0047] Figure 3 A saliency brightness map for visual saliency detection;
[0048] Figure 4 To focus on the fusion diagram;
[0049] Figure 5 For adaptive clustering synthesis graph;
[0050] Figure 6 Output a bar chart for the image colors and their proportions;
[0051] Figure 7 To illustrate the K-means clustering results, a bar chart showing the clustering results in the main color of the original image is provided.
[0052] Figure 8 To illustrate the method of this invention, a histogram of the main color clustering results of the original image is generated. Detailed Implementation
[0053] This invention aims to provide an adaptive method for extracting theme colors from sequential clothing images. It integrates the human visual attention mechanism to extract scene theme colors from batch scene images, forming a color system specific to the imagery scene.
[0054] A method for adaptive extraction of theme color from a sequence of clothing images includes the following steps:
[0055] (1) Batch image preprocessing;
[0056] a) Perform Gaussian filtering on each image element to eliminate Gaussian noise. Use bilateral filtering to preserve edge gradients. The calculation formula is as follows:
[0057]
[0058] In equation (1), g(i,j) represents the pixel value of the output point; f(k,l) represents the pixel value of the template center point (k,l); ω(i,j,k,l) is the template weight of the bilateral filter, which is obtained by multiplying the two templates in the spatial domain kernel and the value domain kernel. The calculation formula is as follows:
[0059]
[0060] In equation (2), σ d σ r These are the standard deviations of the Gaussian functions of the distance template and the range template, respectively.
[0061] b. Convert the initial RGB color space of the image to the HSV space according to formula (1), and the calculation method is as shown in formulas (3) to (5):
[0062]
[0063]
[0064] v = C max (5)
[0065] In the above formula, r, g, and b are the normalized values of the R, G, and B channels of any pixel, respectively; C max Δ is the maximum value in [rgb]; Δ is the difference between the maximum and minimum values in [rgb]; h, s, and v are the HSV values of the pixel after conversion.
[0066] (2) Visual saliency detection: Extract the visual saliency region of each image one by one, divide the saliency into layers, divide each saliency layer into separate regions, and obtain the visual saliency brightness map of each image.
[0067] The method for visual saliency detection of a single image is as follows: First, taking any pixel as a connection point, calculate the weight between it and its adjacent connection points. The calculation formula is as follows:
[0068]
[0069] In equation (6), θ ij c is the weight value. i c j These are the RGB mean values of two adjacent nodes, σ θ ε is the weighting coefficient, and ε is the adjustment coefficient, with a value range of 0 to 1; Formula (6) calculates the weight, which represents the association weight between adjacent nodes. Based on this, the significance value and association of each node are calculated:
[0070]
[0071]
[0072] In equation (7), p0 is the RGB mean of the window center point, and the significant value of the iterative process at this center is calculated; in equation (8), S is the initial significance value. i S j , where are the iterative significance values of the two join points, and λ is the regularization parameter. L s The loss function value is calculated by iteratively calculating formula (8) until it converges to the minimum value, thereby calculating the correlation between any two connection points; by calculating the correlation between adjacent connection pairs point by point, the visual saliency value of the image is obtained.
[0073] Correspondingly, the visual saliency detection method is applied to other images to obtain the visual saliency value of each image. The value is normalized to 0 to 1 to form a visual saliency brightness map. The ratio of brightness to pixel count of each salient region is calculated to generate a saliency weight matrix.
[0074] (3) Generate a focused fusion map: Multiply the significant weight matrix with the HSV color map matrix to form a focused fusion map;
[0075] (4) Focus on color-adaptive clustering of the fusion graph: The cluster center is updated iteratively to obtain the number of clusters and the value of each cluster center;
[0076] First, calculate the initial cluster centers, then focus and fuse the images. Figure 3 The channel values are normalized, and the mean values of H, S, and V of the image are calculated and set as the initial cluster centers.
[0077] Secondly, calculate the Euclidean distance between each point and the initial center, and determine whether the points are similar to or different from the cluster center based on the decision threshold;
[0078]
[0079] In equation (9), H0, S0, and V0 are the HSV channel values of point i in the focused fusion image, respectively; H0, S0, and V0 are the HSV values of the cluster centers, respectively; the initial cluster centers are the mean values of the three HSV channels of the image; μ is the adjustment coefficient; and θ(t) is the threshold for the t-th judgment.
[0080] Next, determine the θ(t) value at each point. If it is less than the threshold, it is classified into category 1 and no longer participates in the calculation; if it is greater than the threshold, it is temporarily classified into other categories.
[0081] Following the above method, recalculate the cluster centers for pixels in other classes, determine whether each point falls into class 2 or other classes, iteratively update the cluster centers until they are inseparable, and obtain the number of clusters and the value of each cluster center.
[0082] (5) Image color and its proportion output: Extract the main color of each batch of scene images and merge them into a color composite image. Extract the main color of the color composite image to obtain the theme color of the scene and count the number of pixels of the theme color. Finally, output the HSV value of the theme color of the sequence scene and the color proportion.
[0083] The above are merely specific embodiments of the present invention, but the technical features of the present invention are not limited thereto. Any simple changes, equivalent substitutions, or modifications made based on the present invention to solve essentially the same technical problems and achieve essentially the same technical effects are all covered within the protection scope of the present invention.
Claims
1. A method for adaptive extraction of theme color from sequential clothing images, characterized in that... Includes the following steps: (1) Batch image preprocessing: a. Denoise the images one by one; b. Convert the images from RGB color space to HSV color space; (2) Visual saliency detection: Extract the visual saliency region of each image one by one, divide the saliency into layers, divide each saliency layer into separate regions, and obtain the visual saliency brightness map of each image. The method for visual saliency detection of a single image is as follows: First, taking any pixel as a connection point, calculate the weight between it and its adjacent connection points. The calculation formula is as follows: In equation (6), c is the weight value. i c j These are the RGB mean values of two adjacent nodes, respectively. ε is the weighting coefficient, and ε is the adjustment coefficient, with a value range of 0 to 1; Formula (6) calculates the weight, which represents the association weight between adjacent nodes. Based on this, the significance value and association of each node are calculated: In equation (7), p0 is the RGB mean of the window center point, and the significant value of the iterative process at this center is calculated; in equation (8), S is the initial significance value. i S j These are the iterative significance values of the two join points, respectively; λ is the regularization parameter; L s The loss function value is calculated by iteratively calculating formula (8) until it converges to the minimum value, thereby calculating the correlation between any two connection points. By calculating the correlation between adjacent connection pairs point by point, the visual saliency value of the image can be traversed. (3) Generate a focused fusion map: Multiply the significant weight matrix with the HSV color map matrix to form a focused fusion map; (4) Focus on color-adaptive clustering of the fusion graph: The cluster center is updated iteratively to obtain the number of clusters and the value of each cluster center; (5) Output of theme color and its proportion: Extract the main color of each batch of scene images and merge them into a color composite image. Extract the main color of the color composite image to obtain the theme color of the scene and count the number of pixels of the theme color. Finally, output the HSV value of the theme color of the sequence scene and the color proportion.
2. The method for adaptive extraction of theme color from sequential clothing images according to claim 1, characterized in that: In step (1)a: Gaussian filtering is performed on each image to eliminate Gaussian noise. Bilateral filtering is used to preserve the edge gradient. The calculation formula is as follows: In equation (1), g(i,j) represents the pixel value of the output point; f(k,l) represents the pixel value at the center point (k,l) of the template; ω(i,j,k,l) is the template weight of the bilateral filter, which is obtained by multiplying the spatial domain kernel and the value domain kernel of the template. The calculation formula is as follows: In equation (2), σ d σ r These are the standard deviations of the Gaussian functions of the distance template and the range template, respectively.
3. The method for adaptive extraction of theme color from sequential clothing images according to claim 1, characterized in that: In step (1)b: the initial RGB color space of the image is converted to HSV space according to formulas (3) to (5), and the calculation method is as shown in formulas (3) to (5): v=C max (5) In the above formula, r, g, and b are the normalized values of the R, G, and B channels of any pixel, respectively; C max [rgb] The maximum value in the [rgb] is Δ; the difference between the maximum and minimum values in [rgb] is h, s, and v, respectively, are the HSV values of the pixel after conversion.
4. The method for adaptive extraction of theme color from sequential clothing images according to claim 1, characterized in that: The visual saliency detection method is applied to other images to obtain the visual saliency value of each image. The value is normalized to 0 to 1 to form a visual saliency brightness map. The ratio of brightness to pixel count of each salient region is calculated to generate a saliency weight matrix.
5. The method for adaptive extraction of theme color from sequential clothing images according to claim 1, characterized in that: Step (4): First, calculate the initial cluster center, normalize the three channel values of the image focus fusion image, calculate the mean values of H, S, and V of the image, and set them as the initial cluster center; Secondly, calculate the Euclidean distance between each point and the initial center, and determine whether the points are similar to or different from the cluster center based on the decision threshold; In equation (9), H0, S0, and V0 are the HSV channel values of point i in the focused fusion image, respectively; H0, S0, and V0 are the HSV values of the cluster centers, respectively; the initial cluster centers are the mean values of the three HSV channels of the image; μ is the adjustment coefficient; and θ(t) is the threshold for the t-th judgment. Next, determine the θ(t) value at each point. If it is less than the threshold, it is classified into category 1 and no longer participates in the calculation; if it is greater than the threshold, it is temporarily classified into other categories. Following the above method, recalculate the cluster centers for pixels in other classes, determine whether each point falls into class 2 or other classes, iteratively update the cluster centers until they are inseparable, and obtain the number of clusters and the value of each cluster center.
Citation Information
Patent Citations
Image detection method based on Gaussian multi-scale transform and color complexity
CN102496157A