CN111615714B - Color adjustment method of RGB data - Google Patents

Color adjustment method of RGB data Download PDF

Info

Publication number
CN111615714B
CN111615714B CN201880086830.7A CN201880086830A CN111615714B CN 111615714 B CN111615714 B CN 111615714B CN 201880086830 A CN201880086830 A CN 201880086830A CN 111615714 B CN111615714 B CN 111615714B
Authority
CN
China
Prior art keywords
rgb
tone
value
adjustment
input data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201880086830.7A
Other languages
Chinese (zh)
Other versions
CN111615714A (en
Inventor
李宗原
吕臻凯
孙新江
那柏林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN111615714A publication Critical patent/CN111615714A/en
Application granted granted Critical
Publication of CN111615714B publication Critical patent/CN111615714B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/46Colour picture communication systems
    • H04N1/56Processing of colour picture signals
    • H04N1/60Colour correction or control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Color Image Communication Systems (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the application discloses a color adjustment method and device of RGB data, wherein the method comprises the following steps: calculating a first tone interval corresponding to the tone adjustment value; determining a second tone interval corresponding to the RGB output data according to the RGB input data and the first tone interval; and regulating the saturation and the brightness of the RGB input data by using the saturation regulating value and the brightness regulating value respectively to obtain RGB regulating data, and selecting RGB output data from the RGB regulating data according to the second tone interval. Because the hue adjustment value, the saturation adjustment value and the brightness adjustment value are used for carrying out color adjustment on RGB input data in an RGB color space all the time, the RGB input data is not required to be firstly transformed into an HSV color space and then subjected to inverse transformation, and the whole color adjustment process is realized through addition operation, subtraction operation, comparison operation and multiplication operation, so that a large number of floating point operation and division operation are avoided, a large number of LUT or divider resources are saved, and the power consumption of hardware is reduced.

Description

Color adjustment method of RGB data
Technical Field
The present application relates to the field of image processing, and in particular, to a color adjustment method and apparatus for RGB data.
Background
In the field of image processing, such as related fields of Camera image signal processing (ISP for Camera), display image processing (Image Processing for Display), digital image processing (Digital Image Processing), and the like, adjustment for hue (hue), saturation (saturation), and brightness (brightness) of an image is a common method for improving image quality. In the prior art, the color adjustment method mainly based on HSV/HSL mainly comprises the following steps: converting the input RGB data into an HSV/HSL color space to obtain tone, brightness and saturation corresponding to the input RGB data; performing a large number of floating point operations on the obtained 3 parameters of hue, brightness and saturation, and the hue adjustment value, the brightness adjustment value and the saturation adjustment value to obtain hue, brightness and saturation after color adjustment; converting the adjusted hue, brightness and saturation into RGB color space; finally, the display is displayed on the electronic equipment.
To implement the forward and inverse transforms of image data in the RGB color space and the HSV/HSL color space, as well as the calculation of hue, brightness and saturation and corresponding adjustment values, the corresponding hardware circuits need to do a large number of floating point operations, in particular division operations. The division operation may be implemented by a divider or LUT (Look Up Table), but the divider requires a complex and highly accurate fixed point simplification process, and the LUT occupies a large amount of hardware resources and increases clock delay, thus increasing hardware area and reducing the rate of color adjustment of RGB data.
Disclosure of Invention
The embodiment of the application provides a color adjustment method of RGB data, which can be used for solving the problems of larger hardware and higher power consumption caused by LUT or divider used as floating point operation in the color adjustment process.
For a clearer description of the present application, three color spaces (modes) are described below:
RGB: a color space (pattern) adds the three primary colors of Red (Red), green (Green), blue (Blue) to produce a variety of colored lights.
HSL: a color space (mode) in which colors are represented by superposition of 3 components of hue H (hue), saturation S (Saturation), and brightness (Lightness).
HSV: hue Saturation Value, a color space (mode) similar to HSL.
In a first aspect, in an embodiment of the present application, there is provided a color adjustment method of RGB data for adjusting hue, saturation, and brightness of RGB input data. The adjusting method comprises the following steps: acquiring RGB input data, and acquiring a tone adjustment value, a saturation adjustment value and a brightness adjustment value required for performing color adjustment on the RGB input data; calculating a first tone interval corresponding to the tone adjustment value; determining a second tone interval corresponding to the RGB output data according to the RGB input data and the obtained first tone interval; adjusting the saturation of the RGB input data by using the saturation adjustment value, adjusting the brightness of the RGB input data by using the brightness adjustment value to obtain RGB adjustment data, and selecting RGB output data from the RGB adjustment data according to the second tone interval; and displaying the obtained RGB output data.
Because the hue adjustment value, the saturation adjustment value and the brightness adjustment value are used for carrying out color adjustment on RGB input data in an RGB color space all the time, the RGB input data is not required to be firstly transformed into an HSV color space and then subjected to inverse transformation, and the whole color adjustment process is realized through addition operation, subtraction operation, comparison operation and multiplication operation, so that a large number of floating point operation and division operation are avoided, a large number of LUT or divider resources are saved, and the power consumption of hardware is reduced.
In one embodiment, calculating a first tone interval corresponding to a tone adjustment value includes: tone adjustment value H and divisor 2 N1 Performing division operation to obtain corresponding quotient Q and remainder Rem, wherein divisor 2 N1 N1 is a non-negative integer, which is the total angle of hue. The quotient Q obtained by the above calculation represents the first tone section corresponding to the tone adjustment value H, and the remainder Rem represents the amount of tone change of the tone adjustment value H to the tone value of the RGB input data in the adjusted tone section. And dividing the tone adjustment value to obtain a first tone interval corresponding to the tone adjustment value so as to determine the change amount of the tone adjustment value to the tone interval of the RGB input data.
In one embodiment, when the hue adjustment value is greater than or equal to the hue threshold, the hue threshold is subtracted from the hue adjustment value, otherwise the hue adjustment value is held unchanged, the hue threshold being the maximum number of intervals multiplied by an integer power of 2. And adjusting the tone adjustment value to ensure that the tone adjustment value is in a proper tone interval, so as to avoid the increase of calculated amount caused by overlarge tone interval in which the tone adjustment value is positioned.
In one embodiment, the step of determining a second tone segment corresponding to the RGB output data from the RGB input data and the first tone segment includes: preprocessing RGB input data to obtain an RGB parameter set; performing linear calculation on the remainder and one or more parameters in the RGB parameter set to obtain an alternative parameter set; and determining a second tone interval corresponding to the RGB output data according to the size relation between the RGB input data and the parameters in the RGB parameter set and the size relation between the RGB input data and the parameters in the alternative parameter set. The second tone interval corresponding to the RGB output data can be determined through the calculation process, and the calculation process only involves simple addition operation, subtraction operation, multiplication operation and comparison operation, so that a large amount of hardware resources are saved through a simple logic calculation circuit.
In one embodiment, the step of calculating the RGB parameter set includes: calculating the maximum value and the minimum value of RGB input data; calculating the difference between the maximum value and the minimum value; and calculating a sub-pixel difference value, wherein the sub-pixel difference value includes an absolute value of a difference value of each two color components. Since the calculation of the RGB parameter set involves only addition and subtraction of non-negative integers, a significant amount of hardware resources are saved.
In one embodiment, the above-mentioned alternative parameter set includes a first parameter S1, and a calculation expression of the first parameter S1 is: s1=Δrgb·rem, where Δrgb is the difference between the maximum value and the minimum value of the RGB input data, and Rem is the remainder. The first parameter S1 is calculated, providing a calculation basis for the subsequent set of alternative parameters.
In one embodiment, the magnitude relation between one color component in the RGB input data and one parameter in the RGB parameter set is compared with the magnitude relation between one color component in the RGB input data and one parameter in the alternative parameter set, and one parameter is selected from the alternative parameter set as the saturation coefficient according to the magnitude relation. The saturation coefficient is obtained by comparing the parameters, and is used as the calculation parameters of the subsequent brightness adjustment and saturation adjustment.
In one embodiment, a hue interval index value is calculated from the magnitude relation, the hue interval index value being a sum of the quotient and a hue constant, wherein the hue constant is determined from the magnitude relation. And obtaining a tone interval index value through the size relation, and taking the tone interval index value as a basis for the subsequent selection of RGB output data.
In one embodiment, the RGB-adjustment data includes a second parameter p 1 Third parameter p 2 Fourth parameter p 3 And a fifth parameter RGB max Wherein:
p 1 =(2 n1 ·RGB max -ΔRGB·S)·2 n2 ·V;
p 2 =(2 n3 ·V-S·Sx)·2 n4 ·V;
p 3 =[RGB min ·S·2 n5 +S·Sx-2 n6 ·RGB max ·(Sat-128)]·2 n7 v (when S. Gtoreq.128);
p 3 =[RGB min ·S·2 n5 +S·Sx+2 n6 ·RGB max ·(128-Sat)]·2 n7 v (when S < 128);
wherein n1 to n7 are integers, RGB max Δrgb is a difference between the maximum value and the minimum value, S is the saturation adjustment value, V is the luminance adjustment value, and Sx is the saturation coefficient. Obtaining a second parameter p by the above process 1 Third parameter p 2 Fourth parameter p 3 And a fifth parameter RGB max As an alternative parameter of RGB output data, the calculation process of RGB adjustment data only comprises addition operation, subtraction operation, comparison operation and multiplication operation which can be realized by shifting, thereby greatly saving hardware resources and reducing power consumption.
In one embodiment, 3 parameters in the RGB adjustment data are selected as RGB output data according to the hue interval index value. The RGB output data is selected with the above tone interval index value to obtain RGB output data at the correct tone interval.
In one embodiment, when the hue interval index value is greater than or equal to the maximum hue interval number, then the hue interval index value is subtracted by the maximum hue interval number; when the tone interval index value is smaller than the maximum tone interval number, the tone interval index value is kept unchanged. And the index value of the tone interval is adjusted to a proper value range so as to reduce unnecessary calculation and save hardware resources.
In a second aspect, in an embodiment of the present application, there is provided a color adjustment apparatus for RGB data for adjusting hue, saturation, and brightness of RGB input data. The color adjusting device comprises an obtaining module, a color adjusting module and a color adjusting module, wherein the obtaining module is used for obtaining RGB input data and obtaining a tone adjusting value, a saturation adjusting value and a brightness adjusting value which are required by color adjustment of the RGB input data; the first calculation module is used for calculating a first tone interval corresponding to the tone adjustment value; the second calculation module is used for determining a second tone interval corresponding to the RGB output data according to the RGB input data and the obtained first tone interval; the adjusting module is used for adjusting the saturation of the RGB input data by using the saturation adjusting value, adjusting the brightness of the RGB input data by using the brightness adjusting value to obtain RGB adjusting data, and selecting RGB output data from the RGB adjusting data according to the obtained second tone interval; the display module is used for displaying the obtained RGB output data;
Because the hue adjustment value, the saturation adjustment value and the brightness adjustment value are used for carrying out color adjustment on RGB input data in an RGB color space all the time, the RGB input data is not required to be firstly transformed into an HSV color space and then subjected to inverse transformation, and the whole color adjustment process is realized through addition operation, subtraction operation, comparison operation and multiplication operation, so that a large number of floating point operation and division operation are avoided, a large number of LUT or divider resources are saved, and the power consumption of hardware is reduced.
In one possible implementation, the first calculation module 320 calculates the tone adjustment value and the divisor 2 N1 Performing division operation to obtain corresponding quotient Q and remainder Rem, wherein divisor 2 N1 N1 is a non-negative integer, which is the total angle of hue. The quotient Q obtained in the calculation process represents the first tone corresponding to the tone adjustmentThe interval, and the remainder represents the amount of hue change of the hue adjustment value to the hue value of the RGB input data in the adjusted hue interval. And dividing the tone adjustment value to obtain a first tone interval corresponding to the tone adjustment value so as to determine the change amount of the tone adjustment value to the tone interval of the RGB input data.
In one possible implementation, the first calculation module is further configured to subtract the tone threshold value from the tone adjustment value when the tone adjustment value is greater than or equal to the tone threshold value, and otherwise, to leave the tone adjustment value unchanged, where the tone threshold value is a maximum tone interval number multiplied by an integer power of 2. And adjusting the tone adjustment value to ensure that the tone adjustment value is in a proper tone interval, so as to avoid the increase of calculated amount caused by overlarge tone interval in which the tone adjustment value is positioned.
In a possible implementation manner, the second calculating module is configured to pre-process RGB input data to obtain an RGB parameter set; performing linear calculation on the remainder Rem and one or more parameters in the RGB parameter set to obtain an alternative parameter set; and determining a second tone interval corresponding to the RGB output data according to the size relation between the RGB input data and the parameters in the RGB parameter set and the size relation between the RGB input data and the parameters in the alternative parameter set. The second tone interval corresponding to the RGB output data can be determined through the calculation process, and the calculation process only involves simple addition operation, subtraction operation, multiplication operation and comparison operation, so that a large amount of hardware resources are saved through a simple logic calculation circuit.
In one possible implementation manner, the second calculating module is configured to calculate a maximum value and a minimum value of RGB input data; calculating the difference between the maximum value and the minimum value; and calculating a sub-pixel difference value, wherein the sub-pixel difference value includes an absolute value of a difference value of each two color components. Since the calculation of the RGB parameter set involves only addition and subtraction of non-negative integers, a significant amount of hardware resources are saved.
In a possible implementation manner, the second calculation module calculates an alternative parameter set, where the alternative parameter set includes a first parameter S1, and a calculation expression of the first parameter S1 is: s1=Δrgb·rem; wherein Δrgb is the difference between the maximum value and the minimum value of the RGB input data, and Rem is the remainder. The first parameter S1 is calculated, providing a calculation basis for the subsequent set of alternative parameters.
In one possible embodiment, the magnitude relation of one color component in the RGB input data and one parameter in the RGB parameter set, and the magnitude relation of one color component in the RGB input data and one parameter in the alternative parameter set are compared, respectively. And the second calculation module selects one parameter from the alternative parameter set as a saturation coefficient according to the size relation. The saturation coefficient is obtained by comparing the parameters, and is used as the calculation parameters of the subsequent brightness adjustment and saturation adjustment.
In one possible implementation, the second calculating module calculates a tone interval index value, where the tone interval index value is a sum of a quotient and a tone constant, and the tone constant is determined by the magnitude relation. And obtaining a tone interval index value through the size relation, and taking the tone interval index value as a basis for the subsequent selection of RGB output data.
In a possible embodiment, the adjustment module calculates RGB adjustment data, which includes the second parameter p 1 Third parameter p 2 Fourth parameter p 3 And a fifth parameter RGB max Wherein:
p1=(2 n1 ·RGB max -ΔRGB·S)·2 n2 ·V;
p2=(2 n3 ·V-S·Sx)·2 n4 ·V;
p 3 =[RGB min ·S·2 n5 +S·Sx-2 n6 ·RGB max ·(Sat-128)]·2 n7 v (when S. Gtoreq.128);
p 3 =[RGB min ·S·2 n5 +S·Sx+2 n6 ·RGB max ·(128-Sat)]·2 n7 v (when S < 128);
wherein n1 to n7 are integers, RGB max For the maximum value, Δrgb is the difference between the maximum value and the minimum value, S is the saturation adjustment value Sat, V is the brightness adjustment value V, and Sx is the saturation coefficient. General purpose medicineObtaining a second parameter p through the above process 1 Third parameter p 2 Fourth parameter p 3 And a fifth parameter RGB max As an alternative parameter of RGB output data, the calculation process of RGB adjustment data only comprises addition operation, subtraction operation, comparison operation and multiplication operation which can be realized by shifting, thereby greatly saving hardware resources and reducing power consumption.
In one possible implementation, the adjustment module 340 uses the index value index of the hue interval as the index value of the RGB adjustment data, and selects the second p 1 Third p 2 Fourth p 3 And fifth RGB max As values of 3 color components R, G and B of the RGB output data. The RGB output data is selected with the above tone interval index value to obtain RGB output data at the correct tone interval.
In one possible embodiment, when the tone interval index value is greater than or equal to the maximum tone interval number, the adjustment module subtracts the maximum tone interval number from the tone interval index value; when the tone interval index value is smaller than the maximum tone interval number, the adjusting module keeps the tone interval index value unchanged. And the index value of the tone interval is adjusted to a proper value range so as to reduce unnecessary calculation and save hardware resources.
In a third aspect, in an embodiment of the present application, there is provided a color adjustment apparatus for RGB data for adjusting hue, saturation, and brightness of RGB input data. The color adjustment device includes a memory for storing computer instructions, and a processor. The processor is communicatively coupled to the memory, wherein the computer instructions configure the processor and are used to perform the color adjustment method of the first aspect and its possible implementation.
Because the hue adjustment value, the saturation adjustment value and the brightness adjustment value are used for carrying out color adjustment on RGB input data in an RGB color space all the time, the RGB input data is not required to be firstly transformed into an HSV color space and then subjected to inverse transformation, and the whole color adjustment process is realized through addition operation, subtraction operation, comparison operation and multiplication operation, so that a large number of floating point operation and division operation are avoided, a large number of LUT or divider resources are saved, and the power consumption of hardware is reduced.
In a fourth aspect, in an embodiment of the present application, there is provided a computer readable storage medium, wherein the computer readable storage medium stores a computer program, which when read and executed by one or more processors implements the color adjustment method in the first aspect and possible implementations thereof.
Because the hue adjustment value, the saturation adjustment value and the brightness adjustment value are used for carrying out color adjustment on RGB input data in an RGB color space all the time, the RGB input data is not required to be firstly transformed into an HSV color space and then subjected to inverse transformation, and the whole color adjustment process is realized through addition operation, subtraction operation, comparison operation and multiplication operation, so that a large number of floating point operation and division operation are avoided, a large number of LUT or divider resources are saved, and the power consumption of hardware is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart of a color adjustment method according to an embodiment of the application.
FIG. 2 is a more specific data flow diagram of a color adjustment method according to an embodiment of the application.
Fig. 3 is a schematic structural diagram of a color adjusting device according to an embodiment of the application.
Fig. 4 is an electronic device for color adjustment according to an embodiment of the application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application.
In the HSV/HSL color space, pixel data is represented by hue, saturation, and brightness. Wherein, the tone represents the basic attribute of the color, namely the name of the color, and the value range of the tone is 0-360 degrees. For example, the color represented by the hue of 0 ° or 360 ° is red, the color represented by the hue of 120 ° is green, and the color represented by the hue of 240 ° is blue. The saturation represents the purity of the color, the value range is 0-100%, the higher the saturation is, the less gray is, and the more vivid the color is. The brightness ranges from 0% to 100%, and represents the brightness of the color, and the higher the brightness is, the closer the color is to white. For example, when the hue is 0 °, the color represented when the luminance is 100% is white, and the color represented when the luminance is 50% is gray. For convenience, an HSV color space is employed in accordance with all embodiments of the present application. It should be noted that the HSL color space may also be employed according to all embodiments of the present application.
Fig. 1 is a schematic flow chart of a color adjustment method according to an embodiment of the present application, where the method can perform color tone adjustment, saturation adjustment and brightness adjustment on RGB input data in an RGB color space according to an input color tone adjustment value H, saturation adjustment value S and brightness adjustment value V, and output color-adjusted RGB output data. The RGB input data and the RGB output data are each represented in an RGB color space, i.e., values of three color components R (Red), G (Green), and B (Blue) in the RGB color space.
As shown in fig. 1, in step 110, RGB input data is acquired, and a hue adjustment value, a saturation adjustment value, and a brightness adjustment value required for color adjustment of the RGB input data are acquired; in step 120, a first tone interval corresponding to the tone adjustment value is calculated; in step 130, determining a second tone interval corresponding to the RGB output data according to the RGB input data and the obtained first tone interval; in step 140, the saturation of the RGB input data is adjusted by the saturation adjustment value, and the brightness of the RGB input data is adjusted by the brightness adjustment value to obtain RGB adjustment data, and the RGB output data is selected from the RGB adjustment data according to the second tone interval obtained in step 130; finally, in step 150, the resulting RGB output data is displayed.
On the other hand, in the color adjustment process, the hue adjustment value H, the saturation adjustment value S and the brightness adjustment value V always perform color adjustment on the RGB input data in the RGB color space, without requiring RGB input numbersThe method is characterized in that the method is firstly transformed into HSV color space and then is subjected to inverse transformation, so that a large number of floating point operations and division operations are avoided. On the other hand, the color adjustment process can be realized by merely adding, subtracting, comparing and multiplying the color adjustment value, RGB input data and intermediate parameters, wherein the data involved in the operations are all non-negative integers, and the multiplication operations are all 2 n Where n is an integer. Thus, the multiplication may be implemented by shifting or other simple computational methods. Compared with the prior art, the color adjustment method of the embodiment of the application realizes the color adjustment of RGB input data through addition operation, subtraction operation, comparison operation and multiplication operation of non-negative integers, avoids the use of a large number of LUTs or dividers in the prior art, saves hardware resources and reduces the power consumption of hardware.
Fig. 2 is a more specific data flow diagram of a color adjustment method according to an embodiment of the present application.
First, the inputted hue adjustment value H is calculated to obtain a first hue interval corresponding to the hue adjustment value H. In HSV color space, a hue having a total angle of 360 ° is generally divided into a plurality of hue intervals by a maximum hue interval number, where the maximum hue interval number is a positive integer. For example, when the maximum number of tone intervals is 6, one tone interval is determined every 60 °. As the maximum number of tone intervals is larger, the tone intervals are divided into finer tone intervals, and thus the accuracy of tone adjustment increases, and the computational complexity increases. In the embodiment of the application, the total angle of the tone is 2 N1 Degree of 2 N1 The degree is divided by a maximum number M of tone intervals, and the angle of each tone interval after division is (2 N1 M) °, for example, the 0 th tone segment angle is 0 to (2) N1 Angle of 1 st tone interval is (2) N1 /M)°~(2·2 N1 M) °, and so on.
Specifically, calculating the first tone interval corresponding to the tone adjustment value includes: tone adjustment value H and divisor 2 N1 A division operation 210 is performed to obtain a corresponding quotient Q and remainder Rem, wherein the divisor 2 N1 N1 is a non-negative integer, which is the total angle of hue. It should be noted that the division calculation of the hue adjustment value H is not the only implementation method for performing the division operation 210 in the present application, and the calculation of the quotient Q and the remainder Rem can be performed by other methods to implement the division operation by using smaller hardware resources, and specific methods will be listed in detail below. The quotient Q obtained in the calculation process represents a first tone interval corresponding to the tone adjustment value H, namely, the quotient Q can reflect the change of the tone adjustment value H to the tone interval where the RGB input data is located, or how much of the tone interval is increased or decreased, namely, the change of the color attribute; the remainder Rem represents the amount of change in hue of the hue adjustment value H to the hue value of the RGB input data in the adjusted hue interval, i.e., the remainder Rem may reflect the amount of change in hue adjustment value H to the hue value of the RGB input data in the adjusted hue interval. The value range of the quotient Q obtained by the division operation is 0 to the maximum tone interval number M, and the remainder Rem is less than or equal to 2 N1 -1。
Alternatively, when the tone adjustment value H is large, the tone threshold H may be exceeded thd Therefore, before division (210) is performed on the tone adjustment value H, it is necessary to perform value range processing (211) on the tone adjustment value H so that the tone adjustment value H is in a suitable tone range, thereby avoiding an increase in the calculation amount caused by an excessive tone adjustment value H. Specifically, when the tone adjustment value H is greater than or equal to the tone threshold value H thd Then subtracting the hue threshold value H from the hue adjustment value H thd Otherwise, the hue adjustment value H is kept unchanged, wherein the hue threshold value H is found thd The expression of (2) is:
H thd =M·2 N1
wherein N1 is an integer, and M is the maximum interval number. Since the divisor in the division operation is 2 N1 Therefore, the division operation (210) can be realized by a simpler method to obtain the quotient Q and the remainder Rem, and the division operation is avoided by adopting a divider or an LUT, so that the area occupied by hardware resources of the division operation (210) is reduced, and the power consumption is saved. For example, the hue adjustment value H is set to n.2 N1 Comparisons were made one by one, where n is 0, 1, 2 …. When the tone adjustment value H satisfiesn·2 N1 ≤H<(n+1)·2 N1 At this time, the value of the quotient q=n is determined, and rem=h-n·2 is calculated N1 To determine the value of remainder Rem.
Since the hue adjustment value H is a non-negative integer, the quotient Q and the remainder Rem obtained are both non-negative integers. The first tone interval corresponding to the tone adjustment value H can be determined by dividing the tone adjustment value H (210) as described above. When the tone adjustment value H is excessively large, the value range processing (211) is performed, and the first tone section corresponding to the tone adjustment value H can be adjusted so as to be in the appropriate tone section.
After the adjustment amount of the tone interval is obtained, a second tone interval corresponding to the RGB output data is determined based on the RGB input data and the first tone interval. Wherein, the step of determining the second tone interval corresponding to the RGB output data according to the RGB input data and the first tone interval includes: preprocessing (220) RGB input data to obtain an RGB parameter set; performing a linear calculation (230) on the remainder Rem and one or more parameters of the RGB parameter set to obtain an alternative parameter set; and determining a second tone interval corresponding to the RGB output data according to the size relation between the RGB input data and the parameters in the RGB parameter set and the size relation between the RGB input data and the parameters in the alternative parameter set.
Specifically, the step of pre-processing (220) the RGB input data to obtain the RGB parameter set comprises:
calculating maximum RGB of RGB input data max And minimum RGB min
Calculating the maximum RGB max And minimum RGB min Is equal to the difference Δrgb of (a), i.e., Δrgb=rgb max -RGB min
And calculating a sub-pixel difference value, wherein the sub-pixel difference value comprises an absolute value of a difference value of every two color components, namely an absolute value RB of a difference value of the red component R and the blue component B abs Absolute value RG of difference between red component R and green component G abs Absolute value GB of the difference between the green and blue components G, B abs
Thus, the above-mentioned RGB parameter set includes RGB max 、RGB min 、ΔRGB、RB abs 、RG abs GB (chinese character) abs . Since the RGB input data are all non-negative integers, the obtained RGB parameter sets are all non-negative integers.
And (2) performing linear calculation (230) on the remainder Rem obtained by performing division (210) on the tone adjustment value H and one or more parameters in the RGB parameter set to obtain an alternative parameter set. Wherein the alternative parameter set comprises the result of linear transformation of the remainder Rem and one or more parameters in the RGB parameter set, i.e. parameter S 1 ~S 11 . Parameter S in alternative parameter set 1 ~S 11 Is determined by the expression in the following table:
S 1 =ΔRGB·Rem
S 2 =S 1 +2 n ·GB abs
S 3 =S 1 +2 n ·RG abs
S 4 =S 1 +2 n ·RB abs
S 5 =S 2 -2 n ·ΔRGB
S 6 =S 3 -2 n ·ΔRGB
S 7 =S 4 -2 n ·ΔRGB
S 8 =S 1 +2 n ·ΔRGB-2 n ·GB abs
S 9 =ΔRGB·Rem-2 n ·GB abs
S 10 =ΔRGB·Rem-2 n ·RG abs
S 11 =ΔRGB·Rem-2 n ·RB abs
it should be noted that the parameters in the alternative parameter set in the present application are not limited to the above 11 parameters, and are not limited to the expression forms of the above parameters. Alternative parameter sets may include one or more other parameters, but at least the first parameter S 1 Or by modifying the first parameter S 1 One or more parameters obtained by the linear calculation (230) are performed. In the expression of the parameters in the alternative parameter set, n is an integer, wherein n in the expression of each parameter is a value independent of each other. In calculating the parameter S 1 ~S 11 In order to align the variables on both sides of the plus sign or minus sign to the same bit width and ensure the calculated result is a non-negative integer when the addition or subtraction is performed abs 、RG abs GB (chinese character) abs Multiplied by an integer power of 2, e.g. in calculating when S 1 With GB abs When the bit widths of the bit patterns are different, GB abs And 2 n Multiplying by alignment S 1 With GB abs . Specifically, ΔRGB, RB abs 、RG abs GB (chinese character) abs And 2 n Multiplication may be achieved by shifting the above data one or more times to the left or right.
After the calculation of the candidate parameter set is completed, determining a second tone interval corresponding to the RGB output data according to the size relation between the RGB input data and the parameters in the RGB parameter set and the size relation between the RGB input data and the parameters in the candidate parameter set. Specifically, the magnitude relation of one color component in RGB input data and one parameter in RGB parameter set and the magnitude relation of one color component in RGB input data and one parameter in the alternative parameter set are compared (240) respectively, and one parameter is selected as a saturation coefficient Sx from the alternative parameter set according to the magnitude relation, and a hue interval index value Indx is calculated according to the magnitude relation and a quotient Q obtained by the division operation (210).
Specifically, the process of comparing (240) includes at least one comparison of a first type and at least one comparison of a second type. The first type of comparison includes a size comparison between three color components R, G and B in the RGB input data, RGB input data and maximum RGB max Is compared with a first threshold value thd and RGB input data 1 And a second threshold value thd 2 Or simultaneously satisfy the expressions of the above-described plural comparisons. Wherein a first threshold thd is calculated 1 And a second threshold value thd 2 The expressions of (2) are respectively:
thd 1 =2 n ·ΔRGB+B;
thd 2 =2 n ·ΔRGB+R。
wherein n is an integer and thd 1 And thd 2 N in (a) is a value independent of each other, B is a blue color component, and R is a red color component. Multiplying the difference Δrgb by the integer power of 2 can align the bit widths of the two addends in the above expression.
The second type of comparison includes the above-mentioned parameter S 2 、S 3 、S 4 、RB abs 、RG abs And GB (GB) abs Parameters and S of (a) 1 And delta RGB.2 n +S 1 Comparison between them. Based on the results of the above two comparisons, the values of the saturation coefficient Sx and the hue interval index value Indx are determined. Specifically, the parameter S is selected from the candidate parameter set according to the magnitude relation 1 ~S 11 As saturation index value Sx, and also calculates hue interval index value indix according to the above-described magnitude relation. The hue interval index value Indx may be expressed as indx=q+k, where k is a hue constant whose value range is a non-negative integer, and Q is the value of step 120 And (5) obtaining a quotient. From the above magnitude relation, the value of k can be determined, thereby calculating the hue interval index value indix.
For example, in the first type of comparison, it is determined whether the color component R is the maximum value of RGB input data, and at the same time, it is determined whether the value of the color component G is equal to or greater than the value of the color component B, that is, G.gtoreq.B; in the second comparison, ΔRGB.2 is determined n +S 1 Value of (2) and RB abs 、S 5 Is a size relationship of (a). Here, a case of comparison results is exemplified. In the first comparison, when r=rgb max R is more than or equal to B; meanwhile, in the second comparison, when ΔRGB.2 n +S 1 =RB abs At this time, the hue interval index value indix=q+1, and the saturation coefficient sx=s 1 The method comprises the steps of carrying out a first treatment on the surface of the When delta RGB.2 n +S 1 ≤S 5 At this time, the hue interval index value indix=q+1, and the saturation coefficient sx=s 5 -ΔRGB·2 n +S 1 . Where n is an integer to align the bit widths of the two addends in the above expression. If neither of the two second type comparisons is satisfied, the hue interval index value indix=q, the saturation coefficient sx=s 5 . For other cases in the first class comparison, the values of the saturation coefficient Sx and the hue interval index value Indx are determined by a second class comparison in other ways.
Since the RGB input data and the hue adjustment value H are different physical quantities, the hue interval corresponding to the RGB output data can be indirectly determined by comparing (240) the above and calculating the hue interval index value indix. Specifically, the quotient Q obtained by the division operation (210) may reflect the amount of change in the hue interval of the hue adjustment value H for the RGB input data in the RGB color space, and the remainder Rem obtained by the division operation (210) may reflect the amount of adjustment of the hue of the RGB input data by the hue adjustment value H in the hue interval. By comparing the above-described magnitude relation, it is possible to determine a tone section corresponding to RGB output data, that is, a tone section index value Indx, which reflects a tone section after the tone adjustment value H acts on RGB input data, that is, a tone section corresponding to RGB output data.
After obtaining the saturation coefficient and the tone interval index value, the saturation of the RGB input data is adjusted by using the saturation adjustment value S, and the brightness of the RGB input data is adjusted by using the brightness adjustment value V to obtain RGB adjustment data, and RGB output data is selected from the RGB adjustment data according to a second tone interval corresponding to the RGB output data. Optionally, the hue interval index value Indx may be value-range processed before the adjustment (260) is made. Specifically, when the hue interval index value indix is greater than or equal to the maximum hue interval number, the maximum hue interval number is subtracted from the hue interval index value indix; when the hue interval index value indix is smaller than the maximum hue interval number, the hue interval index value indix is kept unchanged.
In the adjusting (260), adjusting the saturation of the RGB input data using the saturation adjustment value S, and adjusting the luminance of the RGB input data using the luminance adjustment value V includes: RGB adjustment data is calculated. Wherein the RGB-adjustment data comprises a second parameter p 1 Third parameter p 2 Fourth parameter p 3 And a fifth parameter RGB max . For the second parameter p in RGB-regulated data 1 And a third parameter p 2 The calculation formula is determined by the following expression:
p 1 =(2 n ·RGB max -ΔRGB·S)·2 n ·V;
p 2 =(2 n ·V-S·Sx)·2 n ·V;
The second parameter p 1 And a third parameter p 2 In the expression of (2), n is an integer, wherein n in the expression of each parameter is a value independent of each other. In calculating the second parameter p 1 And a third parameter p 2 In order to align the variables on both sides of the plus or minus sign to the same bit width when the addition or subtraction is performed, RGB max And V and 2 n Multiplying. Calculating p as described above 1 Maximum value RGB in the expression of (a) max Subtracting the product of the saturation adjustment value S and the difference delta RGB to serve as saturation adjustment of the saturation adjustment value S on RGB input data; the obtained result is multiplied by a brightness adjustment value V as brightness adjustment of RGB input data by the brightness adjustment value V. Similarly, calculate p as described above 2 In the expression of (2), the saturation adjustment value S is multiplied by the saturation coefficient Sx as saturation adjustment of the saturation adjustment value S to the RGB input data; the result of subtracting the brightness adjustment value V is multiplied by the brightness adjustment value V as brightness adjustment of the RGB input data by the brightness adjustment value V.
For the fourth parameter p in RGB-regulated data 3 It is necessary to first calculate the intermediate parameter p 31 、p 32 And p 33 For parameter p 31 And p 32 The calculation formula is determined by the following expression:
P 31 =RGB min ·S·2 n
P 32 =S·Sx。
wherein n is an integer. Calculating p as described above 31 And p 32 In the expression of (2), the saturation adjustment value S is respectively equal to the minimum value RGB min And the saturation coefficient Sx as a saturation adjustment value S for saturation adjustment of RGB input data.
For parameter p 33 In order to make the parameter p 33 The calculated result of (2) is positive number, and it is necessary to judge whether the saturation adjustment value S exceeds the saturation standard value, and the saturation standard value can be 2 n Where n is a positive integer, e.g., n=7. Let n=7 be taken as an example of parameter p 33 Although it should be noted that the saturation criterion value according to the embodiment of the present application may be other values satisfying 2 n E.g., 32, 64, etc. When the saturation adjustment value S is greater than or equal to the saturation standard value, namely S is more than or equal to 128, the saturation adjustment value plays a role in enhancing the saturation, so p 33 Otherwise when S < 128, the saturation adjustment value acts to attenuate saturation, at which point p 33 =128-Sat。
Thus, when the parameter Sat is greater than or equal to 128, then:
p 3 =[p 31 +p 32 -(2 n1 ·RGB max ·p 33 )]·2 n2 ·V;
when the parameter Sat < 128, then:
p 3 =[p 31 +p 32 +(2 n1 ·RGB max ·p 33 )]·2 n2 ·V。
the above parameter p 3 In the expression of (2), n 1 And n 2 Are integers independent of each other. In calculating the parameter p 3 In addition or subtraction, RGB is used to align the variables on both sides of the plus or minus sign to the same bit width and ensure the calculated result to be a non-negative integer max ·p 33 And V is multiplied by an integer power of 2. Specifically, RGB is to max ·p 33 And the multiplication of V by an integer power of 2 can be achieved by shifting the data one or more times to the left or to the right.
After the calculation of the RGB-adjustment data is completed, the hue interval index value Indx is used as the index value of the RGB-adjustment data, and the second p is selected 1 Third p 2 Fourth p 3 And fifth RGB max As values of 3 color components R, G and B of the RGB output data. For example, when the hue interval index value indix=0, r=rgb in the RGB output data max 、G=p 3 、B=p 1 The method comprises the steps of carrying out a first treatment on the surface of the When the hue interval index value indix=1, r=p in the RGB output data 2 、G=RGB max 、B=p 1 . It should be noted that the present application does not make any limitation on the tone interval index value Indx and the manner in which the RGB output data is selected. The selected RGB output data may be the parameter p according to different hue interval index values Indx 1 、p 2 、p 3 And RGB max Any 3 of these.
After the adjustment (260) is completed, the resulting RGB output data is displayed (270) on a display device to obtain a color adjustment effect on the RGB input data.
The foregoing details of the method according to the embodiments of the present application, and in order to facilitate better implementation of the foregoing aspects of the embodiments of the present application, the embodiments of the present application further provide a corresponding color adjustment device.
Fig. 3 is a schematic diagram showing a structure of a color adjustment device 300 for RGB data according to an embodiment of the application. The color adjustment device 300 includes:
an acquisition module 310 for acquiring RGB input data, and acquiring a hue adjustment value, a saturation adjustment value, and a brightness adjustment value required for performing color adjustment on the RGB input data;
a first calculating module 320, configured to calculate a first tone interval corresponding to the tone adjustment value;
a second calculation module 330, configured to determine a second tone interval corresponding to the RGB output data according to the RGB input data and the obtained first tone interval;
an adjusting module 340 for adjusting the saturation of the RGB input data using the saturation adjustment value, adjusting the brightness of the RGB input data using the brightness adjustment value to obtain RGB adjustment data, and selecting RGB output data from the RGB adjustment data according to the obtained second tone interval;
a display module 350 for displaying the obtained RGB output data;
in one possible embodiment, the first calculation module 320 combines the hue adjustment value H with the divisor 2 N1 A division operation 210 is performed to obtain a corresponding quotient Q and remainder Rem, wherein the divisor 2 N1 N1 is a non-negative integer, which is the total angle of hue. The quotient Q obtained by the above calculation represents the first tone section corresponding to the tone adjustment value H, and the remainder Rem represents the amount of tone change of the tone adjustment value H to the tone value of the RGB input data in the adjusted tone section.
In one possible embodiment, when the hue adjustment value H is greater than or equal to the hue threshold H thd The first calculation module 320 is further configured to subtract the hue threshold H from the hue adjustment value H thd Otherwise, the tone adjustment value H is kept unchanged, and the tone threshold value is the integer power of 2 multiplied by the maximum tone interval number.
In a possible implementation manner, the second computing module 330 is configured to pre-process RGB input data to obtain an RGB parameter set; performing linear calculation on the remainder Rem and one or more parameters in the RGB parameter set to obtain an alternative parameter set; and determining a second tone interval corresponding to the RGB output data according to the size relation between the RGB input data and the parameters in the RGB parameter set and the size relation between the RGB input data and the parameters in the alternative parameter set.
In a possible embodiment, the second calculating module 330 is configured to calculate a maximum RGB of the RGB input data max And minimum RGB min The method comprises the steps of carrying out a first treatment on the surface of the Calculating the maximum RGB max And minimum RGB min Is equal to the difference Δrgb of (a), i.e., Δrgb=rgb max -RGB min The method comprises the steps of carrying out a first treatment on the surface of the And calculating a sub-pixel difference value, wherein the sub-pixel difference value comprises an absolute value of a difference value of each two color components,
in a possible implementation manner, the second calculating module 330 calculates an alternative parameter set, where the alternative parameter set includes a first parameter S1, and a calculation expression of the first parameter S1 is: s1=Δrgb·rem; wherein Δrgb is the difference between the maximum value and the minimum value of the RGB input data, and Rem is the remainder.
In one possible embodiment, the magnitude relation of one color component in the RGB input data and one parameter in the RGB parameter set, and the magnitude relation of one color component in the RGB input data and one parameter in the alternative parameter set are compared, respectively.
In one possible implementation, the second calculating module 330 calculates a tone interval index value, which is a sum of a quotient Q and a tone constant, where the tone constant is determined by the magnitude relation.
In a possible implementation manner, the second calculating module 330 selects a parameter from the candidate parameter set as the saturation coefficient according to the magnitude relation.
In one possible implementation, when the hue interval index value Indx is greater than or equal to the maximum hue interval number, the adjustment module 340 subtracts the maximum hue interval number from the hue interval index value Indx; when the hue interval index value Indx is smaller than the maximum hue interval number, the adjustment module 340 keeps the hue interval index value Indx unchanged.
In one possible implementation, the adjustment module 340 calculates RGB adjustment data, which includes the second parameter p 1 Third parameter p 2 Fourth parameter p 3 And a fifth parameter RGB max Wherein:
p 1 =(2 n1 ·RGB max -ΔRGB·S)·2 n2 ·V;
p 2 =(2 n3 ·V-S·Sx)·2 n4 ·V;
p 3 =[RGB min ·S·2 n5 +S·Sx-2 n6 ·RGB max ·(Sat-128)]·2 n7 v (when S. Gtoreq.128);
p 3 =[RGB min ·S·2 n5 +S·Sx+2 n6 ·RGB max ·(128-Sat)]·2 n7 v (when S < 128);
wherein n1 to n7 are integers, RGB max For the maximum value, Δrgb is the difference between the maximum value and the minimum value, S is the saturation adjustment value Sat, V is the brightness adjustment value V, and Sx is the saturation coefficient.
In one possible implementation, the adjustment module 340 uses the index value index of the hue interval as the index value of the RGB adjustment data, and selects the second p 1 Third p 2 Fourth p 3 And fifth RGB max As values of 3 color components R, G and B of the RGB output data.
The electronic apparatus 400 shown in fig. 4 is an apparatus that can perform the color adjustment method in the above-described embodiment. The electronic device 400 comprises a bus 401, a processor 402, a memory 403, a display device 404, optionally the electronic device 400 may further comprise an input device 405, radio frequency circuitry 406, a communication device 407, a sensor device 408, an audio device 409 and a power supply device 410. The electronic device 400 may be a communication device such as a mobile phone, a portable computer, etc. The processor 402 and the memory 403 are communicatively coupled to each other and there is a high-speed data transfer connection which may be implemented via a bus 401, which may be a AXI (Advanced eXtensible Interface) bus protocol, or other bus protocol, communicatively coupling the processor 402 and the memory 403, respectively. The processor 402 may be a central processing unit (Central Processing Unit, CPU) for executing software programs and/or instructions stored in the memory 403 to perform various functions of the electronic device 400, which may be an X86-, ARM-, and corex-a-based CPU. The processor 402 may also be an application processor (Application Processor, AP) and/or an image signal processor (Image Signal Processor, ISP). The memory 403 may include a volatile memory, such as a random access memory (Random Access Memory, RAM), a nonvolatile memory, such as a flash memory (flash memory), a hard disk or a Solid State Drive (SSD), or a combination of the above. The display device 404 is used to output visual text, graphics, video, and any combination thereof, and the display device 404 may be an LCD (Liquid Crystal Display ) or an LPD (Lighting Power Density, light emitting polymer display). A user may enter commands and information into the electronic device 400 through an input device 405, such as image data or video stream data to be color adjusted, wherein the input device 405 may be a mouse, keyboard, scanner or camera, etc. The radio frequency circuit 406 is used to receive and transmit electromagnetic waves, convert electrical signals into electromagnetic waves, or convert electromagnetic waves into electrical signals, and communicate with a communication network or other communication device via electromagnetic waves. The communication module 407 is configured to process communication data, for example, communication data represented by an electromagnetic wave received by the radio frequency circuit 406 and converted into an electrical signal. The sensor device 408 includes one or more sensors for receiving external environmental stimuli and providing a physical response, for example, the sensor device 408 may include a distance sensor configured to detect the presence of an object in the vicinity; the sensor device 408 may also include a light sensor, an acceleration sensor, a temperature sensor, and the like. The audio device 409 is for inputting or outputting audio signals, for example, the audio device 409 may comprise a microphone for receiving external audio signals. The power supply device 410 is configured to provide power to the various devices/circuits/modules described above, and the power supply device 410 may include a power management system, and one or more power supplies.
In one embodiment, image data is written into memory 403 via bus 401 through input device 405, and in memory 403, the image data is data of the RGB color space. Parameters such as a hue adjustment value, a saturation adjustment value, and a brightness adjustment value may be input through the input device 405 or may be read from the memory 403. The processor 402 reads the image data in the memory 403 through the bus 401, and reads instructions that can execute the color adjustment method as in all embodiments of the present application, and performs color adjustment on the image data according to the instructions. The color-adjusted image data may be stored in the memory 403 or displayed in the form of an image on the display device 404.
The steps of a method or algorithm described in connection with the present disclosure may be embodied in hardware, or may be embodied in software instructions executed by a processor. The software instructions may be comprised of corresponding software modules that may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. In addition, the ASIC may be located in the data receiving device and/or the data transmitting device. It is also possible that the processor and the storage medium reside as discrete components in a data receiving device and/or data transmitting device.
Those skilled in the art will appreciate that in one or more of the examples described above, the functions described in the present application may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, these functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The foregoing embodiments have been provided for the purpose of illustrating the general principles of the present application in further detail, and are not to be construed as limiting the scope of the application, but are merely intended to cover any modifications, equivalents, improvements, etc. based on the teachings of the application.

Claims (22)

1. A color adjustment method of RGB data, comprising:
Acquiring RGB input data, a tone adjustment value, a saturation adjustment value and a brightness adjustment value;
calculating a first tone interval corresponding to the tone adjustment value;
determining a second tone interval corresponding to RGB output data according to the RGB input data and the first tone interval;
adjusting the saturation of the RGB input data by using the saturation adjustment value and the brightness of the RGB input data by using the brightness adjustment value to obtain RGB adjustment data, and selecting the RGB output data from the RGB adjustment data according to the second tone interval;
displaying the RGB output data;
before the step of calculating the first tone interval corresponding to the tone adjustment value, the method further includes:
subtracting the tone threshold from the tone adjustment value when the tone adjustment value is greater than or equal to the tone threshold, otherwise, keeping the tone adjustment value unchanged, wherein the tone threshold is the maximum tone interval number multiplied by the integer power of 2.
2. The color adjustment method according to claim 1, wherein the step of calculating a first tone interval corresponding to the tone adjustment value includes:
calculating a quotient and remainder of the division of the hue adjustment value by a divisor, wherein the quotient represents a first hue corresponding to the hue adjustment value A tone segment, the remainder representing a change in tone of the tone adjustment value to the tone segment of the RGB input data after adjustment, the divisor being 2 N1 Wherein N1 is a non-negative integer.
3. The color adjustment method according to claim 2, wherein the step of determining a second tone interval corresponding to RGB output data from the RGB input data and the first tone interval comprises:
calculating an RGB parameter set according to the RGB input data;
performing linear calculation on the remainder and one or more parameters in the RGB parameter set to obtain an alternative parameter set;
and determining a second tone interval corresponding to the RGB output data according to the size relation between the RGB input data and the RGB parameter set and the size relation between the RGB input data and the parameters in the alternative parameter set.
4. The color adjustment method according to claim 3, wherein the step of calculating RGB parameter sets from the RGB input data comprises:
calculating a maximum value and a minimum value in the RGB input data;
calculating the difference between the maximum value and the minimum value;
and calculating a sub-pixel difference value, wherein the sub-pixel difference value is an absolute value of a difference value of every two color components in the RGB input data.
5. The color adjustment method according to claim 3 or 4, characterized in that the alternative parameter set comprises a first parameter S1, and the first parameter S1 has a calculation expression:
S1=△RGB·Rem;
wherein Δrgb is the difference between the maximum value and the minimum value of the RGB input data, and Rem is the remainder.
6. The color adjustment method according to claim 3 or 4, wherein the step of determining the second tone section corresponding to the RGB output data according to the magnitude relation between the RGB input data and the RGB parameter set, and the RGB input data and the parameters in the alternative parameter set comprises:
comparing a color component in the RGB input data with a parameter in the RGB parameter set and comparing a color component in the RGB input data with a parameter in the alternative parameter set;
and selecting a parameter from the alternative parameter set as a saturation coefficient according to the magnitude relation.
7. The color adjustment method according to claim 3 or 4, wherein the step of determining a second tone interval corresponding to RGB output data from the RGB input data and the first tone interval further comprises:
And calculating a tone interval index value, wherein the tone interval index value is the sum of the quotient and a tone constant, and the tone constant is determined through the size relation.
8. The color adjustment method according to claim 6, wherein the RGB adjustment data includes:
second parameter p 1 Third parameter p 2 Fourth parameter p 3 And a fifth parameter RGB max Wherein:
p 1 =(2 n1 ·RGB max -△RGB·S)·2 n2 ·V;
p 2 =(2 n3 ·V-S·Sx)·2 n4 ·V;
p 3 =[RGB min ·S·2 n5 +S·Sx-2 n6 ·RGB max ·(Sat-128)]·2 n7 v (when S. Gtoreq.128);
p 3 =[RGB min ·S·2 n5 +S·Sx+2 n6 ·RGB max ·(128-Sat)]·2 n7 v (when S < 128);
wherein n1 to n7 are integers, RGB max For the maximum of the RGB input dataValue, RGB min For the minimum value in the RGB input data, Δrgb is the difference between the maximum value and the minimum value, S is the saturation adjustment value, V is the brightness adjustment value, and Sx is the saturation coefficient.
9. The color adjustment method according to claim 7, wherein the step of selecting the RGB output data from the RGB adjustment data according to the second tone interval includes:
and selecting 3 parameters in the RGB adjustment data as the RGB output data according to the tone interval index value.
10. The color adjustment method according to claim 7, further comprising, before the step of selecting the RGB output data from the RGB adjustment data according to the second tone interval:
And when the tone interval index value is larger than or equal to the maximum tone interval number, subtracting the maximum tone interval number from the tone interval index value, otherwise, keeping the tone interval index value unchanged.
11. A color adjustment apparatus of RGB data, comprising:
the acquisition module acquires RGB input data, a tone adjustment value, a saturation adjustment value and a brightness adjustment value;
a first calculation module, which calculates a first tone interval corresponding to the tone adjustment value;
a second calculation module, which determines a second tone interval corresponding to the RGB output data according to the RGB input data and the first tone interval;
the adjusting module is used for adjusting the saturation of the RGB input data by using the saturation adjusting value and adjusting the brightness of the RGB input data by using the brightness adjusting value to obtain RGB adjusting data, and selecting the RGB output data from the RGB adjusting data according to the second tone interval;
a display module that displays the RGB output data;
the first calculation module is further configured to, before calculating the first tone interval corresponding to the tone adjustment value:
Subtracting the tone threshold from the tone adjustment value when the tone adjustment value is greater than or equal to the tone threshold, otherwise, keeping the tone adjustment value unchanged, wherein the threshold is the maximum tone interval number multiplied by the integer power of 2.
12. The color adjustment device of claim 11, wherein the first calculation module calculating a first tone interval corresponding to the tone adjustment value comprises:
calculating a quotient and a remainder of the division of the hue adjustment value by a divisor, wherein the quotient represents a first hue interval corresponding to the hue adjustment value, the remainder represents a hue change amount of the hue adjustment value to the RGB input data in the adjusted hue interval, and the divisor is 2 N1 Wherein N1 is a non-negative integer.
13. The color adjustment device of claim 12, wherein the second calculation module determining a second tone interval corresponding to RGB output data from the RGB input data and the first tone interval comprises:
calculating an RGB parameter set according to the RGB input data;
performing linear calculation on the remainder and one or more parameters in the RGB parameter set to obtain an alternative parameter set;
and determining a second tone interval corresponding to the RGB output data according to the size relation between the RGB input data and the RGB parameter set and the size relation between the RGB input data and the parameters in the alternative parameter set.
14. The color adjustment device of claim 13, wherein the second calculation module calculating an RGB parameter set from the RGB input data comprises:
calculating a maximum value and a minimum value in the RGB input data;
calculating the difference between the maximum value and the minimum value;
and calculating a sub-pixel difference value, wherein the sub-pixel difference value is an absolute value of a difference value of every two color components in the RGB input data.
15. The color adjustment device according to claim 13 or 14, characterized in that the alternative parameter set comprises a first parameter S1, the first parameter S1 having a calculated expression:
S1=△RGB·Rem;
wherein Δrgb is the difference between the maximum value and the minimum value of the RGB input data, and Rem is the remainder.
16. The color adjustment device of claim 13 or 14, wherein the second calculation module determining a second tone interval corresponding to the RGB output data according to a magnitude relation between the RGB input data and the RGB parameter set, and parameters in the RGB input data and the alternative parameter set comprises:
comparing a color component in the RGB input data with a parameter in the RGB parameter set and comparing a color component in the RGB input data with a parameter in the alternative parameter set;
And selecting a parameter from the alternative parameter set as a saturation coefficient according to the magnitude relation.
17. The color adjustment device of claim 13 or 14, wherein the second calculation module is further configured to:
and calculating a tone interval index value, wherein the tone interval index value is the sum of the quotient and a tone constant, and the tone constant is determined through the size relation.
18. The color adjustment device of claim 16, wherein the RGB adjustment data comprises:
second parameter p 1 Third parameter p 2 Fourth parameter p 3 And a fifth parameter RGB max Wherein:
p 1 =(2 n1 ·RGB max -△RGB·S)·2 n2 ·V;
p 2 =(2 n3 ·V-S·Sx)·2 n4 ·V;
p 3 =[RGB min ·S·2 n5 +S·Sx-2 n6 ·RGB max ·(Sat-128)]·2 n7 v (when S. Gtoreq.128);
p 3 =[RGB min ·S·2 n5 +S·Sx+2 n6 ·RGB max ·(128-Sat)]·2 n7 v (when S < 128);
wherein n1 to n7 are integers, RGB max RGB is the maximum value in the RGB input data min For the minimum value in the RGB input data, Δrgb is the difference between the maximum value and the minimum value, S is the saturation adjustment value, V is the brightness adjustment value, and Sx is the saturation coefficient.
19. The color adjustment device of claim 17, wherein the adjustment module selecting the RGB output data from the RGB adjustment data according to the second hue interval comprises:
and selecting 3 parameters in the RGB adjustment data as the RGB output data according to the tone interval index value.
20. The color adjustment device of claim 17, wherein the adjustment module is further configured to, prior to selecting the RGB output data from the RGB adjustment data based on the second hue interval:
and when the tone interval index value is larger than or equal to the maximum tone interval number, subtracting the maximum tone interval number from the tone interval index value, otherwise, keeping the tone interval index value unchanged.
21. A color adjustment apparatus of RGB data, comprising:
a memory for storing computer instructions;
a processor communicatively coupled to the memory, wherein the computer instructions configure the processor and are configured to perform the color adjustment method of any one of claims 1 to 10.
22. A computer readable storage medium storing a computer program which when read and executed by one or more processors implements the color adjustment method of any one of claims 1 to 10.
CN201880086830.7A 2018-06-27 2018-06-27 Color adjustment method of RGB data Active CN111615714B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/093105 WO2020000255A1 (en) 2018-06-27 2018-06-27 Rgb data color adjustment method

Publications (2)

Publication Number Publication Date
CN111615714A CN111615714A (en) 2020-09-01
CN111615714B true CN111615714B (en) 2023-12-15

Family

ID=68985566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880086830.7A Active CN111615714B (en) 2018-06-27 2018-06-27 Color adjustment method of RGB data

Country Status (2)

Country Link
CN (1) CN111615714B (en)
WO (1) WO2020000255A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112288661B (en) * 2020-12-28 2021-04-09 成都索贝数码科技股份有限公司 Image color correction method
CN114663548A (en) * 2022-02-16 2022-06-24 广东时谛智能科技有限公司 Method, system, equipment and storage medium for changing color of image or image area

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446345A (en) * 2010-09-30 2012-05-09 株式会社理光 Method, device and system for carrying out color enhancement on whiteboard colored image
CN105100762A (en) * 2015-07-17 2015-11-25 敦泰电子有限公司 Image processing method and image processing apparatus
CN107862657A (en) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 Image processing method, device, computer equipment and computer-readable recording medium
CN108024104A (en) * 2017-12-12 2018-05-11 上海顺久电子科技有限公司 The method and display device that a kind of high dynamic range images to input are handled

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4227322B2 (en) * 2001-10-01 2009-02-18 キヤノン株式会社 Image processing method, image processing apparatus, storage medium, and program
CN101742340B (en) * 2010-02-08 2012-05-30 腾讯科技(深圳)有限公司 Method and device for optimizing and editing image
WO2012106122A1 (en) * 2011-01-31 2012-08-09 Malvell World Trade Ltd. Systems and methods for performing color adjustments of pixels on a color display
US9129445B2 (en) * 2012-03-14 2015-09-08 Dolby Laboratories Licensing Corporation Efficient tone-mapping of high-bit-depth video to low-bit-depth display

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446345A (en) * 2010-09-30 2012-05-09 株式会社理光 Method, device and system for carrying out color enhancement on whiteboard colored image
CN105100762A (en) * 2015-07-17 2015-11-25 敦泰电子有限公司 Image processing method and image processing apparatus
CN107862657A (en) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 Image processing method, device, computer equipment and computer-readable recording medium
CN108024104A (en) * 2017-12-12 2018-05-11 上海顺久电子科技有限公司 The method and display device that a kind of high dynamic range images to input are handled

Also Published As

Publication number Publication date
WO2020000255A1 (en) 2020-01-02
CN111615714A (en) 2020-09-01

Similar Documents

Publication Publication Date Title
WO2021047383A1 (en) Image processing method and apparatus for electronic ink screen, and electronic ink screen
KR100925315B1 (en) Image display apparatus and electronic apparatus
US8325198B2 (en) Color gamut mapping and brightness enhancement for mobile displays
US8232944B2 (en) Display device
US8600154B2 (en) Image processing apparatus and image processing method
US10783837B2 (en) Driving method and driving device of display device, and related device
US8452094B2 (en) Real-time image generator
WO2019238071A1 (en) Colour gamut conversion method, colour gamut converter, display apparatus, image signal conversion method, computer device, and non-transitory storage medium
US11288783B2 (en) Method and system for image enhancement
AU2014268148B2 (en) Image processing apparatus, and program
CN110392243B (en) Method and apparatus for gamut mapping
JP2008060760A (en) Image processing program and image processing apparatus
US20210335183A1 (en) Display control method and device for n-primary-color display panel, and display device
CN107564493B (en) Color gamut compression method and device and display equipment
CN111615714B (en) Color adjustment method of RGB data
CN1655626B (en) System and method for clipping values of pixels
CN111626967A (en) Image enhancement method, image enhancement device, computer device and readable storage medium
CN113507598A (en) Video picture display method, device, terminal and storage medium
JP2008011286A (en) Image processing program and image processor
US20200160492A1 (en) Image Adjustment Method and Device, Image Display Method and Device, Non-Transitory Storage Medium
WO2019179059A1 (en) Fuzzy control-based saturation enhancement method and device
WO2022120799A9 (en) Image processing method and apparatus, electronic device, and storage medium
JP2008048264A (en) Image processing program, and image processing unit
CN112534466B (en) Directional scaling system and method
EP4372730A1 (en) Image enhancement method and apparatus, computer device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant