A color palette generation method and system based on natural scene images

By using the K-Means algorithm and method of conspicuous key color selection in natural images, a representative and distinctive color palette is generated, which solves the problem of existing methods ignoring conspicuous colors and improves performance and is suitable for areas such as clothing design.

CN118674614BActive Publication Date: 2025-03-11WUHAN TEXTILE UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410821690.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2025-03-11
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

When extracting colors in natural images, existing palette generation methods are easily dominated by major colors, ignoring the small but conspicuous colors in the image, and the dependence of the K-Means algorithm on prototype initialization causes the calculation to converge to a local minimum.

Method used

A palette generation method based on natural scene images is proposed. The preliminary color palette is extracted through the K-Means algorithm, and the initial color palette is sorted in the HSV space, conspicuous key colors are selected, and the remaining colors are randomly selected to form a new color palette. By calculating the color difference of CIEDE2000 and selecting the largest and obvious palette as the final result.

Benefits of technology

The performance of color palette generation is improved, at least 30% to 42.5% higher than the performance of mainstream unsupervised clustering learning algorithms, ensuring that each color has obvious and representative differences, and is suitable for clothing design and other fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118674614B_ABST
    Figure CN118674614B_ABST
Patent Text Reader

Abstract

The present invention discloses a color palette generation method and system based on natural scene images. The present invention innovatively proposes a method for converting an artificial color palette into a more reasonable standard color palette, an intelligent color palette generation method, and a color palette similarity evaluation model. The importance of the present invention is reflected in the innovative color palette generation method, which brings commercial competitive advantages to the clothing industry and promotes the cross-border integration of design creativity. In addition to clothing design, the natural image palette generation method can also be applied to other design fields, such as home decoration, product design, etc., providing new sources of creativity for designers in these fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer digital image processing, and in particular relates to a method and system for generating a color palette based on a natural scene image. Background Art

[0002] Color palettes extracted from natural images can provide designers with unique and personalized color schemes. These colors are not limited by traditional color palettes, which can inspire creativity. The colors in natural landscape images are often related to people's emotions and experiences. For example, blue sky and green grass may make people feel peaceful and happy, while red sunsets are full of warmth and romance. Applying these colors to clothing design can resonate with the audience. The colors in natural images are affected by the environment and are consistent with the concepts of sustainability and environmental protection. Applying these colors to clothing design can help convey environmental awareness.

[0003] Existing color palette generation methods can be mainly divided into three categories: histogram-based methods, clustering-based methods and neural network-based methods.

[0004] The basic idea of ​​histogram-based color palette extraction methods is to convert the color information of image pixels into a histogram, and then find the color with the highest frequency in the histogram as the main color of the image. Delon et al. found that the peaks in the color histogram of an image usually correspond to spatial regions in natural images. Their algorithm extracts color themes by continuously finding meaningful peaks in the hue, saturation, and value histograms of the image. Due to the hierarchical extraction method, the resulting color set usually contains many colors, some of which are redundant. Morse et al. used a similar hierarchical histogram method to extract color themes, given a user-specified constraint on the maximum number of colors and a small distance between colors. However, they did not provide user or quantitative evaluation of the themes against other methods.

[0005] The clustering-based method is one of the mainstream color palette extraction methods. This method divides the color space into different regions and clusters the colors into a group of categories. Then, some representative colors are selected from each category as the palette. The clustering algorithms commonly used in this method are K-Means algorithm, Fuzzy C-Means (FCM) algorithm and Self-Organizing Maps (SOM) algorithm. The K-Means algorithm, first developed 50 years ago, is one of the most popular center-based algorithms. It attempts to find K clusters to minimize the mean square quantization error, MSQE. The algorithm attempts to locate K prototypes (centroids) in the entire data set so that the K prototypes best represent the data to some extent. The K-Means algorithm is summarized by Barbakh et al.: The K-Means algorithm can cluster all pixels in the color space into a specified number of clusters, and then select the average color of each cluster as the color on the palette. The FCM algorithm was proposed by Bezdek JC in 1981 to optimize image recoloring errors. The SOM algorithm was proposed by Teuvo Kohonen in 1982. It is a neural network algorithm mainly used for data dimensionality reduction and visualization. The SOM algorithm maps high-dimensional data to low-dimensional space in a self-organizing and adaptive manner while retaining the topological structure of the data, aiming to compress a color image into a smaller palette. The NeuQuant algorithm uses the SOM method to learn the color distribution in the image and ultimately obtain the color points in the palette.

[0006] The FCM clustering algorithm works better when applied to CIE L*a*b* color reduction images, and the trained SOM network reduces the execution time of color image segmentation. In terms of color image segmentation, the performance of FCM and SOM algorithms is better than that of K-Means algorithm. The main problem of K-Means algorithm is its dependence on prototype initialization. If the initialization prototype is not carefully selected, the calculation will likely converge to the local minimum instead of the global minimum. Therefore, properly initializing the prototype can have a great impact on K-Means.

[0007] Convolutional neural networks (CNNs) excel in image palette extraction due to their powerful spatial feature extraction capabilities, although they may face challenges in generalization and interpretability. Generative adversarial networks (GANs) can creatively generate novel color combinations and provide high-quality output, but at the cost of training instability and high resource consumption. Attention mechanism methods improve the relevance and representativeness of the palette by focusing on key areas of the image, but this increases the computational complexity of the model. Autoencoders highlight the most important colors in the image by learning a compressed representation of the input, but may be limited by reconstruction errors and training complexity. Each method has its own advantages in terms of efficiency, innovation, and accuracy. Choosing the most appropriate method requires considering specific task requirements and resource constraints. Summary of the invention

[0008] The purpose of the present invention is to solve the problems described in the background technology. The present invention proposes a method for generating a natural image color palette for clothing design. The color palette reference data is obtained through an artificial color selection experiment, and the effectiveness of the scoring model is verified through a color palette similarity scoring experiment. By comparing the mainstream unsupervised clustering learning algorithm with the algorithm proposed in the present invention, it is concluded that the performance of the algorithm of the present invention is at least 30% to 42.5% higher than that of the mainstream algorithm. Finally, the color palette generated by the algorithm proposed in the present invention is applied to clothing design to show the effect.

[0009] The technical solution of the present invention is: a method for generating a color palette based on a natural scene image, comprising the following steps:

[0010] Step 1: Input a natural scenery image I and perform dimensionality reduction transformation on it to obtain I′;

[0011] Step 2, using the K-Means algorithm to extract a preliminary color palette Palette1 containing n colors from I′;

[0012] Step 3: Sort the preliminary color palette according to the hue angle in the HSV space to obtain Palette sort ;

[0013] Step 4: Calculate the color difference between each color in the preliminary color palette and the m standard colors, and take the color with the smallest color difference between the preliminary color palette and the m standard colors as the prominent key color. key , m is less than n;

[0014] Step 5: Based on the selected prominent key color, randomly select m-1 colors from the remaining colors of the preliminary color palette to form a new color palette with the prominent key color. New color palettes for various combinations;

[0015] Step 6, calculate the CIEDE2000 color difference sum between the m colors in the new palette, and select the palette with the largest color difference sum and the color difference between any two colors greater than the color difference threshold as the final palette.

[0016] Furthermore, the calculation formula for the conspicuous key color is as follows:

[0017]

[0018] Where min represents the minimum color difference between each color in the preliminary color palette and all standard colors, argmin represents the color corresponding to the minimum value of all minimum color differences, and c represents Palette sort One of the colors in, s represents one of the m standard colors, CIEDE2000 represents the calculation of the CIEDE2000 color difference between two colors, Colors standard Represents an array of m standard colors.

[0019] Furthermore, there are 6 standard colors, including red, orange, yellow, cyan, blue and purple.

[0020] Furthermore, Colors standard It is expressed as:

[0021]

[0022] Further, the final palette Palette final The calculation formula is as follows:

[0023]

[0024] Among them, Comb palette represents all possible palette color combinations, p represents any palette combination, i, j represents two colors in the palette combination, argmax represents the color difference and the maximum corresponding color combination, CIEDE2000 represents the calculation of the CIEDE2000 color difference between two colors, and k represents the color difference threshold.

[0025] Furthermore, the calculation formula of CIEDE2000 is:

[0026]

[0027]

[0028] a′=(1+G)×a * (3)

[0029] b′=b * (4)

[0030]

[0031] ΔL′=L′1-L′2 (8)

[0032] ΔC′ ab =C′ ab,1 -C′ ab,2 (9)

[0033]

[0034] R T = -sin(2Δθ)R C (15)

[0035]

[0036] Among them, K L , K C , K H is the weight of brightness, chromaticity and hue in actual situation, S L , S C , S H are brightness weight function, chromaticity weight function and hue weight function respectively, R T is the conversion function; ΔL′ is the brightness difference, ΔC′ ab is the chromaticity difference, ΔH′ ab For hue difference; is CIELAB chromaticity, a * 、b * is the CIELAB coordinate, a′ and b′ are the CIEDE2000 coordinates, G is the adjustment factor of the axis of the CIEL*a*b* color space, and h′ ab is the CIEDE2000 hue angle, is the mean chromaticity of the two color stimuli of CIEDE2000, is the mean brightness of the two color stimuli in CIEDE2000, Δh′ ab is the hue angle difference of CIEDE2000, is the mean hue angle of the brightness of the two color stimuli in CIEDE2000, T is the hue weighted T function, R C is the relationship between the conversion function and chromaticity, and Δθ is the relationship between the conversion function and hue.

[0037] Furthermore, the method further includes step 7, calculating the similarity between the final color palette and the color palette obtained by the manual color selection experiment, and the calculation method is as follows:

[0038] First, the extracted final palette is reordered with reference to the standard reference palette so that the color difference between the corresponding positions of the two palettes is minimized. Then, the CIEDE2000 color difference is calculated for the color blocks at the corresponding positions of the two palettes. When the color difference between the two colors is less than a certain color difference threshold dE, it is considered a hit. Finally, the hit rate l / m is used as the similarity score of the two palettes, where l represents the number of hits.

[0039] The present invention also provides a color palette generation system based on natural scene images, comprising the following modules:

[0040] The dimension reduction module is used to input a natural scenery image I and perform dimension reduction transformation on it to obtain I′;

[0041] A preliminary color palette extraction module is used to extract a preliminary color palette Palette1 containing n colors from I′ using a K-Means algorithm;

[0042] The sorting module is used to sort the preliminary color palette according to the hue angle in the HSV space to obtain the Palette sort ;

[0043] The conspicuous key color calculation module is used to calculate the color difference between each color in the preliminary color palette and the m standard colors, and regard the color with the smallest color difference between the preliminary color palette and the m standard colors as the conspicuous key color. key , m is less than n;

[0044] The combination module is used to randomly select m-1 colors from the remaining colors of the preliminary color palette based on the selected conspicuous key color, and form a new color palette with the conspicuous key color to obtain New color palettes for various combinations;

[0045] The final palette generation module is used to calculate the CIEDE2000 color difference sum between m colors in the new palette, and select the palette with the largest color difference sum and the color difference between any two colors greater than the color difference threshold as the final palette.

[0046] The present invention also provides a color palette generation device based on a natural scene image, comprising:

[0047] one or more processors;

[0048] A storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement a color palette generation method based on natural scene images as described in the above technical solution.

[0049] The present invention innovatively proposes a method for converting an artificial color palette into a more reasonable standard color palette, an intelligent color palette generation method, and a color palette similarity evaluation model. The importance of the present invention lies in the innovative color palette generation method, which brings commercial competitive advantages to the clothing industry and promotes the cross-border integration of design creativity. In addition to clothing design, the natural image color palette generation method can also be applied to other design fields, such as home decoration, product design, etc., providing new sources of creativity for designers in these fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 This is an example of the result of extracting the image palette using the standard K-Means algorithm in an embodiment of the present invention.

[0051] Figure 2 This is the extraction process of the two-stage palette extraction algorithm of the embodiment of the present invention.

[0052] Figure 3 It is a schematic diagram of reordering the extracted color palette with reference to the standard reference color palette in an embodiment of the present invention.

[0053] Figure 4 This is a diagram of a palette similarity evaluation experiment in an embodiment of the present invention.

[0054] Figure 5 A diagram showing the relationship between the model score and the manual score in an embodiment of the present invention.

[0055] Specific implementation method

[0056] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0057] The embodiment of the present invention provides a method for generating a color palette based on a natural scene image, which mainly includes two stages: a preliminary color palette generation stage and a "conspicuous color" selection stage;

[0058] Common scenes in natural landscape images, such as the sky, white clouds, green grass, mountains, and lakes, usually occupy a large area, so these colors also occupy a large proportion of the image. In this case, existing methods are easily dominated by these main colors when extracting the color palette, ignoring the smaller but brightly colored and conspicuous parts of the image. Taking the commonly used K-Means algorithm as an example, when the number of clusters is set to 6, the six representative colors extracted are mainly blue, white, green, and black corresponding to the sky, white clouds, green grass, and mountains and waters, and fail to capture the small but very conspicuous pink and purple colors of the flowers in the picture. However, when the number of clusters increases to 15, pink and purple appear in the extraction results.

[0059] In order to extract a representative color palette that is more in line with human choice from natural landscape images for application in subsequent clothing design, this paper proposes a new two-stage color palette extraction method. Figure 2 As shown, input a natural scenery image I∈R H×W×3 , and transform it into I′∈R HW×3 In order to include as many main colors as possible in the image, in the first stage, the K-Means algorithm is used to extract the preliminary palette Palette1 containing 15 colors, which is expressed as:

[0060] Palette1 = KMeans clusters=15 (I′)

[0061] Where clusters represents the number of clusters, such as Figure 1 As shown in the figure, when the number of clusters of the K-Means algorithm is set to 15, the color with the lowest proportion of 1% in the image can be obtained. In order to maintain the stability of the K-Means algorithm, the random number seed is fixed in the first stage, and the colors corresponding to the 15 cluster centers are iterated. In the second stage, the preliminary color palette of the first stage is further processed to obtain the final color palette. In order to ensure the consistency of the results of each run, the specific order of the preliminary color palette needs to be maintained. Therefore, the preliminary color palette of the first stage is first sorted according to the hue in the HSV space (sorted by hue angle from small to large) to obtain Palette sort Next, in order to avoid ignoring the small but conspicuous colors, we first find the "conspicuous colors" by calculating the color difference between each color in the preliminary color palette and the six standard colors (red, orange, yellow, cyan, blue and purple, and eliminating green because it is common in landscapes). The color with the smallest color difference between the preliminary color palette and the six standard colors is regarded as the conspicuous key color. key , the calculation process is as follows:

[0062]

[0063] Where min represents the minimum color difference between each color in the palette and all standard colors, argmin represents the color corresponding to the minimum value of all minimum color differences, and c represents Palette sort One of the colors in, s represents one of the 6 standard colors, Colors standard Represents 6 standard color arrays, expressed as:

[0064]

[0065] CIEDE2000 means calculating the CIEDE2000 color difference between two colors, expressed as:

[0066]

[0067] a′=(1+G)×a * (3)

[0068] b′=b * (4)

[0069]

[0070]

[0071] ΔL′=L′1-L′2 (8)

[0072] ΔC′ ab =C′ ab,1 -C′ ab,2 (9)

[0073]

[0074] R T = -sin(2Δθ)R C (15)

[0075]

[0076] Among them, K L , K C , K H is the weight of brightness, chromaticity and hue in actual situation, S L , S C , S H are brightness weight function, chromaticity weight function and hue weight function respectively, R T is the conversion function; ΔL′ is the brightness difference, ΔC′ ab is the chromaticity difference, ΔH′ ab For hue difference; is CIELAB chromaticity, a * 、b * is the CIELAB coordinate, a′ and b′ are the CIEDE2000 coordinates, G is the adjustment factor of the axis of the CIEL*a*b* color space, and h′ ab is the CIEDE2000 hue angle, is the mean chromaticity of the two color stimuli of CIEDE2000, is the mean brightness of the two color stimuli in CIEDE2000, Δh′ ab is the hue angle difference of CIEDE2000, is the mean hue angle of the brightness of the two color stimuli in CIEDE2000, T is the hue weighted T function, R C is the relationship between the conversion function and chromaticity, and Δθ is the relationship between the conversion function and hue.

[0077] Finally, based on the selected "eye-catching color", 5 colors are randomly selected from the remaining colors in the palette to form a new palette with the "eye-catching color". The CIEDE2000 color difference sum between the 6 colors in the new palette is calculated, and the palette with the largest color difference sum and a color difference of more than 20 between any two colors is selected as the final palette. This ensures that the difference between each color is obvious and representative. The calculation process is as follows:

[0078]

[0079] Among them, Comb palette Represents all possible palette color combinations, p represents any palette combination, i, j represent two colors in the palette combination, and argmax represents the color difference and the maximum corresponding color combination.

[0080] In order to evaluate the performance of the method, the present invention makes some quantitative comparisons. First, a data set is obtained, then an artificial palette is obtained through psychophysical experiments, and a reference palette is obtained based on the artificial palette. Finally, a new palette similarity comparison method is proposed to evaluate the difference between the two-stage palette extraction palette and the artificially extracted palette in the present invention.

[0081] (1) Dataset

[0082] The experimental dataset of the present invention contains 20 natural scenery images with resolutions ranging from 612×523 to 3200×2400, including 5 pairs of repeated images to verify the stability of the algorithm and compare the differences before and after manual color selection.

[0083] (2) Artificial color selection experiment

[0084] Referring to the method of YANG et al., an artificial experiment was designed. A total of 20 participants (14 males and 6 females) with normal color vision who passed the Ishihara test volunteered to participate in this psychophysical experiment. Their ages ranged from 20 to 30 years old. The purpose of the experiment was briefly explained to all participants when they were recruited. The experiment was conducted on a monitor (HP monitor HP N223v 1CR9441H5z, resolution 1920×1080) in a dark room. The 20 participants completed the color selection by clicking the image area with the mouse in the GUI written in the MATLAB programming environment. Each participant was asked to sit in a dark environment for 5 minutes before the formal start of the experiment to adapt to the environment. In the experiment, each participant was asked to select 6 representative colors for each image as a color palette representing the image style. These images were displayed one at a time, with a total of 20 images (5 of which were repeated images). There was no strict time limit for the participants to complete the experiment, but the entire experiment took each participant about 15-25 minutes. The results were automatically saved by the software as visual color palette data. The color selection results of the five repeated images were excluded from the main results to evaluate the repeatability within participants. Unlike Yang et al., who reordered all the artificial color palettes obtained for each image and then directly averaged them to obtain the reference color palette, we clustered the colors in all the artificial color palettes again and used the clustered results as the final reference color palette. From the example in the figure below, we can see that the reference color palette we obtained is more representative of the results of artificial color selection.

[0085] (3) Palette Similarity Evaluation Experiment

[0086] The performance of the method is objectively evaluated by quantitatively comparing the similarity between the palette extracted by the method of the present invention and the palette of the manual color selection experiment in (2). Existing studies have proposed a variety of quantitative palette comparison methods: Ciocca et al. used the earth moving distance to calculate the CIELAB value difference between two palettes, while Pan and Westland17 proposed the mean color difference model (MECDM) and the minimum color difference model (MICDM) based on the dECIELAB color difference formula to quantify the difference between palettes. In subsequent work, Yang et al. confirmed that the quantification effect of the minimum color difference model (MICDM) can be improved by using CIEDE2000 instead of the dE CIELAB color difference equation. However, these palette comparison methods based on complex numerical calculations may lack interpretability in practical applications. Therefore, the present invention proposes a simple and easy-to-understand palette similarity evaluation model-hit rate model, which will first be briefly explained, and then the difference between our evaluation model and the palette similarity obtained by human eye perception is evaluated by designing a psychophysical experiment.

[0087] like Figure 3As shown, the extracted palettes are first reordered with reference to the standard reference palette so that the color difference between the corresponding positions of the two palettes is minimized, and then the CIEDE2000 color difference is calculated for the color blocks at the corresponding positions of the two palettes. When the color difference between the two colors is less than a certain color difference threshold dE, it is considered a hit, and finally the hit rate n / 6 is used as the similarity score of the two palettes.

[0088] In order to intuitively compare the similarity between the extracted color palette and the artificial reference palette, and at the same time test whether our hit rate evaluation model is consistent with the perception of the human eye, we designed a psychophysical experiment to manually score the similarity between the extracted color palette and the artificial reference palette, and then compare these scores with the scores of the hit rate evaluation model to verify the effectiveness of the evaluation model.

[0089] The palette similarity evaluation experiment used the same experimental environment as the manual color selection experiment, and a total of 40 subjects scored 20 pairs of palettes. After the experiment, the results were preprocessed to remove abnormal data, and the average score of each pair of palettes was used as the final manual similarity score.

[0090] The experiment is divided into two parts: experimental guidance and formal experiment.

[0091] Key prompts were given in both parts of the experiment: "Please observe the following palette for 10 seconds and enter the similarity score of the two palettes (after entering the value, press Enter to go to the next page)", "The similarity range is an integer from 0 to 6, 0 means that the color blocks at the corresponding positions of the two palettes are not similar, 6 means that the color blocks at the corresponding positions of the two palettes are similar, and so on. Two colors with little difference in depth can be considered similar." The experimental method is as follows: Figure 4 shown.

[0092] The 20 pairs of color palettes extracted by this method and the manually selected reference color palettes were compared using manual scoring and hit rate model scoring, respectively. The scores of 7 abnormal subjects were excluded from the manual scoring results. The final manual scoring and hit rate model scoring of the 20 pairs of color palette similarities are shown in Figure 2. Figure 5 As shown. Regardless of whether it is manual scoring or hit rate model scoring, the similarity scores of the 20 pairs of palettes are higher than 4, indicating that the palette extracted by this method is similar to the manually selected palette in at least 4 colors. The average manual score and hit rate model score of the 20 pairs of palettes are 5.2 / 6 (86.66%) and 5.05 / 6 (84.16%), respectively, indicating that when 6 representative colors are selected from natural scenery images, this method can accurately extract more than 5 colors similar to those selected manually, verifying the good performance of the palette extraction method of this method. The manual score and the hit rate model score differ by only 2.5%, indicating that the hit rate scoring model is effective.

[0093] In summary, the present invention conducted two psychophysical experiments. First, a landscape color picking experiment was conducted to provide a basis for the standard color palette, and then a palette similarity scoring experiment was conducted. The results show that the scoring hit rate of the evaluation model reached 86.66%, while the manual scoring hit rate obtained by the psychophysical experiment was 84.16%, which verifies the effectiveness of the evaluation model. By comparing with the standard palette similarity score, it is proved that the improved palette generation algorithm can generate visually satisfactory palettes and can be used as an intelligent generation method for various digital image palettes.

[0094] In another embodiment, the present invention further provides a color palette generation system based on natural scene images, comprising the following modules:

[0095] The dimension reduction module is used to input a natural scenery image I and perform dimension reduction transformation on it to obtain I′;

[0096] A preliminary color palette extraction module is used to extract a preliminary color palette Palette1 containing n colors from I′ using a K-Means algorithm;

[0097] The sorting module is used to sort the preliminary color palette according to the hue angle in the HSV space to obtain the Palette sort ;

[0098] The conspicuous key color calculation module is used to calculate the color difference between each color in the preliminary color palette and the m standard colors, and regard the color with the smallest color difference between the preliminary color palette and the m standard colors as the conspicuous key color. key , m is less than n;

[0099] The combination module is used to randomly select m-1 colors from the remaining colors of the preliminary color palette based on the selected conspicuous key color, and form a new color palette with the conspicuous key color to obtain New color palettes for various combinations;

[0100] The final palette generation module is used to calculate the CIEDE2000 color difference sum between m colors in the new palette, and select the palette with the largest color difference sum and the color difference between any two colors greater than the color difference threshold as the final palette.

[0101] The specific implementation method of each module is the same as each step and will not be described in detail in the present invention.

[0102] In another embodiment, the present invention further provides a color palette generation device based on a natural scene image, comprising:

[0103] one or more processors;

[0104] A storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement a color palette generation method based on natural scene images as described in the above technical solution.

[0105] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.

Claims

1. A color palette generation method based on natural scene images, characterized in that: The steps include: Step 1: Input a natural landscape image I and perform dimensionality reduction transformation on it to obtain I ′ ; Step 2: Use K-Means algorithm to extract ′ Extract a preliminary palette Palette1 containing n colors; Step 3: Sort the preliminary color palette according to the hue angle in the HSV space to obtain Palette sort ; Step 4: Calculate the color difference between each color in the preliminary color palette and the m standard colors, and take the color with the smallest color difference between the preliminary color palette and the m standard colors as the prominent key color. key , m is less than n; Step 5: Based on the selected prominent key color, randomly select m-1 colors from the remaining colors of the preliminary color palette to form a new color palette with the prominent key color. New color palettes for various combinations; Step 6, calculate the CIEDE2000 color difference sum between the m colors in the new palette, and select the palette with the largest color difference sum and the color difference between any two colors greater than the color difference threshold as the final palette.

2. A method for generating a color palette based on a natural scene image as claimed in claim 1, characterized in that: The calculation formula for the conspicuous key color is as follows: Where min represents the minimum color difference between each color in the preliminary color palette and all standard colors, argmin represents the color corresponding to the minimum value of all minimum color differences, and c represents Palette sort One of the colors in, s represents one of the m standard colors, CIEDE2000 represents the calculation of the CIEDE2000 color difference between two colors, Colors standard Represents an array of m standard colors.

3. A method for generating a color palette based on a natural scene image as claimed in claim 1 or 2, characterized in that: There are 6 standard colors, including red, orange, yellow, cyan, blue and purple.

4. The method for generating a color palette based on a natural scene image according to claim 2, characterized in that: Colors standard It is expressed as:

5. The method for generating a color palette based on a natural scene image according to claim 1, characterized in that: Final Palette final The calculation formula is as follows: Among them, Comb palette represents all possible palette color combinations, p represents any palette combination, i, j represents two colors in the palette combination, argmax represents the color difference and the maximum corresponding color combination, CIEDE2000 represents the calculation of the CIEDE2000 color difference between two colors, and k represents the color difference threshold.

6. A method for generating a color palette based on a natural scene image as claimed in claim 2 or 5, characterized in that: The calculation formula of CIEDE2000 is: a ′ =(1+G)×a * (3) b ′ =b * (4) ΔL ′ =L ′ 1-L ′ 2 (8) ΔC a ′ b =C a ′ b,1 -C a ′ b,2 (9) R T =-sin(2Δθ)R C (15) Among them, K L , K C , K H is the weight of brightness, chromaticity and hue in actual situation, S L , S C , S H are brightness weight function, chromaticity weight function and hue weight function respectively, R T is the conversion function; ΔL ′ is the brightness difference, ΔC a ′ b is the chromaticity difference, ΔH ′ ab C is the hue difference; a * b is CIELAB chromaticity, a * , b * is the CIELAB coordinate, a ′ , b ′ is the CIEDE2000 coordinate, G is the adjustment factor of the axis of the CIEL*a*b* color space, h ′ ab is the CIEDE2000 hue angle, is the mean chromaticity of the two color stimuli of CIEDE2000, is the mean brightness of the two color stimuli in CIEDE2000, Δh′ ab is the hue angle difference of CIEDE2000, is the mean hue angle of the brightness of the two color stimuli in CIEDE2000, T is the hue weighted T function, R C is the relationship between the conversion function and chromaticity, and Δθ is the relationship between the conversion function and hue.

7. The method for generating a color palette based on a natural scene image according to claim 1, characterized in that: The method also includes step 7, which is to calculate the similarity between the final color palette and the color palette obtained by the manual color selection experiment, and the calculation method is as follows: First, the extracted final palette is reordered with reference to the standard reference palette so that the color difference between the corresponding positions of the two palettes is minimized. Then, the CIEDE2000 color difference is calculated for the color blocks at the corresponding positions of the two palettes. When the CIEDE2000 color difference between the two color blocks is less than a certain color difference threshold dE, it is considered a hit. Finally, the hit rate l / m is used as the similarity score of the two palettes, where l represents the number of hits.

8. A color palette generation system based on natural scene images, characterized in that: Includes the following modules: The dimension reduction module is used to input a natural landscape image I and perform dimension reduction transformation to obtain I ′ ; The preliminary color plate extraction module is used to extract the color from I using the K-Means algorithm. ′ Extract a preliminary palette Palette1 containing n colors; The sorting module is used to sort the preliminary color palette according to the hue angle in the HSV space to obtain the Palette sort ; The conspicuous key color calculation module is used to calculate the color difference between each color in the preliminary color palette and the m standard colors, and regard the color with the smallest color difference between the preliminary color palette and the m standard colors as the conspicuous key color. key , m is less than n; The combination module is used to randomly select m-1 colors from the remaining colors of the preliminary color palette based on the selected conspicuous key color, and form a new color palette with the conspicuous key color to obtain New color palettes for various combinations; The final palette generation module is used to calculate the CIEDE2000 color difference sum between m colors in the new palette, and select the palette with the largest color difference sum and the color difference between any two colors greater than the color difference threshold as the final palette.

9. A color palette generation device based on natural scene images, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement a color palette generation method based on a natural scene image as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for merging image format based on index color

    CN101075344A

  • Garment template coloring method and system driven by natural scene

    CN117689768A