Color enhancement method and device, equipment and storage medium

By traversing the preset color lookup table LUT, the memory color target type and color adjustment amount are determined, which solves the problem that memory color enhancement is difficult to universally apply in the prior art, and achieves an efficient color enhancement effect.

CN120219236AActive Publication Date: 2025-06-27BEIJING X RING TECHNOLOGY CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202311820368.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2025-06-27
Estimated Expiration
2043-12-26

AI Technical Summary

Technical Problem

The prior art is difficult to universally apply to other memory colors other than skin colors in memory color enhancement, and the hardware overhead of the elliptical model is relatively large and hardened.

Method used

By obtaining the color index value of each pixel point in the image, traverse the preset color lookup table LUT, determine the memory color target type and color adjustment amount, and perform color adjustments to achieve memory color enhancement.

Benefits of technology

Improves computing and storage efficiency, is more efficient than deep learning methods, and can quickly determine color enhancement schemes suitable for images, avoiding the problems of excessive enhancement or local distortion in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219236A_ABST
    Figure CN120219236A_ABST
Patent Text Reader

Abstract

The invention provides a color enhancement method and device, equipment and a storage medium, and relates to the technical field of image processing. The method comprises the following steps: acquiring a color index value corresponding to each pixel point in each dimension in an image to be processed; based on the color index value of each pixel point in each dimension, traversing a first preset color lookup table LUT associated with the dimension to obtain a target type of a memory color corresponding to the pixel point; traversing a second preset LUT according to the target type of the memory color to which each pixel point belongs and the corresponding color index value, so as to obtain a color adjustment amount corresponding to the pixel point; and based on the color adjustment amount corresponding to each pixel point, performing color adjustment on each pixel point to obtain a color-enhanced target image. Therefore, when the to-be-processed image is subjected to color enhancement, the target image can better meet the expectation of a user for the color through memory color enhancement, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technologies, and in particular, to a color enhancement method, apparatus, device, and storage medium. Background Art

[0002] Memory color enhancement is a specific subfield in image processing, mainly focusing on enhancing the colors of objects for which people have fixed color expectations, such as the sky, green plants, and human skin color. The colors of these objects have an "expected" color in people's memory, so enhancing these colors can make the image more in line with people's visual expectations.

[0003] In the related art, a skin color model can be modeled through an ellipse model to detect and enhance the skin color, but this is not universal for other memory color migrations, and the hardware overhead of the ellipse model is large and it is difficult to harden. Summary of the Invention

[0004] The present disclosure provides a color enhancement method, apparatus, device, and storage medium, aiming to solve at least one of the technical problems in the related art to some extent.

[0005] In a first aspect, the present disclosure provides a color enhancement method, including:

[0006] Obtaining the color index values corresponding to each pixel point in each dimension of the image to be processed;

[0007] Based on the color index values of each pixel point in each dimension, traversing a first preset color lookup table (LUT) associated with this dimension to obtain the target type of the memory color corresponding to the pixel point;

[0008] According to the target type of the memory color to which each pixel point belongs and the corresponding color index value, traversing a second preset LUT to obtain the color adjustment amount corresponding to the pixel point;

[0009] Based on the color adjustment amount corresponding to each pixel point, performing color adjustment on each pixel point to obtain a target image with enhanced color.

[0010] In a second aspect, the present disclosure provides a color enhancement apparatus, including:

[0011] A first acquisition module, configured to obtain the color index values corresponding to each pixel point in each dimension of the image to be processed;

[0012] A second acquisition module, configured to traverse a first preset color lookup table (LUT) associated with this dimension based on the color index values of each pixel point in each dimension to obtain the target type of the memory color corresponding to the pixel point;

[0013] A third acquisition module, configured to traverse a second preset LUT according to the target type of the memory color to which each pixel belongs and the corresponding color index value, so as to obtain the color adjustment amount corresponding to the pixel;

[0014] A fourth acquisition module, based on the color adjustment amount corresponding to each pixel, performs color adjustment on each pixel to obtain a target image with enhanced color.

[0015] In a third aspect, the present disclosure provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein, the processor is configured to execute the instructions to implement the color enhancement method.

[0016] In a fourth aspect, the present disclosure provides a computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the color enhancement method.

[0017] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, and the computer program is executed by a processor to perform the color enhancement method.

[0018] In the embodiments of the present disclosure, first, the color index value corresponding to each pixel in each dimension of the image to be processed is obtained. Based on the color index value of each pixel in each dimension, the first preset color lookup table (LUT) associated with this dimension is traversed to obtain the target type of the memory color corresponding to the pixel. According to the target type of the memory color to which each pixel belongs and the corresponding color index value, the second preset LUT is traversed to obtain the color adjustment amount corresponding to the pixel. Based on the color adjustment amount corresponding to each pixel, color adjustment is performed on each pixel to obtain a target image with enhanced color. Thus, the color enhancement problem can be resolved into a problem that can be solved by a color lookup table, improving the calculation and storage efficiency, which is more efficient than the deep learning method, and a color enhancement scheme suitable for the image to be processed can be determined in a short time.

[0019] Additional aspects and advantages of the present disclosure will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure and, together with the specification, are used to explain the principles of the present disclosure.

[0021] Figure 1 It is a schematic flowchart of a color enhancement method shown according to the first embodiment of the present disclosure;

[0022] Figure 2It is a schematic flowchart of the color enhancement method shown in the second embodiment of the present disclosure;

[0023] Figure 3 It is a schematic structural diagram of the color enhancement device shown in the embodiment of the present disclosure;

[0024] Figure 4 It shows a block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure.

[0025] Through the above-mentioned drawings, specific embodiments of the present disclosure have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present disclosure in any way, but to illustrate the concept of the present disclosure to those skilled in the art by referring to specific embodiments. Detailed Description of Specific Embodiments

[0026] The embodiments of the present disclosure will be described in detail below. Examples of the embodiments are shown in the drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and are only used to explain the present disclosure and should not be construed as a limitation of the present disclosure. On the contrary, the embodiments of the present disclosure include all variations, modifications, and equivalents falling within the spirit and scope of the appended claims.

[0027] It should be noted that the scenarios to which the present disclosure can be applied can be the fields of photographic imaging and display. After an image is captured or processed, the color may deviate from its original or desired color. By using memory color enhancement, these colors can be automatically adjusted to be closer to the expectations of the viewer. When an image or video is displayed on a computer screen, the viewer may have expectations inconsistent with the video source regarding the color displayed by a specific object. For example, the preference for skin color can be satisfied by more people through color enhancement.

[0028] It should be noted that the execution subject of the color enhancement method in this embodiment can be a color enhancement device, or it can also be any electronic device, such as a camera, a mobile phone, a computer, etc., which is not limited herein. The device can be implemented in software and / or hardware.

[0029] Figure 1 It is a schematic flowchart of the color enhancement method shown in the first embodiment of the present disclosure, as Figure 1 shown, the method includes:

[0030] S101: Obtain the color index values corresponding to each pixel point in each dimension in the image to be processed.

[0031] Among them, the image to be processed can be the original image to be color-enhanced.

[0032] Among them, the dimension can be the brightness dimension, the saturation dimension, the hue dimension, etc., which are not limited here.

[0033] Specifically, the image to be processed can be first converted into the HSV color space or the Lab color space, or other color spaces, which are not limited here. Then, the brightness (Value), saturation (Saturation), and hue value (Hue) of each pixel can be extracted.

[0034] It should be noted that each pixel can be first divided into multiple intervals in each dimension. For example, the range of the hue value is usually from 0 to 360 degrees. Taking 2 degrees as an interval, 0 to 360 degrees can be divided into 180 intervals, denoted as x1, x2, x3... x180 (a total of 180). Among them, the color index values corresponding to the intervals x1, x2, x3... x180 are 1, 2, 3, 4, 5... 180 respectively. Among them, the hue range corresponding to the interval x1 is 0 - 2, the hue range corresponding to the interval x2 is 2 - 4... the hue range corresponding to the interval x180 is 358 - 360, which are not limited here.

[0035] For example, for the pixel P in the image to be processed, its corresponding hue value is 359, which belongs to the interval x180. Therefore, the color index value 180 corresponding to the interval x180 can be used as the color index value of the pixel P in the hue dimension.

[0036] It should be noted that the above example is an example of the hue dimension. The color index values of the pixel in the brightness dimension and the saturation dimension are the same. You can refer to the above method and will not be elaborated here.

[0037] S102: Based on the color index value of each pixel in each dimension, traverse the first preset color lookup table LUT associated with this dimension to obtain the target type of the memory color corresponding to the pixel.

[0038] Among them, the memory color can be the color of an object for which people have a fixed color expectation. It should be noted that users usually have some fixed color expectations for certain specific objects. For example, for the main bodies such as the blue sky, green plants, the ocean, and skin, there are expected colors. For example, if a user sees that the lawn is gray or white, they may feel uncomfortable, but if they see it is green, they will feel comfortable.

[0039] Among them, the target type can be the memory color type suitable for the main body in the image to be processed. In the embodiments of the present disclosure, the target type can be used to represent the color that most meets the user's expectation for the main body in the image to be processed.

[0040] Among them, a color look-up table (LUT) is a table or function that maps input pixel values to output pixel values and can be used for operations such as color correction, color conversion, and contrast adjustment, which are not limited herein.

[0041] Among them, the first preset LUT can be a color look-up table for determining the target type of the memory color.

[0042] It should be noted that different color dimensions correspond to different first preset LUTs. For example, in the saturation dimension, there is a first preset LUT corresponding to saturation, in the hue dimension, there is a first preset LUT corresponding to hue, and in the brightness dimension, there is a first preset LUT corresponding to brightness.

[0043] Optionally, based on the color index value of each pixel point in each dimension, the first preset LUT associated with this dimension can be traversed to obtain the probability values of the pixel point corresponding to different types of memory colors in this dimension.

[0044] The probability values of different types of memory colors corresponding to the same color index value in any dimension may be different. For example, in the saturation dimension, any color index value is K, and different types of memory colors are F1, F2, and F3. Then, in the first preset LUT associated with saturation, the probability value m1 corresponding to K and F1, the probability value m2 corresponding to K and F2, and the probability value m3 corresponding to K and F3 can be recorded, which are not limited herein.

[0045] Therefore, since the first preset LUT records the corresponding relationship between different types of memory colors and probability values, the probability values of any color index value corresponding to different types of memory colors can be determined from the first preset LUT.

[0046] For example, for the color index values K1, K2, and K3 corresponding to the hue dimension, in the first preset LUT associated with the hue dimension, there are different types of memory colors p1, p2, and p3. Among them, the probability values corresponding to the color index value K1 and p1, p2, p3 are b1, b2, and b3 respectively, the probability values corresponding to the color index value K2 and p1, p2, p3 are b4, b5, and b6 respectively, and the probability values corresponding to the color index value K3 and p1, p2, p3 are b7, b8, and b9 respectively.

[0047] Table 1 Memory color p1 Memory color p2 Memory color p3 Color index value K1 Probability value b1 Probability value b1 Probability value b1 Color index value K2 Probability value b4 Probability value b5 Probability value b6 Color index value K3 Probability value b7 Probability value b8 Probability value b9

[0048] It should be noted that the above Table 1 is only an illustrative description and does not limit the present disclosure.

[0049] For example, if the color index value of a pixel point corresponding to the hue dimension is K1, the probability values corresponding to K1 and the memory colors p1, p2, p3 can be determined respectively.

[0050] Further, the target type of the memory color corresponding to the pixel can be determined according to the probability values of the pixel corresponding to different types of memory colors in each dimension.

[0051] As a possible implementation manner, the probability values of the pixel corresponding to different types of memory colors in each dimension can be multiplied first to determine the total probability value of the pixel corresponding to each type of memory color, and then the target type of the memory color corresponding to the pixel can be determined according to the total probability value of the pixel belonging to each type of memory color.

[0052] For example, if the memory color B is the memory color corresponding to green plants, the probability value of the pixel x corresponding to the saturation dimension is k1, the probability value corresponding to the hue dimension is k2, and the probability value corresponding to the brightness dimension is k3, then the total probability value of the pixel corresponding to the memory color B can be calculated as k1 * k2 * k3. If the total probability value corresponding to the memory color B is the largest, the memory color B can be used as the target type of the memory color corresponding to the pixel x, that is, the memory color corresponding to green plants, which is not limited here.

[0053] S103: Traverse the second preset LUT according to the target type of the memory color to which each pixel belongs and the corresponding color index value to obtain the color adjustment amount corresponding to the pixel.

[0054] Optionally, the second preset LUT associated with the hue dimension can be traversed first based on the color index value and the target type corresponding to the pixel in the hue dimension to obtain the first color adjustment amount, and then the second preset LUT associated with the saturation dimension can be traversed based on the color index value and the target type corresponding to the pixel in the saturation dimension to obtain the second color adjustment amount.

[0055] The first color adjustment amount is the color adjustment amount of the pixel in the hue dimension, that is, the hue color adjustment amount.

[0056] The second color adjustment amount is the color adjustment amount of the pixel in the saturation dimension, that is, the saturation color adjustment amount.

[0057] The second preset LUT can reflect the color adjustment amounts respectively corresponding to the respective color index values of any memory color type in any dimension.

[0058] Taking the second preset LUT associated with the hue dimension as an example, if K1, K2, and K3 are all color index values K1, K2, and K3 corresponding to the hue dimension, the memory color types include the blue sky memory color and the skin color memory color. Among them, the first color adjustment amounts corresponding to the color index value K1 and the blue sky memory color and the skin color memory color are b1 and b2 respectively, the first color adjustment amounts corresponding to the color index value K2 and the blue sky memory color and the skin color memory color are b3 and b4 respectively, and the first color adjustment amounts corresponding to the second color index value K3 and the blue sky memory color and the skin color memory color are b5 and b6 respectively.

[0059] Table 2 Blue sky memory color Skin color memory color Color index value K1 First color adjustment amount b1 First color adjustment amount b2 Color index value K2 First color adjustment amount b3 First color adjustment amount b4 Color index value K3 First color adjustment amount b5 First color adjustment amount b6

[0060] It should be noted that the above Table 2 is only a schematic illustration of the second preset LUT associated with the hue dimension, and does not limit the present disclosure. Similarly, for the second preset LUT associated with the saturation dimension, it will not be elaborated here.

[0061] Specifically, after the target type of the memory color to which each pixel belongs and the corresponding color index value, for example, if the target type of the memory color to which the pixel belongs is the blue sky memory color and the color index value of the corresponding hue dimension is K1, then according to the second preset LUT associated with the hue dimension, that is, the above Table 2, the first color adjustment amount corresponding to the blue sky memory color and the color index value K1 can be determined as b1, which is not limited here.

[0062] It should be noted that the saturation dimension can refer to the look-up table method of the hue dimension, which will not be elaborated here.

[0063] Among them, if the pixel does not belong to the memory color, the color of the pixel may not be adjusted. In the embodiments of the present disclosure, after determining whether each pixel belongs to the memory color, the color of the pixel belonging to the memory color can be adjusted.

[0064] S104: Based on the color adjustment amount corresponding to each pixel, perform color adjustment on each pixel to obtain a target image with enhanced color.

[0065] Specifically, color adjustment can be performed on each pixel in the image to be processed, and the image to be processed after the adjustment is used as the target image with enhanced color.

[0066] Among them, the target image can be an image obtained by enhancing the color of the image to be processed.

[0067] For example, if the saturation value of pixel e in the image to be processed is f1 and the hue value is f2, and the color adjustment amount corresponding to pixel e is "+a" and the color adjustment amount of the hue is "+b", then the saturation corresponding to pixel e in the target image is "f1 + a", and the hue value corresponding to pixel e in the target image is "f2 + b", which is not limited here.

[0068] As another possible implementation, taking the hue dimension as an example, the first preset LUT is used as the hue weight table LUT1, and the second preset LUT is used as the hue offset table (LUT2). If it is determined that the hue corresponding to pixel x is f1, then the color adjustment amount can be determined as LUT1(f1) * LUT2(f1), and then the hue value corresponding to pixel x in the final target image is determined as f1 + LUT1(f1) * LUT2(f1).

[0069] In the embodiments of the present disclosure, first, the color index values corresponding to each pixel in the image to be processed in each dimension are obtained. Based on the color index values of each pixel in each dimension, the first preset color lookup table LUT associated with this dimension is traversed to obtain the target type of the memory color corresponding to the pixel. According to the target type of the memory color to which each pixel belongs and the corresponding color index value, the second preset LUT is traversed to obtain the color adjustment amount corresponding to the pixel. Based on the color adjustment amount corresponding to each pixel, each pixel is color-adjusted to obtain the target image with enhanced color. Thus, the color enhancement problem can be resolved into a problem that can be solved by the color lookup table, improving the calculation and storage efficiency, which is more efficient than the deep learning method, and the color enhancement scheme suitable for the image to be processed can be determined in a short time.

[0070] Figure 2 It is a schematic flowchart of the color enhancement method shown in the second embodiment of the present disclosure. As Figure 2 shown, the method includes:

[0071] S201: Obtain the color index values corresponding to each pixel in the image to be processed in each dimension.

[0072] It should be noted that the specific implementation manner of step S201 can refer to the above embodiments and will not be elaborated here.

[0073] S202: Obtain a reference data set, where the reference data set includes multiple groups of mutually associated source data, target data, masks, and the types of memory colors corresponding to the target data.

[0074] Among them, the reference data set can be the preparation data for generating the first preset LUT and the second preset LUT.

[0075] Among them, the source data can be image data to be color enhanced.

[0076] Among them, the target data can be image data that meets the user's color expectations, and the target data contains data of the memory color type.

[0077] As a possible implementation method, the AWB (Auto White Balance) algorithm can be used to calculate the CCT value (color temperature of the light source) corresponding to the original data, and the data can be divided into several categories according to the CCT value to obtain category a data. The AE (Auto Exposure) algorithm can be used to calculate the LuxID value (light intensity under imaging conditions) corresponding to each sample, and the data can be divided into several categories according to the LuxID value to obtain category b data. Further, category a and category b data can be combined to obtain a×b category data. Further, at least one image can be selected from each category of data as the source data.

[0078] Optionally, it is first necessary to collect the source data and the target data. The target data can be a data set that the audience prefers more according to psychophysical experiments. These two data sets of the source data and the target data can come from different sources, and it is not required that the object postures related to the memory color be consistent.

[0079] Among them, psychophysical experiments can be designed and conducted to obtain the preference feedback of the audience for different colors, objects, and scenes. Through the experimental results, the specific colors and related regions that the audience prefers more in the target data set can be determined. Or, a suitable image segmentation algorithm, such as a semantic segmentation algorithm based on deep learning, can also be selected to extract the regions related to the memory color. According to the experimental results, regions related to the memory color such as green plants, blue sky, human faces, etc. can be extracted.

[0080] Further, the results obtained by the segmentation algorithm can be used to generate corresponding masks to highlight or retain the regions related to the target data. The mask can be a binary image, where the pixel value of the target region is 1 and the non-target region is 0.

[0081] After that, according to the directory structures of the source data and the target data, the generated masks can be placed in the corresponding directory structures for subsequent data processing and analysis. Then these data can be used for further processing, analysis, or application.

[0082] Among them, the types of memory colors corresponding to the target data can be the colors corresponding to green plants, blue sky, human faces, ocean, night sky, etc., which are not limited here.

[0083] Optionally, to exclude the influence of "bad pixels" on the overall distribution calculation, the K-means clustering method can be used to classify the data. Before using K-means, color information can be statistically analyzed for regions belonging to specific memory colors in the source data and target data, and data preprocessing can be performed first. This may include operations such as adjusting the brightness, contrast, and color balance of the image to ensure data consistency and comparability. After that, the preprocessed data can be input into the K-means clustering algorithm. The K-means algorithm divides the data set into K clusters, and each cluster contains similar data points. The appropriate number of clusters K can be determined according to the simple elbow principle or silhouette coefficient. After clustering, each cluster represents a similar data group. According to the clustering results, the cluster representing the specific memory color in the target data is determined. The cluster containing the specific memory color can be selected by analyzing the clustering results and the color information related to the target data. By using the previously generated mask, interference from other colors in the target cluster can be excluded. The mask is applied to the target data, only the region related to the specific memory color is retained, and pixels of other colors are excluded.

[0084] Optionally, after obtaining the target data and source data, the brightness of the target data can be aligned with the brightness of the source data based on the optimal distance transport algorithm.

[0085] It should be noted that since the brightness distribution has a great influence on the color perception, usually the color distributions of different brightness levels are different. Therefore, before performing memory color enhancement, it is necessary to first perform a brightness distribution alignment on the brightness. In the embodiments of the present disclosure, the brightness alignment can be achieved based on the optimal distance transport algorithm (Optimal Transport, OT). The color space for transmission can use a color space where brightness and color are separable, and the brightness change can be performed in a linear space. For example, the Lab or J z a z b z color space can be used, so that the brightness alignment of the target data towards the source data can be performed on the distribution of the L dimension or Jz, which is not limited here. Thus, after the brightness alignment, the source data and the target data are under the same brightness reference, and then the color distribution can be aligned.

[0086] Among them, the optimal distance transport algorithm (Optimal Transport, OT) is a mathematical method for calculating the minimum transport cost between two probability distributions. In image processing, this algorithm can be used to align the brightness between two images. By using the optimal distance transport algorithm to align the brightness of the target data with the source data, the transport cost can be minimized.

[0087] S203: Statistically analyze the target data associated with the type of the same memory color to obtain the target distribution characteristics of the target data associated with the type of the same memory color in each dimension.

[0088] Optionally, it is possible to first obtain the histogram of each target data associated with the type of the same memory color in each dimension, then determine the difference between each histogram and the remaining histograms, and then, based on the difference corresponding to each histogram, determine the second weight of each histogram. Subsequently, based on the second weight, multiple histograms associated with the type of the same memory color in each dimension can be fused to obtain the target distribution characteristics of the type of the same memory color in the dimension.

[0089] Among them, the target distribution characteristics can be the expected distribution characteristics corresponding to the target data associated with the type of any memory color in any dimension, that is, the distribution characteristics that are expected to be achieved.

[0090] It should be noted that the target distribution characteristics of the target data associated with the type of the same memory color in different dimensions may be different. For example, in the hue dimension, there are target distribution characteristics corresponding to the hue dimension, and in the saturation dimension, there are target distribution characteristics corresponding to the saturation dimension. This is not limited here.

[0091] Optionally, it is possible to first select a suitable color space for statistics, such as the HSV (hue, saturation, value) and Lab color spaces. The HSV color space is more intuitive, while the Lab color space is more uniform in human eye perception. Subsequently, according to the mask generated previously, pixels belonging to the memory color region can be selected. The mask will only retain the region related to a specific memory color, and pixels of other colors will be excluded.

[0092] Furthermore, for each type of memory color, calculate the distribution of the hue value or saturation in the selected color space. Use the hue value or saturation as the abscissa and the number of pixels as the ordinate to draw a histogram. Subsequently, the histogram of each color channel can be normalized to calculate the frequency of pixel occurrence at different saturation levels or hue angles. By dividing the number of pixels by the total number of pixels, the frequency of each hue value or saturation can be obtained. By analyzing the normalized histogram, the target distribution characteristics of the target data associated with the type of the same memory color in each dimension (hue value or saturation) can be obtained.

[0093] Among them, the difference can be measured in the way of KL (Kullback-Leibler divergence), Jensen-Shannon divergence, Hellinger distance, or cosine similarity. Or, it can also be in other ways, which are not limited here.

[0094] As a possible implementation, in the embodiments of the present disclosure, when determining the difference between each histogram and the remaining histograms, the KL divergence can be used as an implementation to determine the KL divergence between each histogram and the remaining histograms.

[0095] Among them, the KL divergence, also known as relative entropy, is an index for measuring the difference between two probability distributions.

[0096] Among them, the remaining histograms can be the other histograms after removing any one histogram from the set of histograms corresponding to any dimension. Let H be the set of histograms corresponding to any dimension, where H = {h1, h2,..., h n}. h i is the i-th histogram. For each h i , calculate its KL divergence from the other histograms after removing h i

[0097] Among them, for each h i , its second weight w i is calculated by the following formula:

[0098] It should be noted that if the KL divergence between h i and the remaining histograms is large, the second weight w i corresponding to h i will be small. In order for the sum of the weights of the histograms in the histogram set to be 1, weight recalibration can be performed, that is:

[0099]

[0100] Among them, w i is the second weight corresponding to h i , and n is the number of histograms in the histogram set.

[0101] It should be noted that if the difference between a histogram h i and other histograms is large, then the second weight corresponding to the histogram h i is relatively small. If the difference between the histogram h i and other histograms is small, then the second weight corresponding to the histogram h i is relatively large, which also indicates that the histogram h i is more important.

[0102] Further, multiple histograms associated with the same memory color type can be fused according to the second weight. The histograms can be fused using weighted average or weighted summation, where the weight is the second weight. The fused histogram represents the target distribution characteristics of the same memory color type in the dimension.

[0103] Among them, the target distribution characteristics can also be embodied in the form of a distribution function, which is not limited here. That is, the target distribution characteristics can be a probability distribution function that describes the distribution probability of pixel points in the target data in different dimensions for color characteristics. The probability distribution function can describe the characteristics of the color distribution in the image and the frequency of occurrence of different characteristic values, which is not limited here.

[0104] S204: Statistically analyze the source data associated with the same memory color type to obtain the source distribution characteristics of the source data associated with the same memory color type in each dimension.

[0105] Optionally, it is possible to first obtain the histogram of each source data associated with the same memory color type in each dimension, then determine the difference between each histogram and the remaining histograms, and then determine the third weight of each histogram according to the corresponding difference of each histogram. After that, based on the third weight, multiple histograms associated with the same memory color type in each dimension can be fused to obtain the source distribution characteristics of the same memory color type in the dimension.

[0106] Among them, the source distribution characteristics can be the original distribution characteristics corresponding to the source data (raw data) associated with any memory color type in any dimension.

[0107] Optionally, a suitable color space can be first selected for statistics, such as the HSV (hue, saturation, value) and Lab color spaces. The HSV color space is more intuitive, while the Lab color space is more uniform in human eye perception. After that, according to the previously generated mask, pixels belonging to the memory color region can be selected. The mask will only retain the region related to a specific memory color, and pixels of other colors will be excluded.

[0108] Further, for each memory color type, calculate the distribution of hue values or saturation in the selected color space. Using the hue value or saturation as the abscissa and the number of pixels as the ordinate, a histogram is plotted. After that, the histogram of each color channel can be normalized to calculate the frequency of pixel occurrence at different saturations or hue angles. By dividing the number of pixels by the total number of pixels, the frequency of each hue value or saturation is obtained. By analyzing the normalized histogram, the source distribution characteristics of the source data associated with the same memory color type in each dimension (hue value or saturation) can be obtained.

[0109] It should be noted that the specific implementation method of S204 can refer to the above step S203 and will not be elaborated here.

[0110] S205: According to a preset cost function, determine the color transfer mode when each source distribution feature is transformed into an associated target distribution feature, where the color transfer mode includes the second color index value in the source distribution feature and the corresponding first color index value when transformed into the target distribution feature.

[0111] Among them, the first color index value can be each color index value in any dimension of the target distribution feature. For example, for the target distribution feature corresponding to the hue dimension, it can include multiple first color index values corresponding to the hue dimension.

[0112] Among them, the first color index value can be each color index value in any dimension of the source distribution feature. For example, for the source distribution feature corresponding to the hue dimension, it can include multiple first color index values corresponding to the hue dimension.

[0113] Among them, the preset cost function can be:

[0114]

[0115] Among them, Π(p, q) is the set of joint distributions where all target distribution features are p and source distribution features are q. Y is regarded as a transfer function from the expected distribution feature p to the source distribution feature q, and ∫c(x, y)dY(x, y) represents the cost of moving from p to q. The optimal transport problem is to find an optimal transport plan to minimize the cost from probability distribution p to probability distribution q.

[0116] Among them, the color transfer mode can include a saturation transfer mode and a hue transfer mode.

[0117] It should be noted that since the classification and division rules of the source data and the target data are the same, for example, both can be based on the color temperature of the light source and the illumination intensity under the imaging conditions, so if the categories corresponding to the target distribution feature and the source distribution feature are the same, then the target distribution feature and the source distribution feature can be considered associated.

[0118] In this transmission process, the saturation transfer mode and the hue value transfer mode can be used to transform the second color index value in the source distribution feature into the corresponding first color index value when transformed into the target distribution feature, and to minimize the migration cost, reduce the cost, and transfer the most substances.

[0119] Among them, the saturation transfer distance mode can be a convex combination of the first and second norms, in the following form:

[0120] d(x, y) = (1 - λ)|x - y|2 + input |x - y|

[0121] Wherein, x represents the first color index value corresponding to the saturation in the target distribution feature, and y represents the second color index value corresponding to any saturation in the source distribution feature of any pixel.

[0122] Wherein, the second norm indicates that the farther the migration distance is, the greater the corresponding migration cost. The first norm represents the continuity penalty of saturation to ensure that equal weights are given to all differences, thereby encouraging a more continuous, smoother, and sparser transfer scheme.

[0123] Optionally, in skin color saturation transmission, some saturation jumps may still exist in extremely rare cases. In this case, the Sinkhorn-Knopp algorithm can be used to solve the optimal transport problem with entropy regularization. By introducing an entropy regularization term, a smoother transport plan can be obtained.

[0124] Wherein, the form of the hue value transmission distance function is as follows:

[0125] d(x, y) = (1 - λ) * (|x - y| 2 ) + λ * ((1 - α) * |x - y| + α * |(x + 1) - (y - 1)|) K

[0126] Wherein, x represents the first color index value corresponding to any hue in the target distribution feature, y represents the second color index value corresponding to any hue in the source distribution feature, and α, λ, k are hyperparameters.

[0127] It should be noted that the hue needs to consider periodicity. When calculating the difference between the source hue and the target hue, periodic calculation is required. For example, the distances corresponding to 1 degree to 0 degree and 359 degrees to 0 degree are the same.

[0128] It should be noted that when performing the minimum distance transmission of the hue value, not only the difference between the source hue and the target hue is considered, but also the gradient difference between the source hue and the target hue is considered. In the embodiments of the present disclosure, a new regularization term can be defined for the hue, considering the difference and gradient difference of the hue, and regularized into the form of a power-law function of the difference magnitude of adjacent colors, so as to control the influence of the gradient difference on the entire cost function to a certain extent. In this way, if the mapping between the source hue and the target hue results in a large gradient difference, then this mapping will be more explicitly penalized to ensure the continuity of the final color.

[0129] S206: Generate a first preset LUT and a second preset LUT according to the transmission mode.

[0130] Optionally, network flow algorithms such as the Ford-Fulkerson algorithm or the Edmonds-Karp algorithm can be used for fast calculation to solve the transfer function γ according to the transmission mode and convert it into a LUT table for color transformation.

[0131] Optionally, the process of generating the first preset LUT includes:

[0132] In the case where any second color index value is different from the corresponding first color index value, determine that the probability value corresponding to the first color index value in the first preset LUT is 1.

[0133] In the case where any second color index value is the same as the corresponding first color index value, determine that the probability value corresponding to the first color index value in the first preset LUT is 0.

[0134] Specifically, it is necessary to compare the second color index values in different dimensions with the corresponding first color index values to determine the probability value corresponding to each first color index value in each dimension. For example, the second color index values in the hue dimension can be compared with the corresponding first color index values, so as to determine the probability value corresponding to each first color index value in the hue dimension.

[0135] It should be noted that if any second color index value is different from the corresponding first color index value, it means that the color corresponding to this second color index value belongs to the memory color, so the probability can be set to 1. If any second color index value is the same as the corresponding first color index value, it means that no memory color enhancement is required, so the probability corresponding to this first color index value can be set to 0.

[0136] Furthermore, the first preset LUT corresponding to each dimension can be constructed according to the probability values corresponding to each first color index value in each dimension.

[0137] Optionally, the process of generating the second preset LUT includes:

[0138] In the case where any second color index value is different from the corresponding first color index value, determine the difference between the any second color index value and the corresponding first color index value, and then based on the difference, determine the color adjustment amount corresponding to the any second color index value in the second preset LUT.

[0139] For example, the range of hue values is usually from 0 to 360 degrees. It can be divided into 180 intervals with 2 degrees as an interval, denoted as x1, x2, x3... x180 (a total of 180). Among them, the color index values corresponding to the intervals x1, x2, x3... x180 are 1, 2, 3, 4, 5... 180 respectively. Among them, the hue range corresponding to the interval x1 is 0 - 2, the hue range corresponding to the interval x2 is 2 - 4... the hue range corresponding to the interval x180 is 358 - 360, which is not limited here.

[0140] For example, for the pixel point P in the image to be processed, its first color index value corresponding to the hue dimension is 20, and the second color index value corresponding to it is 1. Then, it can be determined that the difference between the first color index value and the second color index value is 19. Since the hue value is divided into intervals with 2 degrees as an interval, the color adjustment amount corresponding to 19 is 38. Further, the second preset LUT corresponding to this dimension can be constructed according to the color adjustment amounts corresponding to the first color index values of each dimension.

[0141] Optionally, after generating the first preset LUT and the second preset LUT, a Gaussian smoothing operation can be performed on them to ensure that there are no drastic changes in the whole process.

[0142] S207: Based on the color index values of each pixel point in each dimension, traverse the first preset color lookup table LUT associated with this dimension to obtain the target type of the memory color corresponding to the pixel point.

[0143] S208: According to the target type of the memory color to which each pixel point belongs and the corresponding color index value, traverse the second preset LUT to obtain the color adjustment amount corresponding to the pixel point.

[0144] S209: Based on the color adjustment amount corresponding to each pixel point, perform color adjustment on each pixel point to obtain the target image with enhanced color.

[0145] It should be noted that the specific implementation manners of steps S207 - S209 can refer to the above embodiments and will not be elaborated here.

[0146] In the embodiments of the present disclosure, first, the color index values corresponding to each pixel point in the image to be processed are obtained in each dimension, and then a reference data set is obtained. The reference data set includes multiple groups of mutually associated source data, target data, masks, and the types of memory colors corresponding to the target data. Then, the target data associated with the same type of memory color is statistically analyzed to obtain the target distribution characteristics of the target data associated with the same type of memory color in each dimension. Then, the source data associated with the same type of memory color is statistically analyzed to obtain the source distribution characteristics of the source data associated with the same type of memory color in each dimension. Then, according to a preset cost function, the color transfer mode when each source distribution characteristic is converted into the associated target distribution characteristic is determined. The color transfer mode includes the second color index value in the source distribution characteristic and the corresponding first color index value when it is converted into the target distribution characteristic. Then, according to the transfer mode, a first preset LUT and a second preset LUT are generated. Based on the color index value of each pixel point in each dimension, the first preset color lookup table LUT associated with this dimension is traversed to obtain the target type of the memory color corresponding to the pixel point. Then, according to the target type of the memory color to which each pixel point belongs and the corresponding color index value, the second preset LUT is traversed to obtain the color adjustment amount corresponding to the pixel point. Finally, based on the color adjustment amount corresponding to each pixel point, each pixel point is color-adjusted to obtain the target image with enhanced color. The target type and color adjustment amount corresponding to the image to be processed are determined based on a preset color mapping table. Finally, these color adjustment amounts are applied to each pixel in the image to be processed to achieve color enhancement. The advantage of this method is that it can perform adaptive enhancement according to the color characteristics of the image, avoiding the problems of over-enhancement or local distortion that may occur in traditional global enhancement algorithms, thereby improving the visual quality and recognition rate of the image. At the same time, this algorithm can also achieve effects such as color stylization and color balance through a preset color mapping table, which has high practicality. The process of calculating the distribution by weighting takes into account the influence of outliers, so it is more robust to noise interference, requires less data volume, and has relatively lower requirements for data quality, reducing the usage cost.

[0147] It should be noted that the embodiments of the present disclosure may also have the following beneficial effects:

[0148] 1. It has stronger universality for various memory colors. This method can be implemented as multiple LUTs. The overall detection and enhancement process is converted into simple linear interpolation, with a small cost for hardware implementation and less need for manual parameter adjustment. 2. The data volume requirement is smaller than that of deep learning solutions, and the requirement for the image quality of the data source is lower. 3. Based on optimal distance transmission, it can capture the complex differences between two distributions, and can explicitly add a penalty for the reverse of hue and saturation during the image adjustment process, resulting in fewer defects in the obtained results. The influence of outliers is considered in the calculation of the overall distribution, and the overall result is more robust. 4. It can adjust specific types of memory colors more specifically. 5. Weighted statistics are added to the histogram statistics, avoiding abnormal adjustment of individual outliers. For example, when adjusting the skin color of Asians, it avoids the overall yellowing during adjustment from affecting individuals with lighter and fairer skin tones. Histogram matching pays more attention to the differences in distribution shapes, and the optimal distance transmission with a cost function is added, which can better measure the distance in actual application scenarios.

[0149] Figure 3 is a block diagram of a color enhancement device shown according to the present disclosure, as Figure 3 shown, the color enhancement device 300 includes:

[0150] A first acquisition module 310, configured to acquire the color index values corresponding to each pixel point in each dimension of the image to be processed;

[0151] A second acquisition module 320, configured to traverse the first preset color lookup table LUT associated with the dimension based on the color index values of each pixel point in each dimension, so as to acquire the target type of the memory color corresponding to the pixel point;

[0152] A third acquisition module 330, configured to traverse the second preset LUT according to the target type of the memory color to which each pixel point belongs and the corresponding color index value, so as to acquire the color adjustment amount corresponding to the pixel point;

[0153] A fourth acquisition module 340, based on the color adjustment amount corresponding to each pixel point, performs color adjustment on each pixel point to acquire the target image after color enhancement.

[0154] Optionally, the second acquisition module includes:

[0155] A first acquisition unit, configured to traverse the first preset LUT associated with the dimension based on the color index values of each pixel point in each dimension, so as to acquire the probability values of different types of memory colors corresponding to the pixel point in this dimension;

[0156] A first determination unit, configured to determine the target type of the memory color corresponding to the pixel point according to the probability values of different types of memory colors corresponding to the pixel point in each dimension.

[0157] Optionally, the determining unit is specifically configured to:

[0158] Multiply the probability values corresponding to different types of memory colors of the pixel point in each dimension to determine the total probability value corresponding to each type of memory color of the pixel point;

[0159] Determine the target type of the memory color corresponding to the pixel point according to the total probability value of the pixel point belonging to each type of memory color.

[0160] Optionally, the third obtaining module is specifically configured to:

[0161] Traverse the second preset LUT associated with the hue dimension based on the color index value corresponding to the pixel point in the hue dimension and the target type to obtain a first color adjustment amount;

[0162] Traverse the second preset LUT associated with the saturation dimension based on the color index value corresponding to the pixel point in the saturation dimension and the target type to obtain a second color adjustment amount.

[0163] Optionally, the second obtaining module is further configured to:

[0164] The second obtaining unit is configured to obtain a reference data set, where the reference data set includes multiple groups of correlated source data, target data, masks, and the types of memory colors corresponding to the target data;

[0165] The third obtaining unit is configured to perform statistics on the target data associated with the type of the same memory color to obtain the target distribution characteristics of the target data associated with the type of the same memory color in each dimension;

[0166] The fourth obtaining unit is configured to perform statistics on the source data associated with the type of the same memory color to obtain the source distribution characteristics of the source data associated with the type of the same memory color in each dimension;

[0167] The second determining unit is configured to determine the color transfer mode when each of the source distribution characteristics is converted into the associated target distribution characteristics according to a preset cost function, where the color transfer mode includes the second color index value in the source distribution characteristics and the corresponding first color index value when converted into the target distribution characteristics;

[0168] The generating unit is configured to generate the first preset LUT and the second preset LUT according to the transfer mode.

[0169] Optionally, the second obtaining unit is further configured to:

[0170] Align the brightness of the target data with the brightness of the source data based on the optimal distance transmission algorithm.

[0171] Optionally, the generating unit is specifically configured to:

[0172] When any second color index value is different from the corresponding first color index value, determine that the probability value corresponding to the first color index value in the first preset LUT is 1; or,

[0173] When any second color index value is the same as the corresponding first color index value, determine that the probability value corresponding to the first color index value in the first preset LUT is 0.

[0174] Optionally, the generating unit is specifically configured to:

[0175] When any second color index value is different from the corresponding first color index value, determine the difference between the any second color index value and the corresponding first color index value;

[0176] Based on the difference, determine the color adjustment amount corresponding to the any second color index value in the second preset LUT.

[0177] Optionally, the third obtaining unit is specifically configured to:

[0178] Obtain the histogram of each target data associated with the type of the same memory color in each dimension;

[0179] Determine the difference between each histogram and the remaining histograms;

[0180] According to the difference corresponding to each histogram, determine the second weight of each histogram;

[0181] Based on the second weight, fuse the multiple histograms associated with the type of the same memory color in each dimension to obtain the target distribution feature of the type of the same memory color in the dimension.

[0182] In an embodiment of the present disclosure, first, color index values corresponding to each pixel point in each dimension of the image to be processed are obtained. Based on the color index values of each pixel point in each dimension, a first preset color look-up table (LUT) associated with this dimension is traversed to obtain the target type of the memory color corresponding to the pixel point. According to the target type of the memory color to which each pixel point belongs and the corresponding color index value, a second preset LUT is traversed to obtain the color adjustment amount corresponding to the pixel point. Based on the color adjustment amount corresponding to each pixel point, each pixel point is color-adjusted to obtain a target image with enhanced color. Thus, the color enhancement problem can be resolved into a problem that can be solved by a color look-up table, improving the computational and storage efficiency, which is higher than that of the deep learning method, and a color enhancement scheme suitable for the image to be processed can be determined in a short time.

[0183] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0184] Figure 4 A block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure is shown. Figure 4 The illustrated electronic device 12 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0185] As Figure 4 shown, the electronic device 12 is presented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 connecting different system components (including the memory 28 and the processing unit 16).

[0186] The bus 18 represents one or more of several types of bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the multiple bus architectures. For example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnection (PCI) bus.

[0187] The electronic device 12 typically includes various computer system-readable media. These media can be any available media accessible to the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0188] The memory 28 can include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache 32. The electronic device 12 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 can be used for reading and writing on non-removable, non-volatile magnetic media ( Figure 4 not shown, commonly referred to as a "hard disk drive"). Although Figure 4 not shown in, a disk drive for reading and writing on removable non-volatile disks (such as a "floppy disk"), and an optical disk drive for reading and writing on removable non-volatile optical disks (such as compact disc read only memory (CD-ROM), digital video disc read only memory (DVD-ROM) or other optical media) can be provided. In these cases, each drive can be connected to the bus 18 through one or more data media interfaces. The memory 28 can include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present disclosure.

[0189] A program / utility 40 having a set (at least one) of program modules 42 can be stored, for example, in the memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods in the embodiments described in the present disclosure.

[0190] The electronic device 12 can also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 22. Moreover, the electronic device 12 can also communicate with one or more networks (such as a Local Area Network (LAN), a Wide Area Network (WAN), and / or a public network, such as the Internet) through the network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the electronic device 12 through the bus 18. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0191] The processing unit 16 executes various functional applications and data processing by running programs stored in the memory 28, such as implementing the methods mentioned in the foregoing embodiments.

[0192] In the description of this specification, the descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0193] In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise specifically defined.

[0194] Any process or method description represented in a flowchart or otherwise described herein can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a customized logic function or process. The scope of the preferred embodiments of the present disclosure includes additional implementations where functions may be executed not in the order shown or discussed, including in a substantially simultaneous manner according to the involved functions or in a reverse order, which should be understood by those skilled in the art to which the embodiments of the present disclosure pertain.

[0195] The logic and / or steps represented in a flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing a logical function, and can be embodied specifically in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection having one or more wires (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable medium on which the program can be printed, as the program can be obtained, for example, electronically by optically scanning the paper or other medium, followed by editing, interpretation, or otherwise processing as appropriate, and then stored in a computer memory.

[0196] It should be understood that various parts of the present disclosure can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one of the following techniques known in the art or a combination thereof can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0197] Those of ordinary skill in the art can understand that all or part of the steps carried out in implementing the above-described embodiment methods can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0198] In addition, in each of the various embodiments of the present disclosure, the functional units can be integrated into one processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. When the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0199] The above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present disclosure.

Claims

1. A color enhancement method, characterized in that, Including: Obtain the color index values corresponding to each pixel point in the image to be processed in each dimension respectively; Based on the color index values of each pixel point in each dimension, traverse the first preset color lookup table (LUT) associated with this dimension to obtain the target type of the memory color corresponding to the pixel point; According to the target type of the memory color to which each pixel point belongs and the corresponding color index value, traverse the second preset LUT to obtain the color adjustment amount corresponding to the pixel point; Based on the color adjustment amount corresponding to each pixel point, perform color adjustment on each pixel point to obtain the target image with enhanced color.

2. The method according to claim 1, wherein, The step of, based on the color index values of each pixel point in each dimension, traversing the first preset color lookup table associated with this dimension to obtain the target type of the memory color corresponding to each pixel point, includes: Based on the color index values of each pixel point in each dimension, traverse the first preset LUT associated with this dimension to obtain the probability values of the pixel point corresponding to different types of memory colors in this dimension; According to the probability values of the pixel point corresponding to different types of memory colors in each dimension, determine the target type of the memory color corresponding to the pixel point.

3. The method according to claim 2, wherein The step of, according to the probability values of the pixel point corresponding to different types of memory colors in each dimension, determining the target type of the memory color corresponding to the pixel point, includes: Multiply the probability values of the pixel point corresponding to different types of memory colors in each dimension to determine the total probability value of the pixel point corresponding to each type of memory color; According to the total probability value of the pixel point belonging to each type of memory color, determine the target type of the memory color corresponding to the pixel point.

4. The method according to claim 1, characterized in that, The step of, according to the target type of the memory color to which the pixel point belongs and the corresponding color index value, traversing the second preset LUT to obtain the color adjustment amount corresponding to the pixel point, includes: Based on the color index value of the pixel point in the hue dimension and the target type, traverse the second preset LUT associated with the hue dimension to obtain the first color adjustment amount; Based on the color index value of the pixel point in the saturation dimension and the target type, traverse the second preset LUT associated with the saturation dimension to obtain the second color adjustment amount.

5. The method according to any one of claims 1-4, characterized in that, Before traversing the first preset color lookup table LUT associated with this dimension, it further includes: Obtain a reference data set, where the reference data set includes multiple groups of mutually associated source data, target data, masks, and the types of memory colors corresponding to the target data; Perform statistics on the target data associated with the same type of memory color to obtain the target distribution characteristics of the target data associated with the same type of memory color in each dimension; Perform statistics on the source data associated with the same type of memory color to obtain the source distribution characteristics of the source data associated with the same type of memory color in each dimension; According to a preset cost function, determine the color transfer mode when each source distribution characteristic is transformed into the associated target distribution characteristic, where the color transfer mode includes the second color index value in the source distribution characteristic and the corresponding first color index value when transformed into the target distribution characteristic; Generate the first preset LUT and the second preset LUT according to the transmission mode.

6. The method according to claim 5, wherein After obtaining the reference data set, it further includes: Align the brightness of the target data with the brightness of the source data based on the optimal distance transmission algorithm.

7. The method according to claim 5, characterized in that The determining the first preset LUT according to the color transmission mode includes: When any second color index value is different from the corresponding first color index value, determine that the probability value corresponding to the first color index value in the first preset LUT is 1; or When any second color index value is the same as the corresponding first color index value, determine that the probability value corresponding to the first color index value in the first preset LUT is 0.

8. The method according to claim 7, characterized in that, The process of generating the second preset LUT includes: When any second color index value is different from the corresponding first color index value, determine the difference between the any second color index value and the corresponding first color index value; Based on the difference, determine the color adjustment amount corresponding to the any second color index value in the second preset LUT.

9. The method according to claim 7, characterized in that, The statistically analyzing the target data associated with the type of the same memory color to obtain the target distribution characteristics of the target data associated with the type of the same memory color in each dimension includes: Obtain the histogram of each target data associated with the type of the same memory color in each dimension; Determine the difference between each histogram and the remaining histograms; According to the difference corresponding to each histogram, determine the second weight of each histogram; Based on the second weight, fuse the multiple histograms associated with the type of the same memory color in each dimension to obtain the target distribution characteristics of the type of the same memory color in the dimension.

10. A color enhancement device, characterized in that, It includes: A first acquisition module, configured to acquire the color index values respectively corresponding to each pixel point in the image to be processed in each dimension; A second acquisition module, configured to traverse the first preset color lookup table (LUT) associated with the dimension based on the color index value of each pixel point in each dimension, so as to obtain the target type of the memory color corresponding to the pixel point; A third acquisition module, configured to traverse the second preset LUT according to the target type of the memory color to which each pixel point belongs and the corresponding color index value, so as to obtain the color adjustment amount corresponding to the pixel point; A fourth acquisition module, based on the color adjustment amount corresponding to each pixel point, performs color adjustment on each pixel point to obtain the target image with enhanced color.

11. An electronic device, characterized in that, It includes: A processor and a memory communicatively connected to the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the computer execution instructions are executed by the processor, they are used to implement the method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Two-waveband video fast naturalness color integration method based on color look-up table

    CN101867685A

  • Image enhancement method, model training method and equipment

    CN113066017A

  • Image enhancement processing method and device, electronic equipment and readable storage medium

    CN116245766A

  • Image processing device and method, equipment and storage medium

    CN117221550A

  • Tone-dependent halftoning with optimized lookup tables

    EP1507404A1