Method for correcting color using RGB data
09794449 · 2017-10-17
Assignee
Inventors
Cpc classification
H04N9/68
ELECTRICITY
International classification
Abstract
A method for a color correction using RGB data without a color space conversion for the color correction includes the steps of: extracting a start hue value of color coordinates from RGB input data; extracting an end hue value, which is finally modified by a color correction matrix user, from the start hue value according to each hue control value of a red color, a green color, a blue color, a yellow color, a cyan color and a magenta color (RGBYCM); converting input values R G and B, according to the end hue value, using a conversion formula for the corresponding input hue value among R, G and B conversion formulas; extracting a final saturation value from the end hue value according to an RGBYCM saturation control value; and calculating values of R, G and B according to modified start hue value, using an RGB color saturation value conversion formula.
Claims
1. A method for correcting color using red color, green color and blue color (RGB) data, comprising steps of: (a) extracting a start hue value of color coordinates from RGB input data, wherein if a maximum value of a corresponding pixel is R and a minimum value of the corresponding pixel is B, calculating the start hue value using a color conversion formula of “60×(Mid−Min)/(Max−Min)”; if the maximum value of the corresponding pixel is G, calculating the start hue value using the color conversion formula of “60×(2+(Mid−Min)/(Max−Min))”; if the maximum value of the corresponding pixel is B, calculating the start hue value using the color conversion formula of “60×(4+(Mid−Min)/(Max−Min))”; if the maximum value of the corresponding pixel is R and the minimum value of the corresponding pixel is G, calculating the start hue value using the color conversion formula of “60×(Mid−Min)/(Max−Min)”, where the “Max” denotes a maximum value of the RGB, “Mid” denotes an intermediate value of the RGB and the “Min” denotes a minimum value of the RGB; (b) extracting an end hue value, which is finally modified by a color correction matrix user, from the start hue value according to each hue control value of a red color, a green color, a blue color, a yellow color, a cyan color and a magenta color (RGBYCM); (c) converting input values R G and B, according to the end hue value, using a conversion formula for the corresponding input hue value among R, G and B conversion formulas; (d) extracting a final saturation value from the end hue value according to an RGBYCM saturation control value; and (e) calculating values of R, G and B according to modified start hue value, using an RGB color saturation value conversion formula.
2. A method for correcting color using red color, green color and blue color (RGB) data, comprising steps of: (a) extracting a start hue value of color coordinates from RGB input data; (b) extracting an end hue value, which is finally modified by a color correction matrix user, from the start hue value according to each hue control value of a red color, a green color, a blue color, a yellow color, a cyan color and a magenta color (RGBYCM); (c) converting input values R G and B, according to the end hue value, using a conversion formula for the corresponding input hue value among R, G and B conversion formulas, wherein if the end hue value is ranged from 60 to 120, calculating R as the maximum value of the corresponding pixel, B as the minimum value of the corresponding pixel and G using G conversion formula of “G=Min+({circle around (b)}/60)×(Max−Min)”; if the end hue value is ranged from 0 to 60, calculating R as the maximum value of the corresponding pixel, B as the minimum value of the corresponding pixel and R using R conversion formula of “R=Min−({circle around (b)}/60−2)×(Max−Min)”; if the end hue value is ranged from 120 to 180, calculating G as the maximum value of the corresponding pixel, R as the minimum value of the corresponding pixel and B using B conversion formula of “B=Min−({circle around (b)}/60−2)×(Max−Min)”; if the end hue value is ranged from 180 to 240, calculating B as the maximum value of the corresponding pixel, R as the minimum value of the corresponding pixel and G using G conversion formula of “G=Min−({circle around (b)}/60−4)×(Max−Min)”; if the end hue value is ranged from 240 to 320, calculating B as the maximum value of the corresponding pixel, G as the minimum value of the corresponding pixel and R using R conversion formula of “R=Min−({circle around (b)}/60−4)×(Max−Min)”; if the end hue value is ranged from 320 to 360, calculating R as the maximum value of the corresponding pixel, G as the minimum value of the corresponding pixel and B using B conversion formula of “B=Min−({circle around (b)}/60−4)×(Max−Min)”, where the “Max” denotes the maximum value of the RGB, the “Mid” denotes an intermediate value of the RGB, the “Min” denotes the minimum value of the RGB, and {circle around (b)} denotes the end hue value; (d) extracting a final saturation value from the end hue value according to an RGBYCM saturation control value; and (e) calculating values of R, G and B according to modified start hue value, using an RGB color saturation value conversion formula.
3. The method of claim 1, wherein in the step of (e), when R, G and B according to modified start hue value are calculated using the RGB color saturation value conversion formula, an intermediate value of R, G and B is not modified.
4. A method for correcting color using red color, green color and blue color (RGB) data, comprising steps of: (a) extracting a start hue value of color coordinates from RGB input data; (b) extracting an end hue value, which is finally modified by a color correction matrix user, from the start hue value according to each hue control value of a red color, a green color, a blue color, a yellow color, a cyan color and a magenta color (RGBYCM): (c) converting input values R G and B, according to the end hue value, using a conversion formula for the corresponding input hue value among R, G and B conversion formulas; (d) extracting a final saturation value from the end hue value according to an RGBYCM saturation control value; and (e) calculating values of R, G and B according to modified start hue value, using an RGB color saturation value conversion formula, wherein the RGB color saturation value conversion formula includes a maximum conversion formula of “Max+{circle around (b)}×(Max−Mid)/(Max×(Max−Min)” and a minimum conversion formula of “Min-{circle around (b)}+(Max−Mid)/(Max−Min)”, where the “Max” denotes a maximum value of RGB, the “Mid” denotes an intermediate value of RGB, the “Min” denotes a minimum value of RGB, and the {circle around (b)} denotes the end hue value.
5. The method of claim 2, wherein in the step of (e), when R, G and B according to modified start hue value are calculated using the RGB color saturation value conversion formula, an intermediate value of R, G and B is not modified.
6. The method of claim 4, wherein in the step of (e), when R, G and B according to modified start hue value are calculated using the RGB color saturation value conversion formula, an intermediate value of R, G and B is not modified.
Description
DESCRIPTION OF DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
BEST MODE
(7) Hereinafter, various embodiments will be described below n more detail with reference to the accompanying drawings.
(8)
(9)
(10)
(11)
(12) Referring to
(13) Firstly, a start hue value {circle around (a)} for RGB input data is extracted at the step of S1. The start hue value represents a hue value of a color coordinate according to RGB input value, and more specifically, represents a hue control value determined by an angle of the color coordinate. The start hue value (color coordinate value) {circle around (a)} may be obtained using a color formula according to a maximum/minimum value of RGB as shown in
(14) In case that a maximum value Max of a corresponding pixel (input data) is a red color (hereinafter, the red color is referred to as ‘R’), and a minimum value Min of the corresponding pixel is a blue color (hereinafter, the blue color is referred to as ‘B’), the start hue value is calculated using the hue formula of “60×(Mid−Min)/(Max−Min)”, where the Max denotes a maximum value among the RGB, the Mid denotes an intermediate value among the RGB, and the Min denotes a minimum value among the RGB.
(15) Ranges of the maximum value Max the intermediate value Mid and the minimum value Min are determined by input bits. For example, if an input bit is 8 bit, the above-mentioned ranges are 255 determined by “2.sup.8−1”. In another example, if an input bit is 10 bit the above-mentioned ranges are 1023 determined by “2.sup.10−1”. The maximum value Max the intermediate value Mid and the minimum value Min are determined by the RGB input data.
(16) Moreover, if the maximum value Max of the corresponding pixel is a green color (hereinafter, it is referred to as ‘G’), the start hue value {circle around (a)} is calculated using the hue formula of “60×(2+Mid−Min)/(Max−Min))”. If the maximum value Max of the corresponding pixel is B, the start hue value @ is calculated using the hue formula of “60×(4+(Mid−Min)/(Max−Min))”. If the maximum value Max of the corresponding pixel is R and the minimum value Min of the corresponding pixel is G, the start hue value {circle around (a)} is calculated using the hue formula of “360−60×(Mid−Min)/(Max−Min)”.
(17) Then, at the step S2, an end hue value {circle around (b)} is extracted from the start hue value {circle around (a)} according to each hue control value of a red color, a green color, a blue color, a yellow color, a cyan color and a magenta color (hereinafter, it is referred to as “RGBYCM”). The end hue value {circle around (b)} is finally modified by a color correction matrix user. That is, the end hue value {circle around (b)} is a color-corrected hue vale.
(18) Subsequently, the RGB according to the end hue value {circle around (b)} is converted using R, G and B conversion formulas such as the table shown in
(19) That is, if the end hue value {circle around (b)} is ranged from 0 to 60, a maximum value Max is R and a minimum value Min is B, G of an intermediate value Mid is obtained by G conversion formula of “G=Min+({circle around (b)}/60)×(Max−Min)”. Herein, “Min” represents B as the minimum value among RGB, “Max” represents R as the maximum value among RGB, and “end hue value {circle around (b)}” represents a final hue value which the color correction matrix user wants finally. For example, if the color correction matrix user wants to convert a yellow color of the start hue value into a red color of the end hue value, a hue value of the yellow color is 30 (angle of color coordinate=30 degree) and a hue value of the red color is 0 (angle of color coordinate=0 degree).
(20) Moreover, if the end hue value {circle around (b)} is ranged from 60 to 120, a maximum value Max is G and a minimum value Min is B, R of an intermediate value Mid is obtained by R conversion formula of “R=Min−({circle around (b)}/60−2)×(Max−Min)”.
(21) If the end hue value {circle around (b)} is ranged from 120 to 180, a maximum value Max is G and a minimum value Min is R, B of an intermediate value Mid is obtained by B conversion formula of “B=Min−({circle around (b)}/60−2)×(Max−Min)”.
(22) If the end hue value {circle around (b)} is ranged from 180 to 240, a maximum value Max is B and a minimum value Min is R, G of an intermediate value Mid is obtained by G conversion formula of “G=Min−({circle around (b)}/60−4)×(Max−Min)”.
(23) If the end hue value {circle around (b)} is ranged from 240 to 320, a maximum value Max is B and a minimum value Min is G R of an intermediate value Mid is obtained by R conversion formula of “R=Min−({circle around (b)}/60−4)×(Max−Min)”.
(24) If the end hue value {circle around (b)} is ranged from 320 to 360, a maximum value Max is R and a minimum value Min is G, B of an intermediate value Mid is obtained by B conversion formula of “B=Min−({circle around (b)}−360)/60)×(Max−Min)”.
(25) As described above, R of the intermediate value Mid, G of the intermediate value Mid and B of the intermediate value Mid are obtained to control the intermediate value Mid. That is, a hue control represents to change a hue value, and a saturation control represents to change a density value of a color. Basically, the saturation depends on a difference between the maximum value and the minimum value, the color depends on an existing position of the intermediate value between the maximum value and the minimum value. Thus, the intermediate value is obtained such that the intermediate value exists at a near position to the maximum value or at a near position to the minimum value.
(26) Subsequently, a final saturation value is extracted at the end hue value {circle around (b)} according to an RGBYCM saturation control value at the step S4. The “final saturation value” is a color saturation value, which is finally changed by the color correction matrix user as described in the step S2.
(27) Next, as shown in
(28) Since the hue then the saturation is modified, the end hue value {circle around (b)} at the step S3 becomes the start hue value {circle around (a)} of the saturation value at the step S5.
(29) The intermediate value of R, G and B is not modified, a maximum value of the RGB color saturation value conversion formulas is modified using “Max+{circle around (b)}×(Max−Mid)/(Max×(Max−Min)”, and a minimum value of the RGB color saturation value conversion formulas is modified using “Min−{circle around (b)}+(Max−Mid)/(Max−Min)”. Herein, “Max” represents a maximum value among R, G and B, “Mid” represents an intermediate value among R, G and B, and “Min” represents a minimum value among R, G and B. For example, the intermediate value among R, G and B represents G value in case of R:100/G:50/B:0.
(30) For example, if the maximum value is R and the start hue value {circle around (a)} is ranged from 0 to 60, the maximum value R is modified using the conversion formula of “Max+{circle around (b)}×(Max−Mid)/(Max×(Max−Min), and the minimum value B is modified using the conversion formula of “Min−{circle around (b)}+(Max−Mid)/(Max−Min)”. Herein, the intermediate value G is not modified.
(31) Although various embodiments have been described for illustrative purposes, it will be apparent to those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the following claims.