1. Field of the Invention
The invention relates in general to a method and an apparatus for processing an image, and more particularly to a method and an apparatus for processing an image and an electronic device using the same to enhance the luminance of the image
2. Description of the Related Art
Usually, to adjust the luminance of an image, a method based on the YUV model is employed. The YUV model includes three components: Y, U, and V. The Y component represents the luminance and the U and V components represent the chrominance. Each pixel in an image contains the data of gray levels of red, green, and blue colors. Therefore, when adjusting the luminance of an image, it is necessary to convert the data in each pixel of the image from the RGB model to the YUV model in advance. With the image transformation, although data having Y, U, and V components in each pixel is obtained, only the Y component is used in the luminance adjustment. After the Y components of all pixels in the image are adjusted, they are converted back to the gray levels that are based on the RGB model. Subsequently, an adjusted image with a luminance higher than that of the original image can be presented in any display or electronic device.
However, the transformation used in the image luminance adjustment procedure described above requires additional hardware for operation; this results in a higher manufacturing cost. Besides, owing to the hardware limitations of the, truncation errors will occur frequently in transformation procedure, thereby causing unexpected side effects.
The invention is directed to a method and an apparatus for processing an image and an electronic device using the same. With the direct conversion of the data of an image that is based on the RGB model, it simplifies the conversion procedure and eliminates the use of additional hardware and is capable of enhancing the luminance of the image.
According to the present invention, a method for processing an image is provided. The method comprises: picking a maximum gray level from the gray levels in the sub-pixels of each image pixel in the image to obtain a luminance map which is consisted of the maximum gray levels of the image pixels; determining an image-content lightness of the image according to the luminance map; and adjusting the gray levels in the sub-pixels of each image pixel in the image according to the image-content lightness of the image.
According to the present invention, an apparatus for processing an image is provided. The apparatus includes a selecting unit, a determining unit and an adjusting unit. The selecting unit is for picking a maximum gray level from the gray levels in the sub-pixels of each image pixel in the image to obtain a luminance map that is consisted of the maximum gray levels of the image pixels in the image. The determining unit is for determining an image-content lightness of the image according to the luminance map. The adjusting unit is for adjusting the gray levels in the sub-pixels of each image pixels in the image according to the image-content lightness of the image.
According to the present invention, an electronic device including a display panel, a backlight, a selecting unit, a determining unit and an adjusting unit is provided. The display panel is for display an image. The backlight is for illuminating the display panel. The selecting unit is for picking a maximum gray level from the gray levels in the sub-pixels of each image pixel in the image to obtain a luminance map that is consisted of the maximum gray levels of the image pixels in the image. The determining unit is for determining an image-content lightness of the image according to the luminance map. The adjusting unit is for adjusting the gray levels in the sub-pixels of each image pixels in the image according to the image-content lightness of the image. When the luminance of the backlight is reduced, the adjusted gray levels in the sub-pixels of each image pixel in the image are higher than the original gray levels for maintaining the lightness of the image.
The invention will become apparent from the following detailed description of the preferred but non-limiting embodiments. The following description is made with reference to the accompanying drawings.
Referring to
The above method can be applied to an apparatus for processing an image. Referring to
Besides, the method and apparatus stated above is especially suitable to an electronic device that has a backlight and a display panel. Referring to
The backlight 230 of the electronic device 200 is adjustable according to the power amount of the battery in the electronic device 200. Usually, the illumination of the backlight 230 will be reduced when the power amount is low. For reducing the power consumption of the battery, the illumination of the backlight 230 is lowered. Therefore, the lightness of the image displayed in the display panel 220 is lowered with the backlight 230 that has lowered illumination. As a result, the display quality of the image will be largely reduced, and the image cannot be clearly displayed. By using the method indicated in
Referring to
After the maximum gray level Mij of each of the image pixels Pij is obtained, referring to
As shown in step 12, determining an image-content lightness of the image according to the luminance map 600. The image-content lightness of the image 500 represents the lightness level of the whole image. When the image 500 has a high image-content lightness, the lightness of the image 500 is high. On the contrary, if the image-content lightness of the image 500 is low, the lightness level of the image 500 is low too.
The image-content lightness of the image 500 can be determined by many methods. For example, the image-content lightness can be an average gray level of the maximum gray levels Mij of the image pixels Pij in the image 500. As the average gray level is high, the image 500 has plenty of image pixels with high gray levels. Therefore, the image 500 has high image-content lightness. If the image 500 has plenty of image pixels with low gray levels, the image 500 has low image-content lightness.
Besides, the image-content lightness of the image 500 can be determined according to the distribution of the maximum gray levels Mij of the image pixels Pij. Referring to
Thereafter, as indicated in
As stated before, when the illumination of the backlight 230 is low, the display quality of the image is bad. Therefore, the gray levels of the image 500 can be adjusted when the illumination of the backlight 230 is reduced to maintain the display quality. However, when the image 500 is adjusted, part of the adjusted gray levels of the image pixels Pij may be over 255. The problem happens with high possibility to the image of high image-content lightness. Therefore, when the image 500 has higher image-content lightness, there is no need to adjust the gray levels in the image pixels Pij of the image 500 largely. On the contrary, if the image-content lightness of the image 500 is low, the gray levels of the image pixels Pij in the image 500 can be adjusted largely. Therefore, for different image-content lightness, different gain can be chosen to adjust the image 500.
Referring to
The adjusted gray levels in sub-pixels of the image pixels Pij can be greater than the gray levels in the sub-pixels of the image pixels Pij before adjusting in order to enhance the lightness of the image 500, for example, according to the curve shown in
In order to maintain the same display effect of the image 500 when the illumination of the backlight 230 is reduced, the chosen gain is also set according to the illumination decrement of the backlight 230. Preferably, as the adjusted luminance of the backlight 230 is K times the original luminance, the chosen gain is substantially 1/K. For example, when the illumination of the backlight 230 is reduced to a half of the original illumination, the chosen gain for adjusting the gray levels in the sub-pixels of each image pixel Pij in the image 500 can be set as 2. Therefore, the adjusted gray levels in the sub-pixels of each image pixel Pij in the image 500 are adjusted by double, such that the display quality of the image 500 still remains the same.
Although the image 500 is adjusted under the condition that the backlight 230 is reduced to maintain the same display quality of the image 500 in the present embodiment, the invention is not limited thereto. The method in
It is noted that the adjustment of image pixels Pij in the image 500 is based on the maximum gray levels Mij in the image pixels Pij and the image-content lightness of the image 500. If the maximum gray levels Mij in the image pixels Pij after adjusting the image 500 are smaller than or equal to 255, it ascertains that all gray levels of the image pixels Pij are smaller than 255. Therefore, the amount of adjusted gray levels that exceed 255 by choosing the gain according to all of the maximum gray levels of all image pixels will be less than the amount of adjusted gray levels that exceed 255 by choosing the gain according to the Y (luminance) components of all pixels in the conventional method. Compared with the conventional method based on the YUV model of adjusting the image luminance, the processing method in the embodiment of the invention effectively reduces the probability of the truncation error that causes the image distortion problem. Besides, without the complicated operation of the conventional method that requires additional expensive hardware, the circuit for the invention is not complicated and the cost of the invention is very low. For example, the selecting unit and determining unit can be implemented by comparators while circuits for RGB to YUV transformation and for RGB to YUV transformation are not required.
The method and apparatus for processing the image of the invention are directed to the maximum gray levels in each image pixel of an image, they are particularly suitable for dynamic backlight control (DBLC) in most display devices or electronic devices. In the cooperation with the DBLC, many electronic devices, such as mobile devices or mobile phones, can still maintain the display quality of the image when the backlight illumination is reduced for lowering the power consumption of the battery. The method and apparatus for processing the image of the invention can also be applied without adjusting the illumination of the backlight.
While the invention has been described by way of example and in terms of a preferred embodiment, it is to be understood that the invention is not limited thereto. On the contrary, it is intended to cover various modifications and similar arrangements and procedures, and the scope of the appended claims therefore should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements and procedures.