A method and device for determining a subject color of a picture, and a method and device for training a model
By grouping image colors and training a model, calculating color difference values and mean values, and selecting high-confidence color groups to determine the theme color of the image, the problem of high manual costs in existing technologies is solved, and efficiency is improved.
Patent Information
- Application Number
- CN202211020688.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-08-24
AI Technical Summary
Existing technologies require significant manual and time costs to determine the theme color of an image, resulting in low efficiency.
By grouping the colors of the image to be processed, calculating the color difference value and the mean number, and inputting them into a pre-trained target color prediction model, the color group with high confidence is selected as the target color group, and the theme color of the image is calculated.
It reduces labor and time costs and improves the efficiency of determining the theme color of images.
Smart Images

Figure CN115424039B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a picture theme color determination method and a model training method and device. BACKGROUND
[0002] At present, the research on immersive experience at home and abroad is still in continuous exploration. The intention of immersive experience is to exclude all interference outside the user's attention as much as possible, so that the user can successfully concentrate on performing the expected behavior, and the user's highly concentrated attention will be used to guide the user to produce positive emotions and immersive experience. As a medium for providing information to users, the rationality and comfort of the display interface design will affect the user's cognition and understanding of the information. A reasonable display interface can enable users to obtain immersive experience and improve user experience.
[0003] For example, for a display interface displaying a picture, the theme color of the picture displayed in the display interface is extracted, the theme color of the picture can represent the overall color feature of the picture, and the color of the menu bar in the display interface is adjusted to the theme color of the picture, so that the color feature of the display interface matches the overall color feature of the picture, improving the user experience of browsing the picture.
[0004] In related technologies, when extracting the theme color of the picture, the average value of the pixel values of each pixel point in the picture is calculated as a candidate color, and the matching degree of the candidate color and the overall color feature of the picture is determined by a technician, the matching degree represents the probability that the candidate color can represent the overall color feature of the picture, and in the case where the determined matching degree is low, the candidate color is adjusted by manual operation, and the adjusted color is taken as the theme color of the picture. It can be seen that in the above process, a large amount of manual cost and time cost is required, resulting in low efficiency of determining the theme color of the picture in related technologies. SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a picture theme color determination method and a model training method and device to reduce the manual cost and time cost and improve the efficiency of determining the theme color of the picture. The specific technical solutions are as follows:
[0006] In the first aspect of the present application, a picture theme color determination method is first provided, which comprises:
[0007] According to the color system to which each to-be-processed color contained in the to-be-processed picture belongs, grouping each to-be-processed color contained in the to-be-processed picture to obtain a plurality of color groups as to-be-processed color groups;
[0008] For each to-be-processed color group, a to-be-processed color difference value and a to-be-processed number average value corresponding to the to-be-processed color group are calculated based on each to-be-processed color in the to-be-processed color group; wherein the to-be-processed color difference value represents a dispersion degree of each to-be-processed color in the to-be-processed color group; and the to-be-processed number average value represents a proportion of to-be-processed colors in the to-be-processed color group in the to-be-processed picture;
[0009] The to-be-processed color difference value and the to-be-processed number average value are input into a pre-trained target color prediction model to obtain a confidence of the to-be-processed color group output by the target color prediction model as a to-be-processed confidence;
[0010] From each to-be-processed color group corresponding to a to-be-processed confidence greater than a first threshold value, a color group is selected as a target color group;
[0011] A subject color of the to-be-processed picture is calculated according to pixel values corresponding to each to-be-processed color in the target color group.
[0012] Optionally, the calculation of the to-be-processed color difference value and the to-be-processed number average value corresponding to each to-be-processed color group based on each to-be-processed color in the to-be-processed color group comprises:
[0013] For each to-be-processed color group, a color difference value between each adjacent two to-be-processed colors in the to-be-processed color group is calculated as a first color difference value according to a descending arrangement order of first numbers corresponding to each to-be-processed color in the to-be-processed color group; and an average value of each first color difference value corresponding to the to-be-processed color group is calculated to obtain a to-be-processed color difference value corresponding to the to-be-processed color group; wherein the first number corresponding to one to-be-processed color is a number of pixel points containing the to-be-processed color in the to-be-processed picture.
[0014] An average value of the first number corresponding to each to-be-processed color in the to-be-processed color group is calculated to obtain a to-be-processed number average value corresponding to the to-be-processed color group.
[0015] Optionally, the grouping of each to-be-processed color in the to-be-processed picture according to a color system to which each to-be-processed color belongs to obtain a plurality of color groups as to-be-processed color groups comprises:
[0016] The method comprises the following steps: clustering each to-be-processed color in a to-be-processed picture according to a color family to which the to-be-processed color belongs, obtaining a plurality of color groups as to-be-processed color groups; wherein a second color difference value between the clustering centers of any two to-be-processed color groups is greater than a second threshold value; and a second color difference value between each to-be-processed color and the clustering center of the to-be-processed color group to which the to-be-processed color belongs is less than a second color difference value between the to-be-processed color and the clustering center of any other to-be-processed color group.
[0017] Optionally, before the step of clustering each to-be-processed color in a to-be-processed picture according to a color family to which the to-be-processed color belongs, obtaining a plurality of color groups as to-be-processed color groups, the method further comprises the following steps:
[0018] According to an arrangement order of the first number of colors from large to small, the first second number of colors are determined from the colors in the to-be-processed picture as to-be-processed colors.
[0019] Optionally, before the step of clustering each to-be-processed color in a to-be-processed picture according to a color family to which the to-be-processed color belongs, obtaining a plurality of color groups as to-be-processed color groups, the method further comprises the following steps:
[0020] For each pixel point in the to-be-processed picture, if the luminance value of the color of the pixel point belongs to a preset luminance interval, the color of the pixel point is determined as a candidate color.
[0021] From the candidate colors, the candidate colors corresponding to the first number greater than a third threshold value are determined as to-be-processed colors; wherein the first number corresponding to one candidate color is the number of pixel points in the to-be-processed picture containing the candidate color.
[0022] Optionally, the step of, for each pixel point in the to-be-processed picture, if the luminance value of the color of the pixel point belongs to a preset luminance interval, determining the color of the pixel point as a candidate color, comprises:
[0023] For each pixel point in the to-be-processed picture, if the luminance value of the color of the pixel point belongs to a first preset luminance interval, the color of the pixel point is determined as a candidate color.
[0024] Alternatively,
[0025] For each pixel point in the to-be-processed picture, if the luminance value of the color of the pixel point belongs to a second preset luminance interval and the saturation value of the color does not belong to a preset saturation interval, the color of the pixel point is determined as a candidate color; wherein the second preset luminance interval belongs to the first preset luminance interval.
[0026] Optionally, before determining the color of the pixel point as the candidate color if the luminance value of the color of the pixel point belongs to the preset luminance interval, the method further comprises:
[0027] obtaining an original picture, and extracting an image region of the original picture except a specified object to obtain a to-be-processed picture;
[0028] for each pixel point in the to-be-processed picture, calculating a luminance value and a saturation value of the color of the pixel point based on a pixel value of the pixel point.
[0029] Optionally, after obtaining the theme color of the to-be-processed picture according to the pixel values corresponding to the to-be-processed colors in the target color group, the method further comprises:
[0030] taking the theme color of the to-be-processed picture as a theme color of an original picture to which the to-be-processed picture belongs, and storing the theme color of the original picture;
[0031] after receiving an acquisition request for the original picture sent by a client, sending the original picture and the theme color of the original picture to the client, so that the client displays the original picture in a display interface of the client after receiving the original picture and the theme color of the original picture, and sets the colors of regions other than the original picture in the display interface to the theme color of the original picture.
[0032] In a second aspect of the embodiment of the present application, a model training method is further provided, and the method comprises:
[0033] grouping each sample color contained in a sample picture according to a color system to which the sample color belongs, to obtain a plurality of color groups as sample color groups;
[0034] calculating a sample color difference value and a sample number average value corresponding to the sample color group based on each sample color in the sample color group; wherein the sample color difference value represents a dispersion degree of each sample color in the sample color group; and the sample number average value represents a proportion of the sample color in the sample color group in the sample picture;
[0035] obtaining a confidence degree of the sample color group as a sample confidence degree; wherein the sample confidence degree represents a probability that the sample color in the sample color group can represent overall color features of the sample picture;
[0036] inputting the sample color difference value and the sample number average value into an initial structure color prediction model to obtain a confidence degree of the sample color group output by the initial structure color prediction model as a prediction confidence degree;
[0037] calculating a loss function value representing a difference between the prediction confidence degree and the sample confidence degree;
[0038] adjusting model parameters of the initial structure color prediction model based on the calculated loss function value until a preset convergence condition is reached to obtain the trained target color prediction model.
[0039] In a third aspect of the embodiment of the present application, a subject color determination device for a picture is also provided, and the device comprises:
[0040] a to-be-processed color grouping module configured to group each to-be-processed color contained in a to-be-processed picture according to a color family to which the to-be-processed color belongs, to obtain a plurality of color groups as to-be-processed color groups;
[0041] a to-be-processed color difference value determination module configured to, for each to-be-processed color group, calculate a to-be-processed color difference value and a to-be-processed number average value corresponding to the to-be-processed color group based on each to-be-processed color in the to-be-processed color group, wherein the to-be-processed color difference value represents a dispersion degree of each to-be-processed color in the to-be-processed color group, and the to-be-processed number average value represents a proportion of to-be-processed colors in the to-be-processed color group in the to-be-processed picture;
[0042] a to-be-processed confidence degree determination module configured to input the to-be-processed color difference value and the to-be-processed number average value into a pre-trained target color prediction model to obtain a confidence degree of the to-be-processed color group output by the target color prediction model as a to-be-processed confidence degree;
[0043] a target color group determination module configured to select one color group as a target color group from each to-be-processed color group corresponding to a to-be-processed confidence degree greater than a first threshold value;
[0044] a subject color determination module configured to calculate a subject color of the to-be-processed picture according to pixel values corresponding to each to-be-processed color in the target color group.
[0045] Optionally, the to-be-processed color difference value determination module is specifically configured to, for each to-be-processed color group, calculate a color difference value between each adjacent two to-be-processed colors in the to-be-processed color group as a first color difference value according to an arrangement order of the first number corresponding to each to-be-processed color in the to-be-processed color group from large to small; and calculate an average value of each first color difference value corresponding to the to-be-processed color group to obtain a to-be-processed color difference value corresponding to the to-be-processed color group; wherein the first number corresponding to one to-be-processed color is a number of pixel points containing the to-be-processed color in the to-be-processed picture.
[0046] Optionally, the to-be-processed color difference value determination module is specifically configured to, for each to-be-processed color group, calculate a color difference value between each adjacent two to-be-processed colors in the to-be-processed color group as a first color difference value according to an arrangement order of the first number corresponding to each to-be-processed color in the to-be-processed color group from large to small; and calculate an average value of each first color difference value corresponding to the to-be-processed color group to obtain a to-be-processed color difference value corresponding to the to-be-processed color group; wherein the first number corresponding to one to-be-processed color is a number of pixel points containing the to-be-processed color in the to-be-processed picture.
[0047] Optionally, the to-be-processed color grouping module is specifically configured to cluster each to-be-processed color based on a color system to which the to-be-processed color belongs, to obtain a plurality of color groups as to-be-processed color groups; wherein a second color difference value between clustering centers of each two to-be-processed color groups is greater than a second threshold value; and a second color difference value between each to-be-processed color and a clustering center of a to-be-processed color group to which the to-be-processed color belongs is less than a second color difference value between the to-be-processed color and a clustering center of another to-be-processed color group.
[0048] Optionally, the device further comprises:
[0049] The to-be-processed color determination module is configured to, before the to-be-processed color grouping module performs grouping of each to-be-processed color contained in the to-be-processed picture according to a color system to which the to-be-processed color belongs to obtain a plurality of color groups as to-be-processed color groups, determine a first number of colors from the colors contained in the to-be-processed picture according to an arrangement order of the first number corresponding to each color from large to small, and determine a first number of colors as to-be-processed colors.
[0050] Optionally, the device further comprises:
[0051] The alternative color determination module is configured to, before the to-be-processed color grouping module performs grouping of each to-be-processed color contained in the to-be-processed picture according to a color system to which the to-be-processed color belongs to obtain a plurality of color groups as to-be-processed color groups, determine, for each pixel point in the to-be-processed picture, a color of the pixel point as an alternative color if an intensity value of the color of the pixel point belongs to a preset intensity interval.
[0052] The color selection module is configured to determine, from the candidate colors, candidate colors corresponding to a first number greater than a third threshold value as the colors to be processed, wherein the first number corresponding to a candidate color is a number of pixel points in the picture to be processed that contain the candidate color.
[0053] Optionally, the candidate color determination module is specifically configured to, for each pixel point in the picture to be processed, if the luminance value of the color of the pixel point belongs to a first preset luminance interval, determine the color of the pixel point as a candidate color.
[0054] Alternatively,
[0055] for each pixel point in the picture to be processed, if the luminance value of the color of the pixel point belongs to a second preset luminance interval and the saturation value of the color does not belong to a preset saturation interval, determine the color of the pixel point as a candidate color, wherein the second preset luminance interval belongs to the first preset luminance interval.
[0056] Optionally, the device further comprises:
[0057] The picture to be processed acquisition module is configured to, before the candidate color determination module determines, for each pixel point in the picture to be processed, if the luminance value of the color of the pixel point belongs to a preset luminance interval, the color of the pixel point as a candidate color, execute acquisition of an original picture and extraction of an image region in the original picture except for a specified object to obtain the picture to be processed.
[0058] The device further comprises:
[0059] Optionally, the device further comprises:
[0060] The storage module is configured to, after the theme color determination module obtains the theme color of the picture to be processed according to the pixel values corresponding to the colors to be processed in the target color group, execute storage of the theme color of the picture to be processed as the theme color of an original picture to which the picture to be processed belongs and storage of the theme color of the original picture.
[0061] The sending module is configured to, after receiving the acquisition request for the original picture sent by the client, send the original picture and the theme color of the original picture to the client, so that the client displays the original picture in a display interface of the client and sets the colors of regions other than the original picture in the display interface to the theme color of the original picture after receiving the original picture and the theme color of the original picture.
[0062] In a fourth aspect of the embodiments of the present application, a model training device is further provided, and the device comprises:
[0063] a sample color grouping module, configured to group each sample color contained in a sample picture according to a color system to which the sample color belongs, to obtain a plurality of color groups as sample color groups;
[0064] a sample color difference value determination module, configured to calculate a sample color difference value and a sample number average value corresponding to each sample color group based on each sample color in the sample color group; wherein the sample color difference value represents a dispersion degree of each sample color in the sample color group; and the sample number average value represents a proportion of the sample color in the sample color group in the sample picture;
[0065] a sample confidence degree acquisition module, configured to acquire a confidence degree of the sample color group as a sample confidence degree; wherein the sample confidence degree represents a probability that the sample color in the sample color group can represent an overall color feature of the sample picture;
[0066] a predicted confidence degree determination module, configured to input the sample color difference value and the sample number average value into an initial structure color prediction model to obtain a confidence degree of the sample color group output by the initial structure color prediction model as a predicted confidence degree;
[0067] a loss function value determination module, configured to calculate a loss function value representing a difference between the predicted confidence degree and the sample confidence degree;
[0068] a model parameter adjustment module, configured to adjust a model parameter of the initial structure color prediction model based on the calculated loss function value until a preset convergence condition is reached, to obtain a trained target color prediction model.
[0069] In another aspect of the embodiments of the present application, an electronic device is further provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
[0070] the memory is configured to store a computer program;
[0071] the processor is configured to execute the program stored on the memory to implement the steps of the picture theme color determination method of any one of the first aspect, or the steps of the model training method of any one of the second aspect.
[0072] In yet another aspect of the embodiments of the present application, a computer readable storage medium is provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method for determining a theme color of a picture according to any one of the first aspect, or the steps of the method for training a model according to any one of the second aspect.
[0073] In yet another aspect of the embodiments of the present application, a computer program product containing instructions, which, when run on a computer, cause the computer to perform the method for determining a theme color of a picture according to any one of the first aspect, or the method for training a model according to any one of the second aspect.
[0074] The method for determining a theme color of a picture provided by the embodiments of the present application comprises the following steps: grouping each to-be-processed color included in a to-be-processed picture according to a color family to which the to-be-processed color belongs, to obtain a plurality of color groups as to-be-processed color groups; for each to-be-processed color group, calculating a to-be-processed color difference value and a to-be-processed number average value corresponding to the to-be-processed color group based on each to-be-processed color in the to-be-processed color group; wherein the to-be-processed color difference value represents the dispersion degree of each to-be-processed color in the to-be-processed color group; and the to-be-processed number average value represents the proportion of the to-be-processed color in the to-be-processed color group in the to-be-processed picture; inputting the to-be-processed color difference value and the to-be-processed number average value into a pre-trained target color prediction model to obtain a confidence of the to-be-processed color group output by the target color prediction model as a to-be-processed confidence; selecting a color group as a target color group from each to-be-processed color group corresponding to a to-be-processed confidence greater than a first threshold; and calculating a theme color of the to-be-processed picture according to pixel values corresponding to each to-be-processed color in the target color group.
[0075] Based on the above processing, the to-be-processed confidence of a to-be-processed color group represents the probability that each to-be-processed color in the to-be-processed color group can represent the overall color feature of the to-be-processed picture, and the to-be-processed confidence of the target color group is greater than the first threshold, indicating that the probability that each to-be-processed color in the target color group can represent the overall color feature of the to-be-processed picture is relatively large, so that the theme color of the to-be-processed picture can be calculated according to the pixel values corresponding to each to-be-processed color in the target color group, which can reduce the labor cost and time cost, and further improve the efficiency of determining the theme color of the picture. BRIEF DESCRIPTION OF DRAWINGS
[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows.
[0077] Figure 1A flowchart of a first subject color determination method for a picture provided in an embodiment of the present application;
[0078] Figure 2 A flowchart of a second subject color determination method for a picture provided in an embodiment of the present application;
[0079] Figure 3 A flowchart of a third subject color determination method for a picture provided in an embodiment of the present application;
[0080] Figure 4 A flowchart of a fourth subject color determination method for a picture provided in an embodiment of the present application;
[0081] Figure 5 A flowchart of a model training method provided in an embodiment of the present application;
[0082] Figure 6 A flowchart of a fifth subject color determination method for a picture provided in an embodiment of the present application;
[0083] Figure 7 A flowchart of a picture display method provided in an embodiment of the present application;
[0084] Figure 8 A structural diagram of a subject color determination apparatus for a picture provided in an embodiment of the present application;
[0085] Figure 9 A structural diagram of a model training apparatus provided in an embodiment of the present application;
[0086] Figure 10 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0087] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
[0088] In the related art, when extracting the subject color of a picture, the average value of the pixel values of each pixel point in the picture is calculated as a candidate color, and a technical personnel determines the matching degree of the candidate color and the overall color feature of the picture, the matching degree representing the probability that the candidate color can represent the overall color feature of the picture. In the case where the determined matching degree is low, the candidate color is adjusted by manual work, and the adjusted color is taken as the subject color of the picture. It can be seen that in the above process, a large amount of manual cost and time cost are required, resulting in low efficiency of determining the subject color of the picture in the related art.
[0089] To solve the above problems, the embodiment of the present application provides a method for determining the theme color of a picture, which is applied to an electronic device. The electronic device can determine the theme color of a picture to be processed according to the method provided by the embodiment of the present application, so as to improve the efficiency of determining the theme color of the picture. If the electronic device is a client, subsequently, the electronic device can set the color of other regions in the display interface according to the theme color of the picture to be processed when displaying the picture to be processed. If the electronic device is a server, subsequently, the electronic device can send the picture to be processed and the theme color of the picture to be processed to the client when receiving the acquisition request for acquiring the picture to be processed sent by the client. Correspondingly, the client can set the color of other regions in the display interface according to the theme color of the picture to be processed when displaying the picture to be processed, so as to improve the user experience of the user browsing the picture.
[0090] Referring to Figure 1 , Figure 1 A flowchart of a method for determining the theme color of a picture provided by the embodiment of the present application, which can include the following steps:
[0091] S101: Grouping the to-be-processed colors contained in the to-be-processed picture according to the color families to which the to-be-processed colors belong, to obtain a plurality of color groups as to-be-processed color groups.
[0092] S102: For each to-be-processed color group, calculating the to-be-processed color difference value and the to-be-processed number average value corresponding to the to-be-processed color group based on the to-be-processed colors in the to-be-processed color group.
[0093] The to-be-processed color difference value represents the dispersion degree of the to-be-processed colors in the to-be-processed color group, and the to-be-processed number average value represents the proportion of the to-be-processed colors in the to-be-processed color group in the to-be-processed picture.
[0094] S103: Inputting the to-be-processed color difference value and the to-be-processed number average value into a pre-trained target color prediction model to obtain the confidence of the to-be-processed color group output by the target color prediction model as a to-be-processed confidence.
[0095] The target color prediction model is trained based on the sample color difference value, the sample number average value and the sample confidence of the sample color group; the sample color group is obtained by grouping the sample colors in the sample picture; the sample color difference value represents the dispersion degree of the sample colors in the sample color group; and the sample number average value represents the proportion of the sample colors in the sample color group in the sample picture.
[0096] S104: Selecting one color group as a target color group from each to-be-processed color group corresponding to a to-be-processed confidence greater than a first threshold.
[0097] S105: calculating the theme color of the picture to be processed according to the pixel values corresponding to the colors to be processed in the target color group.
[0098] According to the method for determining the theme color of a picture provided in the embodiments of the present application, the processing confidence of a color group to be processed indicates the probability that the colors to be processed in the color group to be processed can represent the overall color feature of the picture to be processed, the processing confidence of the target color group is greater than the first threshold value, which indicates that the probability that the colors to be processed in the target color group can represent the overall color feature of the picture to be processed is relatively high, and then the theme color of the picture to be processed can be calculated according to the pixel values corresponding to the colors to be processed in the target color group, which can reduce the labor cost and time cost and further improve the efficiency of determining the theme color of the picture.
[0099] For step S101, the picture to be processed is any picture currently requiring determination of the theme color.
[0100] In an implementation manner, the colors to be processed can be all the colors contained in the picture to be processed. The all the colors contained in the picture to be processed are the colors of each pixel point in the picture to be processed.
[0101] In another implementation manner, the colors to be processed can also be part of the colors determined from all the colors contained in the picture to be processed.
[0102] In some embodiments, the electronic device can determine the colors to be processed in the following manner, and correspondingly, on the basis of Figure 1 , see Figure 2 Before step S101, the method can further include the following steps:
[0103] S106: for each pixel point in the picture to be processed, if the luminance value of the color of the pixel point belongs to the preset luminance interval, determining the color of the pixel point as the candidate color.
[0104] S107: determining, from the candidate colors, the candidate colors corresponding to the first number greater than the third threshold value as the colors to be processed.
[0105] The first number corresponding to one candidate color is the number of pixel points containing the candidate color in the picture to be processed.
[0106] The electronic device can obtain the picture to be processed, for each pixel point in the picture to be processed, the electronic device obtains the luminance value of the color of the pixel point, and judges whether the luminance value of the color of the pixel point belongs to the preset luminance interval, if the luminance value of the color of the pixel point belongs to the preset luminance interval, which indicates that the color of the pixel point is not a relatively bright color nor a relatively dark color, then the electronic device can determine the color of the pixel point as the candidate color.
[0107] In some embodiments, the electronic device can further determine, for each pixel point in the picture to be processed, whether the color of the pixel point is the candidate color in the following manner.
[0108] Manner 1,
[0109] For each pixel point in the picture to be processed, if the luminance value of the color of the pixel point belongs to a first preset luminance interval, it is determined that the color of the pixel point is the candidate color.
[0110] The first preset luminance interval can be set according to actual needs, the lower limit value of the first preset luminance interval is a lower luminance value, and the upper limit value of the first preset luminance interval is a higher luminance value. For example, the first preset luminance interval can be [3, 92], or the first preset luminance interval can also be [4, 91], but is not limited thereto.
[0111] The luminance of a color can be represented by the luminance value of the color. If the luminance value of the color of a pixel point belongs to the first preset luminance interval, it indicates that the color of the pixel point is not a brighter color nor a darker color, and the electronic device can determine that the color of the pixel point is the candidate color.
[0112] Manner 2,
[0113] For each pixel point in the picture to be processed, if the luminance value of the color of the pixel point belongs to a second preset luminance interval, and the saturation value of the color does not belong to a preset saturation interval, it is determined that the color of the pixel point is the candidate color.
[0114] The second preset luminance interval belongs to the first preset luminance interval. The second preset luminance interval can be set according to actual needs, and the second preset luminance interval belongs to the first preset luminance interval. For example, the first preset luminance interval can be [3, 92], and the second preset luminance interval can be [6, 90], or the first preset luminance interval can be [4, 91], and the second preset luminance interval can be [7, 89], but is not limited thereto.
[0115] The preset saturation interval can be set according to actual needs. For example, the preset saturation interval can be [25, 35], or the preset saturation interval can also be [20, 30], but is not limited thereto.
[0116] The luminance of a color can be represented by the luminance value and the saturation value of the color. If the luminance value of the color of a pixel point belongs to the second preset luminance interval, and the saturation value of the color does not belong to the preset saturation interval, it indicates that the color of the pixel point is not a brighter color nor a darker color, and the electronic device can determine that the color of the pixel point is the candidate color.
[0117] Alternatively, for each pixel in the to-be-processed picture, if the brightness value of the color of the pixel belongs to the second preset brightness interval, and the saturation value of the color is not the specified saturation value (for example, 30), it is determined that the color of the pixel is the candidate color.
[0118] Based on the above processing, the brighter and darker colors in the to-be-processed picture can be filtered out, the influence of the brighter and darker colors on the determination of the theme color of the to-be-processed picture can be avoided, and the accuracy of the determined theme color is improved.
[0119] The third threshold value can be determined according to the total number of colors contained in the to-be-processed picture. For example, the third threshold value can be 1.25% of the total number of colors contained in the to-be-processed picture, that is, when the total number of colors contained in the to-be-processed picture is 400, the third threshold value is 5. Alternatively, the third threshold value can also be 1.5% of the total number of colors contained in the to-be-processed picture, that is, when the total number of colors contained in the to-be-processed picture is 400, the third threshold value is 6, but is not limited thereto.
[0120] For each candidate color, the electronic device can count the number of pixels containing the candidate color in the to-be-processed picture to obtain a first number corresponding to the candidate color. The first number is the frequency of the candidate color in the to-be-processed picture, and the first number can represent the proportion of the candidate color in the to-be-processed picture. If the first number corresponding to an candidate color is greater than the third threshold value, it indicates that the proportion of the candidate color in the to-be-processed picture is large, and the electronic device can determine that the candidate color is the to-be-processed color.
[0121] Based on the above processing, if the first number corresponding to the to-be-processed color is greater than the third threshold value, the proportion of the to-be-processed color in the to-be-processed picture is large, that is, the colors with small proportions in the to-be-processed picture can be filtered out, the calculation amount can be reduced, and the influence of the filtered colors with small proportions in the to-be-processed picture on the accuracy of the determined theme color is small. Therefore, the efficiency of determining the theme color of the picture can be further improved while ensuring the accuracy of determining the theme color.
[0122] In some embodiments, before step S101, the method can further include the following steps: determining the first second number of colors from the colors contained in the to-be-processed picture as to-be-processed colors in the order of the first number corresponding to the colors from large to small. The first number corresponding to a to-be-processed color is the number of pixels containing the to-be-processed color in the to-be-processed picture.
[0123] For each color in the to-be-processed picture, the electronic device can count the number of pixel points of the color included in the to-be-processed picture, to obtain a first number corresponding to the color. The first number can represent the proportion of the color in the to-be-processed picture, and then the electronic device can determine, from the colors included in the to-be-processed picture, the first second number of colors in the arrangement order of the first numbers corresponding to the colors from large to small, as to-be-processed colors.
[0124] The second number can be determined based on the total number of colors included in the to-be-processed picture, for example, the second number can be 80% of the total number of colors included in the to-be-processed picture, or the second number can be 90% of the total number of colors included in the to-be-processed picture, etc., but is not limited thereto.
[0125] Based on the above processing, the first second number of colors in the arrangement order of the first numbers from large to small have a large proportion in the to-be-processed picture, that is, the colors with a small proportion in the to-be-processed picture can be filtered out, the calculation amount can be reduced, and filtering out the colors with a small proportion in the to-be-processed picture has little effect on the accuracy of the determined theme color, so that the efficiency of determining the theme color of the picture can be further improved while ensuring the accuracy of determining the theme color.
[0126] In some embodiments, the electronic device can group the to-be-processed colors in the following manner to obtain a plurality of to-be-processed color groups.
[0127] Manner one,
[0128] Step S101 can include the following steps: according to the arrangement order of the first numbers corresponding to the to-be-processed colors included in the to-be-processed picture from large to small, dividing the to-be-processed colors into a third number of color groups as to-be-processed color groups.
[0129] The first number corresponding to one to-be-processed color is the number of pixel points of the to-be-processed color included in the to-be-processed picture; each to-be-processed color group includes the first fourth number of to-be-processed colors in the arrangement order, and the fourth number corresponding to different to-be-processed color groups is different. The third number and the fourth number can be set according to requirements.
[0130] For example, the to-be-processed picture includes 50 to-be-processed colors, and according to the arrangement order of the first numbers corresponding to the to-be-processed colors from large to small, the electronic device can divide the first 5 to-be-processed colors in the arrangement order into one to-be-processed color group, divide the first 10 to-be-processed colors in the arrangement order into one to-be-processed color group, divide the first 20 to-be-processed colors in the arrangement order into one to-be-processed color group, and divide the first 50 to-be-processed colors in the arrangement order into one to-be-processed color group, to obtain 4 to-be-processed color groups.
[0131] Alternatively, the electronic device can divide the first 10 colors in the arrangement order as one color group, divide the first 20 colors in the arrangement order as one color group, divide the first 40 colors in the arrangement order as one color group, divide the first 60 colors in the arrangement order as one color group, and divide the first 80 colors in the arrangement order as one color group, to obtain five color groups.
[0132] Option two,
[0133] The step S101 can include the following steps: clustering each color in the to-be-processed picture based on the color system to which the color belongs, to obtain a plurality of color groups as the to-be-processed color groups.
[0134] The second color difference value between the cluster centers of each two to-be-processed color groups is greater than a second threshold value; the second color difference value between each to-be-processed color and the cluster center of the to-be-processed color group to which the to-be-processed color belongs is less than the second color difference value between the to-be-processed color and the cluster center of other to-be-processed color groups.
[0135] The electronic device can select k seeds from the to-be-processed colors based on the k-Means algorithm, one seed being one cluster center, and group the to-be-processed colors based on the selected cluster centers to obtain a plurality of to-be-processed color groups.
[0136] The electronic device can select a specified to-be-processed color from the arrangement order in which each to-be-processed color corresponds to the first number from large to small, to obtain a first cluster center. For example, the electronic device can select the first to-be-processed color in the arrangement order as the first cluster center, or the electronic device can select the second to-be-processed color in the arrangement order as the first cluster center.
[0137] The electronic device determines other colors in the to-be-processed colors except the first cluster center as the current to-be-compared colors. For each to-be-compared color, the electronic device calculates the color difference value (i.e. the first color difference value) between the to-be-compared color and the first cluster center.
[0138] For example, the color system to which a color belongs can be represented by the hue value of the to-be-processed color, and the electronic device calculates the difference between the hue value of the to-be-compared color and the hue value of the cluster center, and calculates the absolute value of the difference as the second color difference value between the to-be-compared color and the cluster center.
[0139] Alternatively, the color family to which a color belongs can be represented by the hue, saturation, and brightness values of the color to be processed. The electronic device then calculates the sum of the hue, saturation, and brightness values of the color to be compared (this can be called the first sum), and calculates the sum of the hue, saturation, and brightness values of the current cluster center (this can be called the second sum). The electronic device calculates the difference between the first sum and the second sum, and calculates the absolute value of this difference as the second color difference value between the color to be compared and the cluster center.
[0140] For each color to be compared, the electronic device determines whether the second color difference value between the color to be compared and the first cluster center is greater than a second threshold. If the second color difference value between the color to be compared and the cluster center is greater than the second threshold, it indicates that the difference between the color to be compared and the cluster center is large, and the electronic device determines the color to be compared as a new cluster center.
[0141] The second threshold can be set according to actual needs. For example, the second threshold can be 45, or it can be 50, but it is not limited to this.
[0142] Then, the electronic device determines the other colors to be processed from each color to be processed, excluding the current cluster center, to obtain the current colors to be compared. The current cluster centers include all the previously determined cluster centers. Next, the electronic device calculates a second color difference value between each current color to be compared and each current cluster center. From the current colors to be compared, the electronic device determines colors whose second color difference value with that cluster center is greater than a second threshold, and uses them as new cluster centers, and so on, until a fifth number of cluster centers are determined. The fifth number can be set according to the total number of colors contained in the image to be processed. For example, if the total number of colors contained in the image to be processed is 50, the fifth number can be 4; or if the total number of colors contained in the image to be processed is 100, the fifth number can be 5, but it is not limited to these.
[0143] Furthermore, for each color to be compared, the electronic device divides the color to be compared into the color group to which the cluster center with the smallest second color difference value between the color to be compared belongs, thus obtaining multiple color groups as color groups to be processed.
[0144] In some embodiments, before determining the color to be processed, the electronic device may first acquire the image to be processed and determine the brightness and saturation values of each pixel in the image to be processed.
[0145] Before grouping the colors to be processed in the image, the electronic device can first acquire the image itself.
[0146] In an implementation, when the electronic device is a client, the electronic device can obtain a picture currently required to be displayed as the picture to be processed. Alternatively, when the electronic device is a server, the electronic device can receive an obtaining request sent by a client, and determine a picture requested by the client as the picture to be processed.
[0147] In another implementation, on the basis of Figure 2 Figure 3 Before step S106, the method can further include the following steps:
[0148] S108: Obtain the original picture, and extract an image region other than the specified object in the original picture to obtain the picture to be processed.
[0149] S109: For each pixel point in the picture to be processed, calculate a luminance value and a saturation value of a color of the pixel point based on a pixel value of the pixel point.
[0150] The specified object can be set by a technician according to actual needs, for example, the specified object can be a person, an animal, etc.
[0151] When the electronic device is a client, the electronic device can obtain a picture currently required to be displayed as the original picture. Alternatively, when the electronic device is a server, the electronic device can receive an obtaining request sent by a client, and determine a picture requested by the client as the original picture.
[0152] Then, the electronic device can determine whether the original picture contains the specified object. If the original picture does not contain the specified object, the electronic device determines that the original picture is the picture to be processed. If the original picture contains the specified object, the electronic device can extract an image region other than the specified object in the original picture as the picture to be processed. For example, the original picture contains a person image, and the electronic device extracts an image region other than the person image in the original picture to obtain the picture to be processed.
[0153] For each pixel point in the picture to be processed, the electronic device can obtain a pixel value of the pixel point, that is, an RGB value of the pixel point, calculate an HSL (Hue, Saturation, Lightness, color hue, saturation, and brightness) value of the pixel point according to the RGB value of the pixel point, and the HSL value of the pixel point represents a color of the pixel point.
[0154] Based on the above processing, the image of the specified object in the original picture can have a large difference in color features from other regions in the original picture, and the electronic device extracts an image region other than the specified object in the original picture as the picture to be processed, which can improve the accuracy of the theme color of the determined picture.
[0155] For step S102, for each to-be-processed color group, the to-be-processed color difference value of the to-be-processed color group represents the dispersion degree of each to-be-processed color in the to-be-processed color group; the greater the to-be-processed color difference value of the to-be-processed color group, the higher the dispersion degree of each to-be-processed color in the to-be-processed color group.
[0156] The to-be-processed number average of the to-be-processed color group represents the proportion of the to-be-processed color in the to-be-processed color group in the to-be-processed picture. The greater the to-be-processed number average of the to-be-processed color group, the higher the proportion of the to-be-processed color in the to-be-processed color group in the to-be-processed picture.
[0157] In an implementation manner, for each to-be-processed color group, the electronic device calculates the color difference value between each two to-be-processed colors in the to-be-processed color group, and calculates the average of each color difference value as the to-be-processed color difference value of the to-be-processed color group.
[0158] In another implementation manner, on the basis of Figure 1 , referring to Figure 4 , step S102 can include the following steps:
[0159] S1021: For each to-be-processed color group, according to the arrangement order from large to small of the first number corresponding to each to-be-processed color in the to-be-processed color group, the color difference value between each adjacent two to-be-processed colors in the to-be-processed color group is calculated as the first color difference value; the average of each first color difference value corresponding to the to-be-processed color group is calculated to obtain the to-be-processed color difference value corresponding to the to-be-processed color group.
[0160] The first number corresponding to one to-be-processed color is the number of pixel points containing the to-be-processed color in the to-be-processed picture.
[0161] S1022: The average of the first number corresponding to each to-be-processed color in the to-be-processed color group is calculated to obtain the to-be-processed number average corresponding to the to-be-processed color group.
[0162] For each to-be-processed color group, the electronic device can calculate the color difference value between each adjacent two to-be-processed colors in the to-be-processed color group as the first color difference value according to the arrangement order from large to small of the first number corresponding to each to-be-processed color in the to-be-processed color group.
[0163] The first color difference value between each adjacent two to-be-processed colors includes the absolute value of the difference value of the hue value of the adjacent two to-be-processed colors, the absolute value of the difference value of the saturation value, and the absolute value of the difference value of the brightness value.
[0164] For example, the to-be-processed color group includes 4 to-be-processed colors, and the 4 to-be-processed colors are respectively represented by a hue value, a saturation value and a brightness value as follows: a first to-be-processed color (10, 20, 30), a second to-be-processed color (5, 20, 15), a third to-be-processed color (40, 10, 25) and a fourth to-be-processed color (60, 15, 20).
[0165] The electronic device calculates a first color difference value between the first to-be-processed color and the second to-be-processed color as (5, 0, 15), a first color difference value between the second to-be-processed color and the third to-be-processed color as (35, 10, 10), and a first color difference value between the third to-be-processed color and the fourth to-be-processed color as (20, 5, 5), thereby obtaining 3 first color difference values corresponding to the to-be-processed color group.
[0166] The electronic device can calculate an average value of the first color difference values corresponding to the to-be-processed color group, thereby obtaining a to-be-processed color difference value corresponding to the to-be-processed color group. For example, in the above embodiment, the electronic device calculates the average value of the 3 first color difference values as (20, 5, 10).
[0167] The electronic device can also calculate an average value of the first number corresponding to each to-be-processed color in the to-be-processed color group, thereby obtaining a to-be-processed number average value corresponding to the to-be-processed color group.
[0168] For step S103, the target color prediction model can be a neural network model provided by brain.js (brain.JavaScript, intelligent.JavaScript language) for classification. Brain.js is a library based on JavaScript (a programming language) and containing multiple neural network models.
[0169] For each to-be-processed color group, the electronic device inputs the to-be-processed color difference value and the to-be-processed number average value of the to-be-processed color group into the target color prediction model, obtains a confidence of the to-be-processed color group output by the target color prediction model as a to-be-processed confidence, and the to-be-processed confidence represents a probability that each to-be-processed color in the to-be-processed color group can represent the overall color feature of the to-be-processed picture.
[0170] In some embodiments, the electronic device can train the initial structure of the color prediction model to obtain a trained target color prediction model. Correspondingly, referring to Figure 5 , Figure 5 A flowchart of a color prediction model training method provided by an embodiment of the present application, which can include the following steps:
[0171] S501: Grouping each sample color included in the sample picture according to a color system to which each sample color belongs, to obtain a plurality of color groups as sample color groups.
[0172] S502: Calculating a sample color difference value and a sample number average corresponding to each sample color group based on each sample color in the sample color group.
[0173] The sample color difference value represents the dispersion degree of each sample color in the sample color group, and the sample number average represents the proportion of the sample color in the sample color group in the sample picture.
[0174] S503: Obtaining a confidence of the sample color group as a sample confidence.
[0175] The sample confidence represents the probability that the sample color in the sample color group can represent the overall color feature of the sample picture.
[0176] S504: Inputting the sample color difference value and the sample number average into the color prediction model of the initial structure to obtain a confidence of the sample color group output by the color prediction model of the initial structure as a prediction confidence.
[0177] S505: Calculating a loss function value representing the difference between the prediction confidence and the sample confidence.
[0178] S506: Adjusting the model parameters of the color prediction model of the initial structure based on the calculated loss function value until a preset convergence condition is reached to obtain a trained target color prediction model.
[0179] The model training method provided in the embodiments of the present application can train the color prediction model of the initial structure to obtain a target color prediction model. Furthermore, the confidence of each to-be-processed color group can be determined based on the target color prediction model. The to-be-processed confidence of a to-be-processed color group represents the probability that each to-be-processed color in the to-be-processed color group can represent the overall color feature of the to-be-processed picture. If the to-be-processed confidence of the target color group is greater than a first threshold, it means that the probability that each to-be-processed color in the target color group can represent the overall color feature of the to-be-processed picture is relatively large. Then, the dominant color of the to-be-processed picture can be calculated according to the pixel values corresponding to each to-be-processed color in the target color group, which can reduce the labor cost and time cost, and further improve the efficiency of determining the dominant color of the picture.
[0180] The sample colors can be all colors contained in the sample picture. Alternatively, in order to improve the accuracy of the target color prediction model obtained through training, the electronic device can also determine part of the colors from all colors contained in the sample picture as the sample colors. The manner in which the electronic device determines the sample colors in the sample picture is similar to the manner in which the electronic device determines the target colors in the picture to be processed, and can refer to the related description of the foregoing embodiments.
[0181] The manner in which the electronic device groups the sample colors in the sample picture is similar to the manner in which the electronic device groups the target colors in the picture to be processed, and can refer to the related description of the foregoing embodiments.
[0182] For each sample color group, the electronic device calculates a color difference value between each adjacent two sample colors in the sample color group in descending order of the number of samples corresponding to each sample color in the sample color group. Then, the electronic device calculates an average value of the color difference values corresponding to the sample color group, to obtain a sample color difference value corresponding to the sample color group.
[0183] The manner in which the electronic device calculates the color difference value between each adjacent two sample colors in the sample color group is similar to the manner in which the electronic device calculates the color difference value between each adjacent two target colors in the target color group, and can refer to the related description of the foregoing embodiments.
[0184] For each sample color group, the electronic device calculates an average value of the number of samples corresponding to each sample color in the sample color group, to obtain a sample number average value corresponding to the sample color group. The number of samples corresponding to a sample color is the number of pixel points containing the sample color in the sample picture.
[0185] For each sample color group, the electronic device can also obtain a sample confidence of the sample color group. The sample confidence can be determined by a designer based on the theme color of the sample picture in advance. The sample confidence represents the probability that the sample colors in the sample color group can represent the overall color feature of the sample picture. For example, if the theme color of the sample picture is determined based on the sample colors contained in the sample color group, the probability that the sample colors in the sample color group can represent the overall color feature of the sample picture is 1, that is, the sample confidence of the sample color group is 1. If the theme color of the sample picture is not determined based on the sample colors contained in the sample color group, the probability that the sample colors in the sample color group can represent the overall color feature of the sample picture is 0, that is, the sample confidence of the sample color group is 0.
[0186] Further, the electronic device generates a training sample containing the sample color difference value, the sample number average, and the sample confidence, to train the initial structure of the color prediction model based on the obtained training sample.
[0187] For example, the training sample can be expressed in the following form, where a represents the sample confidence of the sample color grouping, b represents the sample number average corresponding to the sample color grouping, and c represents the sample color difference value average corresponding to the sample color grouping.
[0188] let info (input data) = { colorCount: a, average: b, variance: c;
[0189] top50Count: 1, top50Average: 40, top50Variance: (25, 30, 20);
[0190] top20Count: 0, top20Average: 20, top20Variance: (20, 25, 20);
[0191] top10Count: 0, top10Average: 20, top10Variance: (15, 15, 10);
[0192] top5Count: 0, top5Average: 30, top5Variance: (3, 1, 10)}.
[0193] The training sample represents that according to the arrangement order from large to small of the sample number corresponding to the sample color, the sample confidence of the sample color grouping containing the first 50 sample colors is 1, the sample number average is 40, and the sample color difference value is (25, 30, 20); the sample confidence of the sample color grouping containing the first 20 sample colors is 0, the sample number average is 20, and the sample color difference value is (20, 25, 20); the sample confidence of the sample color grouping containing the first 10 sample colors is 0, the sample number average is 20, and the sample color difference value is (15, 15, 10); and the sample confidence of the sample color grouping containing the first 5 sample colors is 0, the sample number average is 30, and the sample color difference value is (3, 1, 10).
[0194] The electronic device inputs the sample color difference value and the sample number average value into the color prediction model of the initial structure to obtain a confidence of the sample color grouping output by the color prediction model of the initial structure (i.e., a predicted confidence). The electronic device calculates a loss function value representing a difference between the sample confidence and the predicted confidence, and adjusts the model parameters of the color prediction model of the initial structure based on the calculated loss function value until a preset convergence condition is reached to obtain a trained target color prediction model. The learning rate of the electronic device for adjusting the model parameters can be 0.01, or the learning rate of the electronic device for adjusting the model parameters can be 0.02, but is not limited thereto.
[0195] The preset convergence condition can be that the number of training times reaches a preset number of times, for example, the preset number of times can be 2000000, or the preset number of times can also be 2500000, but is not limited thereto. The preset convergence condition can also be that the loss function values calculated continuously for multiple times are all less than a fourth threshold value, for example, the fourth threshold value can be 0.005, or the fourth threshold value can also be 0.002, but is not limited thereto.
[0196] In addition, after determining the sample color difference value and the sample number average value, the electronic device can also normalize the sample color difference value and the sample number average value, respectively, for example, taking the sample color difference value as log10, and taking the sample number average value as log10, to normalize the sample color difference value and the sample number average value to [0, 1] respectively, which can reduce the calculation amount of the electronic device and improve the efficiency of model training.
[0197] For step S104, the electronic device can determine, from each to-be-processed color grouping, each to-be-processed color grouping (which can be referred to as an alternative grouping) corresponding to a to-be-processed confidence greater than a first threshold value. Then, the electronic device can determine one color grouping from each alternative grouping as a target color grouping.
[0198] The first threshold value can be set by a technician according to experience, for example, the first threshold value can be 0.8, or the first threshold value can also be 0.7, but is not limited thereto.
[0199] Method one,
[0200] The electronic device can determine, from each alternative grouping, a color grouping containing the most to-be-processed colors as the target color grouping.
[0201] Method two,
[0202] For each alternative grouping, the electronic device can calculate a sum value of a first number corresponding to each to-be-processed color in the alternative grouping, and determine a to-be-processed color grouping corresponding to the maximum sum value as the target color grouping.
[0203] Mode three,
[0204] The electronic device can determine a corresponding color group with the maximum to-be-processed confidence, obtaining a target color group. The target color group has the maximum to-be-processed confidence, indicating that each to-be-processed color in the target color group has the maximum probability to represent the overall color feature of the to-be-processed picture.
[0205] For step S105, the electronic device can calculate the theme color of the to-be-processed picture based on the pixel value corresponding to each to-be-processed color in the target color group. The pixel value corresponding to a to-be-processed color is the pixel value of the pixel point to which the to-be-processed color belongs.
[0206] The electronic device can select a to-be-processed color corresponding to the first maximum number in the target color group as the theme color of the to-be-processed picture.
[0207] Alternatively, the electronic device can calculate the mean of the pixel values corresponding to each to-be-processed color in the target color group, obtaining the theme color of the to-be-processed picture.
[0208] Alternatively, the electronic device can also calculate the weighted sum of the pixel values corresponding to each to-be-processed color in the target color group, obtaining the theme color of the to-be-processed picture.
[0209] In some embodiments, after calculating the theme color of the to-be-processed picture, if the electronic device is a client, the electronic device can directly set the theme color of the to-be-processed picture as the theme color of the original picture to which the to-be-processed picture belongs, and store the theme color of the original picture. Subsequently, when the original picture needs to be displayed, the electronic device sets the colors of other regions in the display interface according to the theme color of the original picture, for example, sets the menu bar in the display interface to the theme color of the original picture.
[0210] In some embodiments, based on the above, Figure 1 Figure 6 After step S105, the method can further include the following steps:
[0211] S110: Set the theme color of the to-be-processed picture as the theme color of the original picture to which the to-be-processed picture belongs, and store the theme color of the original picture.
[0212] S111: After receiving the acquisition request for the original picture sent by the client, send the original picture and the theme color of the original picture to the client, so that the client displays the original picture in the display interface of the client after receiving the original picture and the theme color of the original picture, and sets the colors of other regions in the display interface except the original picture to the theme color of the original picture.
[0213] If the electronic device is a server, after obtaining the theme color of the to-be-processed picture, the electronic device can store the theme color of the to-be-processed picture as the theme color of the original picture.
[0214] When the client needs to display the original picture, the client can send a request for obtaining the original picture to the electronic device. If the electronic device receives the request for obtaining the original picture sent by the client, the electronic device can determine whether the theme color of the original picture is stored. If the theme color of the original picture is stored, the electronic device sends the original picture and the theme color of the original picture to the client. If the theme color of the original picture is not stored, the electronic device determines the theme color of the original picture according to the method provided in the embodiments of the present application, and sends the original picture and the theme color of the original picture to the client.
[0215] Correspondingly, after receiving the original picture and the theme color of the original picture, the client displays the original picture in a display interface of the client, and sets the color of an area other than the original picture in the display interface to the theme color of the original picture.
[0216] For example, the electronic device can record the URL (Universal Resource Locator, uniform resource locator) of each picture and the theme color of the picture, where the URL of the picture indicates the address of the picture. When receiving a request for obtaining the original picture indicated by the URL, the electronic device determines whether the theme color corresponding to the URL is stored.
[0217] If the theme color corresponding to the URL is stored, the electronic device obtains the original picture indicated by the URL, and obtains the theme color corresponding to the URL to obtain the theme color of the original picture. Then, the electronic device sends the original picture and the theme color of the original picture to the client.
[0218] If the theme color of the original picture indicated by the URL is not stored, the electronic device obtains the original picture indicated by the URL, and determines the theme color of the original picture according to the method provided in the embodiments of the present application. Then, the electronic device sends the original picture and the theme color of the original picture to the client.
[0219] In some embodiments, the electronic device can start two processes, which can be referred to as a first process and a second process, respectively. The first process and the second process can communicate with each other.
[0220] The first process can determine the to-be-processed colors from the colors contained in the to-be-processed picture, group the to-be-processed colors to obtain to-be-processed color groups corresponding to the to-be-processed picture, and send the grouping result to the second process. The second process can calculate the to-be-processed confidence of each to-be-processed color group corresponding to the to-be-processed picture, and send the to-be-processed confidence of each to-be-processed color group to the first process. The first process can determine the theme color of the to-be-processed picture according to the to-be-processed confidence of each to-be-processed color group.
[0221] Referring to Figure 7 , Figure 7 A flowchart of a picture display method provided by an embodiment of the present application is shown in FIG. 1. The method is applied to a picture display system, which includes a client and a server.
[0222] When the client needs to display an original picture, the client can request a service from the server, that is, the client sends a request for obtaining the original picture to the server according to the URL of the original picture.
[0223] The server verifies the URL when receiving the request, that is, the server obtains the original picture according to the URL. The server can also determine whether the color value corresponding to the original picture, that is, the theme color of the original picture in the foregoing embodiment, is cached in the cache dictionary through the color extraction module. If the theme color of the original picture is cached in the cache dictionary, the server can obtain the cached theme color of the original picture through the color extraction module, that is, the server obtains the cached theme color of the original picture through the color extraction module. The cache dictionary is used to store the correspondence between the theme color of a picture and the URL of the picture.
[0224] If the theme color of the original picture is not cached, the server can extract the picture color through the color extraction module, that is, the server extracts the to-be-processed picture from the original picture through the color extraction module and determines the colors contained in the to-be-processed picture. Then, the server can perform numerical processing through the color extraction module, that is, the server filters out the brighter colors, the darker colors, and the colors with a smaller proportion in the to-be-processed picture through the color extraction module to obtain the to-be-processed colors contained in the to-be-processed picture. The electronic device groups the to-be-processed colors to obtain a plurality of to-be-processed color groups, and determines the to-be-processed confidence of each to-be-processed color group based on a target color prediction model. Further, the electronic device determines the to-be-processed color group with the maximum corresponding to-be-processed confidence as the target color group, and calculates the average of the pixel values corresponding to the to-be-processed colors in the target color group to obtain the theme color of the to-be-processed picture as the theme color of the original picture.
[0225] After obtaining the result, the server can splice the color value and other data, that is, the server splices the theme color of the original picture and the original picture after obtaining the theme color of the original picture, to obtain the result corresponding to the acquisition request. Further, the server can return the result to the client, that is, the server sends the original picture and the theme color of the original picture to the client. Correspondingly, the client can set the color of other regions in the display interface according to the theme color of the original picture when displaying the original picture.
[0226] Based on the above processing, the colors in the to-be-processed picture can be filtered based on various filtering conditions, for example, colors with a small proportion, bright colors, dark colors, etc., to improve the accuracy of the determined theme color. Moreover, the to-be-processed confidence of each to-be-processed color group determined by the target color prediction model represents the probability that each to-be-processed color in the to-be-processed color group can represent the overall color feature of the to-be-processed picture. If the to-be-processed confidence of the target color group is greater than the first threshold, it means that the probability that each to-be-processed color in the target color group can represent the overall color feature of the to-be-processed picture is relatively large. Then, the theme color of the to-be-processed picture can be calculated according to the pixel values corresponding to each to-be-processed color in the target color group, which can reduce the labor cost and time cost, and further improve the efficiency of determining the theme color of the picture. In addition, the method for determining the theme color of the picture provided by the embodiment of the present application has a wide coverage. The method can be deployed on a server to directly determine the theme color of the picture. The server can communicate with various different clients, such as clients using the Android system, clients using the iOS system, and web clients, etc. The server can directly provide the theme color of the picture requested by various clients.
[0227] With Figure 1 corresponding to the method embodiment of the present application, see Figure 8 , Figure 8 a structural diagram of a picture theme color determination device provided by an embodiment of the present application, the device comprises:
[0228] The to-be-processed color grouping module 801 is configured to group each to-be-processed color contained in the to-be-processed picture according to the color system to which each to-be-processed color belongs, to obtain a plurality of color groups as to-be-processed color groups.
[0229] The to-be-processed color difference value determination module 802 is configured to calculate, for each to-be-processed color group, a to-be-processed color difference value and a to-be-processed number average corresponding to the to-be-processed color group based on to-be-processed colors in the to-be-processed color group. The to-be-processed color difference value represents the dispersion degree of the to-be-processed colors in the to-be-processed color group. The to-be-processed number average represents the proportion of the to-be-processed colors in the to-be-processed color group in the to-be-processed picture.
[0230] The to-be-processed confidence determination module 803 is configured to input the to-be-processed color difference value and the to-be-processed number average into a target color prediction model that is pre-trained to obtain a confidence of the to-be-processed color group output by the target color prediction model as a to-be-processed confidence.
[0231] The target color group determination module 804 is configured to select a color group as a target color group from each to-be-processed color group corresponding to a to-be-processed confidence greater than a first threshold.
[0232] The theme color determination module 805 is configured to calculate a theme color of the to-be-processed picture according to pixel values corresponding to to-be-processed colors in the target color group.
[0233] Optionally, the to-be-processed color difference value determination module 802 is specifically configured to calculate, for each to-be-processed color group, a color difference value between each adjacent two to-be-processed colors in the to-be-processed color group as a first color difference value according to an arrangement order of the first number corresponding to the to-be-processed colors in the to-be-processed color group from large to small. An average value of the first color difference values corresponding to the to-be-processed color group is obtained as the to-be-processed color difference value corresponding to the to-be-processed color group. The first number corresponding to a to-be-processed color is the number of pixel points containing the to-be-processed color in the to-be-processed picture.
[0234] An average value of the first number corresponding to each to-be-processed color in the to-be-processed color group is calculated to obtain the to-be-processed number average corresponding to the to-be-processed color group.
[0235] Optionally, the to-be-processed color group module 801 is specifically configured to cluster to-be-processed colors based on color systems to which the to-be-processed colors belong to obtain a plurality of color groups as to-be-processed color groups. A second color difference value between clustering centers of each two to-be-processed color groups is greater than a second threshold. A second color difference value between each to-be-processed color and a clustering center of a to-be-processed color group to which the to-be-processed color belongs is less than a second color difference value between the to-be-processed color and a clustering center of another to-be-processed color group.
[0236] Optionally, the apparatus further includes:
[0237] The to-be-processed color determining module is configured to, before the to-be-processed color grouping module 801 groups each to-be-processed color in a to-be-processed picture according to a color family to which the to-be-processed color belongs, to obtain a plurality of color groups as to-be-processed color grouping, determine, from the colors in the to-be-processed picture, a first number of colors in descending order of a first number corresponding to the colors in the to-be-processed picture, and determine a second number of colors in the to-be-processed picture as to-be-processed colors.
[0238] Optionally, the apparatus further includes:
[0239] The alternative color determining module is configured to, before the to-be-processed color grouping module 801 groups each to-be-processed color in a to-be-processed picture according to a color family to which the to-be-processed color belongs, to obtain a plurality of color groups as to-be-processed color grouping, determine, for each pixel point in the to-be-processed picture, if a luminance value of a color of the pixel point belongs to a preset luminance interval, the color of the pixel point as an alternative color.
[0240] The to-be-processed color selecting module is configured to determine, from the alternative colors, a first number of alternative colors corresponding to a first number greater than a third threshold value as to-be-processed colors; wherein the first number corresponding to an alternative color is a number of pixel points in the to-be-processed picture that contain the alternative color.
[0241] Optionally, the alternative color determining module is configured to, for each pixel point in the to-be-processed picture, if a luminance value of a color of the pixel point belongs to a first preset luminance interval, determine the color of the pixel point as an alternative color.
[0242] Alternatively,
[0243] For each pixel point in the to-be-processed picture, if a luminance value of a color of the pixel point belongs to a second preset luminance interval and a saturation value of the color does not belong to a preset saturation interval, determine the color of the pixel point as an alternative color; wherein the second preset luminance interval belongs to the first preset luminance interval.
[0244] Optionally, the apparatus further includes:
[0245] The to-be-processed picture obtaining module is configured to, before the alternative color determining module determines, for each pixel point in the to-be-processed picture, if a luminance value of a color of the pixel point belongs to a preset luminance interval, the color of the pixel point as an alternative color, execute obtaining an original picture and extracting an image region in the original picture except for a specified object to obtain the to-be-processed picture.
[0246] For each pixel point in the to-be-processed picture, calculate a luminance value and a saturation value of a color of the pixel point based on a pixel value of the pixel point.
[0247] Optionally, the apparatus further comprises:
[0248] a storage module configured to, after the theme color determination module 805 determines the theme color of the to-be-processed picture according to the pixel values corresponding to the to-be-processed colors in the target color group, execute the theme color of the to-be-processed picture as the theme color of an original picture to which the to-be-processed picture belongs, and store the theme color of the original picture;
[0249] a sending module configured to, after receiving an acquisition request for the original picture sent by a client, send the original picture and the theme color of the original picture to the client, so that the client displays the original picture in a display interface of the client and sets the colors of other regions in the display interface except the original picture to the theme color of the original picture after receiving the original picture and the theme color of the original picture.
[0250] Based on the theme color determination apparatus for a picture provided in the embodiment of the present application, the to-be-processed confidence of a to-be-processed color group indicates the probability that each to-be-processed color in the to-be-processed color group can represent the overall color feature of the to-be-processed picture, and the to-be-processed confidence of the target color group is greater than the first threshold value, indicating that the probability that each to-be-processed color in the target color group can represent the overall color feature of the to-be-processed picture is relatively large, so that the theme color of the to-be-processed picture can be calculated according to the pixel values corresponding to each to-be-processed color in the target color group, which can reduce the labor cost and time cost, and further improve the efficiency of determining the theme color of the picture.
[0251] corresponding to the method embodiment of Figure 5 , see Figure 9 , Figure 9 is a structural diagram of a model training apparatus provided in the embodiment of the present application, and the apparatus comprises:
[0252] a sample color grouping module 901 configured to group each sample color contained in a sample picture according to the color system to which the sample color belongs, to obtain a plurality of color groups as sample color groups;
[0253] a sample color difference value determination module 902 configured to calculate a sample color difference value and a sample number average corresponding to the sample color groups based on each sample color in the sample color groups; wherein the sample color difference value indicates the dispersion degree of each sample color in the sample color groups; and the sample number average indicates the proportion of the sample colors in the sample color groups in the sample picture;
[0254] The sample confidence acquisition module 903 is used to acquire the confidence of the sample color group as the sample confidence; wherein, the sample confidence represents the probability that the sample color in the sample color group can characterize the overall color features of the sample image;
[0255] The prediction confidence determination module 904 is used to input the sample color difference value and the average number of samples into the color prediction model of the initial structure, and obtain the confidence of the sample color group output by the color prediction model of the initial structure as the prediction confidence.
[0256] The loss function value determination module 905 is used to calculate the loss function value representing the difference between the predicted confidence level and the sample confidence level;
[0257] The model parameter adjustment module 906 is used to adjust the model parameters of the initial structure color prediction model based on the calculated loss function value until the preset convergence condition is reached, so as to obtain the trained target color prediction model.
[0258] Based on the model training apparatus provided in this embodiment of the invention, a color prediction model of an initial structure can be trained to obtain a target color prediction model. Furthermore, based on the target color prediction model, the confidence level of each color group to be processed can be determined. The confidence level of a color group to be processed represents the probability that each color in that color group can characterize the overall color features of the image to be processed. If the confidence level of the target color group is greater than a first threshold, it indicates that the probability that each color in the target color group can characterize the overall color features of the image to be processed is relatively high. Therefore, the theme color of the image to be processed can be calculated based on the pixel values corresponding to each color in the target color group, which can reduce manual and time costs, thereby improving the efficiency of determining the theme color of the image.
[0259] This invention also provides an electronic device, such as... Figure 10 As shown, it includes a processor 1001, a communication interface 1002, a memory 1003, and a communication bus 1004, wherein the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004.
[0260] Memory 1003 is used to store computer programs;
[0261] When the processor 1001 executes the program stored in the memory 1003, it implements the image theme color determination method step or the model training method step described in any of the above embodiments.
[0262] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0263] The communication interface is used for communication between the above electronic device and other devices.
[0264] The memory can include a Random Access Memory (RAM) and can also include a non-volatile memory, such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the above-mentioned processor.
[0265] The above-mentioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0266] In still another embodiment provided by the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the picture theme color determination method in any of the above embodiments, or the model training method in any of the above embodiments.
[0267] In still another embodiment provided by the present application, a computer program product containing instructions is also provided, and when the computer program product is run on a computer, the computer is caused to execute the picture theme color determination method in any of the above embodiments, or the model training method in any of the above embodiments.
[0268] In the embodiments described above, all or some of the steps can be implemented by software, hardware or firmware, or any combination thereof. When implemented by software, all or some of the steps can be implemented in the form of one or more computer programs. The computer program can be stored in any computer readable medium, and loaded into the computer system for execution. The computer readable medium includes: a computer storage medium and a computer communication medium. The computer storage medium includes: volatile media (such as random access memory (RAM) and others) and non-volatile media (such as read-only memory (ROM), floppy disks, CD-ROMs, optical disks, hard disks, etc.). The computer communication medium includes: computer networks and other media.
[0269] It should be noted that, in this document, the terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. In addition, the terms "comprise", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or other elements inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of additional identical elements in the process, method, article or device that includes the element.
[0270] Each of the embodiments in the specification is described in a related manner, and the same or similar parts between each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the device, electronic device, computer readable storage medium and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0271] The above merely provides the preferred embodiments of the application, and not intended to limit the protection scope of the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the application shall fall within the protection scope of the application.
Claims
1. A method for determining the theme color of an image, characterized in that, The method includes: Based on the color system to which each color in the image to be processed belongs, the colors in the image to be processed are grouped to obtain multiple color groups, which are then used as the color groups to be processed. For each color group to be processed, based on each color to be processed in the color group, calculate the color difference value and the average number of colors to be processed corresponding to the color group; wherein, the color difference value represents the dispersion of each color to be processed in the color group; and the average number of colors to be processed represents the proportion of the color to be processed in the color group in the image to be processed. The color difference value to be processed and the average number of to be processed are input into the pre-trained target color prediction model to obtain the confidence of the color group to be processed output by the target color prediction model, which is used as the confidence of the to be processed; wherein, the confidence of the to be processed color group represents the probability that each color to be processed in the color group to be processed can characterize the overall color features of the image to be processed. From each color group whose confidence level is greater than the first threshold, select one color group as the target color group; The theme color of the image to be processed is calculated based on the pixel values corresponding to each color to be processed in the target color group.
2. The method according to claim 1, characterized in that, For each color group to be processed, based on each color to be processed in that color group, the method calculates the difference value of the colors to be processed and the average number of colors to be processed for that color group, including: For each color group to be processed, the color difference value between any two adjacent colors in the color group is calculated according to the order of the first number corresponding to each color in the color group from largest to smallest, and is taken as the first color difference value; the average value of each first color difference value corresponding to the color group is calculated to obtain the color difference value corresponding to the color group; wherein, the first number corresponding to a color to be processed is: the number of pixels in the image to be processed containing the color to be processed. Calculate the average of the first number corresponding to each color in the color group to be processed, and obtain the average number of colors to be processed corresponding to the color group to be processed.
3. The method according to claim 1, characterized in that, The step involves grouping the colors in the image to be processed according to their respective color systems, resulting in multiple color groups, which serve as the color groups to be processed. These groups include: Based on the color system to which each color to be processed belongs in the image to be processed, each color to be processed is clustered to obtain multiple color groups, which are used as color groups to be processed; wherein, the second color difference value between the cluster centers of any two color groups to be processed is greater than the second threshold; the second color difference value between each color to be processed and the cluster center of its respective color group to be processed is less than the second color difference value between the color to be processed and the cluster centers of other color groups to be processed.
4. The method according to claim 3, characterized in that, Before grouping the colors in the image to be processed according to their respective color systems to obtain multiple color groups, which are then used as the color groups to be processed, the method further includes: Based on the first number of colors contained in the image to be processed, arranged in descending order, the first two numbers of colors are determined from the colors contained in the image to be processed as the colors to be processed.
5. The method according to claim 1, characterized in that, Before grouping the colors in the image to be processed according to their respective color systems to obtain multiple color groups, which are then used as the color groups to be processed, the method further includes: For each pixel in the image to be processed, if the brightness value of the pixel's color falls within a preset brightness range, the color of that pixel is determined as a candidate color. From the candidate colors, determine the candidate colors whose corresponding first number is greater than the third threshold, and use them as the colors to be processed; wherein, the first number corresponding to a candidate color is: the number of pixels in the image to be processed that contain the candidate color.
6. The method according to claim 5, characterized in that, For each pixel in the image to be processed, if the brightness value of the pixel's color falls within a preset brightness range, the color of that pixel is determined as a candidate color, including: For each pixel in the image to be processed, if the brightness value of the pixel's color belongs to the first preset brightness range, the color of the pixel is determined as a candidate color. or, For each pixel in the image to be processed, if the brightness value of the pixel's color belongs to the second preset brightness range and the saturation value of the color does not belong to the preset saturation range, the color of the pixel is determined as a candidate color; wherein, the second preset brightness range belongs to the first preset brightness range.
7. The method according to claim 6, characterized in that, Before determining that the color of each pixel in the image to be processed is a candidate color if the brightness value of that pixel falls within a preset brightness range, the method further includes: Obtain the original image and extract the image region from the original image excluding the specified object to obtain the image to be processed; For each pixel in the image to be processed, the brightness and saturation values of the pixel's color are calculated based on the pixel value.
8. The method according to any one of claims 1 to 7, characterized in that, After obtaining the theme color of the image to be processed based on the pixel values corresponding to each color to be processed in the target color group, the method further includes: The theme color of the image to be processed is used as the theme color of the original image to which the image to be processed belongs, and the theme color of the original image is stored. After receiving a request from the client to obtain the original image, the system sends the original image and its theme color to the client. Upon receiving the original image and its theme color, the client displays the original image on its display interface and sets the color of all other areas of the display interface except the original image to the theme color of the original image.
9. A model training method, characterized in that, The method includes: Based on the color system to which each sample color in the sample image belongs, the sample colors in the sample image are grouped to obtain multiple color groups, which are used as sample color groups. Based on each sample color in the sample color group, calculate the sample color difference value and the mean number of samples corresponding to the sample color group; wherein, the sample color difference value represents the dispersion of each sample color in the sample color group; and the mean number of samples represents the proportion of the sample color in the sample color group in the sample image. Obtain the confidence level of the sample color group as the sample confidence level; wherein, the sample confidence level represents the probability that the sample color in the sample color group can characterize the overall color features of the sample image; The sample color difference value and the mean number of samples are input into the color prediction model of the initial structure to obtain the confidence level of the sample color group output by the color prediction model of the initial structure, which is used as the prediction confidence level. Calculate the loss function value representing the difference between the predicted confidence level and the sample confidence level; The model parameters of the initial color prediction model are adjusted based on the calculated loss function value until the preset convergence condition is met, thus obtaining the trained target color prediction model.
10. A device for determining the theme color of an image, characterized in that, The device includes: The color grouping module is used to group the colors in the image to be processed according to the color system to which each color belongs, resulting in multiple color groups, which are then used as the color groups to be processed. The module for determining the color difference value to be processed is used to calculate, for each color group to be processed, the color difference value to be processed and the average number of colors to be processed corresponding to that color group; wherein, the color difference value to be processed represents the dispersion of each color to be processed in that color group; and the average number of colors to be processed represents the proportion of the colors to be processed in that color group in the image to be processed. The confidence determination module is used to input the color difference value to be processed and the average number of to be processed into a pre-trained target color prediction model to obtain the confidence of the color group to be processed output by the target color prediction model, which is used as the confidence of the to be processed; wherein, the confidence of the to be processed color group represents the probability that each color to be processed in the color group to be processed can characterize the overall color features of the image to be processed. The target color group determination module is used to select a color group as the target color group from each color group to be processed whose corresponding confidence level is greater than the first threshold. The theme color determination module is used to calculate the theme color of the image to be processed based on the pixel values corresponding to each color to be processed in the target color group.
11. A model training device, characterized in that, The device includes: The sample color grouping module is used to group the sample colors contained in the sample image according to the color system to which each sample color belongs, resulting in multiple color groups, which are used as sample color groups. The sample color difference value determination module is used to calculate the sample color difference value and the mean number of samples corresponding to the sample color group based on each sample color in the sample color group; wherein, the sample color difference value represents the dispersion of each sample color in the sample color group; and the mean number of samples represents the proportion of the sample color in the sample color group in the sample image. The sample confidence acquisition module is used to acquire the confidence of the sample color group as the sample confidence; wherein, the sample confidence represents the probability that the sample color in the sample color group can characterize the overall color features of the sample image; The prediction confidence determination module is used to input the sample color difference value and the average number of samples into the color prediction model of the initial structure, and obtain the confidence of the sample color group output by the color prediction model of the initial structure as the prediction confidence. The loss function value determination module is used to calculate the loss function value representing the difference between the predicted confidence level and the sample confidence level; The model parameter adjustment module is used to adjust the model parameters of the initial structure color prediction model based on the calculated loss function value until the preset convergence condition is met, so as to obtain the trained target color prediction model.
12. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method according to any one of claims 1-8 or claim 9.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-8 or claim 9.
Citation Information
Patent Citations
Interface element color display method and device
CN110865856A
Image theme color extraction method and device and electronic equipment
CN110969170A