Color enhancement method, apparatus, device, and storage medium

By traversing the color lookup table (LUT) to determine the type of color to be remembered and calculating the color adjustment amount, the problem of high hardware overhead of the elliptical model is solved, and a highly efficient color enhancement effect is achieved.

CN120219236BActive Publication Date: 2026-05-08BEIJING X RING TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING X RING TECHNOLOGY CO LTD
Filing Date
2023-12-26
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing technologies, the use of elliptical models for skin color detection and enhancement has high hardware overhead and lacks universality, making it difficult to effectively enhance other memory colors, such as the colors of the sky and green plants.

Method used

By obtaining the color index value of the image pixels, traversing the preset color lookup table (LUT), determining the memory color type, calculating the color adjustment amount, and performing color adjustment, a color-enhanced image is obtained.

Benefits of technology

It improves computational and storage efficiency, enabling the determination of a suitable color enhancement scheme for an image in a short time, thereby improving the efficiency and accuracy of color enhancement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219236B_ABST
    Figure CN120219236B_ABST
Patent Text Reader

Abstract

The present disclosure provides a color enhancement method, device, equipment and storage medium, and relates to the technical field of image processing. The method comprises: acquiring a color index value corresponding to each pixel point in each dimension in a to-be-processed image; 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; according to the target type of the memory color and the corresponding color index value of each pixel point, traversing a second preset LUT 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 target image after color enhancement. Thus, when performing color enhancement on the to-be-processed image, through memory color enhancement, the target image can better meet the user's expectation of color, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and in particular to a color enhancement method, apparatus, device, and storage medium. Background Technology

[0002] Memory color enhancement is a specific subfield of image processing that focuses on enhancing the colors of objects to which people have a fixed color expectation, such as the sky, greenery, and human skin tones. These objects have a "predicted" color in people's memory, so enhancing these colors can make an image better match people's visual expectations.

[0003] In related technologies, skin color models can be modeled using elliptical models to detect and enhance skin color. However, this is not universally applicable to other memory color transfers, and elliptical models have high hardware overhead and are difficult to harden. Summary of the Invention

[0004] This disclosure provides a color enhancement method, apparatus, device, and storage medium, which aims to at least partially solve one of the technical problems in the related art.

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

[0006] Obtain the color index value of each pixel in the image to be processed in each dimension;

[0007] Based on the color index value of each pixel in each dimension, the first preset color lookup table (LUT) associated with that dimension is traversed to obtain the target type of the memory color corresponding to the pixel.

[0008] Based on the target type of the memory color to which each pixel belongs and its corresponding color index value, the second preset LUT is traversed to obtain the color adjustment amount corresponding to the pixel.

[0009] Based on the color adjustment amount corresponding to each pixel, the color of each pixel is adjusted to obtain a color-enhanced target image.

[0010] Secondly, this disclosure provides a color enhancement device, comprising:

[0011] The first acquisition module is used to acquire the color index value of each pixel in the image to be processed in each dimension;

[0012] The second acquisition module is used to traverse the first preset color lookup table (LUT) associated with each dimension based on the color index value of each pixel in each dimension, so as to obtain the target type of the memory color corresponding to the pixel.

[0013] The third acquisition module is used to 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, so as to obtain the color adjustment amount corresponding to the pixel.

[0014] The fourth acquisition module adjusts the color of each pixel based on the color adjustment amount corresponding to each pixel to obtain the color-enhanced target image.

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

[0016] Fourthly, this disclosure provides a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform a color enhancement method.

[0017] Fifthly, this disclosure provides a computer program product, including a computer program, which is executed by a processor as a color enhancement method.

[0018] In this embodiment, the color index value corresponding to each pixel in the image to be processed in each dimension is first obtained. Based on the color index value of each pixel in each dimension, a first preset color lookup table (LUT) associated with that 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 its corresponding color index value, a 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, the color of each pixel is adjusted to obtain the color-enhanced target image. Thus, the color enhancement problem can be parsed into a problem that can be solved by color lookup tables, improving computational and storage efficiency. This method is more efficient than deep learning and can determine a suitable color enhancement scheme for the image to be processed in a short time.

[0019] Additional aspects and advantages of this disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this disclosure. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

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

[0022] Figure 2This is a schematic flowchart of a color enhancement method according to a second embodiment of the present disclosure;

[0023] Figure 3 This is a schematic diagram of the structure of a color enhancement device according to an embodiment of the present disclosure;

[0024] Figure 4 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown.

[0025] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0026] Embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein 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 accompanying drawings are exemplary and are used only to explain this disclosure, and should not be construed as limiting this disclosure. Rather, embodiments of this disclosure include all variations, modifications, and equivalents falling within the spirit and scope of the appended claims.

[0027] It should be noted that this disclosure can be applied to both photographic imaging and display fields. After an image is captured or processed, its colors may deviate from their original or desired colors. By using memory color enhancement, these colors can be automatically adjusted to better match the viewer's expectations. When an image or video is displayed on a computer screen, viewers may have expectations regarding the colors of specific objects that differ from the video source; for example, preferences for skin tones can be satisfied with a wider range of preferences through color enhancement.

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

[0029] Figure 1 This is a schematic flowchart of a color enhancement method according to the first embodiment of this disclosure, as shown below. Figure 1 As shown, the method includes:

[0030] S101: Obtain the color index value of each pixel in the image to be processed in each dimension.

[0031] The image to be processed can be the original image to be color enhanced.

[0032] The dimensions can be brightness, saturation, hue, etc., and are not limited here.

[0033] Specifically, the image to be processed can first be converted to the HSV color space, Lab color space, or other color space, without limitation. Then, the brightness (value), saturation (saturation), and hue (hue) of each pixel can be extracted.

[0034] It should be noted that each pixel can first be divided into multiple intervals along various dimensions. For example, the range of hue values ​​is usually from 0 to 360 degrees. We can divide 0 to 360 degrees into 180 intervals, each with a 2-degree interval, denoted as x1, x2, x3...x180 (a total of 180). The color index values ​​corresponding to intervals x1, x2, x3...x180 are 1, 2, 3, 4, 5...180, respectively. The hue range corresponding to interval x1 is 0-2, interval x2 is 2-4, and so on, with interval x180 ranging from 358 to 360, without further limitation.

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

[0036] It should be noted that the above example is only one example of the hue dimension. The color index values ​​of pixels in the brightness and saturation dimensions are similar and can be referred to the above method, which 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 that dimension to obtain the target type of the memory color corresponding to the pixel.

[0038] Among these, "memory color" can refer to the color of an object to which people have a fixed color expectation. It's important to note that users typically have fixed color expectations for certain specific objects, such as the colors they expect to see for subjects like the blue sky, green plants, the ocean, and skin. For instance, if a user sees a gray or white lawn, they might feel uncomfortable, while seeing a green lawn would make them feel comfortable.

[0039] The target type can be a memory color type that corresponds to the subject in the image to be processed. In this embodiment of the disclosure, the target type can be used to characterize the color that best matches the user's expectation of the subject in the image to be processed.

[0040] A color lookup table (LUT) is a table or function that maps input pixel values ​​to output pixel values. It can be used for operations such as color correction, color conversion, and contrast adjustment, and is not limited here.

[0041] The first preset LUT can be a color lookup table used to determine the target type of the memory color.

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

[0043] Optionally, based on the color index value of each pixel in each dimension, the first preset LUT associated with that dimension can be traversed to obtain the probability value of the pixel corresponding to different types of memory colors in that 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, if the color index value corresponding to the saturation dimension is K, and there are different types of memory colors F1, F2, and F3, then the first preset LUT associated with saturation can record 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. No restrictions are imposed here.

[0045] Therefore, since the first preset LUT records the correspondence between different types of memory colors and probability values, it is possible to determine the probability value of any color index value corresponding to a different type of memory color from the first preset LUT.

[0046] For example, for color index values ​​K1, K2, and K3 corresponding to the hue dimension, there are different types of memory colors p1, p2, and p3 in the first preset LUT associated with the hue dimension. The probability values ​​for color index value K1 with p1, p2, and p3 are b1, b2, and b3 respectively; the probability values ​​for color index value K2 with p1, p2, and p3 are b4, b5, and b6 respectively; and the probability values ​​for color index value K3 with p1, p2, and 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 Table 1 above is only an illustrative example and is not intended to limit this disclosure.

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

[0050] Furthermore, the target type of the memory color corresponding to a pixel can be determined based on the probability value of the pixel corresponding to different types of memory colors in each dimension.

[0051] One possible approach is to first multiply the probability values ​​of a pixel corresponding to different types of memory colors in each dimension to determine the total probability value of the pixel corresponding to each type of memory color. Then, based on the total probability value of the pixel belonging to each type of memory color, the target type of the memory color corresponding to the pixel can be determined.

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

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

[0054] Optionally, the first color adjustment amount can be obtained by first traversing the second preset LUT associated with the hue dimension based on the color index value and target type of the pixel in the hue dimension, and then by traversing the second preset LUT associated with the saturation dimension based on the color index value and target type of 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 amount corresponding to each color index value 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, and the memory color types are blue sky memory color and skin tone memory color, then the first color adjustment amounts corresponding to color index value K1 with blue sky memory color and skin tone memory color are b1 and b2, respectively; the first color adjustment amounts corresponding to color index value K2 with blue sky memory color and skin tone memory color are b3 and b4, respectively; and the first color adjustment amounts corresponding to second color index value K3 with blue sky memory color and skin tone memory color are b5 and b6, respectively.

[0059] Table 2 Blue Sky Memory Color Skin tone 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 Table 2 above is merely an illustrative representation of the second preset LUT related to the hue dimension and is not intended to limit this disclosure. Similarly, the second preset LUT related to the saturation dimension will not be elaborated upon here.

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

[0062] It should be noted that the saturation dimension can be looked up in the same way as the hue dimension, which will not be elaborated here.

[0063] If a pixel does not belong to a memory color, its color does not need to be adjusted. In this embodiment, after determining whether each pixel belongs to a memory color, the color of pixels that do belong to a 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 the color-enhanced target image.

[0065] Specifically, the color of each pixel in the image to be processed can be adjusted, and the adjusted image to be processed can be used as the target image after color enhancement.

[0066] The target image can be the image obtained by color enhancement 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 hue color adjustment amount is "+b", then the saturation value 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", without any restrictions 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 the hue corresponding to pixel x is determined to be f1, then the color adjustment amount can be determined to be LUT1(f1)*LUT2(f1), and thus the hue value corresponding to pixel x in the final target image can be determined to be f1+LUT1(f1)*LUT2(f1).

[0069] In this embodiment, the color index value corresponding to each pixel in the image to be processed in each dimension is first obtained. Based on the color index value of each pixel in each dimension, a first preset color lookup table (LUT) associated with that 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 its corresponding color index value, a 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, the color of each pixel is adjusted to obtain the color-enhanced target image. Thus, the color enhancement problem can be parsed into a problem that can be solved by color lookup tables, improving computational and storage efficiency. This method is more efficient than deep learning and can determine a suitable color enhancement scheme for the image to be processed in a short time.

[0070] Figure 2 This is a schematic flowchart of a color enhancement method according to a second embodiment of the present disclosure, as shown below. Figure 2 As shown, the method includes:

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

[0072] It should be noted that the specific implementation of step S201 can be referred to the above embodiments, and will not be repeated here.

[0073] S202: Obtain a reference dataset, which includes multiple sets of interrelated source data, target data, masking, and the type of memory color corresponding to the target data.

[0074] The reference dataset can be the preparation data used to generate the first preset LUT and the second preset LUT.

[0075] The source data can be the image data to be color enhanced.

[0076] 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] One possible approach is to use the AWB (Auto White Balance) algorithm to calculate the CCT value (color temperature of the light source) corresponding to the original data, and then divide the data into several classes based on the CCT value, obtaining class a data. The AE (Auto Exposure) algorithm can be used to calculate the LuxID value (illuminance under imaging conditions) corresponding to each sample, and then divide the data into several classes based on the LuxID value, obtaining class b data. Furthermore, class a and class b data can be combined to obtain a×b class data. Further, at least one image can be selected from each class as source data.

[0078] Optionally, source data and target data need to be collected first. Target data can be a dataset preferred by the audience selected based on psychophysical experiments. The source and target datasets can come from different sources, and it is not required that the poses of objects related to memory color remain consistent.

[0079] This can be achieved by designing and conducting psychophysical experiments to obtain audience feedback on their preferences for different colors, objects, and scenes. The experimental results can then be used to determine the specific colors and related regions that the audience prefers in the target dataset. Alternatively, a suitable image segmentation algorithm, such as a deep learning-based semantic segmentation algorithm, can be selected to extract regions related to the color of memory. Based on the experimental results, regions related to the color of memory, such as green plants, blue skies, and faces, can be extracted.

[0080] Furthermore, the results obtained from the segmentation algorithm can be used to generate corresponding masks to highlight or retain 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 pixel value of the non-target region is 0.

[0081] Next, the generated masks can be arranged according to the directory structure of the source and target data for subsequent data processing and analysis. These data can then be used for further processing, analysis, or applications.

[0082] The type of memory color corresponding to the target data can be the color corresponding to green plants, blue sky, human face, ocean, or night sky, and there is no limitation here.

[0083] Optionally, to eliminate the impact of "bad pixels" on the overall distribution calculation, K-means clustering can be used to classify the data. Before using K-means, color information statistics for regions belonging to a specific memory color in both the source and target data can be performed, which can be done through data preprocessing. This may include adjusting image brightness, contrast, and color balance to ensure data consistency and comparability. Afterward, the preprocessed data can be input into the K-means clustering algorithm. The K-means algorithm divides the dataset into K clusters, each containing similar data points. The appropriate number of clusters K can be determined based on simple elbow principles or silhouette coefficients. After clustering, each cluster represents a similar group of data. Based on the clustering results, clusters representing specific memory colors in the target data are determined. Clusters containing specific memory colors can be selected by analyzing the clustering results and color information related to the target data. By using a previously generated mask, interference from other colors in the target cluster can be eliminated. The mask is applied to the target data, retaining only regions related to the specific memory color while excluding pixels of other colors.

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

[0085] It should be noted that since brightness distribution has a significant impact on color perception, different brightness levels typically have different color distributions. Therefore, before performing memory color enhancement, brightness distribution alignment needs to be performed first. In this embodiment, brightness alignment can be achieved based on the Optimal Transport (OT) algorithm. The transmitted color space can use a brightness-color separable color space, and brightness changes can be performed in a linear space, such as Lab or J. z a z b z The color space allows for brightness alignment of the target data with respect to the original data across the L-dimensional or Jz distribution, without limitation. Thus, after brightness alignment, the source and target data are on the same brightness baseline, allowing for further alignment of the color distribution.

[0086] 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 of two images. By aligning the target data to the source data using OT, the transport cost can be minimized.

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

[0088] Optionally, we can first obtain the histogram of each target data associated with the same memory color type in each dimension, then determine the difference between each histogram and the other histograms, and then determine the second weight of each histogram based on the difference corresponding to each histogram. Then, based on the second weight, we can fuse multiple histograms associated with the same memory color type in each dimension to obtain the target distribution characteristics of the same memory color type in the dimension.

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

[0090] It should be noted that the target distribution characteristics of target data associated with the same type of memory color may be different in different dimensions. For example, the hue dimension has its own target distribution characteristics, and the saturation dimension has its own target distribution characteristics. This is not a limitation.

[0091] Optionally, you can first choose a suitable color space for statistical analysis, such as HSV (Hue, Saturation, Lightness) and Lab color space. HSV color space is more intuitive, while Lab color space appears more uniform to the human eye. Then, based on the previously generated mask, you can select pixels belonging to the memory color region. The mask will only retain regions associated with the specific memory color, excluding pixels of other colors.

[0092] Furthermore, for each type of memory color, the distribution of hue value or saturation in the selected color space is calculated, and a histogram is plotted with hue value or saturation as the x-axis and pixel count as the y-axis. Then, the histogram for each color channel can be normalized to calculate the frequency of pixel occurrence at different saturation or hue angles. The frequency of each hue value or saturation is obtained by dividing the pixel count by the total number of pixels. By analyzing the normalized histogram, the target distribution characteristics of the target data associated with the same type of memory color in each dimension (hue value or saturation) can be derived.

[0093] The difference can be measured by KL (Kullback-Leibler divergence), Jensen-Shannon divergence, Hellinger distance, or cosine similarity, or other methods, which are not limited here.

[0094] As one possible implementation, in this embodiment of the disclosure, when determining the difference between each histogram and the other histograms, KL divergence can be used as an implementation method to determine the KL divergence between each histogram and the other histograms.

[0095] KL divergence, also known as relative entropy, is an indicator that measures the difference between two probability distributions.

[0096] The remaining histograms can be any histograms obtained by 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 It is the i-th histogram, for each h i Calculate its relationship with removing h i Other histograms after that KL divergence between

[0097] For each h i Its second weight w i Calculated using the following formula:

[0098] It should be noted that if h i Compared with other histograms The KL divergence between them is large, h i The corresponding second weight w i The weights will be relatively small. To ensure that the sum of the weights of all histograms in the histogram set is 1, the weights can be recalibrated, i.e.:

[0099]

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

[0101] It should be noted that if a histogram h i Other histograms The differences between them are relatively large, so the histogram h i The corresponding second weight is relatively small. If the histogram h i Other histograms The differences between them are relatively small, so the histogram h i The corresponding second weight is relatively large, which also indicates that the histogram h i More importantly.

[0102] Furthermore, multiple histograms associated with the same memory color type can be merged based on the second weight. This merging can be achieved using a weighted average or a weighted sum, where the weights are the second weights. The merged histogram represents the target distribution characteristics of the same memory color type across dimensions.

[0103] The target distribution features can also be represented in the form of a distribution function, which is not limited here. That is, the target distribution features can be a probability distribution function that describes the probability distribution of color features of pixels in different dimensions in the target data. The probability distribution function can describe the characteristics of color distribution in the image, as well as the frequency of occurrence of different feature values, which is not limited here.

[0104] S204: Perform statistics on the source data of the same memory color type association to obtain the source distribution characteristics of the source data of the same memory color type association in each dimension.

[0105] Optionally, we can 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 other histograms, and then determine the third weight of each histogram based on the difference corresponding to each histogram. Then, based on the third weight, we can fuse multiple histograms associated with the same memory color type in each dimension to obtain the source distribution characteristics of the same memory color type in the dimension.

[0106] Among them, the source distribution feature can be the original distribution feature of the source data (original data) associated with any memory color in any dimension.

[0107] Optionally, you can first choose a suitable color space for statistical analysis, such as HSV (Hue, Saturation, Lightness) and Lab color space. HSV color space is more intuitive, while Lab color space appears more uniform to the human eye. Then, based on the previously generated mask, you can select pixels belonging to the memory color region. The mask will only retain regions associated with the specific memory color, excluding pixels of other colors.

[0108] Furthermore, for each type of memory color, the distribution of hue value or saturation in the selected color space is calculated, and a histogram is plotted with hue value or saturation as the x-axis and pixel count as the y-axis. Then, the histogram for each color channel can be normalized to calculate the frequency of pixel occurrence at different saturation or hue angles. The frequency of each hue value or saturation is obtained by dividing the pixel count by the total number of pixels. By analyzing the normalized histogram, the source distribution characteristics of the source data associated with the same memory color type can be derived in each dimension (hue value or saturation).

[0109] It should be noted that the specific implementation of S204 can be referred to step S203 above, and will not be repeated here.

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

[0111] The first color index value can be any 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 contain multiple first color index values ​​corresponding to the hue dimension.

[0112] The first color index value can be any 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 contain multiple first color index values ​​corresponding to the hue dimension.

[0113] The preset cost function can be:

[0114]

[0115] Here, Π(p, q) is the set of all joint distributions where the target distribution characteristic is p and the source distribution characteristic is q. Y is considered as a transfer function from the desired distribution characteristic p to the source distribution characteristic q, and ∫c(x, y)dY(x, y) represents the cost of moving from p to q. The optimal transfer problem is to find an optimal transfer plan that minimizes the cost of moving from probability distribution p to probability distribution q.

[0116] Among them, the color transmission mode can be either saturation transmission mode or hue transmission mode.

[0117] It should be noted that since the source data and target data are classified according to the same rules, such as the color temperature of the light source and the light intensity under imaging conditions, if the target distribution features and the source distribution features correspond to the same category, then the target distribution features and the source distribution features can be considered to be related.

[0118] In this transmission process, saturation transmission mode and hue value transmission mode can be used to transform the second color index value in the source distribution features into the first color index value corresponding to the target distribution features, thereby achieving the minimum migration cost, the lowest cost, and the maximum amount of material transmitted.

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

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

[0121] Where 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 for any pixel.

[0122] Here, the L2 norm indicates that the greater the migration distance, the greater the corresponding migration cost. The L1 norm represents the continuity penalty of saturation, ensuring that all differences are given equal weight, thereby encouraging more continuous, smoother, and sparser transmission schemes.

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

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

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

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

[0127] It should be noted that the hue needs to be considered periodically. When calculating the difference between the source hue and the target hue, periodic calculations are required. For example, the distances from 1 degree to 0 degrees and from 359 degrees to 0 degrees are the same.

[0128] It should be noted that when performing minimum distance transmission of hue values, not only the difference between the source and target hues is considered, but also the gradient difference between them. In this embodiment, a new regularization term can be defined for the hue, taking into account both the hue difference and the gradient difference. The regularization is expressed as a power-law function of the magnitude of the difference between adjacent colors, used to control the impact of gradient difference on the overall cost function to some extent. Thus, if the mapping between the source and target hues results in a large gradient difference, this mapping will be more explicitly penalized, thereby ensuring 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 and the Edmonds-Karp algorithm can be used for fast computation to solve the transfer function γ according to the transmission mode and convert it into a color transformation LUT table.

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

[0132] If any second color index value is different from the corresponding first color index value, the probability value corresponding to the first color index value in the first preset LUT is determined to be 1.

[0133] If any second color index value is the same as the corresponding first color index value, the probability value corresponding to the first color index value in the first preset LUT is determined to be 0.

[0134] Specifically, it is necessary to compare the second color index values ​​of different dimensions with their corresponding first color index values ​​to determine the probability value corresponding to the first color index value in each dimension. For example, the second color index value of the hue dimension can be compared with its corresponding first color index value 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 its corresponding first color index value, it means that the color corresponding to the second color index value belongs to the memory color, and therefore the probability can be set to 1. If any second color index value is the same as its corresponding first color index value, it means that memory color enhancement is not needed, and the probability corresponding to the first color index value can be set to 0.

[0136] Furthermore, a first preset LUT corresponding to each dimension can be constructed based on the probability value corresponding to each first color index value of each dimension.

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

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

[0139] For example, the range of hue values ​​is typically from 0 to 360 degrees. This can be divided into 180 intervals, each with a 2-degree increment, denoted as x1, x2, x3...x180 (a total of 180 intervals). The color index values ​​corresponding to intervals x1, x2, x3...x180 are 1, 2, 3, 4, 5...180, respectively. The hue range corresponding to interval x1 is 0-2, interval x2 is 2-4, and so on, with interval x180 ranging from 358 to 360. These ranges are not explicitly defined here.

[0140] For example, for pixel P in the image to be processed, its first color index value in the hue dimension is 20, and its corresponding second color index value is 1. Therefore, the difference between the first and second color index values ​​is 19. Since the hue value is divided into intervals of 2 degrees, the color adjustment amount corresponding to 19 is 38. Furthermore, a second preset LUT can be constructed based on the color adjustment amount corresponding to each first color index value in 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 throughout the process.

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

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

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

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

[0146] In this embodiment, firstly, the color index value corresponding to each pixel in the image to be processed in each dimension is obtained. Then, a reference dataset is obtained, wherein the reference dataset includes multiple sets of interrelated source data, target data, masks, and the type of memory color 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 features 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 features 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 feature is converted into the associated target distribution feature is determined. The color transfer mode includes the second color index value in the source distribution feature and the first color index value corresponding to the target distribution feature when converted. Then, according to the transfer mode, the first preset LUT and the second preset LUT are generated. Based on the color index value of each pixel in each dimension, a first preset color lookup table (LUT) associated with that dimension is traversed to obtain the target type of the memory color corresponding to the pixel. Then, based on the target type of the memory color to which each pixel belongs and its corresponding color index value, a second preset LUT is traversed to obtain the color adjustment amount corresponding to the pixel. Finally, based on the color adjustment amount corresponding to each pixel, color adjustment is performed on each pixel to obtain the color-enhanced target image. 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 adaptively enhance the image according to its color features, avoiding the over-enhancement or local distortion problems 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 color stylization, color balance, and other effects through a preset color mapping table, making it highly practical. The weighted distribution calculation process takes into account the influence of outliers, thus making it more robust to noise interference, requiring less data volume, and relatively reducing the requirements for data quality, thereby lowering the cost of use.

[0147] It should be noted that the embodiments disclosed herein may also have the following beneficial effects:

[0148] 1. This method offers greater universality across various memory colors. It can be implemented using multiple LUTs, and the overall detection and enhancement process is transformed into simple linear interpolation, resulting in low hardware deployment costs and minimal need for manual parameter tuning. 2. It requires less data than deep learning solutions and has lower requirements for the quality of the data source images. 3. Based on optimal distance transfer, it can capture complex differences between two distributions and explicitly incorporates a penalty for inverse hue and saturation during image adjustment, resulting in fewer flaws in the results. The calculation of the overall distribution considers the influence of outliers, making the overall results more robust. 4. It can adjust specific types of memory colors, making it more targeted. 5. It adds weighted statistics to histogram statistics, avoiding abnormal adjustments to individual outliers. For example, when adjusting Asian skin tones, it avoids the overall yellowing effect affecting individuals with lighter or whiter skin tones. Histogram matching focuses more on differences in distribution shape, and the inclusion of optimal distance transfer in the cost function allows for better measurement of distances in real-world application scenarios.

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

[0150] The first acquisition module 310 is used to acquire the color index value of each pixel in the image to be processed in each dimension;

[0151] The second acquisition module 320 is used to traverse the first preset color lookup table (LUT) associated with each dimension based on the color index value of each pixel in each dimension, so as to obtain the target type of the memory color corresponding to the pixel.

[0152] The third acquisition module 330 is used to 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, so as to obtain the color adjustment amount corresponding to the pixel.

[0153] The fourth acquisition module 340 adjusts the color of each pixel based on the color adjustment amount corresponding to each pixel to obtain a color-enhanced target image.

[0154] Optionally, the second acquisition module includes:

[0155] The first acquisition unit is used to traverse the first preset LUT associated with each dimension based on the color index value of each pixel in each dimension, so as to obtain the probability value of the pixel corresponding to different types of memory colors in that dimension.

[0156] The first determining unit is used to determine the target type of the memory color corresponding to the pixel based on the probability value of the pixel corresponding to different types of memory colors in each dimension.

[0157] Optionally, the determining unit is specifically used for:

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

[0159] The target type of the memory color corresponding to the pixel is determined based on the total probability value of the pixel belonging to each type of memory color.

[0160] Optionally, the third acquisition module is specifically used for:

[0161] Based on the color index value of the pixel in the hue dimension and the target type, the second preset LUT associated with the hue dimension is traversed to obtain the first color adjustment amount;

[0162] Based on the color index value of the pixel in the saturation dimension and the target type, the second preset LUT associated with the saturation dimension is traversed to obtain the second color adjustment amount.

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

[0164] The second acquisition unit is used to acquire a reference dataset, wherein the reference dataset includes multiple sets of interrelated source data, target data, masking, and the type of memory color corresponding to the target data;

[0165] The third acquisition unit is used to statistically analyze the target data associated with the same memory color type in order to obtain the target distribution characteristics of the target data associated with the same memory color type in each dimension;

[0166] The fourth acquisition unit is used to 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.

[0167] The second determining unit is used to determine the color transmission mode when each source distribution feature is transformed into an associated target distribution feature according to a preset cost function, wherein the color transmission mode includes a second color index value in the source distribution feature and a first color index value corresponding to the transformation into the target feature;

[0168] The generation unit is used to generate the first preset LUT and the second preset LUT according to the transmission mode.

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

[0170] Based on the optimal distance transmission algorithm, the brightness of the target data is aligned with the brightness of the source data.

[0171] Optionally, the generation unit is specifically used for:

[0172] If any second color index value differs from the corresponding first color index value, the probability value corresponding to the first color index value in the first preset LUT is determined to be 1; or,

[0173] If any second color index value is the same as the corresponding first color index value, the probability value corresponding to the first color index value in the first preset LUT is determined to be 0.

[0174] Optionally, the generation unit is specifically used for:

[0175] If any second color index value is different from the corresponding first color index value, the difference between the second color index value and the corresponding first color index value is determined.

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

[0177] Optional, the third acquisition unit is specifically used for:

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

[0179] Determine the differences between each of the histograms and the remaining histograms;

[0180] A second weight for each histogram is determined based on the difference corresponding to each histogram;

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

[0182] In this embodiment, the color index value corresponding to each pixel in the image to be processed in each dimension is first obtained. Based on the color index value of each pixel in each dimension, a first preset color lookup table (LUT) associated with that 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 its corresponding color index value, a 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, the color of each pixel is adjusted to obtain the color-enhanced target image. Thus, the color enhancement problem can be parsed into a problem that can be solved by color lookup tables, improving computational and storage efficiency. This method is more efficient than deep learning and can determine a suitable color enhancement scheme for the image to be processed in a short time.

[0183] According to embodiments of this disclosure, this 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 embodiments of the present disclosure is shown. Figure 4 The electronic device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0185] like Figure 4 As shown, the electronic device 12 is represented 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, memory 28, and bus 18 connecting different system components (including memory 28 and processing unit 16).

[0186] Bus 18 represents one or more of several 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 various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0187] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0188] Memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and / or cache 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 4 Not shown; usually referred to as a "hard drive"). Although Figure 4 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disc drive for reading and writing to a removable non-volatile optical disc (e.g., a compact disc read-only memory (CD-ROM), a digital video disc read-only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this disclosure.

[0189] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in 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. Program modules 42 typically perform the functions and / or methods described in the embodiments of this disclosure.

[0190] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with electronic device 12, and / or with any device that enables electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with 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.

[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 references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0193] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0194] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain.

[0195] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

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

[0197] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0198] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as 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 storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those skilled 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, include: Obtain the color index value of each pixel in the image to be processed in each dimension; Obtain a reference dataset, wherein the reference dataset includes multiple sets of interrelated source data, target data, masking, and the type of memory color corresponding to the target data; Statistical analysis is performed 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; Statistical analysis is performed on 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; Based on a preset cost function, a color transmission mode is determined when each source distribution feature is transformed into an associated target distribution feature, wherein the color transmission mode includes a second color index value in the source distribution feature and a first color index value corresponding to the transformation into the target feature; Based on the transmission mode, a first preset color lookup table (LUT) and a second preset LUT are generated; Based on the color index value of each pixel in each dimension, the first preset color lookup table (LUT) associated with that dimension is traversed to obtain the target type of the memory color corresponding to the pixel. Based on the target type of the memory color to which each pixel belongs and its 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, the color of each pixel is adjusted to obtain a color-enhanced target image.

2. The method as described in claim 1, characterized in that, The step of traversing a first preset color lookup table (LUT) associated with each dimension based on the color index value of each pixel in each dimension to obtain the target type of the memory color corresponding to the pixel includes: Based on the color index value of each pixel in each dimension, the first preset LUT associated with that dimension is traversed to obtain the probability value of the pixel corresponding to different types of memory colors in that dimension; Based on the probability values ​​of the pixel corresponding to different types of memory colors in each dimension, the target type of the memory color corresponding to the pixel is determined.

3. The method as described in claim 2, characterized in that, The step of determining the target type of the memory color corresponding to the pixel based on the probability values ​​of the pixel corresponding to different types of memory colors in each dimension includes: Multiply the probability values ​​of the pixel corresponding to different types of memory colors in each dimension to determine the total probability value of the pixel corresponding to each type of memory color; The target type of the memory color corresponding to the pixel is determined based on the total probability value of the pixel belonging to each type of memory color.

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

5. The method according to claim 1, characterized in that, Following the acquisition of the reference dataset, the following is also included: Based on the optimal distance transmission algorithm, the brightness of the target data is aligned with the brightness of the source data.

6. The method as described in claim 1, characterized in that, The step of generating a first preset color lookup table (LUT) based on the color transmission mode includes: If any second color index value differs from the corresponding first color index value, the probability value corresponding to the first color index value in the first preset LUT is determined to be 1; or, If any second color index value is the same as the corresponding first color index value, the probability value corresponding to the first color index value in the first preset LUT is determined to be 0.

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

8. The method as described in claim 6, characterized in that, The statistical analysis of target data associated with the same memory color type to obtain the target distribution characteristics of the target data associated with the same memory color type 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 differences between each of the histograms and the remaining histograms; A second weight for each histogram is determined based on the difference corresponding to each histogram; Based on the second weight, multiple histograms associated with the same memory color type in each dimension are fused to obtain the target distribution characteristics of the same memory color type in that dimension.

9. A color enhancement device, characterized in that, include: The first acquisition module is used to acquire the color index value of each pixel in the image to be processed in each dimension; A reference dataset is obtained, comprising multiple sets of interconnected source data, target data, masks, and memory color types corresponding to the target data. Statistical analysis is performed on target data associated with the same memory color type to obtain target distribution features of the target data associated with the same memory color type in each dimension. Statistical analysis is also performed on source data associated with the same memory color type to obtain source distribution features of the source data associated with the same memory color type in each dimension. Based on a preset cost function, a color transfer mode is determined when each source distribution feature is transformed into an associated target distribution feature, wherein the color transfer mode includes a second color index value in the source distribution feature and a first color index value corresponding to the transformation into the target distribution feature. Based on the transfer mode, a first preset color lookup table (LUT) and a second preset LUT are generated. The second acquisition module is used to traverse the first preset color lookup table (LUT) associated with each dimension based on the color index value of each pixel in each dimension, so as to obtain the target type of the memory color corresponding to the pixel. The third acquisition module is used to 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, so as to obtain the color adjustment amount corresponding to the pixel. The fourth acquisition module adjusts the color of each pixel based on the color adjustment amount corresponding to each pixel to obtain the color-enhanced target image.

10. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-8.

Citation Information

Patent Citations

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

    CN101867685A

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

    CN116245766A