1. Field of the Invention
The invention relates to an image processing method, and more particularly to an image processing method for color enhancement.
2. Description of the Related Art
Referring to
The RGB-HSL conversion unit 11 receives an original image and converts each original image pixel from an RGB color space into an HSL color space.
The hue region determining unit 12 determines, for each original image pixel, a hue region to which the original image pixel belongs according to a hue component H thereof.
The parameter selecting unit 13 selects, for each original image pixel, a color enhancement parameter from a color enhancement parameter set, the selected color enhancement parameter corresponding to the hue region determined by the hue region determining unit 12.
For each original image pixel, the color enhancing unit 14 multiplies a saturation component S of the original image pixel by the corresponding color enhancement parameter selected by the parameter selecting unit 13 to obtain an enhanced saturation component S′.
The HSL-RGB conversion unit 15 obtains, for each original image pixel, a color enhanced pixel (R′, G′, B′) according to the hue component H, the enhanced saturation component S′, and the luminance component L, so as to output a color enhanced output image.
As described above, the conventional image processing device needs to convert the original image pixels from the RGB color space into the HSL color space prior to color enhancement processing, and to convert the color enhanced pixels from the HSL color space back to the RGB color space, resulting in large power consumption and large required chip area.
Therefore, an object of the present invention is to provide an image processing method that can overcome the above drawbacks of the prior art.
According to the present invention, an image processing method is provided for processing an original image pixel composed of a plurality of pixel components each having a component value. The image processing method is implemented by an image processing device and comprises:
a) configuring the image processing device to determine, from a plurality of predetermined hue regions, the hue region to which the original image pixel belongs based directly on the component values of the pixel components thereof;
b) configuring the image processing device to select a color enhancement parameter corresponding to the hue region determined in step a); and
c) configuring the image processing device to obtain a color enhanced pixel according to the color enhancement parameter selected in step b) and the component values of the pixel components of the original image pixel.
Other features and advantages of the present invention will become apparent in the following detailed description of the preferred embodiment with reference to the accompanying drawings, of which:
Referring to
The image processing device includes a hue region determining unit 21, a parameter selecting unit 22, and a color enhancing unit 23 for implementing the following steps of the preferred embodiment of the image processing method.
Step 31: The hue region determining unit 21 is configured to determine, from a plurality of predetermined hue regions, the hue region to which the original image pixel belongs based directly on the component values of the pixel components thereof. In this preferred embodiment, the hue region is defined using inequality relationships among the component values of R, G, and B components as listed in Table 1 and shown in
Step 32: The hue region determining unit 21 is configured to divide a range defined by the component values max1, min1 of the first and third components into a plurality of sub-ranges. Each sub-range corresponds to a respective one of the sub-hue regions.
In this preferred embodiment, the range between the component values max1, min1 of the first and third components is equally divided into four sub-ranges.
Step 33: The hue region determining unit 21 is configured to determine one of the sub-hue regions to which the original image pixel belongs according to one of the sub-ranges that has the component value of the second component falling therewithin.
As an example, assuming the original image pixel has the component values (R, G, B)=(120, 120, 20), from the inequality relationship, it is known that this original image pixel belongs to the hue region 40. The range between the component values of the first and third component 20˜120 is equally divided into four parts 20˜45 (corresponding to the sub-hue region 401), 45˜70 (corresponding to the sub-hue region 402), 70˜95 (corresponding to the sub-hue region 403), and 95˜120 (corresponding to the sub-hue region 404). Since R=G=120, the component value of the second component of the original image pixel is 120, and it is determined that the original image pixel belongs to the sub-hue region 404.
Step 34: The parameter selecting unit 22 is configured to select a color enhancement parameter from a plurality of predetermined ones of the color enhancement parameters that correspond respectively to the sub-hue regions according to said one of the sub-hue regions determined in step 33.
In this preferred embodiment, the color enhancement parameters are those listed in Table 2. In other embodiment, values of the color enhancement parameters may be user-defined, and are not limited to those listed herein.
Referring to
Step 35: The color enhancing unit 23 is configured to obtain a color enhanced pixel according to the color enhancement parameter selected in step 34 and the component values max1, mid1, min1 of the pixel components of the original image pixel, in which the color enhanced pixel is composed of a first enhanced component that corresponds to the first component and that has the largest component value max2 of the color enhanced pixel, a second enhanced component that corresponds to the second component and that has a component value mid2, and a third enhanced component that corresponds to the third component and that has the smallest component value min2 of the color enhanced pixel.
In this preferred embodiment, the component values max2, mid2, and min2 are obtained using the following equations (1), (2), and (3), respectively.
In which, max2 has a limitation of max2≦max1+min1. That is, when max2 obtained using equation (1) is greater than max1+min1, max2 is defined to be equal to max1+min1.
min2=(max1+min1)−max2 (2)
In which, min2 has a limitation of min2≧0. That is, when min2 obtained using equation (2) is smaller than zero, min2 is defined to be zero.
The above equations (1), (2), and (3) are derived from the following equations of the hue component value H, the saturation component value S, and the luminance value L:
Therefore, through the image processing method of this invention, the saturation component value S of the original image pixel may be directly adjusted in RGB color space to obtain the color enhanced pixel without adjustments of the hue component value H and the luminance component value L.
The color enhanced pixel and the original image pixel belong to the same hue region, thereby the component values of the color enhanced pixel are determined. For example, assuming the original image pixel belongs to the hue region 40, the component values (R′, G′, B′) of the color enhanced pixel are processed to be (max2, mid2, min2).
To sum up, the image processing method of this invention is implemented to process the original image pixel directly in RGB color space by the hue region determining unit 21, the parameter selecting unit 22, and the color enhancing unit 23. Compared to the conventional image processing method, the forward and reverse conversions between RGB color space and HSL color space may be omitted, thereby promoting efficiency of image processing and reducing complexity of computation, power consumption, and required chip area.
While the present invention has been described in connection with what is considered the most practical and preferred embodiment, it is understood that this invention is not limited to the disclosed embodiment but is intended to cover various arrangements included within the spirit and scope of the broadest interpretation so as to encompass all such modifications and equivalent arrangements.
Number | Name | Date | Kind |
---|---|---|---|
6757427 | Hongu | Jun 2004 | B1 |
6892193 | Bolle et al. | May 2005 | B2 |
7394931 | Shimizu | Jul 2008 | B2 |
Number | Date | Country | |
---|---|---|---|
20140270514 A1 | Sep 2014 | US |