Image local color adjustment method and device, electronic equipment and storage medium

By converting the image from the RGB color space to the HSL space for local color adjustment and generating a calibrated HSL and a 3D lookup table, the problem of local color adjustment of images that cannot be achieved in existing technologies is solved, thus improving image quality.

CN114529617BActive Publication Date: 2025-10-17EEASY TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210094222.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-26
Publication Date
2025-10-17
Estimated Expiration
2042-01-26

AI Technical Summary

Technical Problem

Existing technologies cannot effectively achieve local color adjustment of images, especially in complex and ever-changing video scenes, resulting in a decline in the overall image quality.

Method used

The image is converted from the RGB color space to the HSL color space. Local color adjustments are made in the HSL space to generate a calibrated HSL lookup table. The 3D lookup table is then calibrated based on this lookup table, and finally, color adjustments are made in the RGB space.

Benefits of technology

It achieves precise adjustment of local color of the image and improves the quality of the entire image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114529617B_ABST
    Figure CN114529617B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of image processing, and provides an image local color adjustment method and device, electronic equipment and storage medium, the method comprises the following steps: converting a first to-be-adjusted image obtained from an RGB color space to an HSL color space, adjusting the local color of the first to-be-adjusted image in the HSL color space, obtaining a calibrated HSL lookup table according to a plurality of sets of adjustment values obtained after adjustment, calibrating a preset three-dimensional lookup table based on the calibrated HSL lookup table to obtain a calibrated three-dimensional lookup table, and adjusting the color of a second to-be-adjusted image according to the calibrated three-dimensional lookup table, so that the local color of the image is adjusted, and the quality of the whole image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of image processing, and particularly relates to an image local color adjustment method and device, an electronic device and a storage medium. BACKGROUND

[0002] Generally, there is a color difference between the original data output by the image sensor and the image expected by human beings, and color correction or color enhancement processing is needed, specifically, the image hue, saturation and brightness need to be adjusted.

[0003] At present, in the color correction or color enhancement processing based on the 2D color gamut, the related technology is to map the RGB value of the input pixel point to a new RGB value by using a global matrix, and the matrix parameters are adjusted to make the mapped color as close to the ideal value as possible. However, this method cannot perform targeted processing on specific colors of the image, and is easy to process redundant color regions, especially for complex and variable video scenes, the scheme of processing by using the related technology is difficult to realize local color adjustment, thereby affecting the quality of the whole image. SUMMARY

[0004] The present application aims to provide an image local color adjustment method, device, electronic device and storage medium, and aims to solve the problem that the image local color adjustment cannot be realized in the prior art.

[0005] In one aspect, the present application provides an image local color adjustment method, which comprises the following steps:

[0006] Converting the obtained first image to be color adjusted from an RGB color space to an HSL color space;

[0007] Adjusting the local color of the first image to be color adjusted in the HSL color space, and obtaining a calibrated HSL lookup table according to the multiple sets of adjustment values obtained after adjustment;

[0008] Calibrating a preset three-dimensional lookup table based on the calibrated HSL lookup table to obtain a calibrated three-dimensional lookup table;

[0009] Color adjusting a second image to be color adjusted according to the calibrated three-dimensional lookup table.

[0010] Optionally, the step of adjusting the local color of the first image to be color adjusted in the HSL color space and obtaining a calibrated HSL lookup table according to the multiple sets of adjustment values obtained after adjustment comprises:

[0011] Uniformly sampling in the HSL color space to obtain an initial HSL lookup table;

[0012] According to the initial HSL lookup table, a target sampling point corresponding to a local color of the first image to be color adjusted is obtained;

[0013] The target sampling point is adjusted in hue, saturation and lightness to obtain a plurality of sets of adjustment values;

[0014] The initial HSL lookup table is calibrated according to the plurality of sets of adjustment values to obtain a calibrated HSL lookup table.

[0015] Optionally, the step of uniformly sampling in the HSL color space comprises:

[0016] Uniformly sampling in three dimensions of the HSL color space respectively;

[0017] According to the initial HSL lookup table, a target sampling point corresponding to a local color of the first image to be color adjusted is obtained;

[0018] According to the index value of the plurality of sampling points in the initial HSL lookup table in the hue dimension, the target sampling point is obtained.

[0019] Optionally, the three-dimensional lookup table contains 10 3 sampling points, and the intervals between adjacent sampling points in each dimension are equal.

[0020] Optionally, the step of calibrating a preset three-dimensional lookup table based on the calibrated HSL lookup table comprises:

[0021] Converting the original RGB value of each sampling point in the preset three-dimensional lookup table into a corresponding original HSL value, and adjusting each original HSL value according to the calibrated HSL lookup table to obtain a corresponding target HSL value;

[0022] Converting each target HSL value into a corresponding target RGB value;

[0023] Calibrating the three-dimensional lookup table based on each original RGB value and each target RGB value.

[0024] Optionally, the step of adjusting each original HSL value according to the calibrated HSL lookup table comprises:

[0025] According to the calibrated HSL lookup table, a preset interpolation method is used to obtain each original HSL value for adjustment to obtain a corresponding target adjustment value;

[0026] Based on each original HSL value and the corresponding target adjustment value, the target HSL value is obtained.

[0027] Optionally, the step of color adjusting the second image to be color adjusted according to the calibrated three-dimensional look-up table comprises:

[0028] According to the calibrated three-dimensional look-up table, the pixel points in the second image to be color adjusted are color adjusted by using a preset interpolation method.

[0029] In another aspect, the present application provides an image local color adjustment device, which comprises:

[0030] a color space conversion unit, configured to convert the acquired first image to be color adjusted from an RGB color space to an HSL color space;

[0031] an HSL look-up table calibration unit, configured to adjust the local color of the first image to be color adjusted in the HSL color space, and obtain a calibrated HSL look-up table according to a plurality of sets of adjustment values obtained after the adjustment;

[0032] a three-dimensional look-up table calibration unit, configured to calibrate a preset three-dimensional look-up table based on the calibrated HSL look-up table, and obtain a calibrated three-dimensional look-up table; and

[0033] an image color adjustment unit, configured to color adjust a second image to be color adjusted according to the calibrated three-dimensional look-up table.

[0034] In another aspect, the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0035] In another aspect, the present application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is executable on a processor to implement the steps of the above method.

[0036] The present application converts the acquired first image to be color adjusted from an RGB color space to an HSL color space, adjusts the local color of the first image to be color adjusted in the HSL color space, obtains a calibrated HSL look-up table according to a plurality of sets of adjustment values obtained after the adjustment, calibrates a preset three-dimensional look-up table based on the calibrated HSL look-up table, obtains a calibrated three-dimensional look-up table, and color adjusts a second image to be color adjusted according to the calibrated three-dimensional look-up table, thereby realizing the adjustment of the local color of the image and further improving the quality of the whole image. BRIEF DESCRIPTION OF DRAWINGS

[0037] Figure 1 is the implementation flowchart of the image local color adjustment method provided by the first embodiment of the present application;

[0038] Figure 2 is a structural schematic diagram of an image local color adjustment device provided by Embodiment Two of the present application; and

[0039] Figure 3 is a structural schematic diagram of an electronic device provided by Embodiment Three of the present application. DETAILED DESCRIPTION

[0040] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0041] The specific implementation of the present application is described in detail below in combination with specific embodiments:

[0042] Example One:

[0043] Figure 1 An implementation flow of the image local color adjustment method provided by Embodiment One of the present application is shown, for the convenience of description, only the part related to the embodiments of the present application is shown, and the details are as follows:

[0044] In step S101, the acquired first image to be color adjusted is converted from the RGB color space to the HSL color space.

[0045] The present application is applicable to an electronic device, which can be a terminal device such as a mobile phone, a camera, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the specific type of the electronic device is not limited in the embodiments of the present application.

[0046] In the embodiments of the present application, the RGB value of each pixel point in the first image to be color adjusted is read, and each RGB value is converted into a corresponding HSL value. Specifically, the conversion formula is as follows:

[0047] The conversion formula from the RGB space to the HSL space is as follows:

[0048]

[0049]

[0050]

[0051] wherein r, g, b are respectively red, green, blue components of each pixel point in the first image to be color adjusted in RGB space, max and min are respectively maximum and minimum values of the three components of red, green and blue, h is a hue value in HSL space, h∈[0°, 360°), s, l are respectively saturation and brightness in HSL space, s, l∈[0, 1].

[0052] In step S102, the local color of the first image to be color adjusted is adjusted in the HSL color space, and the HSL lookup table is calibrated according to the plurality of adjustment values obtained after the adjustment.

[0053] In the embodiment of the present application, when the local color of the first image to be color adjusted is adjusted in the HSL color space, the HSL lookup table is uniformly sampled in the HSL color space to obtain an initial HSL lookup table, the target sampling point corresponding to the local color of the first image to be color adjusted is obtained according to the initial HSL lookup table, the hue, saturation and brightness of the target sampling point are adjusted to obtain a plurality of adjustment values, and the initial HSL lookup table is calibrated according to the plurality of adjustment values to obtain the calibrated HSL lookup table, so that the generation of the HSL lookup table is realized through the plurality of adjustment values. The above-mentioned HSL lookup table includes three sub-lookup tables, i.e. a hue lookup table, a saturation lookup table and a brightness lookup table, and the adjustment values Δh, Δs and Δl of the pixel values of the sampling points at fixed intervals are recorded in the three sub-lookup tables. The adjustment value can be understood as the difference between the pixel value of the sampling point after the adjustment and the pixel value of the sampling point before the adjustment. When the initial HSL lookup table is calibrated according to the plurality of adjustment values, the plurality of adjustment values are sequentially filled into the initial HSL lookup table to obtain the calibrated HSL lookup table. It should be pointed out here that the adjustment value of the sampling point without adjustment is zero.

[0054] When the HSL color space is uniformly sampled, the HSL color space is uniformly sampled in three dimensions to obtain the initial HSL lookup table, so that the generation of the initial HSL lookup table is realized through the uniform interval sampling in the three dimensions. The three dimensions include H (hue) dimension, S (saturation) dimension and L (brightness) dimension, and the division intervals of each dimension are the same or different.

[0055] The size of the above-mentioned HSL lookup table is determined according to the sampling interval, and the size of the HSL lookup table is 29*21*21*3, so that the size of the HSL lookup table is determined according to the actual effect.

[0056] Optionally, the target sampling point is obtained according to the index values of the plurality of sampling points in the initial HSL lookup table in the hue dimension, so as to improve the efficiency of obtaining the target sampling point.

[0057] In step S103, the preset three-dimensional lookup table is calibrated based on the calibrated HSL lookup table, and a calibrated three-dimensional lookup table is obtained.

[0058] In the embodiment of the application, in order to avoid the reduction of operation efficiency caused by the conversion from the RGB color space to the HSL color space when adjusting the image color, a three-dimensional lookup table based on the RGB space is established in advance, so as to directly adjust the color in the three-dimensional space. The three-dimensional lookup table includes three dimensions of R, G and B. In order to reduce the storage space occupied by the three-dimensional lookup table, the three-dimensional lookup table contains 10 3 sampling points, and the intervals between the adjacent sampling points in each dimension are equal. Specifically, the lookup table of 10 3 sampling points can be established by dividing the range of 0-255 in the RGB color space by an interval of 28 units.

[0059] In the calibration of the preset three-dimensional lookup table based on the calibrated HSL lookup table, specifically, each original RGB value in the preset three-dimensional lookup table is converted into a corresponding original HSL value, each original HSL value is adjusted according to the calibrated HSL lookup table to obtain a corresponding target HSL value, each target HSL value is converted into a corresponding target RGB value, and the three-dimensional lookup table is calibrated based on each original RGB value and each target RGB value, so as to realize the calibration of the three-dimensional lookup table through the color space conversion. The calibrated three-dimensional lookup table contains the original RGB value and the target RGB value corresponding to the original RGB.

[0060] In the adjustment of each original HSL value according to the calibrated HSL lookup table, optionally, each original HSL value is adjusted to obtain a corresponding target adjustment value by using a preset interpolation method (first interpolation method) according to the calibrated HSL lookup table, and the target HSL value is obtained based on each original HSL value and the corresponding target adjustment value, so as to perform the color adjustment through the interpolation calculation in the HSL space. The interpolation method can be trilinear interpolation, tetrahedral vertical interpolation or the like, which is not limited herein.

[0061] Specifically, for each pixel point in the 3D lookup table, the original RGB value (r, g, b) is converted into the corresponding original HSL value (h, s, l), and the original HSL value (h, s, l) is adjusted according to the calibrated HSL lookup table. If the converted HSL value is equal to the HSL value corresponding to a sampling point in the calibrated HSL lookup table, the adjusted pixel value of the pixel point is:

[0062] (h', s', l') = (h, s, l) + (Δh, Δs, Δl), where Δh, Δs, and Δl are adjustment values.

[0063] If the converted HSL value is not equal to the pixel value corresponding to a sampling point in the calibrated HSL lookup table, the adjustment value of the pixel value of the point needs to be calculated by three-dimensional linear interpolation or other methods. The specific method of calculating the adjustment value of the pixel value by three-dimensional linear interpolation is as follows:

[0064] For an equally spaced HSL color space, a fast lookup method is used to calculate the eight adjacent sampling points of the input pixel point. Assuming that the input pixel point pixel value is (h, s, l), the above eight sampling points are P 0,0,0 =(Δh i,j,k ,Δs i,j,k ,Δl i,j,k ), P 0,0,1 =(Δh i,j,k+1 ,Δs i,j,k+1 ,Δl i,j,k+1 ),

[0065] P 0,1,1 =(Δh i,j+1,k+1 ,Δs i,j+1,k+1 ,Δl i,j+1,k+1 ), P 0,1,0 =(Δh i,j+1,k ,Δs i,j+1,k ,Δl i,j+1,k ),

[0066] P 1,0,0 =(Δh i+1,j,k ,Δs i+1,j,k ,Δl i+1,j,k ), P 1,0,1 =(Δh i+1,j,k+1 ,Δs i+1,j,k+1 ,Δl i+1,j,k+1 ),

[0067] P 1,1,0 =(Δh i+1,j+1,k ,Δs i+1,j+1,k ,Δl i+1,j+1,k ), P 1,1,1 =(Δh i+1,j+1,k+1 ,Δsi+1,j+1,k+1 , Δi i+1,j+1,k+1 ), where i ∈ [0, 28],

[0068] j ∈ [0, 20], k ∈ [0, 20], are the index values of the sampling points in H (hue), S (saturation), L (lightness) dimensions in HSL color space respectively, then i = h / x, j = s / y, k = l / z, " / " represents the quotient operation, x, y, z represent the sampling interval of hue, saturation and lightness respectively. The adjacent sampling points of the input pixel point are calculated, and the point P 0,0,0 corresponding to the HSL value (h0, s0, l0) is recorded. The d h = (h - h0) / x, d s = (s - s0) / y,

[0069] d l = (l - l0) / z. Then, the adjustment value corresponding to the input pixel point is calculated:

[0070] P = P 000 × (1 - d h ) × (1 - d s ) × (1 - d l ) + P 001 × (1 - d h ) × (1 - d s ) × d l

[0071] + P 011 × (1 - d h ) × d s × d l + P 010 × (1 - d h ) × d s × (1 - d l )

[0072] + P 100 × d h × (1 - d s ) × (1 - d l ) + P 101 × d h × (1 - d s ) × d l

[0073] + P 110 × d h × d s × (1 - d l ) + P 111 × d h × d s × d l

[0074] = (Ah, As, Al)

[0075] The adjusted pixel value of the pixel point: (h', s', l') = (h, s, l) + (Ah, As, Al).

[0076] Convert the adjusted HSL value (h', s', l') into RGB value (r', g', b'), and the conversion formula from HSL space to RGB space is as follows:

[0077] When s' = 0, r' = g' = b' = l';

[0078] When s' ≠ 0:

[0079]

[0080]

[0081] p = 2xl' - q

[0082]

[0083] t G = h k

[0084]

[0085]

[0086] For each color vector Color = (Color R , Color G , Color B ) = (r', g', b'),

[0087]

[0088] In step S104, the second image to be adjusted in color is adjusted in color according to the calibrated three-dimensional lookup table.

[0089] In an embodiment of the present invention, when color adjustment is performed on the second image to be color-adjusted according to a calibrated three-dimensional lookup table, optionally, a preset interpolation method (first interpolation method) is used to perform color adjustment on the pixels in the second image to be color-adjusted according to the calibrated three-dimensional lookup table. Specifically, each pixel of the second image to be color-adjusted is traversed to obtain the original RGB value (r, g, b) of each pixel, three-dimensional linear interpolation is performed according to the calibrated 3D lookup table, the target RGB value (r′, g′, b′) of the current pixel is calculated, and the original RGB value of the current pixel is adjusted to the corresponding target RGB value to obtain the pixel after hue, saturation and brightness are adjusted. The above steps are repeated to adjust the original RGB value of each pixel of the second image to be color-adjusted to the target RGB value to obtain the target image after color adjustment. The interpolation method can be trilinear interpolation, tetrahedral vertical interpolation, etc., which is not limited here.

[0090] In an embodiment of the present invention, the acquired first image to be color-adjusted is converted from the RGB color space to the HSL color space, the local color of the first image to be color-adjusted is adjusted in the HSL color space, a calibrated HSL lookup table is obtained based on the multiple groups of adjustment values ​​obtained after the adjustment, the preset three-dimensional lookup table is calibrated based on the calibrated HSL lookup table to obtain a calibrated three-dimensional lookup table, and the color of the second image to be color-adjusted is adjusted according to the calibrated three-dimensional lookup table, thereby achieving adjustment of the local color of the image and improving the quality of the entire image.

[0091] Example Two:

[0092] Figure 2 The structure of the image local color adjustment device provided by the second embodiment of the present invention is shown. For ease of description, only the parts related to the embodiment of the present invention are shown, including:

[0093] A color space conversion unit 21 is used to convert the acquired first image to be toned from the RGB color space to the HSL color space;

[0094] An HSL lookup table calibration unit 22 is configured to adjust the local colors of the first image to be toned in the HSL color space, and obtain a calibrated HSL lookup table according to the multiple sets of adjustment values ​​obtained after the adjustment;

[0095] a three-dimensional lookup table calibration unit 23, configured to calibrate a preset three-dimensional lookup table based on the calibrated HSL lookup table to obtain a calibrated three-dimensional lookup table; and

[0096] The image color adjustment unit 24 is configured to perform color adjustment on the second image to be adjusted according to the calibrated three-dimensional lookup table.

[0097] Optionally, the HSL lookup table calibration unit comprises:

[0098] an HSL lookup table generation unit configured to uniformly sample in the HSL color space to obtain an initial HSL lookup table;

[0099] a target sampling point acquisition unit configured to acquire, according to the initial HSL lookup table, a target sampling point corresponding to a local color of the first image to be color adjusted;

[0100] an adjustment value acquisition unit configured to adjust the target sampling point in hue, saturation and lightness to obtain a plurality of groups of adjustment values;

[0101] an HSL lookup table calibration subunit configured to calibrate the initial HSL lookup table according to the plurality of groups of adjustment values to obtain a calibrated HSL lookup table.

[0102] Optionally, the HSL lookup table generation unit is further configured to uniformly sample in three dimensions of the HSL color space.

[0103] Optionally, the target sampling point acquisition unit is further configured to acquire the target sampling point according to an index value of a plurality of sampling points in the initial HSL lookup table in a hue dimension.

[0104] Optionally, the three-dimensional lookup table contains 10 3 sampling points, and intervals between adjacent sampling points in each dimension are equal.

[0105] Optionally, the three-dimensional lookup table calibration unit comprises:

[0106] an HSL value adjustment unit configured to convert original RGB values of each sampling point in a preset three-dimensional lookup table into corresponding original HSL values, and adjust each original HSL value according to the calibrated HSL lookup table to obtain a corresponding target HSL value;

[0107] a color conversion unit configured to convert each target HSL value into a corresponding target RGB value; and

[0108] a three-dimensional lookup table calibration subunit configured to calibrate the three-dimensional lookup table based on each original RGB value and each target RGB value.

[0109] Optionally, the HSL value adjustment unit comprises:

[0110] an HSL interpolation unit configured to obtain each original HSL value for adjustment according to the calibrated HSL lookup table by using a preset interpolation method to obtain a corresponding target adjustment value; and

[0111] a target HSL value acquisition unit configured to obtain the target HSL value based on each original HSL value and the corresponding target adjustment value.

[0112] Optionally, the image color adjustment unit is further configured to adjust the color of the pixel points in the second image to be color adjusted according to the preset interpolation method and the calibrated three-dimensional lookup table.

[0113] In the embodiments of the present application, the units of the image local color adjustment device can be realized by corresponding hardware or software units, and each unit can be an independent software or hardware unit, or can be integrated into a software or hardware unit, which does not limit the present application. The specific implementation of each unit of the image local color adjustment device can refer to the description of the foregoing method embodiments, which will not be described here.

[0114] Example Three:

[0115] Figure 3 The structure of the electronic device provided in the third embodiment of the present application is shown, and only the parts related to the embodiments of the present application are shown for the convenience of description.

[0116] The electronic device 3 of the embodiments of the present application includes a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30. The processor 30 implements the steps in the foregoing method embodiments when executing the computer program 32, for example Figure 1 the steps S101 to S104 shown. Alternatively, the processor 30 implements the functions of the units in the foregoing device embodiments when executing the computer program 32, for example Figure 2 the functions of the units 21 to 24 shown.

[0117] In the embodiments of the present application, the first image to be color adjusted is converted from the RGB color space to the HSL color space, the local color of the first image to be color adjusted is adjusted in the HSL color space, the calibrated HSL lookup table is obtained according to the plurality of sets of adjustment values obtained after the adjustment, the preset three-dimensional lookup table is calibrated based on the calibrated HSL lookup table, the calibrated three-dimensional lookup table is obtained, and the color of the second image to be color adjusted is adjusted according to the calibrated three-dimensional lookup table, so as to realize the adjustment of the local color of the image, and further improve the quality of the entire image.

[0118] Example Four:

[0119] In the embodiments of the present application, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the steps in the foregoing method embodiments, for example, Figure 1 the steps S101 to S104 shown. Alternatively, the computer program is executed by a processor to implement the functions of the units in the foregoing device embodiments, for example Figure 2 the functions of the units 21 to 24 shown.

[0120] In the embodiment of the present application, the obtained first image to be color adjusted is converted from an RGB color space to an HSL color space, local colors of the first image to be color adjusted are adjusted in the HSL color space, a calibrated HSL lookup table is obtained according to a plurality of sets of adjustment values obtained after the adjustment, the preset three-dimensional lookup table is calibrated based on the calibrated HSL lookup table, a calibrated three-dimensional lookup table is obtained, and the second image to be color adjusted is color adjusted according to the calibrated three-dimensional lookup table, so that the adjustment of the local colors of the image is realized, and the quality of the whole image is improved.

[0121] The computer readable storage medium of the embodiment of the present application can include any entity or device capable of carrying computer program codes, recording media, such as ROM / RAM, magnetic disk, optical disk, flash memory, etc.

[0122] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for adjusting local color of an image, characterized in that: The method comprises the following steps: Converting the acquired first image to be toned from the RGB color space to the HSL color space; Adjusting the local colors of the first image to be toned in the HSL color space, and obtaining a calibrated HSL lookup table according to the multiple sets of adjustment values ​​obtained after the adjustment; Calibrate a preset three-dimensional lookup table based on the calibrated HSL lookup table to obtain a calibrated three-dimensional lookup table; performing color adjustment on the second image to be color-adjusted according to the calibrated three-dimensional lookup table; The step of adjusting the local color of the first image to be toned in the HSL color space and obtaining a calibrated HSL lookup table according to the multiple sets of adjustment values ​​obtained after the adjustment includes: uniformly sampling in the HSL color space to obtain an initial HSL lookup table; Obtaining target sampling points corresponding to local colors of the first image to be toned according to the initial HSL lookup table; Adjusting the hue, saturation and brightness of the target sampling point to obtain the multiple groups of adjustment values; Calibrate the initial HSL lookup table according to the multiple groups of adjustment values ​​to obtain the calibrated HSL lookup table; The step of calibrating the preset three-dimensional lookup table based on the calibrated HSL lookup table includes: Converting the original RGB value of each sampling point in the preset three-dimensional lookup table into a corresponding original HSL value, and adjusting each original HSL value according to the calibrated HSL lookup table to obtain a corresponding target HSL value; Convert each of the target HSL values ​​into a corresponding target RGB value; The three-dimensional lookup table is calibrated based on each of the original RGB values ​​and each of the target RGB values.

2. The method according to claim 1, wherein The step of uniformly sampling in the HSL color space comprises: Performing uniform sampling in the three dimensions of the HSL color space; The step of obtaining target sampling points corresponding to local colors of the first image to be toned according to the initial HSL lookup table includes: The target sampling point is obtained according to the index values ​​of the plurality of sampling points in the hue dimension in the initial HSL lookup table.

3. The method according to claim 1, wherein The three-dimensional lookup table contains 10 3 sampling points, and the intervals between adjacent sampling points in each dimension are equal.

4. The method according to claim 1, wherein The step of adjusting each of the original HSL values ​​according to the calibrated HSL lookup table comprises: According to the calibrated HSL lookup table, a preset interpolation method is used to obtain each of the original HSL values ​​for adjustment to obtain a corresponding target adjustment value; The target HSL value is obtained based on each of the original HSL values ​​and the corresponding target adjustment value.

5. The method according to claim 1, wherein The step of performing color adjustment on the second image to be color-adjusted according to the calibrated three-dimensional lookup table comprises: According to the calibrated three-dimensional lookup table, a preset interpolation method is used to perform color adjustment on the pixels in the second image to be color-adjusted.

6. A device for adjusting local color of an image, characterized in that: The device comprises: A color space conversion unit, configured to convert the acquired first image to be toned from an RGB color space to an HSL color space; An HSL lookup table calibration unit is configured to adjust the local color of the first image to be toned in the HSL color space, and obtain a calibrated HSL lookup table according to multiple sets of adjustment values ​​obtained after the adjustment; a three-dimensional lookup table calibration unit, configured to calibrate a preset three-dimensional lookup table based on the calibrated HSL lookup table to obtain a calibrated three-dimensional lookup table; and an image color adjustment unit, configured to perform color adjustment on the second image to be color adjusted according to the calibrated three-dimensional lookup table; Wherein, the HSL lookup table calibration unit includes: An HSL space sampling unit is used to uniformly sample in the HSL color space to obtain an initial HSL lookup table; a target sampling point extraction unit, configured to obtain target sampling points corresponding to local colors of the first image to be toned according to the initial HSL lookup table; a sampling point adjustment unit, configured to adjust the hue, saturation, and brightness of the target sampling point to obtain the plurality of groups of adjustment values; a lookup table calibration unit, configured to calibrate the initial HSL lookup table according to the multiple groups of adjustment values ​​to obtain the calibrated HSL lookup table; The three-dimensional lookup table calibration unit includes: an RGB-HSL conversion and adjustment unit, configured to convert the original RGB value of each sampling point in the preset three-dimensional lookup table into a corresponding original HSL value, and adjust each original HSL value according to the calibrated HSL lookup table to obtain a corresponding target HSL value; An HSL-RGB inverse conversion unit, configured to convert each of the target HSL values ​​into a corresponding target RGB value; A three-dimensional lookup table mapping calibration unit is used to calibrate the three-dimensional lookup table based on each of the original RGB values ​​and each of the target RGB values.

7. The device according to claim 6, characterized in that When the HSL space sampling unit uniformly samples in the HSL color space, it includes: Performing uniform sampling in the three dimensions of the HSL color space; When the target sampling point extraction unit obtains the target sampling point corresponding to the local color of the first image to be toned according to the initial HSL lookup table, it includes: The target sampling point is obtained according to the index values ​​of the plurality of sampling points in the hue dimension in the initial HSL lookup table.

8. The device according to claim 6, wherein The three-dimensional lookup table contains 10 3 sampling points, and the intervals between adjacent sampling points in each dimension are equal.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Systems and methods for performing color adjustments of pixels on a color display

    CN103339944A