The present invention relates to a method and an apparatus for dynamic image contrast expansion, and more particularly to a method and an apparatus for dynamic image expansion that can dynamically expand the image contrast to an optimal value according to the image gray level distribution range, so as to eliminate the flickering occurred during a dynamic change of screens and effectively reduce the noises produced at a low-gray level after the contrast of the image is expanded.
In general, an image contrast expansion refers to expanding a gray level range to a maximum gray level range of 0˜255, and its main objective is to increase the dynamic range of the gray level distribution. As to the visual effect, the image contrast is enhanced. For example, an 8-bit 256 gray-level image has a maximum gray level range of 0˜255, but there is a loss of the image gray level distribution range in an actual video transmission due to the signal attenuation of photography, duplication and transmission. In a general 8-bit television video system, the actual number of gray levels of the video display is less than 256, and thus the video contrast will be attenuated, and the video quality will be deteriorated. In addition to the foregoing factors, the properties and parameters of the analog components in the video interface also cause a loss of the image gray level distribution range and adversely affect the displaying effect. For example, since most video decoders decode a received video signal according to its recommended parameters, the gray level range of the decoded image generally falls between 17˜235. Further, the factory default settings of the brightness and contrast of the video interface, the computation of scalar, and the conversion of color matrix will also affect the image gray level distribution range directly.
Traditionally, the image contrast is enhanced to improve the image gray level distribution range, and the dynamic image contrast expansion adjustment technique is applied to process the images, and its method substantially includes the following steps:
1. Firstly, the properties of the image gray level distribution of the three colors: red (R), green (G), and blue (B) of a color image are analyzed. Referring to the image property histogram as shown in
2. Secondly, the maximum gray level and minimum gray level required by computing an image contrast expansion are defined. In general, the maximum gray level is obtained by integrating the area from the utmost right side toward the left side of the image property histogram, and its corresponding gray level is defined as the maximum gray level when a critical value of the integrated area is achieved. The minimum gray level is obtained by integrating the area from the utmost left side towards the right side of the image property histogram, and its corresponding minimum gray level is defined if a critical value of the integrated area is achieved. Taking the image processing software, PhotoShop, for example, we define the 5% of the area on the right side of the image property histogram as the maximum gray level (max) and the 5% of the area on the left side of the image property histogram as the minimum gray level (min). Since a color image includes three colors: red, green, and blue, therefore the maximum gray level of the processed image adopts the maximum of the three colors: red, green, and blue and the minimum gray level adopts the minimum of the three color red, green, and blue.
3. The formula for the image contrast expansion is given as follows. After the required maximum gray level (max) and the minimum gray level (min) are obtained, the maximum gray level and the minimum gray level are used to compute a new gray level value Gray′ and an image contrast expansion gain (which has a value k in Formula (2)) of the processed image contrast expansion:
Since a plasma display panel (PDP) usually comes with a large screen and its structural properties are totally different from those of traditional color cathode ray tubes (CRT), therefore the dynamic contrast expansion technique used for the traditional small-size CRT televisions cannot be used directly for the plasma display panels. It is necessary to make an appropriate modification of the algorithm of the dynamic contrast expansion technique according to the properties of the plasma display panels. The most difficult point is to avoid the flickering of a large plasma display panel, the too-low signal noise ratio (SNR) of a signal at a low gray level, and the noise produced by the contrast expansion, when a dynamic contrast adjustment is made.
The problem of producing noises easily after a contrast expansion is processed for a too-low SNR at a low gray level is described as follows. Referring to
In view of the foregoing shortcomings of the prior art, the inventor of the present invention based on years of experience to conduct extensive researches and experiments to improve the prior art, and finally invented a novel dynamic image contrast expansion technique for dynamically expanding the image contrast to an optimal value according to the image gray level distribution range, so as to eliminate the flickering occurred during a dynamic change of screens and effectively reduce the noises produced at a low-gray level after the contrast of the image is expanded.
Therefore, it is a primary objective of the present invention to provide a method and an apparatus for dynamic image contrast expansion, and the method comprises the following steps. Firefly, a gamma conversion for the inputted image is performed to convert the relationship of the brightness and gray level of the inputted image into a linear relation. After the image contrast expansion technique performs a subtraction for the gray level value of the image, the image can maintain its smallest color deviation. Secondly, the image property histogram is analyzed to compute the maximum gray level and the minimum gray level required for carrying out the image contrast expansion, and then the maximum gray level and the minimum gray level are used to obtain an image contrast expansion gain, so as to prevent the influence caused by the property of the image in a very small area or the noises, and lower the image contrast expansion effect. Finally, an average of several previously inputted image contrast expansion gains and a current image contrast expansion gain is adopted as the contrast expansion gain for the formula of computing the dynamic contrast expansion and used in the actual contrast expansion gain formula, so as to compute a new outputted gray level value after the image contrast expansion is performed.
Another objective of the present invention is to avoid the flickering occurred in the image by adopting a minimum gray level for the formula of computing the dynamic contrast expansion, and an average of several previous minimum gray levels and a current minimum gray level of the image is used as the minimum gray level for the actual computation to compute a new outputted gray level value after the image contrast expansion is performed.
A further objective of the invention is to use a preset gain conversion table to look up the image contrast expansion gain according to the maximum gray level and the minimum gray level so as to omit the division required in the formula for the actual computation of the dynamic contrast expansion, and effectively improve the processing speed and efficiency of the image contrast expansion and achieve the image contrast expansion effect quickly.
Another objective of the present invention is to design a gamma conversion table that varies according to different contrast expansion gains for reducing the noises at the low gray level and carrying out a gamma value adjustment for the outputted images at low gray levels. Such arrangement not only maintains the contrast enhancement effect, but also achieves the effect of reducing noises at low gray levels.
Another further objective of the present invention is to convert the relation of the brightness and gray level of the outputted image such that the product of the gamma value of the outputted image and the gamma value of a video display is maintained at 1.0 according to the optoelectronic properties of the video display and the gamma value of the video display module corresponding to the brightness and gray level when a gamma conversion is performed for the outputted image.
The above and other objects, features and advantages of the present invention will become apparent from the following detailed description taken with the accompanying drawings.
In a method and an apparatus for dynamic image contrast expansion, the method is applied to a video display for processing an inputted image according to an inputted image gray level distribution range, so that the image contrast is dynamically expanded to an optimal condition to effectively eliminate the flickering occurred during the dynamic changes of video screens and reduce the noises of the images at low gray levels after the contrast expansion is carried out. The method comprises the following steps:
(1) Firefly, a gamma conversion for the inputted image is performed to convert the relationship of the brightness and the gray level of the inputted image into a linear relation. After the image contrast expansion technique performs a subtraction for the gray level value of the image, the image can maintain its smallest color deviation.
(2) Secondly, the image property histogram is analyzed to compute the maximum gray level and the minimum gray level required for carrying out the image contrast expansion, and then the maximum gray level and the minimum gray level are used to obtain an image contrast expansion gain, so as to prevent the influence caused by the properties of the image in a very small area or the noises, and lower the image contrast expansion effect.
(3) Finally, an average of several previously inputted image contrast expansion gains and a current image contrast expansion gain is adopted as the contrast expansion gain for the formula of computing the dynamic contrast expansion and used in the formula for the actual computation of the contrast expansion gain, so as to compute a new outputted gray level value after the image contrast expansion is performed.
Further, the present invention can effectively improve the processing speed and the efficiency of the image contrast expansion and quickly achieve the image contrast expansion effect. In the computation of the contrast expansion gain, a gain table is designed in advance, and the contrast expansion gain is obtained by looking up the table according to the maximum gray level and the minimum gray level. Such arrangements omits the division required for the computation of the dynamic contrast expansion and greatly reduces the hardware resources consumed for the division operation, and thus greatly reducing the costs and expenditures.
Further, the present invention can reduce the noises of an image at a low gray level by adopting a gamma conversion table that varies according to different contrast expansion gains and carries out a gamma adjustment for the outputted images at low gray levels. Such arrangement not only maintains the contrast enhancement effect, but also achieves the effect of reducing noises at low gray levels. Finally, a gamma conversion is performed for the outputted image, such that the product of the gamma value of the outputted image and the gamma value of a video display is maintained at 1.0 according to the optoelectronic properties of the video display and the gamma value of the video display module corresponding to the brightness and gray level, before the image is outputted to the video display.
To fully demonstrate the design concept and functions of the present invention, a preferred embodiment as shown in
In this preferred embodiment, the gamma conversion unit 10 for inputted unit is provided for carrying out a gamma conversion for inputted images. Since the relation between the gray level and the brightness of a traditional image inputted to a video display has gone through a conversion of gamma=0.45, therefore a linear relation exists between the gray level and the brightness. It is necessary to carry out a conversion of gamma=2.2 for the gray level value of the image inputted to the video display. Since the preferred embodiment carries out the computation according to the following image contrast expansion formula (1),
Gray′=k×(Gray−min) (1)
A subtraction is performed for the gray level value Gray of the inputted image, so that a linear relation exists between the gray level value and the brightness of the inputted image. After the subtraction is preformed, the inputted image Gray′ can maintain its minimum color deviation. When the conversion of gamma=2.2 is performed for the gray level value of the inputted image, it is necessary to amplify the video signal to obtain more details of the gray level, such as the original 8-bit inputted image has to be enlarged to an image of over 10 bits when performing the gamma conversion to enhance the details of the image at the low gray level.
The image dynamic contrast expansion unit 20 determines the maximum gray level (max) and the minimum gray level (min) required for computing the image contrast expansion by analyzing the image property histogram, and then the following formula (2) is used to determine the image contrast expansion coefficient k (which is the gain):
Therefore, the influence due to the properties of a very small area or a small noise can be avoided to lower the image contrast expansion effect. The image dynamic contrast expansion unit 20 comprises the following units.
(a) A smooth processing unit 21 for smoothing an inputted video signal: When a pre-processing such as a sharpness filter is performed on an 8-bit image, the boundaries of many images are expanded to the gray level 0 or the gray level 255, and thus it will affect the determination of the maximum gray level and the minimum gray level for carrying out the image contrast expansion, and thus the effect of contrast expansion will be poor. To solve this problem, this preferred embodiment performs the smooth process to the video signal used for compiling statistics of the image property histogram only, but it will not perform the smooth process on the outputted video signal, and thus will not affect the resolution of the image, and the smooth process of the video signal can use the following smooth mask for the process:
(b) A statistic compiling unit 22 for the image property histogram: it is used for compiling the statistics of the pixels for each gray level value of all pixels of the image. For example, a color image of 1366*768 pixels has a total number over 3 million points for the statistics, and thus creating a tremendous burden to the computational circuit. In this preferred embodiment, a sample is taken for each pixel between every interval of M rows and every interval of N points, such as a sample being taken for every interval of 4 rows and every interval of four points. Therefore, it only needs to take 1/16 of the total data for the statistics while maintaining the video characteristics.
(c) A maximum and minimum gray level determination processing unit 23: The maximum gray level can be obtained by integrating the area from the utmost right side of the image property histogram towards the right side, and if the integrated area reaches a critical value Thmax, then the corresponding gray level value is defined as the maximum gray level. The minimum gray level can be obtained by integrating the area from the utmost left side of the image property histogram towards the right side, and if the integrated area reaches a critical value Thmin, then the corresponding gray level value is defined as the minimum gray level (min).
(d) A gain conversion table 24: The image contrast expansion adopts formula (1) to calculate the gray level value of the outputted image. To effectively improve the processing speed and efficiency of the image contrast expansion, the image contrast expansion coefficients k are computed from various different maximum gray levels (max) and minimum gray levels (min) according to Formula (2) to produce the following gain conversion table 24:
After the maximum gray level and the minimum gray level required for performing the contrast expansion of the inputted image are computed, the gain conversion table 24 can be looked up to obtain the image contrast expansion coefficient k, and thus the division as shown in Formula (2) can be omitted to achieve the image contrast expansion effect quickly.
(e) An image contrast expansion gain average processing unit 25: To avoid the flickering produced by the image when performing a dynamic image contrast expansion, the N−1th image is taken and adopted as a contrast expansion gain in Formula (1) for this preferred embodiment, and the maximum gray level and the minimum gray level of the image are used to look up the gain conversion table 24 to obtain the corresponding contrast expansion gain k1˜kN−1 , and then an average is computed from the corresponding image contrast expansion gains kN according to Formula (3). The average kout is used as the contrast expansion gain in Formula (1):
For example, an average computed from the contrast expansion gains of the first 31st image outputs and the contrast expansion gain of the current image is used as the contrast expansion gain of the 32nd image output. Referring to
It is worthy to point out that either one or both of the foregoing average processing units 25, 26 can be installed according to actual needs. Referring to
(f) A dynamic contrast expansion processing unit 27: After the computations of the contrast expansion gain kout and the minimum gray level minoout are completed, the gray level value Gray, the contrast expansion gain kout and the minimum gray level minout of the video signal are inputted into the dynamic contrast expansion processing unit 27 and computed according to Formula (1) to obtain the gray level value Gray′ of the image outputted after the image dynamic contrast expansion is processed, so as to achieve the image contrast expansion effect quickly.
In general, the video signal inputted into a video display is usually an analog signal such as YPbPr, S-Video and Composite signals. Since the analog signals will be interfered easily and have a too-low signal noise ratio (SNR) at a low gray level, therefore if the foregoing digital method is used for performing an image contrast expansion for an image and the contrast expansion gain is too large, then a distributing noise will be produced easily for the image at a low gray level. To overcome this shortcoming, a preferred embodiment of the present invention specially adds a noise reducing unit 30 at a low gray level, and the reducing unit 30 comprises a dynamic gamma conversion table 31 for the image contrast expansion and a dynamic gamma conversion unit 32. The gamma in the conversion table 31 varies according to different contrast expansion gains. The corresponding gamma graph for different image contrast expansion gains is shown in
In this preferred embodiment, if the outputted image is outputted to the screen of the video display, it is necessary to perform a gamma conversion to the outputted image through the gamma conversion unit 40 of the outputted image. Since the optoelectronic properties of different video displays are not the same, therefore if the graph of the brightness and the gray level of a video display is gamma=2.2, then it is necessary to perform a conversion of gamma=0.45 to the outputted image to maintain the product of the gamma value of the brightness and gray level of the video display and the gamma value of the outputted image at 1.0.
In summation of the description above, an inputted image goes through the processing by the foregoing units to achieve the dynamic image contrast expansion as well as overcoming the noise issue of an image at a low gray level after the image at a low dynamic gray level range has gone through the image contrast expansion.
While the invention herein disclosed has been described by means of specific embodiments, numerous modifications and variations could be made thereto by those skilled in the art without departing from the scope and spirit of the invention set forth in the claims.
Number | Date | Country | Kind |
---|---|---|---|
094132653 | Sep 2005 | TW | national |