Color information determination method and device
By using the Gaussian hybrid model to obtain color information in the target color space, the problem of insufficient efficiency and accuracy of color information acquisition in the prior art is solved, especially in complex environments and different brightness conditions, and more efficient and accurate color information acquisition is achieved.
Patent Information
- Application Number
- CN202311668440.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art has shortcomings in terms of efficiency and accuracy in obtaining color information, especially in complex environments and under different brightness conditions, the accuracy of obtaining color information is low.
The first Gaussian mixed model is used to obtain the probability of the Gaussian distribution component to which any data point in the data point set of the target image belongs, and allocate the data points to the components corresponding to the maximum probability to determine the color information. When needed, the Gaussian hybrid model is corrected for improved accuracy.
It improves the efficiency and accuracy of color information acquisition, is suitable for complex environments, and reduces the inaccuracy of color information acquisition under different brightness conditions.
Smart Images

Figure CN120107375A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data image processing, and in particular to a method and device for determining color information. Background Art
[0002] With the development of science and technology, users have higher and higher requirements for color recognition. Among them, memory color can be, for example, the inherent color of an object. For example, the color of the sky, the color of green plants, or the color of human skin. In the field of image processing technology, memory color enhancement is a specific subfield of image processing, which can enhance the color of an object, where, for example, the object can be an object for which the user has a fixed expected color. That is, the object has a "standard" or "expected" color in the user's memory, so enhancing these colors can make the image more in line with people's visual expectations. Summary of the invention
[0003] The present disclosure provides a method and device for determining color information to improve the efficiency of obtaining color information while improving the accuracy of obtaining color information. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a method for determining color information is provided, including:
[0005] Get a set of data points corresponding to the target image in the target color space;
[0006] Using a first Gaussian mixture model to obtain a probability corresponding to at least one Gaussian distribution component to which any data point in the data point set belongs;
[0007] Allocate any one of the data points to a component corresponding to a maximum probability among the probabilities corresponding to the at least one Gaussian distribution component, and determine the first color information corresponding to the any one of the data points based on the component corresponding to the maximum probability.
[0008] According to some embodiments, obtaining color space information corresponding to a target image;
[0009] In a case where the color space information indicates that the color space of the target image is not the target color space, the target image is converted to convert the color space of the target image to the target color space.
[0010] According to some embodiments, the method further comprises:
[0011] Acquire second color information corresponding to any one of the data points, wherein the second color information is color information newly acquired for any one of the data points;
[0012] Acquire difference information between the first color information and the second color information;
[0013] When the difference information is greater than the difference threshold, the first Gaussian mixture model is corrected to obtain a corrected first Gaussian mixture model.
[0014] According to a second aspect of an embodiment of the present disclosure, a model training method is provided, characterized by comprising:
[0015] Obtaining a set of sample data points corresponding to the training sample image, and obtaining a set of cluster centers corresponding to the set of sample data points;
[0016] Using the cluster center set, obtaining a first value corresponding to any Gaussian distribution component in the Gaussian distribution component set;
[0017] Obtaining a posterior probability corresponding to each sample data point in the set of sample data points according to the first value, the mixing weight corresponding to any Gaussian distribution component, and the covariance matrix of any Gaussian distribution component;
[0018] The model parameters of the second Gaussian mixture model are updated according to the posterior probability until the model parameters of the second Gaussian mixture model meet the parameter requirements, thereby obtaining the first Gaussian mixture model.
[0019] According to some embodiments, obtaining a set of cluster centers corresponding to the set of sample data points includes:
[0020] Taking a first sample data point in the sample data point set as a first cluster center, wherein the first sample data point is any sample data point in the sample data point set;
[0021] Acquire a distance between a second sample data point and the first sample data point, wherein the second sample data point is any sample data point in the sample data point set except the first sample data point;
[0022] When the distance does not meet the distance requirement, selecting a second sample data point with the largest distance as a second cluster center;
[0023] Adding the first cluster center and the second cluster center to a cluster center set;
[0024] Repeat the step of obtaining the second cluster center until the set of cluster centers that meets the cluster center requirements is selected.
[0025] According to some embodiments, the method further comprises:
[0026] Obtaining third color information corresponding to the test sample image output by the second Gaussian mixture model;
[0027] Acquire fourth color information corresponding to the test sample image, wherein the fourth color information is label color information;
[0028] Obtaining an intersection-over-union ratio of the third color information and the fourth color information;
[0029] When the intersection-over-union ratio meets the threshold requirement, the training of the second Gaussian mixture model is stopped to obtain the first Gaussian mixture model.
[0030] According to some embodiments, the obtaining third color information corresponding to the test sample image output by the second Gaussian mixture model includes:
[0031] Obtain a standard deviation corresponding to a Gaussian distribution component in the second Gaussian mixture model and a second numerical value corresponding to the Gaussian distribution component;
[0032] Acquire a threshold set of at least one feature dimension corresponding to the color space according to the standard deviation and the second value;
[0033] According to the threshold set, third color information corresponding to the test sample image output by the second Gaussian mixture model is obtained.
[0034] According to a third aspect of an embodiment of the present disclosure, a color information determination device is provided, including:
[0035] A set acquisition unit, used to acquire a set of data points corresponding to a target image in a target color space;
[0036] A probability acquisition unit, configured to acquire a probability corresponding to at least one Gaussian distribution component to which any data point in the data point set belongs by using a first Gaussian mixture model;
[0037] The color determination unit is used to assign any of the data points to the component corresponding to the maximum probability among the probabilities corresponding to the at least one Gaussian distribution component, and determine the first color information corresponding to the any of the data points according to the component corresponding to the maximum probability.
[0038] According to a fourth aspect of an embodiment of the present disclosure, a model training device is provided, including:
[0039] A data point acquisition unit, used to acquire a set of sample data points corresponding to the training sample image, and acquire a set of cluster centers corresponding to the set of sample data points;
[0040] A value acquisition unit, used to use the cluster center set to acquire a first value corresponding to any Gaussian distribution component in the Gaussian distribution component set;
[0041] a posterior probability acquisition unit, configured to acquire the posterior probability corresponding to each sample data point in the set of sample data points according to the first value, the mixing weight corresponding to any Gaussian distribution component and the covariance matrix of any Gaussian distribution component;
[0042] A parameter updating unit is used to update the model parameters of the second Gaussian mixture model according to the posterior probability until the model parameters of the second Gaussian mixture model meet the parameter requirements, thereby obtaining the first Gaussian mixture model.
[0043] According to a fifth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0044] processor;
[0045] a memory for storing instructions executable by the processor;
[0046] The processor is configured to execute the instructions to implement the color information determination method described in any one of the aforementioned aspects.
[0047] According to a sixth aspect of the present application, a storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the color information determination method described in any one of the preceding aspects.
[0048] According to a seventh aspect of the present application, a computer program product is provided, comprising a computer program, wherein the computer program implements any one of the methods described in the preceding aspects when executed by a processor.
[0049] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0050] In some or related embodiments, a set of data points corresponding to a target image in a target color space is obtained; a first Gaussian mixture model is used to obtain the probability corresponding to at least one Gaussian distribution component to which any data point in the set of data points belongs; any data point is assigned to a component corresponding to the maximum probability among the probabilities corresponding to the at least one Gaussian distribution component, and the first color information corresponding to any data point is determined according to the component corresponding to the maximum probability. Therefore, a Gaussian mixture model can be used to obtain color information, and color information acquisition suitable for complex environments can be used to reduce the complexity of the color information acquisition steps when complex algorithms are used to obtain color information. In addition, color information acquisition in the target color space can reduce the situation where the accuracy of color acquisition at different brightness is low, and the efficiency of color information acquisition can be improved while improving the accuracy of color information acquisition.
[0051] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0053] Figure 1 A background schematic diagram showing a method for determining color information according to an embodiment of the present disclosure;
[0054] Figure 2 A background schematic diagram showing a method for determining color information according to an embodiment of the present disclosure;
[0055] Figure 3 is a flow chart of a model training method according to an exemplary embodiment;
[0056] FIG4( a ) is a schematic diagram showing an example of a test sample image in a method for determining color information according to an embodiment of the present disclosure;
[0057] FIG4( b ) shows an example schematic diagram of a mask in a method for determining color information according to an embodiment of the present disclosure;
[0058] Figure 5 is a block diagram of a color information determination device according to an exemplary embodiment;
[0059] Figure 6 is a block diagram of a model training device according to an exemplary embodiment;
[0060] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0061] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0062] The embodiments of the present disclosure provide a method and device for determining color information. In some embodiments, the terms such as the method for determining color information and the information processing method and the communication method can be interchangeable, the terms such as the device for determining color information and the information processing device and the communication device can be interchangeable, and the terms such as the information processing system and the communication system can be interchangeable.
[0063] The embodiments of the present disclosure are not exhaustive, but are only illustrative of some embodiments, and are not intended to be a specific limitation on the scope of protection of the present disclosure. In the absence of contradiction, each step in a certain embodiment can be implemented as an independent embodiment, and the steps can be arbitrarily combined. For example, a solution after removing some steps in a certain embodiment can also be implemented as an independent embodiment, and the order of the steps in a certain embodiment can be arbitrarily exchanged. In addition, the optional implementation methods in a certain embodiment can be arbitrarily combined; in addition, the embodiments can be arbitrarily combined, for example, some or all of the steps of different embodiments can be arbitrarily combined, and a certain embodiment can be arbitrarily combined with the optional implementation methods of other embodiments.
[0064] In each embodiment of the present disclosure, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between the embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form a new embodiment based on their internal logical relationships.
[0065] The terms used in the embodiments of the present disclosure are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure.
[0066] In the embodiments of the present disclosure, unless otherwise specified, elements expressed in the singular form, such as "a", "an", "the", "above", "said", "aforementioned", "this", etc., may mean "one and only one", or "one or more", "at least one", etc. For example, when using articles such as "a", "an", "the" in English in translation, the noun after the article may be understood as a singular expression or a plural expression.
[0067] In the embodiments of the present disclosure, “plurality” refers to two or more.
[0068] In some embodiments, the terms “at least one,” “one or more,” “a plurality of,” “multiple,” etc. may be used interchangeably.
[0069] In some embodiments, "at least one of A and B", "A and / or B", "A in one case, B in another case", "in response to one case A, in response to another case B", etc., may include the following technical solutions according to the situation: in some embodiments, A (A is executed independently of B); in some embodiments, B (B is executed independently of A); in some embodiments, execution is selected from A and B (A and B are selectively executed); in some embodiments, A and B (both A and B are executed). When there are more branches such as A, B, C, etc., the above is also similar.
[0070] In some embodiments, the recording method of "A or B" may include the following technical solutions according to the situation: in some embodiments, A (A is executed independently of B); in some embodiments, B (B is executed independently of A); in some embodiments, execution is selected from A and B (A and B are selectively executed). When there are more branches such as A, B, C, etc., the above is also similar.
[0071] The prefixes such as "first" and "second" in the embodiments of the present disclosure are only used to distinguish different description objects, and do not constitute restrictions on the position, order, priority, quantity or content of the description objects. The statement of the description object refers to the description in the context of the claims or embodiments, and should not constitute unnecessary restrictions due to the use of prefixes. For example, if the description object is a "field", the ordinal number before the "field" in the "first field" and the "second field" does not limit the position or order between the "fields", and the "first" and "second" do not limit whether the "fields" they modify are in the same message, nor do they limit the order of the "first field" and the "second field". For another example, if the description object is a "level", the ordinal number before the "level" in the "first level" and the "second level" does not limit the priority between the "levels". For another example, the number of description objects is not limited by the ordinal number, and can be one or more. Taking the "first device" as an example, the number of "devices" can be one or more. In addition, the objects modified by different prefixes may be the same or different. For example, if the description object is "device", then the "first device" and the "second device" may be the same device or different devices, and their types may be the same or different. For another example, if the description object is "information", then the "first information" and the "second information" may be the same information or different information, and their contents may be the same or different.
[0072] In some embodiments, “including A”, “comprising A”, “used to indicate A”, and “carrying A” can be interpreted as directly carrying A or indirectly indicating A.
[0073] In some embodiments, terms such as "in response to ...", "in response to determining ...", "in the case of ...", "at the time of ...", "when ...", "if ...", "if ...", etc. can be used interchangeably.
[0074] In some embodiments, terms such as "greater than", "greater than or equal to", "not less than", "more than", "more than or equal to", "not less than", "higher than", "higher than or equal to", "not lower than", and "above" can be replaced with each other, and terms such as "less than", "less than or equal to", "not greater than", "less than", "less than or equal to", "no more than", "lower than", "lower than or equal to", "not higher than", and "below" can be replaced with each other.
[0075] In some embodiments, devices and equipment may be interpreted as physical or virtual, and their names are not limited to the names recorded in the embodiments. In some cases, they may also be understood as "equipment", "device", "circuit", "network element", "node", "function", "unit", "section", "system", "network", "chip", "chip system", "entity", "subject", etc.
[0076] In some embodiments, "network" can be interpreted as devices included in the network, such as access network equipment, core network equipment, etc.
[0077] In some embodiments, "terminal" or "terminal device" can be referred to as "user equipment (UE)", "user terminal" "mobile station (MS)", "mobile terminal (MT)", subscriber station, mobile unit, subscriber unit, wireless unit, remote unit, mobile device, wireless device, wireless communication device, remote device, mobile subscriber station, access terminal, mobile terminal, wireless terminal, remote terminal, handset, user agent, mobile client, client, etc.
[0078] In some embodiments, data, information, etc. may be obtained with the user's consent.
[0079] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0080] According to some embodiments, the technical solution of the embodiments of the present disclosure can be used in memory color detection or data image processing scenarios, for example.
[0081] In some embodiments, the memory color may be enhanced by at least one of memory color recognition and color correction. Memory color recognition may include, for example, recognizing an area in an image related to the memory color, and color correction may include, for example, adjusting the memory color according to a predetermined target color or a color desired by a user when the memory color is recognized. Adjustment of the memory color may include, for example, adjustment of hue, saturation, and brightness.
[0082] According to some embodiments, for example, the memory color can be identified and enhanced based on rules through a predefined color range, or the characteristics of the memory color can be adaptively learned through machine learning and deep learning algorithms, and color correction can be performed. However, in this method, the K-means clustering algorithm can be used to cluster the colors, which is relatively complex, and for colors with complex transitions, they need to be separated into different layers, and the color settings of the color palette need to be manually adjusted, resulting in poor accuracy in color recognition.
[0083] Figure 1 is a flow chart of a method for determining color information according to an exemplary embodiment. Figure 1 As shown, the color information determination method can be used in memory color detection or data image processing scenarios, including the following steps:
[0084] In step S11, a set of data points corresponding to a target image in a target color space is obtained;
[0085] According to some embodiments, the technical solution of the embodiments of the present disclosure may be applied to a scenario of detecting a memory color area in an image, for example.
[0086] The target color space may be, for example, the color space where the target image is located when the target image is color recognized. The target color space does not specifically refer to a fixed color space. For example, when a modification instruction of the target color space is received, the target color space may also change accordingly.
[0087] In some embodiments, the target image may be, for example, an input image, and the target image does not specifically refer to a fixed image. For example, when the image content corresponding to the target image changes, the target image may also change accordingly. For example, when the colors corresponding to the objects in the target image change, the target image may also change accordingly. The method for acquiring the target image is not limited. The method for acquiring the target image may be, for example, by clicking on an image in a gallery, or by photographing it with a camera.
[0088] According to some embodiments, the data point set may be, for example, a collection of at least one data point. The data point set does not specifically refer to a fixed set. For example, when the number of data points included in the data point set changes, the data point set may also change accordingly. For example, when the target image changes, the data point set may also change accordingly. In some embodiments, the data point may be, for example, a color feature.
[0089] According to some embodiments, when executing the color information determination method, for example, a set of data points corresponding to a target image in a target color space may be obtained.
[0090] In step S12, a first Gaussian mixture model is used to obtain a probability corresponding to at least one Gaussian distribution component to which any data point in the data point set belongs;
[0091] Among them, in one embodiment of the present disclosure, the first Gaussian Mixed Model (GMM) can be, for example, a model that has been trained and can be used to determine color information. The first Gaussian Mixed Model does not specifically refer to a fixed model. For example, when the model parameters in the first Gaussian Mixed Model change, the first Gaussian Mixed Model can also change accordingly. For example, when at least one Gaussian distribution component included in the first Gaussian Mixed Model changes, the first Gaussian Mixed Model can also change accordingly.
[0092] In some embodiments, any data point may be, for example, any data point in a set of data points.
[0093] According to some embodiments, the Gaussian distribution component may refer to, for example, a Gaussian distribution in a first Gaussian mixture model. The at least one Gaussian distribution component does not specifically refer to a fixed Gaussian distribution component, for example, when the quantity corresponding to the at least one Gaussian distribution component changes, the at least one Gaussian distribution component may also change accordingly.
[0094] The probability is a probability corresponding to a Gaussian distribution component. For example, when the Gaussian distribution component changes, the probability may also change accordingly.
[0095] According to some embodiments, when a set of data points is obtained, a probability corresponding to at least one Gaussian distribution component to which any data point in the set of data points belongs may be obtained by using a first Gaussian mixture model.
[0096] In step S13, any data point is assigned to a component corresponding to the maximum probability among the probabilities corresponding to at least one Gaussian distribution component, and the first color information corresponding to any data point is determined according to the component corresponding to the maximum probability.
[0097] In some embodiments, the first color information may be, for example, the color corresponding to any data point. The first in the first color information is only used to distinguish from the remaining color information, and the first color information does not specifically refer to a fixed color information. For example, when any data point changes, the first color information may also change accordingly. For example, when the target image changes, the first color information may also change accordingly.
[0098] According to some embodiments, when the probability corresponding to at least one Gaussian distribution component is obtained, the maximum probability among the at least one probability can be obtained, and any data point can be assigned to the component corresponding to the maximum probability. The first color information corresponding to any data point can be determined according to the component corresponding to the maximum probability.
[0099] In some or related embodiments, a set of data points corresponding to a target image in a target color space is obtained; a first Gaussian mixture model is used to obtain the probability corresponding to at least one Gaussian distribution component to which any data point in the data point set belongs; any data point is assigned to a component corresponding to the maximum probability among the probabilities corresponding to at least one Gaussian distribution component, and the first color information corresponding to any data point is determined according to the component corresponding to the maximum probability. Therefore, a Gaussian mixture model can be used to obtain color information, and color information acquisition suitable for complex environments can be used to reduce the complexity of the color information acquisition steps when complex algorithms are used to obtain color information. In addition, color information acquisition in the target color space can reduce the situation where the accuracy of color acquisition at different brightness is low, and the efficiency of color information acquisition can be improved while improving the accuracy of color information acquisition.
[0100] Figure 2 is a flow chart of a method for determining color information according to an exemplary embodiment. Figure 2 As shown, the color information determination method can be used in memory color detection or data image processing scenarios, including the following steps:
[0101] In step S21, the color space information corresponding to the target image is obtained;
[0102] The specific process is as described above and will not be repeated here.
[0103] According to some embodiments, the color space information is used to indicate the color space of the target image. The color space information does not specifically refer to a certain fixed color information.
[0104] According to some embodiments, for example, color space information corresponding to the target image may be acquired.
[0105] In some embodiments, the target image may be, for example, image A. The acquired color space information corresponding to image A may be, for example, a red, green, and blue (RGB) space.
[0106] In step S22, when the color space information indicates that the color space of the target image is not the target color space, the target image is converted to convert the color space of the target image to the target color space;
[0107] According to some embodiments, the target color space may be, for example, a converted color space. The target color space does not specifically refer to a fixed color space, and the target color space may be, for example, pre-set, or may be determined according to the image content of the target image. For example, when the target image includes human skin, the target color space may be, for example, a YCbCr color space.
[0108] In some embodiments, when the color space information indicates that the color space of the target image is not the target color space, the target image is converted to convert the color space of the target image to the target color space.
[0109] According to some embodiments, the target color space may be, for example, an HSL color space. The color space information corresponding to the acquired A image may be, for example, a red, green, and blue RGB color space. For example, the RGB color space of the A image may be converted to the HSL color space. Wherein, L here refers to the Luma information of the nonlinear domain, and the specific calculation is a weighted value of the RGB three colors related to a color domain. Wherein, the RGB may be, for example, a nonlinear RGB value after gamma transformation.
[0110] For example, when the target image is identified and it is found that the target image includes skin color, the target color space may be a YCbCr color space, for example, the RGB color space of the A image may be converted to the YCbCr color space.
[0111] In step S23, a set of data points corresponding to the target image in the target color space is obtained;
[0112] The specific process is as described above and will not be repeated here.
[0113] In step S24, a first Gaussian mixture model is used to obtain a probability corresponding to at least one Gaussian distribution component to which any data point in the data point set belongs;
[0114] The specific process is as described above and will not be repeated here.
[0115] In step S25, any data point is assigned to a component corresponding to the maximum probability among the probabilities corresponding to at least one Gaussian distribution component, and the first color information corresponding to any data point is determined according to the component corresponding to the maximum probability.
[0116] The specific process is as described above and will not be repeated here.
[0117] According to some embodiments, the method further comprises:
[0118] Obtain the second color information corresponding to any data point;
[0119] Acquire difference information between the first color information and the second color information;
[0120] When the difference information is greater than the difference threshold, the first Gaussian mixture model is corrected to obtain a corrected first Gaussian mixture model. Therefore, the first Gaussian mixture model can be corrected to improve the accuracy of color recognition of the first Gaussian mixture model and to improve the scope of application of the first Gaussian mixture model.
[0121] According to some embodiments, the second color information may be, for example, color information reacquired for any data point. The reacquisition may be, for example, obtained by re-executing the color information determination method for the target image, or may be directly adjusted for the color information of the any data point. The difference information does not specifically refer to a fixed information, for example, when the first color information or the second color information changes, the difference information may also change accordingly.
[0122] In some embodiments, the difference threshold may be, for example, a threshold for detecting whether to modify the first Gaussian mixture model. The difference threshold does not specifically refer to a fixed threshold. For example, when a modification instruction for the difference threshold is received, the difference threshold may also change accordingly.
[0123] In some or related embodiments, when the color space information indicates that the color space of the target image is not the target color space, the target image is converted to the target color space, thereby acquiring color information in the target color space, thereby reducing the situation where color recognition in the RGB color space results in inaccurate color information acquisition, and reducing the situation where the accuracy of acquiring memory colors and memory color transition ranges at different brightnesses is low, thereby improving the accuracy of color information acquisition and the stability of color information acquisition.
[0124] Figure 3 is a flow chart of a method for determining color information according to an exemplary embodiment. Figure 3 As shown, the method includes:
[0125] In step S31, a set of sample data points corresponding to the training sample image is obtained, and a set of cluster centers corresponding to the set of sample data points is obtained;
[0126] According to some embodiments, the training sample image may be, for example, an image used to train a Gaussian mixture model. The training sample image does not specifically refer to a fixed image. For example, when the image content corresponding to the training sample image changes, the training sample image may also change accordingly. When the light source conditions corresponding to the training sample image change, the training sample image may also change accordingly. The color space of the training sample image is the target color space.
[0127] In some embodiments, the sample data point set may be, for example, a collection of at least one sample data point. The sample data point set does not specifically refer to a fixed set. For example, when the training sample image changes, the sample data point set may also change accordingly. For example, when the number of data points corresponding to the sample data point set changes, the sample data point set may also change accordingly.
[0128] In some embodiments, the cluster center set may be, for example, a collection of at least one cluster center. The cluster center set does not specifically refer to a fixed set. For example, when the method for obtaining the cluster center set changes, the cluster center set may also change accordingly.
[0129] According to some embodiments, a set of sample data points corresponding to the training sample image is obtained, and a set of cluster centers corresponding to the set of sample data points is obtained.
[0130] According to some embodiments, for example, the K-means++ algorithm may be used to obtain the cluster center set. Obtaining the cluster center set corresponding to the sample data point set includes:
[0131] Taking the first sample data point in the sample data point set as the first cluster center, wherein the first sample data point is any sample data point in the sample data point set;
[0132] Obtaining a distance between a second sample data point and the first sample data point, wherein the second sample data point is any sample data point in the sample data point set except the first sample data point;
[0133] When the distance does not meet the distance requirement, the second sample data point with the largest distance is selected as the second cluster center;
[0134] Add the first cluster center and the second cluster center to the cluster center set;
[0135] Repeat the step of obtaining the second cluster center until a cluster center set that meets the cluster center requirements is selected. Therefore, the cluster center set can be obtained according to the distance, which can improve the accuracy of obtaining the cluster center set and improve the accuracy of color recognition.
[0136] According to some embodiments, a data point is randomly selected from the input sample data point set as the first cluster center, c 1 =x i , where x i is a data point randomly selected from the sample data point set X of the data set; for each point in the data set, calculate the distance between it and the selected cluster center For each data point x in the sample data point set X i , calculate the square of the minimum distance from it to the selected cluster center, and select the point with the farthest distance as the next cluster center, that is, Repeat the above steps to select cluster centers until K cluster centers are selected, that is, a set of cluster centers is obtained. Then the K-means algorithm is executed using the selected cluster centers. For example, the K-means++ algorithm can be used to initialize the GMM to converge to the optimal solution faster, because the K-means++ algorithm provides an initial point closer to the global optimum. The K-means++ algorithm can provide better initial cluster centers, which helps the GMM better capture the distribution of data points.
[0137] According to some embodiments, after performing a GMM training, the initialization method becomes the mean variance of the foreground and background obtained by the previous round of GMM model, which can improve the efficiency of the GMM model in reaching the optimal solution.
[0138] In step S32, the cluster center set is used to obtain a first value corresponding to any Gaussian distribution component in the Gaussian distribution component set;
[0139] According to some embodiments, the first numerical value refers to a numerical value corresponding to any Gaussian distribution component, and the first numerical value is used to distinguish from the second numerical value. The first numerical value does not specifically refer to a fixed numerical value. When the Gaussian distribution component changes, the first numerical value may also change accordingly. The first numerical value may, for example, be the mean of the clustered data cluster, and the first numerical value may, for example, also be the variance of the clustered data cluster. The embodiments of the present disclosure are not limited to this.
[0140] According to some embodiments, for example, a cluster center set may be used to obtain a first value corresponding to any Gaussian distribution component in a Gaussian distribution component set. For example, the cluster center corresponding to the sample data point set may be used as the mean, and the covariance matrix of the data points in each data cluster relative to the cluster center may be used as the covariance matrix of the Gaussian distribution component.
[0141] In step S33, according to the first value, the mixing weight corresponding to any Gaussian distribution component and the covariance matrix of any Gaussian distribution component, the posterior probability corresponding to each sample data point in the sample data point set is obtained;
[0142] According to some embodiments, the mixing weight may be, for example, a weight corresponding to any Gaussian distribution component. The mixing weight does not specifically refer to a fixed weight. The first of the mixing weights is only used to distinguish from the other mixing weights.
[0143] According to some embodiments, the covariance matrix may be, for example, a covariance matrix corresponding to any Gaussian distribution component. The first covariance matrix is only used to distinguish the other covariance matrices and does not specifically refer to a fixed covariance matrix.
[0144] According to some embodiments, for example, based on the first numerical value, the mixing weight corresponding to any Gaussian distribution component and the covariance matrix of any Gaussian distribution component, for example, the EM algorithm can be executed to obtain the posterior probability corresponding to each sample data point in the sample data point set.
[0145] In step S34, the model parameters of the second Gaussian mixture model are updated according to the posterior probability until the model parameters of the second Gaussian mixture model meet the parameter requirements, and the first Gaussian mixture model is obtained.
[0146] According to some embodiments, the second Gaussian mixture model may be, for example, an initial Gaussian mixture model, that is, it may be understood as a Gaussian mixture model that has not completed training.
[0147] In some embodiments, when the posterior probability is obtained, the posterior probability can be used as a basis for whether to update the model parameters of the second Gaussian mixture model. For example, when the iteration result of the previous round does not meet the result requirements, the model parameters of the second Gaussian mixture model are updated according to the posterior probability until the model parameters of the second Gaussian mixture model meet the parameter requirements, and the first Gaussian mixture model is obtained.
[0148] According to some embodiments, the method further comprises:
[0149] Obtaining third color information corresponding to the test sample image output by the second Gaussian mixture model;
[0150] Acquire fourth color information corresponding to the test sample image, wherein the fourth color information is label color information;
[0151] Obtaining an intersection-and-union ratio of the third color information and the fourth color information;
[0152] When the intersection-over-union ratio meets the threshold requirement, the training of the second Gaussian mixture model is stopped to obtain the first Gaussian mixture model.
[0153] According to some embodiments, for example, a test image may be used to verify the first Gaussian mixture model, specifically including:
[0154] For each data point x in the test data point set i , and calculate the probability that it belongs to each Gaussian distribution component:
[0155] p j (x i )=π j N(x i |μ j ,Σ j ) (1)
[0156] Where: π j is the mixing weight of the jth Gaussian distribution component;
[0157] N(x i |μ j ,Σ j ) is the given mean μ j and the covariance matrix Σ j Next, data point x i Gaussian distribution probability density function.
[0158] According to some embodiments, for each data point x i Assigned to the component with the highest probability j:label(x i )=argmax j p j (xi ), then for each data point in the input test data point set, it can be output whether it is a memory color (label=1) or not a memory color (label=1).
[0159] According to some embodiments, IoU (intersection over union), for example, can be used to measure the accuracy achieved by a Gaussian mixture model. Assuming that the model output is A and the label is B, IoU is defined as the ratio of the intersection of A and B to the union:
[0160]
[0161] If the intersection-over-union ratio is greater than the set threshold, the Gaussian mixture model training is no longer performed. If the threshold is not reached, the Gaussian mixture model is repeatedly trained until the threshold requirement is reached.
[0162] According to some embodiments, obtaining third color information corresponding to the test sample image output by the second Gaussian mixture model includes:
[0163] Obtain a standard deviation corresponding to a Gaussian distribution component and a second value corresponding to the Gaussian distribution component in a second Gaussian mixture model;
[0164] Obtaining a threshold set of at least one feature dimension corresponding to the color space according to the standard deviation and the second value;
[0165] According to the threshold set, third color information corresponding to the test sample image output by the second Gaussian mixture model is obtained.
[0166] According to some embodiments, when the second GMM model is used for training, for example, the problem of identifying each type of memory color can be regarded as a two-classification problem, that is, one type is memory color and the other type is non-memory color, that is, the data is fitted as a mixture of two Gaussian distributions:
[0167] p(x)=π 1 N(x|μ 1 ,Σ 1 )+π 2 N(x|μ 2 ,Σ 2 ) (3)
[0168] Where: π 1 ,π 2 is the mixing weight, μ 1 ,μ 2 is the mean of each Gaussian distribution, Σ 1 ,Σ 2 is the covariance matrix of each Gaussian distribution. When initialized, μ 1 ,μ 2 The mean of the cluster center using K-means++, Σ 1 ,Σ2 The randomly initialized covariance matrix can improve the convergence efficiency of the second GMM model. Then execute the EM algorithm, which specifically includes:
[0169] Step E: Calculate the posterior probability of each data point:
[0170]
[0171] Step M: Update model parameters using posterior probabilities:
[0172]
[0173] In the parameter μ j ,Σ j ,π j Stop iterative training when there is no significant change, that is, the parameter μ j ,Σ j ,π j When the parameter requirements are met, the iterative training is stopped and the first GMM model is obtained.
[0174] According to some embodiments, the first Gaussian mixture model Σ j The square root of the diagonal elements of is the standard deviation σ of the Gaussian distribution i , the mean of the Gaussian distribution is μ i , then the threshold calculation method for color detection is as follows,
[0175] lowthreshold i =μ i -σ i
[0176] highthreshold i =μ i +σ i (6)
[0177] According to some embodiments, after obtaining the thresholds of the three characteristic dimensions of color detection (H, S, L three dimensions or Yc b c r ), the detection threshold can be shifted up and down, that is, θ current =θ best ±k·σ, where k is a parameter that varies in the range [a,b] with a step size of 0.005 or 0.02.
[0178] Among them, in one embodiment of the present disclosure, FIG4(a) shows an example schematic diagram of a test sample image in a color information determination method of an embodiment of the present disclosure, and FIG4(b) shows an example schematic diagram of a mask in a color information determination method of an embodiment of the present disclosure. For example, the third color information may be, for example, the color distribution output by the second Gaussian mixture model for the test sample image, and the fourth color information may be, for example, the label color information of the test sample image. When identifying the test sample image, the three feature dimensions may be set to 1 in the threshold range image and the rest may be set to 0 to obtain a predicted mask, and the intersection-over-union ratio of the mask and the label may be calculated.
[0179]
[0180] When the change value of the intersection-over-union ratio is less than the change value threshold or the number of iterations of the Gaussian mixture model reaches the number threshold, the iteration of the second Gaussian mixture model is stopped, and the color distribution hist of various memory colors in the area where the memory color is located can be obtained. memtrain :
[0181] θ best =θ current , iou best = iou current ,if iou current > iou best (8)
[0182] For example, it can be the color distribution corresponding to the test sample image. Get the difference information between the color distribution of the test sample image and the color distribution of the training sample image:
[0183]
[0184] When the difference information between the color distribution of the test sample image and the color distribution of the training sample image is greater than the difference information threshold, it means that the color distribution of the training sample image and the test sample image is greatly different, and the threshold that has been set may be biased under this light source. In this case, the trained second Gaussian mixture model needs to be corrected, and step E is performed again on the newly input image, and the posterior probability of belonging to the foreground is recorded as greater than th. update The sample data points of this type are basically memory colors. k Perform three random samplings, μ k Satisfies the distribution p(μ k )~N(μ 0 ,Σ 0 ), where μ 0 and Σ 0is a hyperparameter and can be set to 0 or the identity matrix. If the probability of a sample data point with a posterior probability greater than 0.7 increases, then record μ at this time k Therefore, the difference information between the color distribution of the test sample image and the color distribution of the training sample image is greater than the difference information threshold, and there is no need to perform complex operations in the online model to obtain the memory color range, which can reduce the adjustment complexity of the Gaussian mixture model, improve the adjustment efficiency of the Gaussian mixture model, and reduce the deployment difficulty of the Gaussian mixture model.
[0185] According to some embodiments, Σ k Perform random sampling p(Σ k )~Inv-Wishart(Ψ,ν), due to Σ k There is no preset prior information, so the unit matrix can be selected as the sampling matrix of the covariance matrix, and then v selects the feature dimension plus 1 as the degree of freedom of the distribution. The parameter is sampled five times. If the probability of the sample data point that is judged as the foreground with a probability greater than 0.7 increases in 80% of the data, then the sample is retained. k The color detection range is calculated in the same way as in formula (8), and the adjusted color detection range can be obtained. The detected color area is convenient for subsequent color adjustment and enhancement, or combined with Bayesian methods to optimize the detection area.
[0186] In some or related embodiments, by obtaining a set of sample data points corresponding to a training sample image, and obtaining a set of cluster centers corresponding to the set of sample data points; using the set of cluster centers, obtaining a first value corresponding to any Gaussian distribution component in the set of Gaussian distribution components; obtaining the posterior probability corresponding to each sample data point in the set of sample data points according to the first value, the mixing weight corresponding to any Gaussian distribution component, and the covariance matrix of any Gaussian distribution component; updating the model parameters of the second Gaussian mixture model according to the posterior probability, until the model parameters of the second Gaussian mixture model meet the parameter requirements, and obtaining the first Gaussian mixture model. Therefore, the Gaussian mixture model can be trained by the set of cluster centers and the posterior probability, which can improve the accuracy of model training, and the computing resource consumption of the Gaussian mixture model is low, which can improve the training efficiency of the Gaussian mixture model, and the acquisition accuracy of the Gaussian mixture model can be improved by iterative training of the Gaussian mixture model, thereby improving the training efficiency of the Gaussian mixture model while improving the acquisition accuracy of the Gaussian mixture model.
[0187] Figure 5 is a block diagram of a device for determining color information according to an exemplary embodiment. Figure 5 , the device comprises:
[0188] A set acquisition unit 501 is used to acquire a data point set corresponding to a target image in a target color space;
[0189] A probability acquisition unit 502, configured to acquire a probability corresponding to at least one Gaussian distribution component to which any data point in the data point set belongs by using a first Gaussian mixture model;
[0190] The color determination unit 503 is used to assign any data point to a component corresponding to a maximum probability among the probabilities corresponding to at least one Gaussian distribution component, and determine the first color information corresponding to any data point according to the component corresponding to the maximum probability.
[0191] According to some embodiments, the set acquisition unit 501 is further configured to:
[0192] Get the color space information corresponding to the target image;
[0193] When the color space information indicates that the color space of the target image is not the target color space, the target image is converted to convert the color space of the target image to the target color space.
[0194] According to some embodiments, the color determination unit 503 is further configured to:
[0195] Obtaining second color information corresponding to any data point, wherein the second color information is color information re-obtained for any data point;
[0196] Acquire difference information between the first color information and the second color information;
[0197] When the difference information is greater than the difference threshold, the first Gaussian mixture model is modified to obtain a modified first Gaussian mixture model.
[0198] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0199] In some or related embodiments, a set acquisition unit is used to acquire a set of data points corresponding to a target image in a target color space; a probability acquisition unit is used to adopt a first Gaussian mixture model to acquire the probability corresponding to at least one Gaussian distribution component to which any data point in the data point set belongs; and a color determination unit is used to assign any data point to a component corresponding to the maximum probability among the probabilities corresponding to at least one Gaussian distribution component, and determine the first color information corresponding to any data point according to the component corresponding to the maximum probability. Therefore, a Gaussian mixture model can be used to acquire color information, and color information acquisition suitable for complex environments can be used to reduce the situation where the color information acquisition step is more complicated when complex algorithms are used to acquire color information. In addition, color information acquisition in the target color space can reduce the situation where the accuracy of color acquisition at different brightness is low, and the efficiency of color information acquisition can be improved while improving the accuracy of color information acquisition.
[0200] Figure 6 is a block diagram of a model training device according to an exemplary embodiment. Figure 6 , the device comprises:
[0201] The data point acquisition unit 601 is used to acquire a set of sample data points corresponding to the training sample image, and acquire a set of cluster centers corresponding to the set of sample data points;
[0202] A value acquisition unit 602 is used to acquire a first value corresponding to any Gaussian distribution component in the Gaussian distribution component set by using the cluster center set;
[0203] The posterior probability acquisition unit 603 is used to acquire the posterior probability corresponding to each sample data point in the sample data point set according to the first value, the mixing weight corresponding to any Gaussian distribution component and the covariance matrix of any Gaussian distribution component;
[0204] The parameter updating unit 604 is used to update the model parameters of the second Gaussian mixture model according to the posterior probability until the model parameters of the second Gaussian mixture model meet the parameter requirements, thereby obtaining the first Gaussian mixture model.
[0205] According to some embodiments, the data point acquisition unit 601 is used to acquire a cluster center set corresponding to a sample data point set, specifically to:
[0206] Taking the first sample data point in the sample data point set as the first cluster center, wherein the first sample data point is any sample data point in the sample data point set;
[0207] Obtaining a distance between a second sample data point and the first sample data point, wherein the second sample data point is any sample data point in the sample data point set except the first sample data point;
[0208] When the distance does not meet the distance requirement, the second sample data point with the largest distance is selected as the second cluster center;
[0209] Add the first cluster center and the second cluster center to the cluster center set;
[0210] Repeat the step of obtaining the second cluster center until a set of cluster centers that meets the cluster center requirements is selected.
[0211] According to some embodiments, the parameter updating unit 604 is further configured to:
[0212] Obtaining third color information corresponding to the test sample image output by the second Gaussian mixture model;
[0213] Acquire fourth color information corresponding to the test sample image, wherein the fourth color information is label color information;
[0214] Obtaining an intersection-and-union ratio of the third color information and the fourth color information;
[0215] When the intersection-over-union ratio meets the threshold requirement, the training of the second Gaussian mixture model is stopped to obtain the first Gaussian mixture model.
[0216] According to some embodiments, the parameter updating unit 604, when used to obtain the third color information corresponding to the test sample image output by the second Gaussian mixture model, is specifically used to:
[0217] Obtain a standard deviation corresponding to a Gaussian distribution component and a second value corresponding to the Gaussian distribution component in a second Gaussian mixture model;
[0218] Obtaining a threshold set of at least one feature dimension corresponding to the color space according to the standard deviation and the second value;
[0219] According to the threshold set, third color information corresponding to the test sample image output by the second Gaussian mixture model is obtained.
[0220] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0221] In some or related embodiments, a data point acquisition unit is used to acquire a set of sample data points corresponding to the training sample image, and to acquire a set of cluster centers corresponding to the set of sample data points; a value acquisition unit is used to adopt the set of cluster centers to acquire a first value corresponding to any Gaussian distribution component in the set of Gaussian distribution components; a posterior probability acquisition unit is used to acquire the posterior probability corresponding to each sample data point in the set of sample data points according to the first value, the mixing weight corresponding to any Gaussian distribution component, and the covariance matrix of any Gaussian distribution component; a parameter updating unit 604 is used to update the model parameters of the second Gaussian mixture model according to the posterior probability until the model parameters of the second Gaussian mixture model meet the parameter requirements, and the first Gaussian mixture model is acquired. Therefore, the accuracy of model training can be improved by using the set of cluster centers and the posterior probability for the Gaussian mixture model, and the computing resource consumption of the Gaussian mixture model is low, which can improve the training efficiency of the Gaussian mixture model, and the acquisition accuracy of the Gaussian mixture model can be improved by iterative training of the Gaussian mixture model, thereby improving the training efficiency of the Gaussian mixture model while improving the acquisition accuracy of the Gaussian mixture model.
[0222] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable electronic devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0223] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0224] A number of components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the electronic device 700 to exchange information / data with other electronic devices through a computer network such as the Internet and / or various telecommunication networks.
[0225] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as color information determination or model training methods. For example, in some embodiments, the color information determination or model training method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the color information determination or model training method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the color information determination or model training method in any other suitable manner (eg, by means of firmware).
[0226] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0227] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0228] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0229] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0230] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0231] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0232] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0233] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for determining color information, It is characterized in that include: Get a set of data points corresponding to the target image in the target color space; Using a first Gaussian mixture model to obtain a probability corresponding to at least one Gaussian distribution component to which any data point in the data point set belongs; Allocate any one of the data points to a component corresponding to a maximum probability among the probabilities corresponding to the at least one Gaussian distribution component, and determine the first color information corresponding to the any one of the data points based on the component corresponding to the maximum probability.
2. The method according to claim 1, It is characterized in that The method further comprises: Get the color space information corresponding to the target image; In a case where the color space information indicates that the color space of the target image is not the target color space, the target image is converted to convert the color space of the target image to the target color space.
3. The method according to claim 1, It is characterized in that The method further comprises: Acquire second color information corresponding to any one of the data points, wherein the second color information is color information newly acquired for any one of the data points; Acquire difference information between the first color information and the second color information; When the difference information is greater than the difference threshold, the first Gaussian mixture model is corrected to obtain a corrected first Gaussian mixture model.
4. A model training method, It is characterized in that include: Obtaining a set of sample data points corresponding to the training sample image, and obtaining a set of cluster centers corresponding to the set of sample data points; Using the cluster center set, obtaining a first value corresponding to any Gaussian distribution component in the Gaussian distribution component set; Obtaining a posterior probability corresponding to each sample data point in the set of sample data points according to the first value, the mixing weight corresponding to any Gaussian distribution component, and the covariance matrix of any Gaussian distribution component; The model parameters of the second Gaussian mixture model are updated according to the posterior probability until the model parameters of the second Gaussian mixture model meet the parameter requirements, thereby obtaining the first Gaussian mixture model.
5. The method according to claim 4, It is characterized in that The obtaining of a cluster center set corresponding to the sample data point set includes: Taking a first sample data point in the sample data point set as a first cluster center, wherein the first sample data point is any sample data point in the sample data point set; Acquire a distance between a second sample data point and the first sample data point, wherein the second sample data point is any sample data point in the sample data point set except the first sample data point; When the distance does not meet the distance requirement, selecting a second sample data point with the largest distance as a second cluster center; Adding the first cluster center and the second cluster center to a cluster center set; Repeat the step of obtaining the second cluster center until the set of cluster centers that meets the cluster center requirements is selected.
6. The method according to claim 4, It is characterized in that The method further comprises: Obtaining third color information corresponding to the test sample image output by the second Gaussian mixture model; Acquire fourth color information corresponding to the test sample image, wherein the fourth color information is label color information; Obtaining an intersection-over-union ratio of the third color information and the fourth color information; When the intersection-over-union ratio meets the threshold requirement, the training of the second Gaussian mixture model is stopped to obtain the first Gaussian mixture model.
7. The method according to claim 6, It is characterized in that The obtaining the third color information corresponding to the test sample image output by the second Gaussian mixture model includes: Obtain a standard deviation corresponding to a Gaussian distribution component in the second Gaussian mixture model and a second numerical value corresponding to the Gaussian distribution component; Acquire a threshold set of at least one feature dimension corresponding to the color space according to the standard deviation and the second value; According to the threshold set, third color information corresponding to the test sample image output by the second Gaussian mixture model is obtained.
8. A color information determining device, It is characterized in that include: A set acquisition unit, used to acquire a set of data points corresponding to a target image in a target color space; A probability acquisition unit, configured to acquire a probability corresponding to at least one Gaussian distribution component to which any data point in the data point set belongs by using a first Gaussian mixture model; The color determination unit is used to assign any of the data points to the component corresponding to the maximum probability among the probabilities corresponding to the at least one Gaussian distribution component, and determine the first color information corresponding to the any of the data points according to the component corresponding to the maximum probability.
9. A model training device, It is characterized in that include: A data point acquisition unit, used to acquire a set of sample data points corresponding to the training sample image, and acquire a set of cluster centers corresponding to the set of sample data points; A value acquisition unit, used to use the cluster center set to acquire a first value corresponding to any Gaussian distribution component in the Gaussian distribution component set; a posterior probability acquisition unit, configured to acquire the posterior probability corresponding to each sample data point in the set of sample data points according to the first value, the mixing weight corresponding to any Gaussian distribution component and the covariance matrix of any Gaussian distribution component; A parameter updating unit is used to update the model parameters of the second Gaussian mixture model according to the posterior probability until the model parameters of the second Gaussian mixture model meet the parameter requirements, thereby obtaining the first Gaussian mixture model.
10. An electronic device, It is characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method as claimed in any one of claims 1 to 3 or 4 to 7.
11. A storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 3 or 4 to 7.