A method, apparatus, computer device, and storage medium for processing picture data

By performing uniform quantization and sliding window traversal in the target color space, selecting an aggregated set that meets the conditions, the problem of low accuracy of main color extraction in the prior art is solved, and more efficient and accurate main color extraction is achieved.

CN114385847BActive Publication Date: 2025-07-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011138255.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-22
Publication Date
2025-07-08
Estimated Expiration
2040-10-22

AI Technical Summary

Technical Problem

In the process of extracting the main color of the picture, the color with the largest number of pixels is directly obtained from the quantized set as the main color, resulting in low extraction accuracy.

Method used

In the target color space, by determining the first variable value of the pixel point, uniform quantization processing is performed to form a quantization set, and traversing these sets using a sliding window, selecting an aggregated set that meets the main color extraction conditions, obtaining the second variable value of the target pixel point, and finally determining the main color of the picture data.

Benefits of technology

It improves the accuracy of main color extraction, reduces the impact on saturation and brightness, and improves the efficiency of main color extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114385847B_ABST
    Figure CN114385847B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose an image data processing method, apparatus, computer device, and storage medium. The method includes: determining a first variable value of a pixel point on a first color dimension of a target color space based on the pixel value of the pixel point in the target color space within the image data; performing uniform quantization processing on the first variable value based on a quantization window to obtain m quantization sets; determining a sliding step of a sliding window based on the window size of the quantization window, and traversing the m quantization sets based on the sliding window and the sliding step to obtain n aggregation sets; selecting an aggregation set that meets the dominant color extraction condition from the n aggregation sets, determining a target pixel point in the selected aggregation set, obtaining a second variable value on a second color dimension of the target color space, and determining the dominant color of the image data based on the second variable value and the first variable value of the target pixel point. By using the embodiments of the present application, the accuracy of dominant color extraction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a method and apparatus for processing picture data, a computer device, and a storage medium. Background Art

[0002] Currently, in the process of extracting the dominant color of a picture, a computer device needs to obtain all pixel points in the picture data to be used for dominant color extraction, and then can obtain the pixel values of these pixel points in a certain color space (for example, a color space composed of three color channels of red (Red), green (Green), and blue (Blue), abbreviated as the RGB color space). Further, the computer device can uniformly quantize the pixel points belonging to the RGB color space based on the pixel values of these pixel points to obtain a quantization set associated with the pixel points. At this time, the computer device can directly obtain the target quantization set with the largest number of pixel points from these quantization sets, so that the color mapped by the largest number of pixel points in the target quantization set is mistakenly regarded as the dominant color of the picture data, thereby reducing the accuracy of directly extracting the dominant color from the target quantization set. Summary of the Invention

[0003] Embodiments of this application provide a method and apparatus for processing picture data, a computer device, and a storage medium, which can improve the accuracy of dominant color extraction.

[0004] On the one hand, an embodiment of this application provides a method for processing picture data, including:

[0005] Determine a first variable value of a pixel point on a first color dimension of a target color space based on the pixel value of the pixel point in the target color space within the picture data;

[0006] Perform uniform quantization processing on the first variable value of the pixel point based on a quantization window corresponding to the first color dimension to obtain m quantization sets associated with the pixel point; m is a positive integer;

[0007] Determine a sliding step of a sliding window based on the window size of the quantization window, and perform traversal processing on the m quantization sets based on the sliding window and the sliding step to obtain n aggregation sets associated with the pixel point; n is a positive integer; the sliding window has the function of covering k quantization sets; k is a positive integer less than or equal to m; n is equal to (m - k + 1);

[0008] Select an aggregation set that meets the dominant color extraction condition from the n aggregation sets, determine a target pixel point in the aggregation set that meets the dominant color extraction condition, obtain a second variable value of the target pixel point on a second color dimension of the target color space, and determine the dominant color of the picture data based on the second variable value of the target pixel point and the first variable value of the target pixel point.

[0009] In one aspect, an embodiment of the present application provides a picture data processing device, including:

[0010] A variable value determination module, configured to determine a first variable value of a pixel point on a first color dimension of a target color space based on the pixel value of the pixel point in the picture data in the target color space;

[0011] A quantization processing module, configured to perform uniform quantization processing on the first variable value of the pixel point based on a quantization window corresponding to the first color dimension to obtain m quantization sets associated with the pixel point; m is a positive integer;

[0012] A traversal processing module, configured to determine a sliding step of a sliding window based on the window size of the quantization window, and perform traversal processing on the m quantization sets based on the sliding window and the sliding step to obtain n aggregation sets associated with the pixel point; n is a positive integer; the sliding window has a function of covering k quantization sets; k is a positive integer less than or equal to m; n is equal to (m - k + 1);

[0013] A picture main color determination module, configured to select an aggregation set that meets the main color extraction condition from the n aggregation sets, determine a target pixel point in the aggregation set that meets the main color extraction condition, obtain a second variable value of the target pixel point on a second color dimension of the target color space, and determine the main color of the picture data based on the second variable value of the target pixel point and the first variable value of the target pixel point.

[0014] Wherein, before the variable value determination module, the device further includes:

[0015] A picture acquisition module, configured to acquire original picture data uploaded by a management terminal; the original picture data is game picture data selected by the management terminal in response to a trigger operation on a main color extraction interface; the color space corresponding to the game picture data is an initial color space; the initial color space includes a first color channel, a second color channel, and a third color channel;

[0016] A preprocessing module, configured to perform preprocessing on the original pixel points of the original picture data based on a pixel point filtering condition corresponding to the initial color space, and use the preprocessed original picture data as the picture data for main color extraction;

[0017] A pixel point extraction module, configured to extract pixel points from the picture data, obtain a first channel variable value of the pixel point on the first color channel, obtain a second channel variable value of the pixel point on the second color channel, and obtain a third channel variable value of the pixel point on the third color channel;

[0018] A color conversion processing module, which is used to perform color conversion processing on the initial pixel values of pixel points belonging to the initial color space based on the first channel variable value, the second channel variable value, and the third channel variable value, so as to obtain the pixel values of the pixel points in the target color space.

[0019] Among them, the preprocessing module includes:

[0020] A filtering condition acquisition unit, which is used to acquire the pixel point filtering condition corresponding to the initial color space and acquire the total number of original pixel points in the original image data;

[0021] A downsampling processing unit, which is used to perform downsampling processing on the original pixel points in the original image data when the total number of the original pixel points reaches the downsampling threshold in the pixel point filtering condition, and use the downsampled image data composed of the downsampled original pixel points as the image data to be filtered;

[0022] A filtering processing unit, which is used to use the pixel points in the image data to be filtered as candidate filtering pixel points. Among the candidate filtering pixel points, the candidate filtering pixel points that meet the pixel point filtering condition are used as target filtering pixel points, and the target filtering pixel points in the image data to be filtered are filtered, and the filtered image data to be filtered is used as the image data for main color extraction.

[0023] Among them, the filtering processing unit includes:

[0024] A candidate filtering pixel point determination subunit, which is used to use the pixel points in the image data to be filtered as candidate filtering pixel points, determine the transparency value of the candidate filtering pixel points, and the channel variable values corresponding to the first color channel, the second color channel, and the third color channel of the candidate filtering pixel points in the initial color space respectively;

[0025] A first determination subunit, which is used to select, among the candidate filtering pixel points, the candidate filtering pixel points with a transparency value less than the first filtering threshold, and use the selected candidate filtering pixel points as the target filtering pixel points that meet the pixel point filtering condition; or,

[0026] A second determination subunit, which is used to select, among the candidate filtering pixel points, the candidate filtering pixel points with the channel variable value of each color channel greater than the second filtering threshold, and use the selected candidate filtering pixel points as the target filtering pixel points that meet the pixel point filtering condition;

[0027] A filtering processing subunit, which is used to filter the target filtering pixel points in the image data to be filtered, and use the filtered image data to be filtered as the image data for main color extraction.

[0028] Among them, the quantization processing module includes:

[0029] A quantization interval determination unit, configured to obtain a maximum first variable value and a minimum first variable value based on a first variable value of a pixel point, and determine a variable value range formed by the minimum first variable value and the maximum variable value as the quantization interval of the pixel point;

[0030] A division unit, configured to obtain a quantization window corresponding to a first color dimension, divide the quantization interval into m quantization sub-intervals associated with the pixel point, and obtain a quantization sub-interval X within the m quantization sub-intervals i ; i is a positive integer less than or equal to m;

[0031] An addition unit, configured to obtain, based on the first variable value of the pixel point, a pixel point to be added to the quantization sub-interval X from the pixel points in the picture data, and add the pixel point to be added to the quantization sub-interval X i ; i ;

[0032] A quantization set determination unit, configured to use the added quantization sub-interval X i as the quantization set corresponding to the pixel point to be added, and obtain m quantization sets associated with the pixel point until all the pixel points in the picture data are in the corresponding quantization sets.

[0033] Among them, the traversal processing module includes:

[0034] A sliding window determination unit, configured to obtain the interval length formed by k quantization sets, use the interval length as the window size of the sliding window for dominant color extraction, and use the window size of the quantization window as the sliding step of the sliding window;

[0035] A traversal processing unit, configured to traverse and obtain k quantization sets covered by the sliding window from the m quantization sets based on the sliding window and the sliding step, and use the k quantization sets covered by the sliding window as the aggregation set Y j ; j is a positive integer less than or equal to n;

[0036] An aggregation set determination unit, configured to obtain (m - k + 1) aggregation sets until the k quantization sets covered by the sliding window include the m-th quantization set, and determine the (m - k + 1) aggregation sets as n aggregation sets associated with the pixel point.

[0037] Among them, the n aggregation sets include the aggregation set Y j ; the aggregation set Y j includes a first quantization set and a second quantization set;

[0038] The device further includes:

[0039] A first quantity determination module, configured to be in the aggregation set Y jIn it, obtain the number of pixel points in the first quantized set that has been counted, and use the number of pixel points in the first quantized set as the first quantity;

[0040] A second quantity determination module, configured to obtain the number of pixel points in the second quantized set that has been counted, and use the number of pixel points in the second quantized set as the second quantity;

[0041] An addition processing module, configured to perform an addition process on the first quantity and the second quantity, and use the total quantity after the addition process as the number of pixel points in the aggregated set Y j in.

[0042] Among them, the picture dominant color determination module includes:

[0043] A target pixel point determination unit, configured to, among n aggregated sets, use the aggregated set with the largest number of pixel points as the aggregated set that meets the dominant color extraction condition, and determine the target pixel point in the aggregated set that meets the dominant color extraction condition;

[0044] A first - dimension dominant color determination unit, configured to obtain the second variable value of the target pixel point on the second color dimension of the target color space, and determine the first - color - dimension dominant color of the picture data;

[0045] A second - dimension dominant color determination unit, configured to perform an averaging process on the second variable values of the target pixel points to obtain an average variable value, and determine the second - color - dimension dominant color of the picture data based on the average variable value;

[0046] A picture dominant color determination unit, configured to determine the dominant color of the picture data based on the first - color - dimension dominant color and the second - color - dimension dominant color.

[0047] Among them, the target pixel point determination unit includes:

[0048] A to - be - processed aggregated set determination subunit, configured to, among n aggregated sets, use the aggregated set with the largest number of pixel points as the aggregated set that meets the dominant color extraction condition, and use the aggregated set that meets the dominant color extraction condition as the to - be - processed aggregated set;

[0049] A third determination subunit, configured to, if the number of to - be - processed aggregated sets is one, use the pixel points in the to - be - processed aggregated set as the target pixel points;

[0050] A fourth determination subunit, configured to, if the number of to - be - processed aggregated sets is at least two, use the pixel points in a randomly obtained to - be - processed aggregated set as the target pixel points.

[0051] Among them, the first - dimension dominant color determination unit includes:

[0052] A to-be-processed pixel determination subunit, configured to obtain a second variable value of a target pixel in a second color dimension of a target color space, obtain a target pixel with the maximum second variable value, and use the obtained target pixel as the to-be-processed pixel;

[0053] A fifth determination subunit, configured to, if the number of to-be-processed pixels is one, use the first variable value of the to-be-processed pixel as the main color of the first color dimension of the picture data;

[0054] A sixth determination subunit, configured to, if the number of to-be-processed pixels is at least two, use the average value obtained by averaging the first variable values of the at least two to-be-processed pixels as the main color of the first color dimension of the picture data.

[0055] Wherein, the second dimension main color determination unit includes:

[0056] An averaging processing subunit, configured to perform an averaging process on the second variable values of the target pixels to obtain an average variable value;

[0057] A seventh determination subunit, configured to, if the average variable value is less than or equal to a main color threshold, use the average variable value as the main color of the second color dimension of the picture data;

[0058] An eighth determination subunit, configured to, if the average variable value is greater than the main color threshold, use the main color threshold as the main color of the second color dimension of the picture data.

[0059] Wherein, the apparatus further includes:

[0060] A background color determination module, configured to, based on the component types included in the display interface of the user terminal, use the variable value configured for the component type as the third variable value in the third color dimension of the target color space, and obtain the background color corresponding to the component type based on the third variable value and the main color of the picture data; the display interface is a display interface for displaying the picture data;

[0061] A background color sending module, configured to send the background color corresponding to the component type to the management terminal respectively, so that the management terminal outputs the background color corresponding to the component type on the main color extraction interface of the management terminal; the main color extraction interface includes a service audit control; the service audit control is used to instruct the management terminal to generate a service audit request based on the background color corresponding to the component type;

[0062] An audit request sending module, configured to, when receiving a service audit request sent by the management terminal, send the service audit request to the audit terminal, so that the audit terminal audits the background color corresponding to the component type;

[0063] The background color sending module is used to send the background color of the corresponding component type to the user terminal when the review at the review terminal is successful, so that the user terminal can display the background color of the corresponding component type on the display interface.

[0064] On the one hand, the present application provides a computer device, including: a processor, a memory, and a network interface;

[0065] The processor is connected to the memory and the network interface. Among them, the network interface is used to provide data communication functions, the memory is used to store computer programs, and the processor is used to call the computer programs to execute the methods in the above-mentioned aspect in the embodiments of the present application.

[0066] On the one hand, the present application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the methods in the above-mentioned aspect in the embodiments of the present application are executed.

[0067] On the one hand, the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods in the above-mentioned aspect.

[0068] In an embodiment of the present application, a computer device can quickly obtain a quantization window corresponding to a single color dimension in a target color space (for example, the target color space can be a color space composed of three color dimensions: Hue, Saturation, and Brightness, abbreviated as the HSB color space). For example, the computer device can obtain a quantization window corresponding to a first color dimension in the target color space (for example, the Hue of the HSB color space). At this time, the computer device can perform uniform quantization processing on the first variable values of the pixel points in the picture data in the first color dimension, and then obtain m quantization sets associated with these pixel points; m here can be a positive integer. Further, the computer device can determine the sliding step of the sliding window based on the quantization size of the quantization window. It can be understood that the quantization size of the quantization window in the embodiment of the present application can be set by itself according to actual needs. For example, if the first color dimension is the Hue in the aforementioned HSB color space, an interval such as 1 degree, 5 degrees, or 30 degrees can be adaptively set as the window size of the quantization window according to the value range of the first variable values of these pixel points in the first color dimension. At this time, when the computer device traverses the m quantization sets based on the sliding window and the sliding step, and aggregates to obtain n aggregation sets in the way of the sliding window, pixel points with similar colors will not be divided into different aggregation sets; n here can be a positive integer. Therefore, the computer device can accurately obtain an aggregation set that meets the main color extraction condition, and then when extracting the main color of the picture data according to the second variable value and the first variable value of the target pixel point in the second color dimension of the target color space (for example, the Saturation of the HSB color space) in the aggregation set that meets the main color extraction condition, the accuracy of the main color extraction can be improved. Description of the Drawings

[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0070] Figure 1 It is a schematic structural diagram of a network architecture provided by an embodiment of the present application;

[0071] Figure 2 It is a schematic diagram of a scenario for extracting the main color of picture data provided by an embodiment of the present application;

[0072] Figure 3 It is a schematic flowchart of a method for processing picture data provided by an embodiment of the present application;

[0073] Figure 4a It is a schematic diagram of a scenario for a management terminal to upload original picture data extracted in an embodiment of the present application;

[0074] Figure 4b It is a histogram for counting the number of pixel points provided in an embodiment of the present application;

[0075] Figure 5a It is a schematic diagram of a scenario for traversing and processing a quantization set provided in an embodiment of the present application;

[0076] Figure 5b It is a schematic diagram of a scenario for traversing and processing a quantization set provided in an embodiment of the present application;

[0077] Figure 6 It is a schematic flow diagram of a picture data processing method provided in an embodiment of the present application;

[0078] Figure 7 It is a schematic diagram of a scenario for previewing a display effect provided in an embodiment of the present application;

[0079] Figure 8 It is a schematic diagram of a scenario for auditing a background color provided in an embodiment of the present application;

[0080] Figure 9 It is a schematic diagram of a scenario for displaying a display interface provided in an embodiment of the present application;

[0081] Figure 10 It is a schematic structural diagram of a picture data processing device provided in an embodiment of the present application;

[0082] Figure 11 It is a schematic diagram of a computer device provided in an embodiment of the present application. Detailed implementation manners

[0083] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0084] Please refer to Figure 1 , Figure 1 It is a schematic structural diagram of a network architecture provided in an embodiment of the present application. As Figure 1As shown in the figure, the network architecture may include a server 10, an administrative terminal 110x, an auditing terminal 120y, and a cluster of user terminals. The cluster of user terminals may include one or more user terminals, and the number of user terminals will not be limited herein. As Figure 1 shown in the figure, the cluster of user terminals may specifically include user terminal 100a, user terminal 100b, user terminal 100c, …, user terminal 100n. As Figure 1 shown in the figure, user terminal 100a, user terminal 100b, user terminal 100c, …, user terminal 100n may be respectively connected to the above-mentioned server 10 through a network, so that each user terminal can perform data interaction with the server 10 through this network connection. Among them, the network connection here does not limit the connection method, and it can be directly or indirectly connected through a wired communication method, or directly or indirectly connected through a wireless communication method, or through other methods, which are not limited in this application.

[0085] Among them, each user terminal in the cluster of user terminals may include: intelligent terminals with data processing functions such as smart phones, tablet computers, notebook computers, desktop computers, wearable devices, smart homes, and head-mounted devices. It should be understood that each user terminal in the cluster of user terminals may be installed with a target application (i.e., an application client). When the application client runs on each user terminal, it can perform data interaction with the above-mentioned Figure 1 shown server 10 respectively. Among them, the application client may include application clients with functions of displaying picture data such as social clients, multimedia clients (for example, video clients), entertainment clients (for example, game clients), education clients, and live broadcast clients. Among them, the application client may be an independent client or an embedded sub-client integrated in a certain client (such as a social client, an education client, and a multimedia client, etc.), which is not limited herein.

[0086] As Figure 1 shown in the figure, the server 10 in the embodiment of this application may be a server with a main color extraction function. The server 10 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0087] It should be understood that both the management terminal 110x and the review terminal 120y can be any user terminal in the user terminal cluster. Among them, the management terminal 110x can be the user terminal corresponding to the management user (for example, the operation staff), and this management terminal 110x can be used to upload the picture data for primary color extraction. The review terminal 120y can be the user terminal corresponding to the review user, and this review terminal 120y can be used to review the primary color of the picture data extracted by the server 10.

[0088] Among them, the color of the pixel points in the picture data is objective in itself, and measuring the same color from different perspectives can correspond to different color spaces. Here, the color space refers to the space range composed of variables in the color model. This color space can include the RGB color space, the HSB color space, the grayscale color space, etc. In the RGB color space, a color can be described by adding and mixing the components of three different color channels: red (abbreviated as R), green (abbreviated as G), and blue (abbreviated as B). Among them, each color channel can include 256 levels of brightness from 0 to 255. In the HSB color space, a color can be described according to three color dimensions: hue (abbreviated as H), saturation (abbreviated as S), and brightness (abbreviated as B). Among them, the hue (also called chroma) is the basic attribute of the color, and the hue is a circular structure. Saturation can be used to describe the vividness of the color, and brightness can be used to describe the lightness and darkness of the color. It can be understood that the hue can be expressed in degrees, with a value range of [0°, 360°], and the saturation and brightness can be expressed as percentage values, with a value range of [0%, 100%]. In the grayscale color space, a color can be described by a grayscale value. Among them, the grayscale value can be used to indicate the shade of the color, and the value range generally ranges from 0 to 255. A grayscale value of 0 can be represented as black, and a grayscale value of 255 can be represented as white.

[0089] The computer devices in the embodiments of the present application can all perform primary color extraction on the picture data within the above-mentioned color space. It can be understood that the primary color of the picture data extracted by the server 10 can be applied to the page design scenario. Among them, the management terminal 110x can upload the picture data for primary color extraction (for example, game picture data, movie posters, etc.), and then can send this picture data to Figure 1The server 10 shown. At this time, the server 10 can extract the dominant color of the picture data to obtain the dominant color of the picture data. Further, the server 10 can determine the background color of the display interface for displaying the picture data (for example, page background color, card background color, button background color, text color, etc.) based on the dominant color of the picture data. Among them, the display interface of the picture data can be the display interface corresponding to the application client of the user terminal. When the user corresponding to the user terminal (for example, Figure 1 the user terminal 100a shown) performs a trigger operation on the application client, the user terminal 100a can respond to the trigger operation and output the background color that has been successfully audited by the audit terminal 120y on the display interface, so as to bring a better visual experience to the user.

[0090] Optionally, the dominant color of the picture data extracted by the server 10 can be applied to the image special effect processing scenario. Among them, the server 10 can obtain the picture data uploaded by the management terminal 110x, and the management terminal 110x can be a user terminal with an image acquisition function (for example, the user terminal 100b). The picture data here can be the picture data saved in the album of the management terminal 110x, or the picture data being collected by the management terminal through an imaging device (for example, a camera), which is not limited here. When the server 10 extracts the dominant color of the picture data (for example, picture data associated with a human face), the dominant color can be returned to the user terminal 100b. It can be understood that when the user terminal performs image processing (for example, special effect processing) on the picture data according to user needs, it can identify the human face part in the picture data, and then can add a special effect image with the same color as the dominant color (for example, rabbit ears) on the identified human face part, thereby increasing the fun. For example, if the dominant color extracted by the server 10 is purple, the added special effect image can be purple rabbit ears.

[0091] Optionally, the dominant color of the picture data extracted by the server 10 can be applied to the photo frame selection scenario. Among them, the server 10 can obtain the picture data for dominant color extraction. For example, the picture data can be artistic photos, wedding photos, etc. uploaded by the management terminal 110x. It can be understood that when the server 10 obtains the dominant color of the picture data, the dominant color can be returned to the management terminal 110x for display. At this time, the management user corresponding to the management terminal 110x can select a photo frame with the same color as the dominant color for the picture data based on the dominant color of the picture data, thereby improving the beauty of the picture data.

[0092] Further, please refer to Figure 2 , Figure 2FIG. 0 is a schematic diagram of a scenario for extracting dominant colors from picture data provided by an embodiment of the present application. Among them, the computer device in the embodiment of the present application may be a computer device with the function of extracting dominant colors, and this computer device may be a user terminal or a server, which is not limited herein.

[0093] It should be understood that the picture data 2a in the embodiment of the present application may be picture data obtained by a management terminal having a network connection relationship with the computer device, and this management terminal may be the management terminal 110x shown above. It can be understood that the picture data here may be game picture data associated with a certain game client, a poster associated with a certain movie, picture data saved in the album of the management terminal, or picture data collected by an image acquisition device (such as a camera, a video camera, a single-lens reflex camera, etc.) having an association relationship with the management terminal. Figure 1

[0094] Among them, it can be understood that when the color space of the picture data 2a is the RGB color space (i.e., the initial color space), the computer device may convert the color space of the pixel points in the picture data 2a from the RGB color space to the HSB color space, and then may extract the dominant colors from the picture data 2a in the HSB color space. At this time, the embodiment of the present application may refer to the HSB color space as the target color space. The HSB color space here may include three color dimensions: hue, saturation, and brightness.

[0095] It should be understood that the computer device may obtain the pixel values of the pixel points in the picture data 2a in the HSB color space. Since in the HSB color space, the hue can reflect the color tone. By performing uniform quantization processing on the color dimension of the hue, the computer device can effectively avoid the influence of saturation and brightness on the extracted dominant colors. Therefore, in the embodiment of the present application, for the quantization set corresponding to a single color dimension (such as hue) in the HSB color space, the aggregation set may be obtained by means of a sliding window, and dimensionality reduction processing may be achieved, which can effectively improve the efficiency of the computer device in extracting dominant colors.

[0096] Among them, it can be understood that the computer device may determine a first variable value of the pixel point on the hue (i.e., the first color dimension) in the HSB color space based on the pixel value. Further, the computer device may perform uniform quantization processing on the first variable value of the pixel point based on the quantization window corresponding to the hue to obtain m quantization sets associated with the pixel point. Here, m may be a positive integer. As Figure 2 shown, the quantization sets associated with the pixel point in the embodiment of the present application may specifically include: quantization set 1, quantization set 2,..., quantization set m.

[0097] Further, the computer device can determine the sliding step of the sliding window based on the window size of the quantization window (e.g., 30°), and then, based on the sliding window and the sliding step, Figure 2 perform a traversal process on the m quantization sets shown, so as to obtain n aggregation sets associated with the pixel points. Here, n can be a positive integer. Among them, the sliding window can have the function of covering k quantization sets. Here, k can be a positive integer less than or equal to m.

[0098] It can be understood that if the variable value range determined by the computer device based on the first variable value of the pixel point in the chromaticity of the HSB color space is [0°, 360°], then the m quantization sets determined by the computer device can form a circular structure. At this time, the number n of the aggregation sets determined by the computer device can be equal to m. Optionally, if the variable value range determined by the computer device based on the first variable value of the pixel point in the chromaticity of the HSB color space is a certain range of values, for example, [40°, 270°], then the m quantization sets determined by the computer device do not form a circular structure. At this time, the number n of the aggregation sets determined by the computer device can be equal to (m - k + 1). As Figure 2 shown, the aggregation sets associated with the pixel points in the embodiments of the present application may specifically include: aggregation set Y1, aggregation set Y2,..., aggregation set Y n . For example, taking 12 quantization sets as an example for the m quantization sets associated with the pixel points, if the sliding window can have the function of covering 2 quantization sets, then the number of aggregation sets associated with the pixel points obtained by the computer device can be 11.

[0099] At this time, the computer device can select the aggregation sets that meet the main color extraction condition among the n aggregation sets, and then can determine the target pixel points in the aggregation sets that meet the main color extraction condition. Here, the main color extraction condition can be used to instruct the computer device to obtain the aggregation set with the largest number of pixel points. As Figure 2 shown, the aggregation set that meets the main color extraction condition selected by the computer device can be aggregation set Y2. At this time, the computer device can use the pixel points in aggregation set Y2 as the target pixel points. Further, the computer device can obtain the second variable value of the target pixel points in the saturation (i.e., the second color dimension) of the HSB color space. Based on the second variable value of the target pixel points and the first variable value of the target pixel points, determine the main color of the picture data 2a.

[0100] It can be seen that the computer device in the embodiment of the present application converts the color space of the image data 2a from the RGB color space to the HSB color space. Furthermore, in the HSB color space, when performing uniform quantization processing on the first color dimension (i.e., chromaticity), the influence of the second color dimension (e.g., saturation) and the third color dimension (e.g., brightness) can be effectively reduced. Therefore, when the computer device subsequently extracts the dominant color of the picture data 2a in the HSB color space, there is no need to perform uniform quantization processing on saturation and brightness, achieving dimensionality reduction processing, and thus improving the efficiency of extracting the dominant color of the picture data 2a subsequently. In addition, when the computer device traverses the obtained quantization set through a sliding window, it can accurately determine the target pixel point in the aggregation set that meets the dominant color extraction condition, thereby improving the accuracy of the computer device in extracting the dominant color of the picture data 2a.

[0101] Among them, for the computer device with the dominant color extraction function, the specific implementation method of traversing the quantization set after uniform quantization processing through a sliding window and then extracting the dominant color of the picture data from the obtained aggregation set can be seen in the following Figures 3 - 9 corresponding embodiment.

[0102] Further, please refer to Figure 3 , Figure 3 which is a schematic flowchart of a picture data processing method provided by an embodiment of the present application. As Figure 3 shown, this method can be executed by a computer device with the dominant color extraction function, and this computer device can be a user terminal (e.g., the user terminal 100a shown above Figure 1 ), or a server (e.g., the server 10 shown above Figure 1 ), which is not limited herein. For ease of understanding, this embodiment of the present application takes this method being executed by the server as an example for description. This method can at least include the following steps S101-step S104:

[0103] Step S101, based on the pixel value of the pixel point in the picture data in the target color space, determine the first variable value of the pixel point on the first color dimension of the target color space.

[0104] It should be understood that before performing step S101, a computer device with a main color extraction function can obtain the original picture data uploaded by a management terminal that has a network connection relationship with the computer device. Among them, the color space of the original picture data can be the initial color space. Further, the computer device can preprocess the original pixels in the original picture data based on the pixel filtering conditions corresponding to the initial color space, and can use the preprocessed original picture data as the picture data for main color extraction. It can be understood that the computer device can extract pixels from the picture data. In order to reduce the dimension of the main color extraction and improve the efficiency of the computer device for main color extraction, the computer device can perform color conversion processing on the initial pixel values of the pixels belonging to the initial color space, and then can obtain the pixel values of the pixels in the target color space. Further, the computing device can determine the first variable value of the pixel on the first color dimension of the target color space based on the pixel value.

[0105] It can be understood that the user corresponding to the management terminal that has a network connection relationship with the computer device can perform a trigger operation in the main color extraction interface corresponding to the management terminal, so that the management terminal can respond to the trigger operation and select the original picture data. Here, the trigger operation can include contact operations such as voice and gesture, and can also include non-contact operations such as click and long press, which will not be limited here. Among them, the original picture data can be game picture data associated with a certain game client, a poster associated with a certain movie, picture data saved in the album of the management terminal, or picture data collected by an image acquisition device (such as a camera, a video camera, a single-lens reflex camera, etc.) that has an associated relationship with the management terminal.

[0106] For ease of understanding, further, please refer to Figure 4a , Figure 4a is a schematic diagram of a scenario where a management terminal uploads original picture data extracted in an embodiment of the present application. As Figure 4a shown, the main color extraction interface 400 in the embodiment of the present application can be the display interface of the management terminal, and the management terminal can be the management terminal 110x shown above Figure 1 .

[0107] As Figure 4aAs shown, the main color extraction interface 400 in the embodiment of the present application may include the game client name associated with the game client (for example, Game A). It can be understood that when the management user corresponding to the management terminal needs to perform main color extraction on the game picture data associated with Game A, the management user can perform a trigger operation (such as a click operation) on the picture adding control in the main color extraction interface 400, so that the management user can select the game picture data associated with Game A in the album of the management terminal. Optionally, when the management user performs a trigger operation on the picture adding control, the management user can capture the game picture data associated with Game A through the image acquisition device in the management terminal.

[0108] At this time, the management terminal can respond to the trigger operation, use the game picture data selected by the management user as the original picture data, and then can output the original picture data to the main color extraction interface 400. For example, the original picture data can be Figure 4a the original picture data 40 shown.

[0109] Furthermore, when the computer device obtains the original picture data uploaded by the management terminal, it can extract the main color associated with the original picture data. It can be understood that the color space of the original picture data can be the initial color space. Among them, the color space here can be the RGB color space. The first color channel included in the initial color space can be the R channel, the second color channel can be the G channel, and the third color channel can be the B channel.

[0110] At this time, the computer device can obtain the pixel point filtering condition corresponding to the initial color space and obtain the total number of original pixel points in the original picture data. The pixel point filtering condition here can be used to instruct the computer device to perform preprocessing such as downsampling processing and filtering processing on the original picture data.

[0111] Among them, it can be understood that when the total number of original pixel points reaches the downsampling threshold (for example, 1 million) in the pixel point filtering condition, the computer device can perform downsampling processing on the original pixel points in the original picture data, and then can use the downsampled picture data composed of the downsampled original pixel points as the picture data to be filtered.

[0112] For example, when the total number of original pixels in the original picture data obtained by the computer device is 10 million, the computer device can determine the ratio between the total number and the downsampling threshold (e.g., 10), and then use this ratio as the downsampling factor. At this time, the computer device can perform downsampling processing (e.g., equidistant downsampling processing) on the original picture data based on this downsampling factor, and then use the downsampled picture data composed of the downsampled original pixels as the picture data to be filtered. For example, the computer device can extract one original pixel every 10 original pixel distances in the original picture data. In other words, the computer device can process an original picture data with a higher clarity (e.g., high definition) into a picture data to be filtered with a lower clarity (e.g., standard definition).

[0113] Optionally, when the total number of original pixels in the original picture data obtained by the computer device is 10 million, the computer device can determine the ratio between the total number and the downsampling threshold (e.g., 10), and then use this ratio as the downsampling factor. At this time, the computer device can perform downsampling processing (e.g., shrinking processing) on the picture size of the original picture data according to the downsampling factor, and then use the downsampled picture data composed of the downsampled original pixels as the picture data to be filtered. For example, the picture size of the original picture data can be A*B, and the picture size of the picture data to be filtered obtained after the downsampling processing by the computer device can be A / 10*B / 10.

[0114] Furthermore, since in the process of primary color extraction, the primary colors extracted by the computer device cannot be the colors with white attributes in the picture data, that is, the white that occupies too much of the picture background color, the computer device needs to filter this kind of color with white attributes from the picture data to be filtered. Among them, the performance of this kind of white in the RGB color space can be that the channel variable values of the three color channels are all very high, or the transparency is very low. It should be understood that the computer device can use the pixels in the picture data to be filtered as candidate filtering pixels. Among the candidate filtering pixels, the computer device can use the candidate filtering pixels that meet the pixel filtering conditions as target filtering pixels, and then perform filtering processing on the target filtering pixels in the picture data to be filtered, and use the picture data to be filtered after the filtering processing as the picture data for primary color extraction.

[0115] Among them, it can be understood that the computer device can use the pixel points in the picture data to be filtered as candidate filtering pixel points, and then can determine the transparency value of the candidate filtering pixel points, as well as the channel variable values corresponding to the first color channel (for example, the R channel), the second color channel (for example, the G channel), and the third color channel (for example, the B channel) of the candidate filtering pixel points in the initial color space. The transparency value here can indicate the value of the pixel point in terms of transparency (Alpha, abbreviated as a).

[0116] Among the candidate filtering pixel points, the computer device can select the candidate filtering pixel points whose transparency values are less than the first filtering threshold (for example, 0.05), and use the selected candidate filtering pixel points as target filtering pixel points that meet the pixel point filtering conditions. Alternatively, among the candidate filtering pixel points, the computer device selects the candidate filtering pixel points whose channel variable values of each color channel are all greater than the second filtering threshold (for example, 250), and uses the selected candidate filtering pixel points as target filtering pixel points that meet the pixel point filtering conditions. At this time, the computer device can perform filtering processing on the target filtering pixel points in the picture data to be filtered, and then can use the picture data after the filtering processing as the picture data for main color extraction.

[0117] For example, if the transparency value of the candidate filtering pixel point (for example, pixel point 1) in the picture data to be filtered is 0.03, the computer device can determine that the transparency value of the pixel point 1 is less than the first filtering threshold (for example, 0.05), and then can use the pixel point 1 as the target filtering pixel point.

[0118] For example, the color of the candidate filtering pixel point in the picture data to be filtered can be (253, 251, 255). Among them, 253 refers to the channel variable value of the candidate filtering pixel point on the R channel, 251 refers to the channel variable value of the candidate filtering pixel point on the G channel, and 255 refers to the channel variable value of the candidate filtering pixel point on the B channel. At this time, the computer device can determine that the channel variable values of the filtering pixel point on each color channel are all greater than 250 (i.e., the second filtering threshold), and then can use the candidate filtering pixel point as the target filtering pixel point.

[0119] Further, in order to reduce the dimension of the dominant color extraction, the computer device can extract pixel points from the picture data and convert the color space of the pixel points from the initial color space (e.g., RGB color space) to the target color space (e.g., HSB color space). It can be understood that the computer device obtains the first channel variable value of the pixel point on the first color channel, the second channel variable value of the pixel point on the second color channel, and the third channel variable value of the pixel point on the third color channel. Further, the computer device can obtain the conversion rule for converting the RGB color space to the HSB color space. Specifically, the conversion rule for converting the RGB color space to the HSB color space can be seen in the following formula (1):

[0120]

[0121] Where r refers to the first channel variable value of the pixel point on the R channel in the RGB color space, g refers to the second channel variable value of the pixel point on the G channel in the RGB color space, b refers to the third channel variable value of the pixel point on the B channel in the RGB color space, max refers to the maximum value among the three channel variable values of r, g, and b, and min refers to the minimum value among the three channel variable values of r, g, and b. H refers to the first variable value on the chroma of the HSB color space, S refers to the second variable value on the saturation of the HSB color space, and B refers to the third variable value on the brightness of the HSB color space.

[0122] It should be understood that the computer device can convert the color space of the pixel point from the RGB color space to the HSB color space through formula (1). Among them, it can be understood that the computer device can perform color conversion processing on the initial pixel value of the pixel point belonging to the initial color space (e.g., RGB color space) based on the first channel variable value, the second channel variable value, and the third channel variable value to obtain the pixel value of the pixel point in the target color space (e.g., HSB color space).

[0123] Step S102: Based on the quantization window corresponding to the first color dimension, uniformly quantize the first variable value of the pixel point to obtain m quantization sets associated with the pixel point.

[0124] Specifically, the computer device can obtain the maximum first variable value and the minimum first variable value based on the first variable value of the pixel point, and then can determine the variable value range composed of the minimum first variable value and the maximum variable value as the quantization interval of the pixel point. Further, the computer device can obtain the quantization window corresponding to the first color dimension and divide the quantization interval into m quantization sub-intervals associated with the pixel point. Among them, m can be a positive integer. It should be understood that the computer device can obtain quantization sub-interval X within the m quantization sub-intervalsi Here, i can be a positive integer less than or equal to m. Further, the computer device can obtain, from the pixel points in the picture data, the pixel points to be added to the quantization sub-interval X based on the first variable value of the pixel points. i Add the pixel points to be added to the quantization sub-interval X. i It can be understood that the computer device can use the added quantization sub-interval X i as the quantization set corresponding to the pixel points to be added. Until all the pixel points in the picture data are in the corresponding quantization sets, m quantization sets associated with the pixel points are obtained.

[0125] Among them, color quantization is a term in the picture compression algorithm, aiming to reduce the number of colors in the picture data and approximate the original picture as much as possible. Among them, color quantization can include uniform quantization, median cut quantization, octree quantization, K-Means quantization, etc. In order to reduce the color dimension of the color quantization process and improve the quantization efficiency in the embodiments of the present application, the computer device can perform uniform quantization processing on the first variable value of the pixel points in the picture data to obtain m quantization sets associated with the pixel points.

[0126] For example, in the HSB color space, the computer device can obtain the maximum first variable value (e.g., 299°) and the minimum first variable value (e.g., 0°) based on the first variable value (i.e., the variable value on chromaticity) of the pixel points in the picture data (e.g., the picture data 2a shown). At this time, the computer device can determine the variable value range composed of 0° and 299° as the quantization interval of the pixel points. Further, the computer device can obtain the quantization window corresponding to the first color dimension (e.g., 30°) and divide the quantization interval into 10 quantization sub-intervals associated with the pixel points. Figure 2 For example, the 10 quantization sub-intervals obtained by the computer device can specifically include quantization sub-interval X1[0°, 29°], quantization sub-interval X2[30°, 59°], quantization sub-interval X3[60°, 89°], quantization sub-interval X4[90°, 119°], quantization sub-interval X5[120°, 149°], quantization sub-interval X6[150°, 179°], quantization sub-interval X7[180°, 209°], quantization sub-interval X8[210°, 239°], quantization sub-interval X9[240°, 269°], and quantization sub-interval X

[0127] [270°, 299°]. 10

[0128] Further, the computer device can obtain the quantization sub-interval X within these 10 quantization sub-intervals. iHere, i can be a positive integer less than or equal to 10. At this time, the computer device can obtain the pixels to be added to the quantization sub-interval X from the pixels in the picture data based on the first variable value of the pixel points. i Add the pixels to be added to the quantization sub-interval X. i It can be understood that the computer device can use the added quantization sub-interval X i as the quantization set corresponding to the pixels to be added. Until all the pixels in the picture data are in the corresponding quantization sets, 10 quantization sets associated with the pixel points are obtained. For example, the added quantization sub-interval X1 can be used as quantization set 1, and so on. The added quantization sub-interval X 10 can be used as quantization set 10.

[0129] At this time, the computer device can also count the number of pixel points in each quantization set, so that when traversing and processing the m quantization sets later, it can quickly obtain the number of pixel points in each aggregation set, so as to quickly select the aggregation sets that meet the main color extraction conditions.

[0130] For example, in the embodiments of the present application, Matlab software can be used for color statistics, and thus a histogram can be obtained. For easy understanding, please refer to Figure 4b , Figure 4b which is a histogram for counting the number of pixel points provided in the embodiments of the present application. As Figure 4b shown, the picture data 40 in the embodiments of the present application can be the picture data 40 uploaded by the management terminal in the above Figure 4a .

[0131] It should be understood that the computer device can perform uniform quantization processing on the first variable value of the pixel points for the quantization window corresponding to the first color dimension (for example, chromaticity) of the pixel points in the picture data 40 in the target color space (for example, HSB color space), and then obtain the quantization sets associated with the pixel points. For example, the quantization sub-interval of quantization set 1 can be [0, 59], the quantization sub-interval of quantization set 2 can be [60, 119], the quantization sub-interval of quantization set 3 can be [120, 179], the quantization sub-interval of quantization set 4 can be [180, 239], and the quantization sub-interval of quantization set 5 can be [240, 299].

[0132] At this time, the computer device can use Matlab software to count the number of pixel points in each quantization set according to the interval length of the quantization sub-interval of the quantization set, and then generate a histogram as Figure 4b shown. Among them, the horizontal axis of the histogram can represent the value range on the first color dimension, and the vertical axis can represent the number of pixel points.

[0133] Step S103: Determine the sliding step of the sliding window based on the window size of the quantization window. Traverse the m quantization sets based on the sliding window and the sliding step to obtain n aggregation sets associated with the pixel points.

[0134] Specifically, the computer device can obtain the interval length composed of k quantization sets, and then use the interval length as the window size of the sliding window for dominant color extraction, and use the window size of the quantization window as the sliding step of the sliding window. Further, the computer device can traverse and obtain the k quantization sets covered by the sliding window from the m quantization sets based on the sliding window and the sliding step, and use the k quantization sets covered by the sliding window as the aggregation set Y. j Here, k can be a positive integer less than or equal to m; j can be a positive integer less than or equal to n. Until the k quantization sets covered by the sliding window include the m-th quantization set, the computer device can obtain n aggregation sets associated with the pixel points.

[0135] It should be understood that if the variable value range determined by the computer device based on the first variable value of the pixel point in the first color dimension of the target color space (for example, the chromaticity in the HSB color space) is a value range such as [30°, 270°], then the m quantization sets determined by the computer device do not form a circular structure. At this time, the number n of the aggregation sets determined by the computer device in the way of the sliding window can be equal to (m - k + 1). For ease of understanding, further, please refer to Figure 5a , Figure 5a which is a schematic diagram of a scenario for traversing and processing quantization sets provided by an embodiment of the present application. It should be understood that the quantization sets associated with the pixel points obtained by the computer device in the embodiment of the present application through uniform quantization processing can include m. The embodiment of the present application can take 7 quantization sets as an example, and these 7 quantization sets can specifically include quantization set 1, quantization set 2, quantization set 3, quantization set 4, quantization set 5, quantization set 6, and quantization set 7.

[0136] It should be understood that the computer device can obtain the interval length composed of k (for example, 2) quantization sets, use the interval length as the sliding size of the sliding window for dominant color extraction, and use the window size of the quantization window as the sliding step of the sliding window. It can be understood that Figure 5a the sliding window shown can have the function of covering 2 quantization sets, and each time it slides by one quantization window. The shape of the sliding window can be Figure 5a the quadrilateral shown.

[0137] Among them, during the process of traversing and processing these 7 quantization sets, when performing the first traversal and processing, the computer device can obtain 2 quantization sets covered by the sliding window from these 7 quantization sets. For example, quantization set 1 and quantization set 2. At this time, the computer device can use the quantization sets 1 and 2 covered by the sliding window as a new set, that is, aggregation set Y1. When performing the second traversal and processing, the computer device can slide the sliding window backward by the distance of one quantization window, and then can obtain 2 quantization sets covered by the slid sliding window. For example, quantization set 2 and quantization set 3. At this time, the computer device can use the quantization sets 2 and 3 covered by the sliding window as a new set, that is, aggregation set Y2. And so on. When performing the sixth traversal and processing, the computer device can continue to slide the sliding window backward by the distance of one quantization window, and then can obtain 2 quantization sets covered by the current sliding window. For example, quantization set 6 and quantization set 7. At this time, the computer device can use the quantization sets 6 and 7 covered by the sliding window as a new set, that is, aggregation set Y6.

[0138] It can be understood that when performing the sixth traversal and processing, quantization set 7 can be included in the 2 quantization sets covered by the current sliding window. Since the number of quantization sets associated with the pixel point is 7, at this time, the computer device can determine that the traversal is completed, and then can determine the 6 aggregation sets obtained after the traversal and processing as the aggregation sets associated with the pixel point. These 6 aggregation sets can specifically include: aggregation set Y1, aggregation set Y2, aggregation set Y3, aggregation set Y4, aggregation set Y5, and aggregation set Y6.

[0139] Optionally, if the variable value range determined by the computer device based on the first variable value of the pixel point in the first color dimension of the target color space (for example, the chroma in the HSB color space) is [0°, 360°], then the m quantization sets determined by the computer device can form a circular structure. At this time, the number n of aggregation sets determined by the computer device in the way of the sliding window can be equal to m. For easy understanding, further, please refer to Figure 5b , Figure 5b FIG. is a schematic diagram of a scenario for traversing and processing quantization sets provided by an embodiment of the present application. It should be understood that the quantization sets associated with the pixel point obtained by the computer device through uniform quantization processing can include m. Taking 8 quantization sets as an example in the embodiment of the present application, these 8 quantization sets can specifically include quantization set 1, quantization set 2, quantization set 3, quantization set 4, quantization set 5, quantization set 6, quantization set 7, and quantization set 8. As Figure 5bAs shown, these 8 quantization sets can form a circular structure.

[0140] It should be understood that the computer device can obtain the quantization degree (e.g., 90°) jointly formed by k (e.g., 2) quantization sets, use this quantization degree as the sliding size of the sliding window for primary color extraction, and can use the window size of the quantization window (e.g., 45°) as the sliding step of this sliding window. It can be understood that Figure 5b The sliding window shown can have the function of covering 2 quantization sets, and each time it slides by one quantization window. The shape of this sliding window can be a sector.

[0141] Among them, during the process of traversing and processing these 8 quantization sets, when performing the first traversal and processing, the computer device can obtain the 2 quantization sets covered by the sliding window from these 8 quantization sets. For example, quantization set 1 and quantization set 2. At this time, the computer device can use the quantization set 1 and quantization set 2 covered by the sliding window as a new set, that is, the aggregated set Y1. When performing the second traversal and processing, the computer device can slide the sliding window backward by the distance of one quantization window, and then can obtain the 2 quantization sets covered by the slid sliding window. For example, quantization set 2 and quantization set 3. At this time, the computer device can use the quantization set 2 and quantization set 3 covered by the sliding window as a new set, that is, the aggregated set Y2. And so on. Since these 8 quantization sets can form a circular structure as Figure 5b shown, therefore, when performing the eighth traversal and processing, the computer device can continue to slide the sliding window backward by the distance of one quantization window, and then can obtain the 2 quantization sets covered by the current sliding window. For example, quantization set 8 and quantization set 1. At this time, the computer device can use the quantization set 8 and quantization set 1 covered by the sliding window as a new set, that is, the aggregated set Y8.

[0142] It can be understood that when performing the eighth traversal and processing, the 2 quantization sets covered by the current sliding window can include quantization set 8. Since the number of quantization sets associated with the pixel point is 8, at this time, the computer device can determine that the traversal is completed, and then can determine the 8 aggregated sets obtained after the traversal and processing as the aggregated sets associated with the pixel point. These 8 aggregated sets can specifically include: aggregated set Y1, aggregated set Y2, aggregated set Y3, aggregated set Y4, aggregated set Y5, aggregated set Y6, aggregated set Y7, and aggregated set Y8.

[0143] It can be understood that the shape of the sliding window in the embodiments of the present application can also be other shapes, which are not limited herein. For example, the m quantization sets formed by the computer device can be polygons (e.g., regular hexagons). Among them, the shape of each quantization set can be an equilateral triangle. At this time, the sliding window can have the function of covering k quantization sets, that is, the shape of the sliding window can be a triangle.

[0144] It can be seen that since the sliding step of the sliding window can be the window size of a quantization window, when traversing and processing these quantization sets, similar colors will not be divided into different quantization sets. For example, the first variable value of a certain pixel point (e.g., pixel point a) is 200 and is added to quantization set 3 during uniform quantization processing, while the first variable value of another pixel point (e.g., pixel point b) is 201 and is added to quantization set 4 during uniform quantization processing, thus splitting these two similar colors of pixel point a and pixel point b into different quantization sets. Since in the embodiments of the present application, the quantization window can be traversed and processed based on the sliding window and the sliding step, pixel point a and pixel point b will eventually be traversed into an aggregation set (e.g., aggregation set Y3), so that when extracting the dominant color of the picture data subsequently, an aggregation set that more accurately meets the dominant color extraction conditions can be obtained.

[0145] Step S104, select an aggregation set that meets the dominant color extraction conditions from the n aggregation sets, determine the target pixel point in the aggregation set that meets the dominant color extraction conditions, obtain the second variable value of the target pixel point in the second color dimension of the target color space, and determine the dominant color of the picture data based on the second variable value of the target pixel point and the first variable value of the target pixel point.

[0146] Specifically, the computer device can use the aggregation set with the largest number of pixel points among the n aggregation sets as the aggregation set that meets the dominant color extraction conditions, and then determine the target pixel point in the aggregation set that meets the dominant color extraction conditions. Further, the computer device can obtain the second variable value of the target pixel point in the second color dimension of the target color space to determine the dominant color of the first color dimension of the picture data, and perform an averaging process on the second variable value of the target pixel point to obtain the variable average value, and then can determine the dominant color of the second color dimension of the picture data based on the variable average value. Among them, the dominant color of the first color dimension in the embodiments of the present application can refer to the dominant color extracted from the picture data in the first color dimension, for example, the dominant color hue, abbreviated as dominant color H. The dominant color of the second color dimension in the embodiments of the present application can refer to the dominant color extracted from the picture data in the second color dimension, for example, the dominant color saturation, abbreviated as dominant color S. At this time, the computer device can determine the dominant color of the picture data based on the dominant color of the first color dimension and the dominant color of the second color dimension.

[0147] It should be understood that the main color extraction condition in the embodiments of the present application can be used to instruct the computer device to obtain the aggregation set with the largest number of pixel points. Therefore, the computer device needs to obtain the number of pixel points in each aggregation set. It can be understood that the n aggregation sets obtained by the computer device may include the aggregation set Y j , and this aggregation set Y j may include a first quantization set and a second quantization set. Among them, in the aggregation set Y j , the computer device can obtain the number of pixel points in the statistically obtained first quantization set, and use the number of pixel points in the first quantization set as the first quantity; at the same time, the computer device can obtain the number of pixel points in the statistically obtained second quantization set, and use the number of pixel points in the second quantization set as the second quantity. Further, the computer device can perform an addition process on the first quantity and the second quantity, and use the total quantity after the addition process as the number of pixel points in the aggregation set Y j .

[0148] For example, Figure 5a the aggregation set Y1 shown may include quantization set 1 (i.e., the first quantization set) and quantization set 2 (i.e., the second quantization set). The computer device can obtain the number of pixel points in the statistically obtained quantization set 1 (for example, 3), and use the number of pixel points in quantization set 1 as the first quantity. At the same time, the computer device can also obtain the number of pixel points in the statistically obtained quantization set 2 (for example, 2), and use the number of pixel points in quantization set 2 as the second quantity. At this time, the computer device can perform an addition process on the first quantity and the second quantity, and further use the total quantity obtained after the addition process as the number of pixel points in the aggregation set Y1 (for example, 5).

[0149] Further, the computer device may use, among the n aggregated sets, the aggregated set with the largest number of pixel points as the aggregated set that meets the primary color extraction condition, and may use the aggregated set that meets the primary color extraction condition as the to-be-processed aggregated set. It can be understood that if the number of to-be-processed aggregated sets is one, the computer device may use the pixel points in the to-be-processed aggregated set as the target pixel points. For example, the aggregated set determined by the computer device that meets the primary color extraction condition may be Aggregated Set Y1. In this case, the computer device may use the pixel points in this Aggregated Set Y1 as the target pixel points. Optionally, if the number of to-be-processed aggregated sets is at least two, the computer device may use the pixel points in a randomly obtained to-be-processed aggregated set as the target pixel points. For example, the aggregated sets determined by the computer device that meet the primary color extraction condition may be three aggregated sets, namely Aggregated Set Y2, Aggregated Set Y5, and Aggregated Set Y7. Then, the computer device may randomly select one aggregated set from these three aggregated sets, and further may use the pixel points in the selected aggregated set as the target pixel points.

[0150] Further, the computer device may obtain the second variable value of the target pixel points on the second color dimension (e.g., saturation) of the target color space (e.g., HSB color space), and further may obtain the target pixel points with the largest second variable value, and use the obtained target pixel points as the to-be-processed pixel points. It can be understood that if the number of to-be-processed pixel points is one, the computer device may use the first variable value of the to-be-processed pixel points as the primary color of the first color dimension of the picture data (e.g., primary color H).

[0151] For example, the computer device may obtain the second variable values of the target pixel points (e.g., pixel point a, pixel point b, pixel point c, and pixel point d) on the saturation of the HSB color space. For instance, the second variable value of pixel point a may be 72%, the second variable value of pixel point b may be 50%, the second variable value of pixel point c may be 60%, and the second variable value of pixel point d may be 15%. In this case, the computer device may obtain the pixel point with the largest second variable value (e.g., pixel point a), use this pixel point a as the to-be-processed pixel point, and further may use the first variable value of pixel point a (i.e., the variable value on the chromaticity, e.g., 252°) as the primary color of the first color dimension of the picture data.

[0152] If the number of to-be-processed pixel points is at least two, the computer device may perform an averaging process on the first variable values of the at least two to-be-processed pixel points, and use the average value obtained after the averaging process as the primary color of the first color dimension of the picture data. Optionally, if the number of to-be-processed pixel points is at least two, the computer device may randomly select the first variable value of one to-be-processed pixel point as the primary color of the first color dimension of the picture data.

[0153] For example, the pixel points to be processed obtained by the computer device can be pixel point a and pixel point b. Among them, the first variable value of pixel point a can be 232°, and the second variable value can be 70%. The first variable value of pixel point b can be 234°, and the second variable value can be 70%. At this time, the computer device can perform an averaging process on the first variable value of pixel point a (for example, 232°) and the first variable value of pixel point b (for example, 234°), and can use the average value obtained after the averaging process (for example, 233°) as the main color of the first color dimension of the picture data. Optionally, the computer device can also randomly select the first variable value of a pixel point to be processed (for example, the first variable value 232° of pixel point a) as the main color of the first color dimension of the picture data.

[0154] Furthermore, the computer device can perform an averaging process on the second variable value of the target pixel point to obtain an average variable value, and then can determine the main color of the second color dimension of the picture data (for example, main color S) based on the average variable value. It can be understood that if the average variable value is less than or equal to the main color threshold (for example, 40%), the computer device can use the average variable value as the main color of the second color dimension of the picture data; if the average variable value is greater than the main color threshold, the computer device can use the main color threshold as the main color of the second color dimension of the picture data to prevent the color from being too vivid.

[0155] For example, when the average variable value determined by the computer device is 30%, that is, less than the main color threshold (for example, 40%). The computer device can use 30% as the main color of the second color dimension of the picture data. When the average variable value determined by the computer device is 60%, that is, greater than the main color threshold (for example, 40%). The computer device can use 40% as the main color of the second color dimension of the picture data.

[0156] At this time, the computer device can determine the main color of the picture data based on the main color of the first color dimension and the main color of the second color dimension in the target color space (for example, HSB color space).

[0157] Optionally, the picture data processing method in the embodiments of the present application is also applicable in other color spaces. For example, in order to reduce the dimension of main color extraction, the computer device can also convert the color space of the picture data for main color extraction from the RGB color space (i.e., the initial color space) to the grayscale color space (i.e., the target color space), and perform main color extraction on the picture data in the grayscale color space. It can be understood that the computer device obtains the conversion rule for converting the RGB color space to the grayscale color space. Specifically, the conversion rule for converting the RGB color space to the grayscale color space can be referred to the following formula (2):

[0158] Gray = r * 0.299 + g * 0.587 + b * 0.114, (2)

[0159] Where Gray can be the grayscale value of a pixel in the grayscale color space, r is the first channel variable value of the pixel on the R channel in the RGB color space, g is the second channel variable value of the pixel on the G channel in the RGB color space, and b is the third channel variable value of the pixel on the B channel in the RGB color space.

[0160] It should be understood that the computer device can convert the color space of a pixel into the grayscale color space through formula (2). Among them, it can be understood that the computer device can perform color conversion processing on the initial pixel value of a pixel belonging to the initial color space (for example, the RGB color space) based on the first channel variable value, the second channel variable value, and the third channel variable value, to obtain the pixel value (i.e., the grayscale value) of the pixel in the target color space (for example, the grayscale color space).

[0161] At this time, the computer device can obtain a quantization window associated with the grayscale value, and then can perform uniform quantization processing on the grayscale value of the pixel, so as to obtain multiple (for example, m1) quantization sets associated with the pixel. Among them, m1 can be a positive integer. Further, the computer device can determine the sliding step of the sliding window based on the window size of the quantization window. Based on the sliding window and the sliding step, it can traverse these m1 quantization sets to obtain multiple (for example, n1) aggregation sets associated with the pixel. Among them, n1 can be a positive integer. The sliding window has the function of covering k1 quantization sets, where k1 can be a positive integer less than or equal to m1. n1 is equal to (m1 - k1 + 1). Further, the computer device can select an aggregation set that meets the main color extraction condition among the n1 aggregation sets, determine the target pixel point in the aggregation set that meets the main color extraction condition, and then can determine the main color of the picture data based on the grayscale value of the target pixel point in the grayscale color space. For example, the computer device can perform an average process on the grayscale value of the target pixel point, and perform color conversion processing on the average grayscale value obtained after the average process to convert the average grayscale value into a pixel value in the RGB color space. At this time, the computer device can determine the converted pixel value as the main color of the picture data.

[0162] Optionally, the computer device can also directly extract the dominant color from the picture data in the RGB color space. It can be understood that the computer device can obtain the pixel values of the pixels in the picture data in the RGB color space, and determine the first variable value of the pixel on the first color channel (for example, the R channel) of the RGB color space. At this time, the computer device can obtain the quantization window associated with the R channel, and then can perform uniform quantization processing on the first variable value of the pixel, so as to obtain multiple (for example, m2) quantization sets associated with the pixel. Wherein, m2 can be a positive integer. Further, the computer device can determine the sliding step of the sliding window based on the window size of the quantization window. Based on the sliding window and the sliding step, it can traverse these m2 quantization sets to obtain multiple (for example, n2) aggregation sets associated with the pixel. Wherein, n2 can be a positive integer. The sliding window has the function of covering k2 quantization sets, where k2 can be a positive integer less than or equal to m2. n2 is equal to (m2 - k2 + 1). Further, the computer device can select the aggregation sets that meet the dominant color extraction conditions from the n2 aggregation sets, determine the target pixels in the aggregation sets that meet the dominant color extraction conditions, and then can determine the first dominant color (for example, dominant color R) of the picture data based on the first variable value of the target pixels in the RGB color space. For example, the computer device can perform an average process on the first variable value of the target pixels and use the average value after the average process as the first dominant color of the picture data.

[0163] Meanwhile, the computer device can also determine the second dominant color (for example, dominant color G) of the picture data based on the second variable value of the pixels in the picture data on the second color channel (for example, the G channel) of the RGB color space. Similarly, the computer device can also determine the third dominant color (for example, dominant color B) of the picture data based on the third variable value of the pixels in the picture data on the third color channel (for example, the B channel) of the RGB color space. The specific implementation manners for the computer device to determine the second and third dominant colors can refer to the specific implementation manner for the computer device to determine the first dominant color, and will not be elaborated here. Further, the computer device can determine the dominant color of the picture data based on the first dominant color, the second dominant color, and the third dominant color.

[0164] Among them, in order to reduce the dimension of main color extraction, the computer device in the embodiments of the present application can convert the color space of the image data from the initial color space (e.g., RGB color space) to the target color space (e.g., HSB color space or grayscale color space). Then, in this target color space, multiple aggregation sets can be obtained by aggregating in the first color dimension (e.g., chromaticity) in the way of a sliding window, thus improving the efficiency of subsequent main color extraction of picture data. In addition, when the computer device traverses the obtained quantization set through the sliding window, it can accurately determine the target pixel points in the aggregation sets that meet the main color extraction conditions, and thus can improve the accuracy of the computer device in main color extraction of picture data.

[0165] Further, please refer to Figure 6 , Figure 6 which is a schematic flowchart of a picture data processing method provided by an embodiment of the present application. As Figure 6 shown, this method can be executed by a computer device with the function of main color extraction. This computer device can be a user terminal (e.g., the user terminal 100a shown above Figure 1 ), or a server (e.g., the server 10 shown above Figure 1 ), which is not limited herein. For ease of understanding, an embodiment of the present application takes this method being executed by the server as an example for description. This method can at least include the following steps S201 - step S208:

[0166] Step S201: Based on the pixel values of the pixel points in the picture data in the target color space, determine the first variable value of the pixel points in the first color dimension of the target color space.

[0167] Step S202: Based on the quantization window corresponding to the first color dimension, perform uniform quantization processing on the first variable value of the pixel points to obtain m quantization sets associated with the pixel points.

[0168] Step S203: Determine the sliding step of the sliding window based on the window size of the quantization window. Based on the sliding window and the sliding step, traverse the m quantization sets to obtain n aggregation sets associated with the pixel points.

[0169] Step S204: Select the aggregation sets that meet the main color extraction conditions from the n aggregation sets, determine the target pixel points in the aggregation sets that meet the main color extraction conditions, obtain the second variable value of the target pixel points in the second color dimension of the target color space, and determine the main color of the picture data based on the second variable value of the target pixel points and the first variable value of the target pixel points.

[0170] Among them, the specific implementation manners of steps S201 - S204 can be referred to the aboveFigure 3 The descriptions of steps S101 - S104 in the corresponding embodiments will not be elaborated here.

[0171] Step S205: Based on the component types included in the display interface of the user terminal, take the variable value configured for the component type as the third variable value on the third color dimension in the target color space, and based on the third variable value and the dominant color of the picture data, obtain the background color corresponding to the component type.

[0172] Specifically, the computer device can determine the display interface in the user terminal for displaying picture data. Among them, the display interface can include multiple component types. Specifically, it can include: page components, card components, button components, and text components, etc. Further, the computer device can take the variable value configured for the component type as the third variable value on the third color dimension (such as brightness) in the target color space (such as the HSB color space), and then based on the third variable value and the dominant color of the picture data, obtain the background color corresponding to the component type.

[0173] It should be understood that the computer device can set different component colors by adjusting the brightness value. Since the text component is above other components, a larger brightness value needs to be set to be seen more clearly, while the page component is at the bottom of other components, so a smaller brightness value needs to be set. For example, the variable value configured by the computer device for the page component can be B40 (i.e., 40% brightness value), the variable value configured for the card component can be B50 (i.e., 50% brightness value), the variable value configured for the button component can be B60 (i.e., 60% brightness value), and the variable value configured for the text component can be B90 (i.e., 90% brightness value).

[0174] Further, the computer device can obtain the background color corresponding to the component type based on the third variable value and the dominant color of the picture data. For example, the main color of the first color dimension (such as the main color hue) in the dominant color of the picture data extracted by the computer device is 260°, and the main color of the second color dimension (such as the saturation main color) is 30%. At this time, the background color of the page component can be (260, 30, 40), the background color of the card component can be (260, 30, 50), the background color of the button component can be (260, 30, 60), and the background color of the text component can be (260, 30, 90).

[0175] Step S206: Send the background colors corresponding to the component types to the management terminal respectively, so that the management terminal outputs the background colors corresponding to the component types on the main color extraction interface of the management terminal.

[0176] Specifically, the computer device can send the background colors corresponding to the component types to the management terminal having a network connection with the computer device. At this time, the management terminal can output the background colors corresponding to the component types in the main color extraction interface of the management terminal.

[0177] It should be understood that when the management terminal uploads the picture data for main color extraction, the computer device can perform main color extraction on the picture data respectively through various main color extraction methods included in the main color extraction interface, obtain the main color of the picture data, and can send the background color of the corresponding component determined based on the main color to the management terminal. The main color extraction methods herein can specifically include Method 1 (for example, the method for main color extraction based on a sliding window provided in the embodiments of the present application), Method 2 (for example, the method for main color extraction based on median cut quantization), Method 3 (for example, the method for main color extraction based on octree quantization), and Method 4 (for example, a custom method).

[0178] It can be understood that the management user corresponding to the management terminal can view the display effects of the background colors of the corresponding components obtained by multiple main color extraction methods on the display interface of the user terminal in the main color extraction interface of the management terminal. Among them, the management user can trigger an operation on the preview control in the main color extraction interface, so that the management terminal can respond to the trigger operation and output the display effects corresponding to multiple main color extraction methods in a preview sub-interface independent of the main color extraction interface, so that the management user can select a reasonable display effect. Among them, the preview sub-interface can be a display interface superimposed on the main color extraction interface (such as a floating window or a pop-up window), and the interface size of the preview sub-interface is smaller than the interface size of the main color extraction interface, so as to reduce the occlusion of the display data in the main color extraction interface. The display data in the main color extraction interface and the display data in the preview sub-interface are independent of each other.

[0179] For ease of understanding, further, please refer to Figure 7 , Figure 7 which is a schematic diagram of a scenario for previewing and displaying effects provided by the embodiments of the present application. As Figure 7 shown, the main color extraction interface 700 in the embodiments of the present application can be the display interface corresponding to the management terminal, and the management terminal can be the management terminal 110x shown above. Figure 1 shown.

[0180] As Figure 7As shown, the color matching area in the main color extraction interface 700 can be used to select the main color extraction method. Among them, there can be multiple main color extraction methods. Here, taking 4 as an example, specifically, it can include Method 1 (for example, the method for extracting the main color based on a sliding window provided in the embodiments of the present application), Method 2 (for example, the method for extracting the main color based on median cut quantization), Method 3 (for example, the method for extracting the main color based on octree quantization), and Method 4 (for example, a custom method).

[0181] It should be understood that when the management terminal uploads the picture data for main color extraction, the computer device can respectively perform main color extraction on the picture data through these 4 main color extraction methods included in the main color extraction interface 700 to obtain the main color of the picture data, and then can send the background color of the corresponding component determined based on the main color to Figure 7 the management terminal shown.

[0182] It can be understood that the management user corresponding to the management terminal can view the display effects of the background colors of the corresponding components obtained by multiple main color extraction methods on the display interface of the user terminal in the main color extraction interface 700 of the management terminal. As Figure 7 shown, the management user can trigger an operation on the preview control in the main color extraction interface 700, so that the management terminal can respond to the trigger operation and output the display effects corresponding to multiple main color extraction methods on the preview sub-interface 710 independent of the main color extraction interface 700, so that the management user can select a reasonable display effect.

[0183] Among them, the preview sub-interface 710 can be a display interface (such as a floating window or a pop-up window) superimposed on the main color extraction interface 700, and the interface size of the preview sub-interface 710 is smaller than the interface size of the main color extraction interface 700, so as to reduce the occlusion of the display data in the main color extraction interface 700. Among them, the display data in the main color extraction interface 700 and the display data in the preview sub-interface 710 are independent of each other.

[0184] It can be understood that the display effects displayed in the preview sub-interface 710 can include the display effects associated with Method 1 (for example, Figure 7 the display effect 1 shown), the display effects associated with Method 2 (for example, Figure 7 the display effect 2 shown), and the display effects associated with Method 3 (for example, Figure 7 the display effect 3 shown). At this time, the management user can select a reasonable display effect in the preview sub-interface 710 and for the service determination control in the preview sub-interface 710 (for example, Figure 7Execute a trigger operation on the "OK" control shown, so that the main color extraction method corresponding to the display effect (for example, Method 1) can be used as the main color extraction method selected in the color matching area. At this time, the management terminal can display the background color of the corresponding component type determined according to Method 1 in the display area of the corresponding component type in the main color extraction interface 700.

[0185] Step S207, when receiving a service audit request sent by the management terminal, send the service audit request to the audit terminal, so that the audit terminal audits the background color of the corresponding component type.

[0186] It should be understood that the management user of the management terminal can perform a trigger operation on the service audit control in the main color extraction interface (for example, Figure 7 The "Submit for Audit" control in the main color extraction interface shown), so that the management terminal can respond to the trigger operation, and then can generate a service audit request based on the background color of the corresponding component type in the main color extraction interface. At this time, the management terminal can send the service audit control request to the audit terminal, so that the audit terminal audits the background color of the corresponding component type.

[0187] For ease of understanding, further, please refer to Figure 8 , Figure 8 is a schematic diagram of a scenario for auditing the background color provided by an embodiment of the present application. As Figure 8 shown, the management terminal 8x in the embodiment of the present application can be the above-mentioned Figure 1 shown management terminal 110x, and the audit terminal 8y in the embodiment of the present application can be the above-mentioned Figure 1 shown audit terminal 120y.

[0188] As Figure 8 shown, the management user corresponding to the management terminal 8x can select a main color extraction method for immersive experience design on the main color extraction interface 800. Among them, the management user can perform a trigger operation on the Figure 8 shown color matching area, so that the management terminal 8x can respond to the trigger operation and output a drop-down list associated with the main color extraction method. Among them, the drop-down list can include multiple main color extraction methods, for example, Method 1, Method 2, Method 3, and a custom method.

[0189] As Figure 8As shown, the management user can select the main color extraction method corresponding to Method 1 to extract the main color of the picture data 80, so as to obtain the background color of the corresponding component type. Then, in the display area of the corresponding component type in the main color extraction interface 800, the background color of the corresponding component type can be displayed. For example, the page background color, the background color of the jump card, and the background color of the jump button. At this time, the management user can perform a trigger operation on the business review control in the main color extraction interface 800 (for example, Figure 8 the "Submit for Review" control in the main color extraction interface shown) to make the management terminal 8x respond to the trigger operation, and then a business review request can be generated based on the background color of the corresponding component type in the main color extraction interface 800. At this time, the management terminal 8x can send the business review control request to the review terminal 8y, so that the review terminal 8y can review the background color of the corresponding component type.

[0190] When the review user corresponding to the review terminal 8y determines that the review fails, the review terminal 8y can generate a review failure prompt message and forward the review failure prompt message to the management terminal 8x by the computer device, so that the management user corresponding to the management terminal 8x can modify the selected main color extraction method based on the review failure prompt message. For example, the management user can select a custom method in the color matching area to re-modify the obtained background color of the corresponding component type until the review user corresponding to the review terminal 8y determines that the review is successful.

[0191] When the review user corresponding to the review terminal 8y determines that the review is successful, the review terminal 8y can generate a review success prompt message and forward the review success prompt message to the management terminal 8x by the computer device to notify the management user of the management terminal 8x that the selected background color has passed the review.

[0192] Step S208, when the review terminal reviews successfully, send the background color of the corresponding component type to the user terminal so that the user terminal can display the background color of the corresponding component type on the display interface.

[0193] Specifically, when the application client running on the user terminal responds to the user's trigger operation to output the display interface of the picture data, the computer device can send the background color of the corresponding component type that the review terminal has reviewed successfully to the user terminal. At this time, the user terminal can display the background color of the corresponding component type on the display interface of the application client.

[0194] For ease of understanding, further, please refer to Figure 9 , Figure 9 which is a schematic diagram of a scenario for displaying a display interface provided by an embodiment of the present application. As Figure 9As shown, the application display interface 900 in the embodiments of the present application may be the display interface of a user terminal (e.g., user terminal 90) running an application client. The user terminal 90 may be any one of the user terminals in the user terminal cluster shown above Figure 1 , for example, user terminal 100a. The user corresponding to the user terminal 90 may be Figure 9 the target user shown above.

[0195] It should be understood that when the target user performs a trigger operation on the "Game" control in the application display interface 900 of the user terminal 90, the user terminal 90 may respond to the trigger operation and switch the display interface of the user terminal 90 from the application display interface 900 to Figure 9 the home page display interface 910 shown above. Among them, the home page display interface 910 may include a "Game Circle" control. It can be understood that the target user may perform a trigger operation on the "Game Circle" control, so that the user terminal 90 can respond to the trigger operation and obtain display data associated with game picture data from a computer device having a network connection with the user terminal 90. The game picture data may be picture data for primary color extraction. The computer device may send the background color of the corresponding component type that has been successfully audited by the audit terminal to the user terminal 90. The background color of the corresponding component type is determined by the primary color extracted by the computer device through the primary color extraction method provided in the embodiments of the present application.

[0196] When the user terminal 90 obtains the display data associated with the game picture data, it may switch the display interface of the user terminal 90 from the home page display interface 910 to a display interface (e.g., Figure 9 the display interface 920 shown above) for displaying the game picture data (picture data for primary color extraction), thereby bringing a better visual experience to the user.

[0197] Further, please refer to Figure 10 , Figure 10 which is a schematic structural diagram of a picture data processing device provided in the embodiments of the present application. As Figure 10 shown, the picture data processing device 1 may be a computer program (including program code) running in a computer device. For example, the picture data processing device 1 is an application software; the picture data processing device 1 may be used to execute the corresponding steps in the method provided in the embodiments of the present application. As Figure 10As shown, the picture data processing device 1 can run on a computer device with a main color extraction function. The picture data processing device 1 may include: a variable value determination module 11, a quantization processing module 12, a traversal processing module 13, a picture main color determination module 14, a picture acquisition module 15, a preprocessing module 16, a pixel point extraction module 17, a color conversion processing module 18, a first quantity determination module 19, a second quantity determination module 20, an addition processing module 21, a background color determination module 22, a background color sending module 23, an audit request sending module 24, and a background color distribution module 25.

[0198] The variable value determination module 11 is configured to determine a first variable value of a pixel point on a first color dimension of a target color space based on a pixel value of the pixel point in the target color space within picture data.

[0199] The quantization processing module 12 is configured to perform uniform quantization processing on the first variable value of the pixel point based on a quantization window corresponding to the first color dimension to obtain m quantization sets associated with the pixel point; m is a positive integer.

[0200] Among them, the quantization processing module 12 includes: a quantization interval determination unit 121, a division unit 122, an addition unit 123, and a quantization set determination unit 124.

[0201] The quantization interval determination unit 121 is configured to obtain a maximum first variable value and a minimum first variable value based on the first variable value of the pixel point, and determine a variable value range composed of the minimum first variable value and the maximum variable value as a quantization interval of the pixel point.

[0202] The division unit 122 is configured to obtain a quantization window corresponding to the first color dimension, divide the quantization interval into m quantization sub-intervals associated with the pixel point, and obtain a quantization sub-interval X within the m quantization sub-intervals i ; i is a positive integer less than or equal to m;

[0203] The addition unit 123 is configured to obtain a pixel point to be added to the quantization sub-interval X based on the first variable value of the pixel point from the pixel points in the picture data, and add the pixel point to be added to the quantization sub-interval X i ; i ;

[0204] The quantization set determination unit 124 is configured to use the added quantization sub-interval X i as a quantization set corresponding to the pixel point to be added. Until all pixel points in the picture data are in the corresponding quantization sets, m quantization sets associated with the pixel point are obtained.

[0205] Among them, for the specific implementation manners of the quantization interval determination unit 121, the division unit 122, the addition unit 123, and the quantization set determination unit 124, reference can be made to the description of step S102 in the corresponding embodiment above, and details will not be elaborated here. Figure 3 The description of step S102 in the corresponding embodiment will not be elaborated here.

[0206] The traversal processing module 13 is configured to determine the sliding step of the sliding window based on the window size of the quantization window, and perform traversal processing on m quantization sets based on the sliding window and the sliding step to obtain n aggregation sets associated with the pixel points; n is a positive integer; the sliding window has the function of covering k quantization sets; k is a positive integer less than or equal to m; and n is equal to (m - k + 1).

[0207] Among them, the traversal processing module 13 includes: a sliding window determination unit 131, a traversal processing unit 132, and an aggregation set determination unit 133.

[0208] The sliding window determination unit 131 is configured to obtain the interval length formed by k quantization sets, use the interval length as the window size of the sliding window for dominant color extraction, and use the window size of the quantization window as the sliding step of the sliding window;

[0209] The traversal processing unit 132 is configured to traverse and obtain k quantization sets covered by the sliding window from m quantization sets based on the sliding window and the sliding step, and use the k quantization sets covered by the sliding window as the aggregation set Y j ; j is a positive integer less than or equal to n;

[0210] The aggregation set determination unit 133 is configured to, until the k quantization sets covered by the sliding window include the mth quantization set, obtain (m - k + 1) aggregation sets, and determine the (m - k + 1) aggregation sets as the n aggregation sets associated with the pixel points.

[0211] Among them, for the specific implementation manners of the sliding window determination unit 131, the traversal processing unit 132, and the aggregation set determination unit 133, reference can be made to the description of step S103 in the corresponding embodiment above, and details will not be elaborated here. Figure 3 The description of step S103 in the corresponding embodiment will not be elaborated here.

[0212] The picture dominant color determination module 14 is configured to select the aggregation sets that meet the dominant color extraction conditions from the n aggregation sets, determine the target pixel points in the aggregation sets that meet the dominant color extraction conditions, obtain the second variable value of the target pixel points in the second color dimension of the target color space, and determine the dominant color of the picture data based on the second variable value and the first variable value of the target pixel points.

[0213] Among them, the main color determination module 14 of the picture includes: a target pixel determination unit 141, a first-dimension main color determination unit 142, a second-dimension main color determination unit 143, and a picture main color determination unit 144.

[0214] The target pixel determination unit 141 is configured to, among n aggregation sets, use the aggregation set with the largest number of pixel points as the aggregation set that meets the main color extraction condition, and determine target pixels in the aggregation set that meets the main color extraction condition.

[0215] Among them, the target pixel determination unit 141 includes: a to-be-processed aggregation set determination subunit 1411, a third determination subunit 1412, and a fourth determination subunit 1413.

[0216] The to-be-processed aggregation set determination subunit 1411 is configured to, among n aggregation sets, use the aggregation set with the largest number of pixel points as the aggregation set that meets the main color extraction condition, and use the aggregation set that meets the main color extraction condition as the to-be-processed aggregation set;

[0217] The third determination subunit 1412 is configured to, if the number of to-be-processed aggregation sets is one, use the pixels in the to-be-processed aggregation set as target pixels;

[0218] The fourth determination subunit 1413 is configured to, if the number of to-be-processed aggregation sets is at least two, use the pixels in the randomly obtained to-be-processed aggregation set as target pixels.

[0219] Among them, the specific implementation manners of the to-be-processed aggregation set determination subunit 1411, the third determination subunit 1412, and the fourth determination subunit 1413 can refer to the description of the target pixels in the corresponding embodiments above Figure 3 and will not be elaborated here.

[0220] The first-dimension main color determination unit 142 is configured to obtain the second variable value of the target pixel in the second color dimension of the target color space and determine the main color of the first color dimension of the picture data.

[0221] Among them, the first-dimension main color determination unit 142 includes: a to-be-processed pixel determination subunit 1421, a fifth determination subunit 1422, and a sixth determination subunit 1423.

[0222] The to-be-processed pixel determination subunit 1421 is configured to obtain the second variable value of the target pixel in the second color dimension of the target color space, obtain the target pixel with the largest second variable value, and use the obtained target pixel as the to-be-processed pixel;

[0223] The fifth determination subunit 1422 is configured to use the first variable value of the pixel point to be processed as the primary color of the first color dimension of the picture data if the number of pixel points to be processed is one.

[0224] The sixth determination subunit 1423 is configured to use the average value obtained by averaging the first variable values of at least two pixel points to be processed as the primary color of the first color dimension of the picture data if the number of pixel points to be processed is at least two.

[0225] Wherein, for the specific implementation manners of the pixel point to be processed determination subunit 1421, the fifth determination subunit 1422, and the sixth determination subunit 1423, reference may be made to the description of the primary color of the first color dimension in the corresponding embodiments above, which will not be elaborated here. Figure 3 The description of the primary color of the first color dimension in the corresponding embodiments above will not be elaborated here.

[0226] The second dimension primary color determination unit 143 is configured to average the second variable values of the target pixel points to obtain an average variable value, and determine the primary color of the second color dimension of the picture data based on the average variable value.

[0227] Wherein, the second dimension primary color determination unit 143 includes: an averaging processing subunit 1431, a seventh determination subunit 1432, and an eighth determination subunit 1433.

[0228] The averaging processing subunit 1431 is configured to average the second variable values of the target pixel points to obtain an average variable value.

[0229] The seventh determination subunit 1432 is configured to use the average variable value as the primary color of the second color dimension of the picture data if the average variable value is less than or equal to the primary color threshold.

[0230] The eighth determination subunit 1433 is configured to use the primary color threshold as the primary color of the second color dimension of the picture data if the average variable value is greater than the primary color threshold.

[0231] Wherein, for the specific implementation manners of the averaging processing subunit 1431, the seventh determination subunit 1432, and the eighth determination subunit 1433, reference may be made to the description of the primary color of the second color dimension in the corresponding embodiments above, which will not be elaborated here. Figure 3 The description of the primary color of the second color dimension in the corresponding embodiments above will not be elaborated here.

[0232] The picture primary color determination unit 144 is configured to determine the primary color of the picture data based on the primary color of the first color dimension and the primary color of the second color dimension.

[0233] Wherein, for the specific implementation manners of the target pixel point determination unit 141, the first dimension primary color determination unit 142, the second dimension primary color determination unit 143, and the picture primary color determination unit 144, reference may be made to the corresponding embodiments above. Figure 3The description of step S104 in the corresponding embodiment will not be elaborated here.

[0234] The picture acquisition module 15 is used to acquire the original picture data uploaded by the management terminal; the original picture data is the game picture data selected by the management terminal in response to the trigger operation for the main color extraction interface; the color space corresponding to the game picture data is the initial color space; the initial color space includes a first color channel, a second color channel, and a third color channel.

[0235] The preprocessing module 16 is used to preprocess the original pixel points of the original picture data based on the pixel point filtering condition corresponding to the initial color space, and use the preprocessed original picture data as the picture data for main color extraction.

[0236] Among them, the preprocessing module 16 includes: a filtering condition acquisition unit 161, a downsampling processing unit 162, and a filtering processing unit 163.

[0237] The filtering condition acquisition unit 161 is used to acquire the pixel point filtering condition corresponding to the initial color space, and acquire the total number of original pixel points in the original picture data.

[0238] The downsampling processing unit 162 is used to perform downsampling processing on the original pixel points in the original picture data when the total number of the original pixel points reaches the downsampling threshold in the pixel point filtering condition, and use the downsampled picture data composed of the downsampled original pixel points as the picture data to be filtered.

[0239] The filtering processing unit 163 is used to use the pixel points in the picture data to be filtered as candidate filtering pixel points. Among the candidate filtering pixel points, the candidate filtering pixel points that meet the pixel point filtering condition are used as target filtering pixel points, and the target filtering pixel points in the picture data to be filtered are filtered, and the filtered picture data to be filtered is used as the picture data for main color extraction.

[0240] Among them, the filtering processing unit 163 includes: a candidate filtering pixel point determination subunit 1631, a first determination subunit 1632, a second determination subunit 1633, and a filtering processing subunit 1634.

[0241] The candidate filtering pixel point determination subunit 1631 is used to use the pixel points in the picture data to be filtered as candidate filtering pixel points, determine the transparency value of the candidate filtering pixel points, and the channel variable values corresponding to the first color channel, the second color channel, and the third color channel of the candidate filtering pixel points in the initial color space respectively.

[0242] The first determination subunit 1632 is configured to select, from the candidate filtered pixel points, the candidate filtered pixel points whose transparency values are less than the first filtering threshold, and use the selected candidate filtered pixel points as the target filtered pixel points that meet the pixel point filtering condition; or,

[0243] The second determination subunit 1633 is configured to select, from the candidate filtered pixel points, the candidate filtered pixel points whose channel variable values of each color channel are greater than the second filtering threshold, and use the selected candidate filtered pixel points as the target filtered pixel points that meet the pixel point filtering condition;

[0244] The filtering processing subunit 1634 is configured to perform filtering processing on the target filtered pixel points in the picture data to be filtered, and use the picture data to be filtered after the filtering processing as the picture data for main color extraction.

[0245] Among them, for the specific implementation manners of the candidate filtered pixel point determination subunit 1631, the first determination subunit 1632, the second determination subunit 1633, and the filtering processing subunit 1634, reference can be made to the description of filtering the picture data to be filtered in the corresponding embodiments above, and details will not be elaborated here. Figure 3 For the specific implementation manners of the filtering condition obtaining unit 161, the downsampling processing unit 162, and the filtering processing unit 163, reference can be made to the description of preprocessing the original picture data in the corresponding embodiments above, and details will not be elaborated here.

[0246] Among them, for the specific implementation manners of the filtering condition obtaining unit 161, the downsampling processing unit 162, and the filtering processing unit 163, reference can be made to the description of preprocessing the original picture data in the corresponding embodiments above, and details will not be elaborated here. Figure 3 For the specific implementation manners of the filtering condition obtaining unit 161, the downsampling processing unit 162, and the filtering processing unit 163, reference can be made to the description of preprocessing the original picture data in the corresponding embodiments above, and details will not be elaborated here.

[0247] The pixel point extraction module 17 is configured to extract pixel points from the picture data, obtain the first channel variable value of the pixel points on the first color channel, the second channel variable value of the pixel points on the second color channel, and the third channel variable value of the pixel points on the third color channel;

[0248] The color conversion processing module 18 is configured to perform color conversion processing on the initial pixel values of the pixel points belonging to the initial color space based on the first channel variable value, the second channel variable value, and the third channel variable value, to obtain the pixel values of the pixel points in the target color space.

[0249] Among them, the n aggregation sets include the aggregation set Y j ; the aggregation set Y j includes a first quantization set and a second quantization set;

[0250] The first quantity determination module 19 is configured to obtain, in the aggregation set Y j the counted number of pixel points in the first quantization set, and use the number of pixel points in the first quantization set as the first quantity;

[0251] The second quantity determination module 20 is configured to obtain the number of pixel points in the statistically counted second quantization set, and use the number of pixel points in the second quantization set as the second quantity;

[0252] The addition processing module 21 is configured to perform an addition process on the first quantity and the second quantity, and use the total quantity after the addition process as the number of pixel points in the aggregation set Y j in.

[0253] The background color determination module 22 is configured to, based on the component types included in the display interface of the user terminal, use the variable value configured for the component type as the third variable value on the third color dimension in the target color space, and obtain the background color corresponding to the component type based on the third variable value and the main color of the picture data; the display interface is a display interface for displaying the picture data;

[0254] The background color sending module 23 is configured to send the background color corresponding to the component type to the management terminal respectively, so that the management terminal outputs the background color corresponding to the component type on the main color extraction interface of the management terminal; the main color extraction interface includes a service review control; the service review control is used to instruct the management terminal to generate a service review request based on the background color corresponding to the component type;

[0255] The review request sending module 24 is configured to, when receiving the service review request sent by the management terminal, send the service review request to the review terminal, so that the review terminal reviews the background color corresponding to the component type;

[0256] The background color distribution module 25 is configured to, when the review terminal's review is successful, distribute the background color corresponding to the component type to the user terminal, so that the user terminal displays the background color corresponding to the component type on the display interface.

[0257] Among them, the specific implementation manners of the variable value determination module 11, the quantization processing module 12, the traversal processing module 13, the picture main color determination module 14, the picture acquisition module 15, the preprocessing module 16, the pixel point extraction module 17, the color conversion processing module 18, the first quantity determination module 19, the second quantity determination module 20, the addition processing module 21, the background color determination module 22, the background color sending module 23, the review request sending module 24, and the background color distribution module 25 can refer to the descriptions of steps S201 - S208 in the corresponding embodiments above, and will not be elaborated here. In addition, the description of the beneficial effects of adopting the same method will not be elaborated either. Figure 6

[0258] Figure 11 Figure 11 Figure 11 , Figure 11 is a schematic diagram of a computer device provided by an embodiment of the present application. As Figure 11As shown, the computer device 1000 can be the server 10 in the corresponding Figure 1 embodiment. The computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display) and a keyboard (Keyboard). Optionally, the network interface 1004 may include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. Optionally, the memory 1005 may also be at least one storage device located far from the aforementioned processor 1001. As Figure 11 shown, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.

[0259] In Figure 11 the computer device 1000 shown, the network interface 1004 is mainly used for network communication with a management terminal, an audit terminal, and a user terminal; while the user interface 1003 is mainly used to provide an input interface for users; and the processor 1001 can be used to call the device control application program stored in the memory 1005 to implement:

[0260] Based on the pixel values of the pixel points in the picture data in the target color space, determine the first variable value of the pixel points on the first color dimension of the target color space;

[0261] Based on the quantization window corresponding to the first color dimension, perform uniform quantization processing on the first variable value of the pixel points to obtain m quantization sets associated with the pixel points; m is a positive integer;

[0262] Based on the window size of the quantization window, determine the sliding step of the sliding window. Based on the sliding window and the sliding step, traverse the m quantization sets to obtain n aggregation sets associated with the pixel points; n is a positive integer; the sliding window has the function of covering k quantization sets; k is a positive integer less than or equal to m; n is equal to (m - k + 1);

[0263] Select the aggregation sets that meet the main color extraction condition from the n aggregation sets, determine the target pixel points in the aggregation sets that meet the main color extraction condition, obtain the second variable value of the target pixel points on the second color dimension of the target color space, and determine the main color of the picture data based on the second variable value of the target pixel points and the first variable value of the target pixel points.

[0264] It should be understood that the computer device 1000 described in the embodiments of the present application can execute the foregoing Figure 3 and Figure 6 the description of the picture data processing method in the corresponding embodiments, and can also execute the foregoing Figure 10 the description of the picture data processing device 1 in the corresponding embodiments, which will not be elaborated herein. In addition, the description of the beneficial effects of using the same method will not be elaborated either.

[0265] In addition, it should be noted here that: the embodiments of the present application also provide a computer-readable storage medium, and the computer-readable storage medium stores the computer program executed by the foregoing-mentioned picture data processing device 1, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the foregoing Figure 3 or Figure 6 the description of the picture data processing method in the corresponding embodiments. Therefore, it will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either. For the technical details not disclosed in the embodiments of the computer-readable storage medium involved in the present application, please refer to the description of the method embodiments of the present application. As an example, the program instructions can be deployed to be executed on one computing device, or on multiple computing devices located at one location, or, on multiple computing devices distributed at multiple locations and interconnected by a communication network. The multiple computing devices distributed at multiple locations and interconnected by a communication network can form a blockchain system.

[0266] On the one hand, the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device can execute the foregoing Figure 3 or Figure 6 the description of the picture data processing method in the corresponding embodiments, which will not be elaborated herein. In addition, the description of the beneficial effects of using the same method will not be elaborated either.

[0267] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The above program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the above storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM), etc.

[0268] The above-disclosed is only the preferred embodiment of the present application. Of course, it cannot be used to limit the scope of the rights of the present application. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.

Claims

1. A method for processing picture data, characterized in that, Including: Determining a first variable value of a pixel point on a first color dimension of the target color space based on a pixel value of the pixel point in the target color space; the pixel value of the pixel point in the target color space is obtained by performing color conversion processing on an initial pixel value of a pixel point belonging to an initial color space; wherein, if the initial color space is an RGB color space, the target color space at least includes an HSB color space; Performing uniform quantization processing on the first variable value of the pixel point based on a quantization window corresponding to the first color dimension and a quantization interval formed by a minimum first variable value and a maximum first variable value obtained from the first variable value of the pixel point, to obtain m quantization sets associated with the pixel point; m is a positive integer; Determining a sliding step of a sliding window based on a window size of the quantization window, and traversing the m quantization sets based on the sliding window and the sliding step to obtain n aggregation sets associated with the pixel point; n is a positive integer; the sliding window has a function of covering k quantization sets; k is a positive integer less than or equal to m; n is equal to (m - k + 1); Selecting an aggregation set that meets the main color extraction condition from the n aggregation sets, determining a target pixel point in the aggregation set that meets the main color extraction condition, obtaining a second variable value of the target pixel point on a second color dimension of the target color space, and determining a main color of the picture data based on the second variable value of the target pixel point and the first variable value of the target pixel point; the main color of the picture data is determined based on a main color of a first color dimension of the picture data and a main color of a second color dimension of the picture data; the main color of the first color dimension is determined based on the first variable value of a to-be-processed pixel point having the maximum second variable value obtained from the target pixel point, and the main color of the second color dimension is determined based on the minimum value between an average value of variables and a main color threshold, and the average value of variables is obtained by averaging the second variable values of the target pixel point.

2. The method according to claim 1, characterized in that Before determining the first variable value of the pixel point on the first color dimension of the target color space based on the pixel value of the pixel point in the picture data, the method further includes: Obtaining original picture data uploaded by a management terminal; the original picture data is game picture data selected by the management terminal in response to a trigger operation on a main color extraction interface; a color space corresponding to the game picture data is an initial color space; the initial color space includes a first color channel, a second color channel, and a third color channel; Preprocessing original pixel points of the original picture data based on a pixel point filtering condition corresponding to the initial color space, and using the preprocessed original picture data as picture data for main color extraction; Extract pixel points from the picture data, obtain the first channel variable value of the pixel points on the first color channel, obtain the second channel variable value of the pixel points on the second color channel, and obtain the third channel variable value of the pixel points on the third color channel; Based on the first channel variable value, the second channel variable value, and the third channel variable value, perform color conversion processing on the initial pixel values of the pixel points belonging to the initial color space to obtain the pixel values of the pixel points in the target color space.

3. The method according to claim 2, wherein The preprocessing of the original pixel points of the original picture data based on the pixel point filtering conditions corresponding to the initial color space, and using the preprocessed original picture data as the picture data for dominant color extraction includes: Obtain the pixel point filtering conditions corresponding to the initial color space, and obtain the total number of original pixel points in the original picture data; When the total number of the original pixel points reaches the downsampling threshold in the pixel point filtering conditions, perform downsampling processing on the original pixel points in the original picture data, and use the downsampled picture data composed of the downsampled original pixel points as the picture data to be filtered; Use the pixel points in the picture data to be filtered as candidate filtering pixel points. Among the candidate filtering pixel points, use the candidate filtering pixel points that meet the pixel point filtering conditions as target filtering pixel points, perform filtering processing on the target filtering pixel points in the picture data to be filtered, and use the filtered picture data to be filtered as the picture data for dominant color extraction.

4. The method according to claim 3, wherein The step of using the pixel points in the picture data to be filtered as candidate filtering pixel points, among the candidate filtering pixel points, using the candidate filtering pixel points that meet the pixel point filtering conditions as target filtering pixel points, performing filtering processing on the target filtering pixel points in the picture data to be filtered, and using the filtered picture data to be filtered as the picture data for dominant color extraction includes: Use the pixel points in the picture data to be filtered as candidate filtering pixel points, determine the transparency value of the candidate filtering pixel points, and the channel variable values corresponding to the first color channel, the second color channel, and the third color channel of the candidate filtering pixel points in the initial color space respectively; Among the candidate filtering pixel points, select the candidate filtering pixel points with transparency values less than the first filtering threshold, and use the selected candidate filtering pixel points as the target filtering pixel points that meet the pixel point filtering conditions; or, Among the candidate filtering pixel points, select the candidate filtering pixel points with the channel variable values of each color channel greater than the second filtering threshold, and use the selected candidate filtering pixel points as the target filtering pixel points that meet the pixel point filtering conditions; In the picture data to be filtered, perform filtering processing on the target filtering pixel points, and use the filtered picture data to be filtered as the picture data for dominant color extraction.

5. The method according to claim 1, wherein Performing uniform quantization processing on the first variable value of the pixel point based on the quantization window corresponding to the first color dimension and the quantization interval composed of the minimum first variable value and the maximum first variable value obtained from the first variable values of the pixel points, to obtain m quantization sets associated with the pixel point, including: Based on the first variable value of the pixel point, obtaining the maximum first variable value and the minimum first variable value, and determining the variable value range composed of the minimum first variable value and the maximum first variable value as the quantization interval of the pixel point; Obtain the quantization window corresponding to the first color dimension, divide the quantization interval into m quantization sub-intervals associated with the pixel point, and obtain quantization sub-intervals within the m quantization sub-intervals ; where i is a positive integer less than or equal to m; Based on the first variable value of the pixel, obtain the pixel to be added for adding to the quantization sub-interval from the pixels in the picture data and add the pixel to be added to the quantization sub-interval ; The quantized sub-intervals after addition are used as the quantization sets corresponding to the pixels to be added. Until all the pixels in the picture data are in the corresponding quantization sets, m quantization sets associated with the pixels are obtained.

6. The method according to claim 1, wherein Determining the sliding step of the sliding window based on the window size of the quantization window, and performing traversal processing on the m quantization sets based on the sliding window and the sliding step, to obtain n aggregation sets associated with the pixel point, including: Obtaining the interval length jointly composed of k quantization sets, taking the interval length as the window size of the sliding window for main color extraction, and taking the window size of the quantization window as the sliding step of the sliding window; Based on the sliding window and the sliding step, traverse and obtain k quantization sets covered by the sliding window from the m quantization sets, and use the k quantization sets covered by the sliding window as the aggregation set ; where j is a positive integer less than or equal to n; Until the k quantization sets covered by the sliding window include the m-th quantization set, obtaining (m - k + 1) aggregation sets, and determining the (m - k + 1) aggregation sets as the n aggregation sets associated with the pixel point.

7. The method according to claim 1, wherein The n aggregation sets include an aggregation set ; The aggregation set includes a first quantization set and a second quantization set; The method further includes: In the aggregated set obtain the counted number of pixel points in the first quantization set, and use the number of pixel points in the first quantization set as the first quantity; Obtaining the number of pixel points in the second quantization set that is statistically counted, and taking the number of pixel points in the second quantization set as the second quantity; Add the first quantity and the second quantity, and use the total quantity after the addition process as the number of pixel points in the aggregation set. ​ 8. The method according to claim 1, characterized in that, Selecting an aggregation set that meets the main color extraction condition from the n aggregation sets, determining a target pixel point in the aggregation set that meets the main color extraction condition, obtaining the second variable value of the target pixel point in the second color dimension of the target color space, and determining the main color of the picture data based on the second variable value of the target pixel point and the first variable value of the target pixel point, including: In the n aggregation sets, taking the aggregation set with the largest number of pixel points as the aggregation set that meets the main color extraction condition, and determining a target pixel point in the aggregation set that meets the main color extraction condition; Obtaining the second variable value of the target pixel point in the second color dimension of the target color space, and determining the main color of the first color dimension of the picture data; Performing averaging processing on the second variable value of the target pixel point to obtain a variable average value, and determining the main color of the second color dimension of the picture data based on the variable average value; Determining the main color of the picture data based on the main color of the first color dimension and the main color of the second color dimension.

9. The method according to claim 8, wherein The step of, in the n aggregation sets, taking the aggregation set with the largest number of pixel points as the aggregation set that meets the main color extraction condition, and determining a target pixel point in the aggregation set that meets the main color extraction condition, includes: In the n aggregation sets, taking the aggregation set with the largest number of pixel points as the aggregation set that meets the main color extraction condition, and taking the aggregation set that meets the main color extraction condition as the aggregation set to be processed; If the number of the aggregation sets to be processed is one, taking the pixel points in the aggregation set to be processed as the target pixel points; If the number of the aggregating sets to be processed is at least two, the pixel points in the randomly obtained aggregating set to be processed are used as target pixel points.

10. The method according to claim 8, wherein Obtaining the second variable value of the target pixel point on the second color dimension of the target color space and determining the primary color of the first color dimension of the picture data includes: Obtaining the second variable value of the target pixel point on the second color dimension of the target color space, obtaining the target pixel point with the maximum second variable value, and using the obtained target pixel point as the pixel point to be processed; If the number of the pixel points to be processed is one, the first variable value of the pixel point to be processed is used as the primary color of the first color dimension of the picture data; If the number of the pixel points to be processed is at least two, the average value obtained after averaging the first variable values of at least two pixel points to be processed is used as the primary color of the first color dimension of the picture data.

11. The method according to claim 8, characterized in that, Averaging the second variable values of the target pixel points to obtain an average variable value, and determining the primary color of the second color dimension of the picture data based on the average variable value includes: Averaging the second variable values of the target pixel points to obtain an average variable value; If the average variable value is less than or equal to the primary color threshold, the average variable value is used as the primary color of the second color dimension of the picture data; If the average variable value is greater than the primary color threshold, the primary color threshold is used as the primary color of the second color dimension of the picture data.

12. The method according to claim 1, wherein The method further includes: Based on the component types included in the display interface of the user terminal, using the variable values configured for the component types as the third variable values on the third color dimension of the target color space, and obtaining the background colors corresponding to the component types based on the third variable values and the primary colors of the picture data; the display interface is a display interface for displaying the picture data; Sending the background colors corresponding to the component types to the management terminal respectively, so that the management terminal outputs the background colors corresponding to the component types on the primary color extraction interface of the management terminal; the primary color extraction interface includes a service review control; the service review control is used to instruct the management terminal to generate a service review request based on the background colors corresponding to the component types; When receiving the service review request sent by the management terminal, sending the service review request to the review terminal, so that the review terminal reviews the background colors corresponding to the component types; When the review by the review terminal is successful, sending the background colors corresponding to the component types to the user terminal, so that the user terminal displays the background colors corresponding to the component types on the display interface.

13. An image data processing device, characterized in that, Including: A variable value determination module, configured to determine a first variable value of a pixel point on a first color dimension of the target color space based on a pixel value of the pixel point in the target color space; the pixel value of the pixel point in the target color space is obtained by performing color conversion processing on an initial pixel value of a pixel point belonging to the initial color space; wherein, if the initial color space is the RGB color space, the target color space at least includes the HSB color space; A quantization processing module, configured to perform uniform quantization processing on the first variable value of the pixel point based on a quantization window corresponding to the first color dimension and a quantization interval formed by a minimum first variable value and a maximum first variable value obtained from the first variable value of the pixel point, to obtain m quantization sets associated with the pixel point; m is a positive integer; A traversal processing module, configured to determine a sliding step of a sliding window based on a window size of the quantization window, and perform traversal processing on the m quantization sets based on the sliding window and the sliding step, to obtain n aggregation sets associated with the pixel point; n is a positive integer; the sliding window has a function of covering k quantization sets; k is a positive integer less than or equal to m; n is equal to (m - k + 1); A main color determination module for an image, configured to select an aggregation set that meets the main color extraction condition from the n aggregation sets, determine a target pixel point in the aggregation set that meets the main color extraction condition, obtain a second variable value of the target pixel point on a second color dimension of the target color space, and determine the main color of the image data based on the second variable value of the target pixel point and the first variable value of the target pixel point; the main color of the image data is determined based on the main color of the first color dimension of the image data and the main color of the second color dimension of the image data; the main color of the first color dimension is determined based on the first variable value of a pixel point to be processed with the largest second variable value obtained from the target pixel point, and the main color of the second color dimension is determined based on the minimum value between the variable average value and the main color threshold, and the variable average value is obtained by performing averaging processing on the second variable values of the target pixel point.

14. A computer device, characterized in that, Comprising: A processor, a memory, and a network interface; The processor is connected to the memory and the network interface. Among them, the network interface is used to provide a data communication function, the memory is used to store a computer program, and the processor is used to call the computer program to execute the method according to any one of claims 1 - 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by the processor, the method according to any one of claims 1 - 12 is executed.

16. A computer program product, characterized in that, The computer program product includes a computer program, the computer program is stored in a computer-readable storage medium, a processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program to cause the computer device to execute the method according to any one of claims 1-12.

Citation Information

Patent Citations

  • Image data processing method and electronic device supporting the same

    US20160364888A1

  • Method for finding representative vectors in a class of vector spaces

    US7120300B1