System and method for adaptive color space conversion
A method and system for adaptive color space conversion includes a color space converter, a brightness adaptive controller and a soft clipper. The color space converter receives a first color space format signal and converts the first color space format signal into a second color space format signal. The brightness adaptive controller is connected to the color space converter in order to produce a gain and an offset based on a brightness value. The soft clipper is connected to the color space converter and the brightness adaptive controller in order to clip the second color space format signal based on the gain and the offset to thereby produce a corrected second color space format signal.
Latest Sunplus Technology Co., Ltd. Patents:
1. Field of the Invention
The present invention relates to the technical field of color processing and, more particularly, to a system and method for adaptive color space conversion.
2. Description of Related Art
The color image devices (such as a computer display) mostly use the three primary color signals, i.e., R, G, B, for color representation in the market. Since a typical color image device is designed in accordance with the color domain range rendered on the CRT screen. Thus, for the same color representation on the peripheral information products, a Standard RGB (sRGB) is defined as a standard color space for the information products based on the computer multimedia applications.
The Standard RGB (sRGB) specification is submitted by the HP Company and the Microsoft Corporation. The sRGB specification defines standard color conditions and code exchange modes. Since the color reproduction on the CRT screen is mostly considered for the color range of a typical image playback content, the sRGB specification is typically used as a basis.
However, owing to the rapid advance of technologies, the sRGB specification cannot meet the color representation for a high definition TV (HDTV). The image playback contents of the displays with color representation capability and requirement higher than the sRGB specification are thus limited to the sRGB range. In this case, the high-level displays cannot completely show the color playback features.
To overcome this, ICE 61966-2-4 defines a new standard for color space, which is referred to as xvYCC and can support the color information of wide color domain.
The xvYCC uses the ITU-R BT. 709 color domain to standardize a wider color domain for assuring the compatibility with the sRGB under the HDTV condition. The sRGB specification renders colors in a range of 0 to 1, and the xvYCC specification in a range of −1 to +1, which is over the color range defined by the sRGB specification. However, since the xvYCC is compatible with the sRGB, current image output products including a TV can receive the xvYCC image content and correctly display the colors of film under the sRGB specification.
The difference of the YCbCr representation between the xvYCC and the sRGB specifications is the defined gamut.
However, when YCbCr of the xvYCC specification is converted into BT. 709 RGB, the resulting RGB may exceed the gamut. A typical solution in the prior art limits the values over the gamut to the maximum and minimum, which is referred to as a hard clip.
By contrast, a typical soft clip uses an additional oblique line to define the relationship between RGB input and output values when the RGB input values exceed a threshold.
However, for a gray image, the maximum of a gray level cannot be displayed because the image is clipped. Accordingly, the brightness is reduced, which causes the eyes of a viewer uncomfortable.
Therefore, it is desirable to provide an improved system and method for adaptive color space conversion to mitigate and/or obviate the aforementioned problems.
SUMMARY OF THE INVENTIONThe object of the present invention is to provide a method and system for adaptive color space conversion, which can overcome the problems in the typical soft clip operation that the maximum of a gray level cannot be displayed and the eyes of a viewer feel uncomfortable.
According to a feature of the invention, a system for adaptive color space conversion is provided, which includes a color space converter, a brightness adaptive controller and a soft clipper. The color space converter receives a first color space format signal and converts the first color space format signal into a second color space format signal. The brightness adaptive controller is connected to the color space converter in order to produce a gain and an offset based on a brightness value. The soft clipper is connected to the color space converter and the brightness adaptive controller in order to clip the second color space format signal based on the gain and the offset to thereby produce a corrected second color space format signal.
According to another feature of the invention, a method for adaptive color space conversion is provided, which includes: a color space conversion step, which receives a first color space format signal and converts the first color space format signal into a second color space format signal; a brightness adaptive control step, which produces a gain and an offset based on a brightness value; and a soft clip step, which clips the second color space format signal based on the gain and the offset to thereby produce a corrected second color space format signal.
Other objects, advantages, and novel features of the invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
As shown in
When the first color space format signal is the YCbCr signal, the color space converter 410 converts the first color space format signal (YCbCr) into the second color space format signal (RGB) based on the equation as follows:
The brightness adaptive controller 420 is connected to the color space converter 410 in order to produce a gain gainY and an offset offsetY based on a brightness value Y. The brightness value Y is derived from the second color space format signal.
The brightness adaptive controller 420 computes the brightness value based on the equation as follows:
Y=0.2126×R+0.7152×G+0.0722×B,
where Y indicates the brightness value, and R, G, B respectively indicate red, green, blue signals of the second color space format signal. In other embodiments, the brightness Y can be the brightness signal of the first color space format signal.
The brightness adaptive controller 420 computes the gain based on the equation as follows:
where rgb_max indicates a maximum of the second color space format signal, gainY indicates the gain, Y indicates the brightness, and K is a constant. When the corrected second color space format signal is represented by n bits, the constant is obtained as K=2n−1.
The brightness adaptive controller 420 computes the offset based on the equation as follows:
where offsetY indicates the offset.
Since the brightness adaptive controller 420 computes the gain gainY and the offset offsetY based on the brightness value Y for the soft clipper 430, the soft clipper 430 in the invention can overcome the problems in the typical soft clip operation that the maximum of a gray level cannot be displayed and the produced brightness is reduced.
The soft clipper 430 is connected to the color space converter 410 and the brightness adaptive controller 420 in order to clip the second color space format signal (RGB) based on the gain gainY and the offset offsetY to thereby produce the corrected second color space format signal RGBout.
The soft clipper 430 computes the corrected second color space format signal RGBout based on the equation as follows:
RGBout=min(RGB, RGB×gainY+offsetY),
where RGBout indicates the corrected second color space format signal, gainY indicates the gain, offsetY indicates the offset, and RGB indicates the second color space format signal.
The brightness adaptive controller 420 can determine the gamut size of soft clip operation based on the brightness value Y.
The invention focuses on the condition that the RGB values of the second color space format signal have an overflow.
When the brightness value Y is greater than start_point, the soft clip operation starts to produce different gain gainY and offset offsetY based on the brightness value Y. When the brightness value Y is smaller than or equal to start_point, the gain gainY and the offset offsetY are computed as follows:
where start_point indicates a value of the start point, and rgb_max indicates an adjustable parameter. For example, rgb_max=350. When the brightness value Y is greater than start_point, the gain gainY and the offset offsetY are computed as follows:
In practical design of the brightness adaptive controller 420 and the soft clipper 430, start_point=200 and rgb_max=350 are first set. The second color space format signal RGB is a BT.709 RGB signal. In this case, the brightness value Y is computed as follows.
Y=0.2126×R+0.7152×G+0.0722×B.
However, other manner that can be representative of the brightness information is also applicable, not limited to the above computation. For example, Y=(R+G+B)/3, or the brightness of the first color space format signal can be used as the brightness value Y in computation.
The brightness adaptive controller 420 can use the above equations or a lookup table to produce the gain gainY and the offset offsetY.
As cited, the soft clip operation of the prior art does not consider the brightness information so that it cannot display the maximum of a gray level for a gray image and accordingly the brightness is reduced. By contrast, the invention changes the soft clip operation based on the brightness information. The essential purpose above is to adjust the gains gainY and the offsets offsetY of the soft clipper 430 based on the different brightness values when the values exceed the targeted gamut on improving color conversion. Thus, the detail features are restored without having any loss on the gray image, and the image details are reserved. In addition, when an xvYCC image content is output by a display not supporting the xvYCC color space, the image details are still reserved.
Although the present invention has been explained in relation to its preferred embodiment, it is to be understood that many other possible modifications and variations can be made without departing from the spirit and scope of the invention as hereinafter claimed.
Claims
1. A system for adaptive color space conversion, comprising:
- a color space converter, for receiving a first color space format signal and converting the first color space format signal into a second color space format signal;
- a brightness adaptive controller, connected to the color space converter, for producing a gain and an offset based on a brightness value; and
- a soft clipper, connected to the color space converter and the brightness adaptive controller, for clipping the second color space format signal based on the gain and the offset to produce a corrected second color space format signal;
- wherein the soft clipper multiplies the second color space format signal with the gain, then adds with the offset to generates a modified second color space format signal, and selects the minimum of second color space format signal and modified second color space format signal as the modified second color space format signal.
2. The system as claimed in claim 1, wherein the first color space format signal is YCbCr signal and the second color space format signal is an RGB signal.
3. The system as claimed in claim 2, wherein the brightness adaptive controller computes the gain based on the following equation when the brightness value is smaller than or equal to a start point: gain Y = K - start_point rgb_max - start_point; and on the following equation when the brightness value is greater than the start point: gain Y = K - Y rgb_max - Y, where start_point indicates a value of the start point, rgb_max indicates a maximum of the second color space format signal, gainY indicates the gain, Y indicates the brightness value, and K=2n−1 when the corrected second color space format signal is represented in n bits.
4. The system as claimed in claim 3, wherein the brightness adaptive controller computes the offset based on the following equation when the brightness value is smaller than or equal to the start point: offset Y = K - K - start_point rgb_max - start_point × rgb_max; and on the following equation when the brightness value is greater than the start point: offset Y = K - K - Y rgb_max - Y × rgb_max, where offsetY indicates the offset.
5. The system as claimed in claim 2, wherein when the brightness value and a value of the second color space format signal are smaller than the value of the start point, a relationship of the corrected second color space format signal and the second color space format signal responds to a line with a third slope, when the brightness value is smaller than the value of the start point and the value of the second color space format signal is greater than the value of the start point, the relationship of the corrected second color space format signal and the second color space format signal responds to a line with a first slope, when the brightness value is greater than the value of the start point and the value of the second color space format signal are smaller than the brightness value, the relationship of the corrected second color space format signal and the second color space format signal responds to the line with the third slope, and when the brightness value is greater than the value of the start point and the value of the second color space format signal are greater than the brightness value, the relationship of the corrected second color space format signal and the second color space format signal responds to a line with a second slope.
6. The system as claimed in claim 4, wherein the soft clipper computes the corrected second color space format signal based on an equation as follows: where RGBout indicates the corrected second color space format signal, and RGB indicates the second color space format signal.
- RGBout=min(RGB,RGB×gainY+offsetY),
7. The system as claimed in claim 4, wherein the gain and the offset are obtained by a lookup table.
8. The system as claimed in claim 1, wherein the first color space format signal is a brightness and chromatic signal.
9. The system as claimed in claim 8, wherein the color space converter converts the first color space format signal into the second color space format signal based on a matrix as follows: [ 1 0 1.5748 1 - 0.1873 - 0.4681 1 1.8556 0 ].
10. The system as claimed in claim 2, wherein the brightness adaptive controller produces the brightness value based on en equation as follows: where Y indicates the brightness value, R indicates a red signal, G indicates a green signal, and B indicates a blue signal.
- Y=0.2126×R+0.7152×G+0.0722×B,
11. A method for adaptive color space conversion in a color image device, comprising:
- a color space conversion step, for receiving a first color space format signal and converting the first color space format signal into a second color space format signal;
- a brightness adaptive control step, for producing a gain and an offset based on a brightness value; and
- a soft clip step, for clipping the second color space format signal based on the gain and the offset to produce a corrected second color space format signal;
- wherein the soft clip step multiplies the second color space format signal with the gain, then adds with the offset to generates a modified second color space format signal, and selects the minimum of second color space format signal and modified second color space format signal as the modified second color space format signal.
12. The method as claimed in claim 10, wherein the first color space format signal is YCbCr signal and the second color space format signal is an RGB signal.
13. The method as claimed in claim 12, wherein the brightness adaptive control step computes the gain based on the following equation when the brightness value is smaller than or equal to a start point: gain Y = K - start_point rgb_max - start_point; and on the following equation when the brightness value is greater than the start point: gain Y = K - Y rgb_max - Y, where start_point indicates a value of the start point, rgb_max indicates a maximum of the second color space format signal, gainY indicates the gain, Y indicates the brightness value, and K=2n−1 when the corrected second color space format signal is represented in n bits.
14. The method as claimed in claim 13, wherein the brightness adaptive controller computes the offset based on the following equation when the brightness value is smaller than or equal to the start point: offset Y = K - K - start_point rgb_max - start_point × rgb_max; and on the following equation when the brightness value is greater than the start point: offset Y = K - K - Y rgb_max - Y × rgb_max, where offsetY indicates the offset.
15. The method as claimed in claim 12, wherein when the brightness value and a value of the second color space format signal are smaller than the value of the start point, a relationship of the corrected second color space format signal and the second color space format signal responds to a line with a third slope, when the brightness value is smaller than the value of the start point and the value of the second color space format signal is greater than the value of the start point, the relationship of the corrected second color space format signal and the second color space format signal responds to a line with a first slope, when the brightness value is greater than the value of the start point and the value of the second color space format signal are smaller than the brightness value, the relationship of the corrected second color space format signal and the second color space format signal responds to the line with the third slope, and when the brightness value is greater than the value of the start point and the value of the second color space format signal are greater than the brightness value, the relationship of the corrected second color space format signal and the second color space format signal responds to a line with a second slope.
16. The method as claimed in claim 14, wherein the soft step computes the corrected second color space format signal based on an equation as follows: where RGBout indicates the corrected second color space format signal, and RGB indicates the second color space format signal.
- RGBout=min(RGB,RGB×gainY+offsetY),
17. The method as claimed in claim 14, wherein the gain and the offset are obtained by a lookup table.
18. The method as claimed in claim 11, wherein the first color space format signal is a brightness and chromatic signal.
19. The method as claimed in claim 16, wherein the color space converter converts the first color space format signal into the second color space format signal based on a matrix as follows: [ 1 0 1.5748 1 - 0.1873 - 0.4681 1 1.8556 0 ].
20. The method as claimed in claim 12, wherein the brightness adaptive controller produces the brightness value based on an equation as follows: where Y indicates the brightness value, R indicates a red signal, G indicates a green signal, and B indicates a blue signal.
- Y=0.2126×R+0.7152×G+0.0722×B,
Type: Application
Filed: Mar 25, 2009
Publication Date: Oct 8, 2009
Patent Grant number: 8174537
Applicant: Sunplus Technology Co., Ltd. (Hsinchu)
Inventors: Tsung Han Chiang (Kaohsiung City), Yuan-Chih Peng (Taipei City)
Application Number: 12/382,839
International Classification: G09G 5/02 (20060101);