Next Patent: Interpolation of a sequence of images using motion analysis
Next Patent: Interpolation of a sequence of images using motion analysis
Plaque It!
Sponsored by: Flash of Genius |
[0001] This application claims the benefit of Korean Application No. 2002-68898, filed Nov. 7, 2002, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein by reference.
[0002] 1. Field of the Invention
[0003] The present invention relates to a contrast compensation apparatus using histogram equalization and a method thereof, and more particularly, to a contrast compensation apparatus having a simplified hardware structure and a low contrast distortion and a method thereof.
[0004] 2. Description of the Related Art
[0005] The basic principle of histogram equalization is to change features of a given image by varying a histogram of the image. A histogram shows a gray-level luminance distribution of an image. Such a gray-level histogram shows ratios of brightness to darkness, that is, contrast ratios, of an image, and the contrast ratios change when the histogram varies. In general, a high contrast ratio renders an image sharp, and a low contrast ratio renders an image blurry.
[0006]
[0007] The views shown in
[0008]
[0009] The PDF calculation unit
[0010] The CDF calculation unit
[0011] The mapping unit
[0012]
[0013]
[0014] In the meantime, as shown in
[0015] The present invention has been devised to solve the above problem. Thus, an aspect of the present invention is to provide a contrast compensation apparatus having less contrast distortion than conventional hardware and having a simplified hardware structure, and a method thereof.
[0016] To achieve the above and/or other aspects, a contrast compensation apparatus comprises a pixel value detection unit to detect a distribution of pixel values of respective pixels of an input image signal; a pixel value limit unit having pre-set luminance limit values, and to reconfigure the distribution of the pixel values of the respective pixels based on the pre-set luminance limit values; and a mapping unit to set a luminance for the respective pixels based on a cumulative distribution function with respect to the re-configured pixel values.
[0017] Generally, the pre-set luminance limit values include a first setting value for setting an upper limit of the detected pixel values of the respective pixels; and a second setting value for setting a lower limit of the detected pixel values of the respective pixels.
[0018] Typically, the pixel value limit unit includes a first comparison part to compare the pixel values of the respective pixels detected from the pixel value detection unit with a first setting value, and outputting the first setting value when the detected pixel values exceed the first setting value; and a second comparison part to compare the pixel values of the respective pixels detected from the pixel value detection unit with a second setting value, and outputting the second setting value when the detected pixel values of the respective pixels are smaller than the second setting value.
[0019] Generally, the first comparison part includes a first buffer having an input terminal from which an image signal is inputted, and an output terminal connected to an output terminal of the first comparison part; a first storage to store the first setting value; and a first comparator to compare the image signal with the first setting value of the first storage, and enable either the first buffer or the first storage based on a result of the comparison.
[0020] Typically, the second comparison part includes a second buffer having an input terminal from which an image signal is inputted, and an output terminal connected to an output terminal of the second comparison part; a second storage to store the second setting value; and a second comparator to compare the image signal with the second setting value of the second storage, and enable either the second buffer or the second storage based on a result of the comparison.
[0021] Generally, the contrast compensation apparatus further comprises a cumulative distribution function conversion unit provided between the pixel value limit unit and the mapping unit, to convert the image signal based on the Formula as shown below with the cumulative distribution function of pixel values re-configured in the pixel value limit unit:
[0022] wherein N is the highest pixel value displayable when the image signal forms an image, and K denotes a pixel value.
[0023] To achieve the above and/or other aspects, a contrast compensation method comprises operations of calculating pixel values of an image signal; limiting the calculated pixel values based on pre-set luminance limit values, and re-configuring the calculated pixel values of the image signal; and calculating a cumulative distribution function for the reconfigured pixel values, and setting a contrast of the image signal based on the cumulative distribution function.
[0024] Additional aspects and/or advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
[0025] Typically, the operation to reconfigure the pixel values includes operations of setting an upper limit value of the calculated pixel values; setting a lower limit value of the calculated pixel values; and mapping pixel values over the upper limit value and pixel values under the lower limit value into the upper limit value and the lower limit value, respectively.
[0026] Generally, the operation to set the contrast of the image signal includes operations of converting the cumulative distribution function into a predetermined gray level; and mapping the pixel values of the image signal based on the cumulative distribution function converted to the gray level.
[0027] Typically, the mapping operation includes operations of dividing the cumulative distribution function by the number of pixels forming the image signal; and multiplying, by the predetermined gray level, the cumulative distribution function divided by the number of pixels.
[0028] Generally, the operation to set the contrast of the image signal further includes an operation of calculating the cumulative distribution function for the pixel values and reconfiguring the cumulative distribution function based on the Formula as shown below:
[0029] wherein N is the highest pixel value displayable when the image signal forms an image, and K denotes a pixel value.
[0030] These and/or other aspects and/or advantages of the invention will become apparent and more readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040] Reference will now be made in detail to the embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the like elements throughout. The embodiments are described below in order to explain the present invention by referring to the figures.
[0041]
[0042] The contrast compensation apparatus in the embodiment illustrated in
[0043] The PDF unit
[0044] The pixel value can be the luminance value, a grayscale value of three primary colors R, G, B, or a grayscale value of color difference signals Y, Cb, Cr. Representing the grayscale value by 8-bits will render the primary colors R, G, B and the saturation in 256 levels (i.e., 2
[0045] The BUBO unit
[0046] The CDF calculation unit
[0047] The CDF compensation unit
[0048]
[0049] The BUBO unit
[0050] The second comparison part
[0051] Generally, the first comparison part
[0052] The second comparison part
[0053]
[0054]
[0055]
[0056]
[0057] The luminance value detector
[0058] The subtractor
[0059] The adder
[0060] Hereinafter, a detailed description will be made with examples of the detailed operations of the present embodiment and the operations of the CDF compensation unit
[0061] First, in the example below, it is assumed that an image X has a luminance signal distribution as follows:
[0062] X={1,1,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,2,2 ,2,2,1,1}
[0063] Herein, a lowest value of a luminance signal is “1”, and the highest value is “4”. The luminance values are limited to, for example, 4 kinds for simplicity but, actually, the luminance signal has a 256-level (0˜255) luminance.
[0064] Next, when the image X having the above luminance distribution is inputted to the PDF calculation unit
[0065] PDF{1}=4
[0066] PDF{2}=8
[0067] PDF{3}=8
[0068] PDF{4}=13
[0069] The above values indicate that the number of pixels having a luminance value of “1” is 4, the number of pixels having a luminance value of “2” is 8, the number of pixels having a luminance value of “3” is 8, and the number of pixels having a luminance value of “4” is 13.
[0070] Further, when the probability density functions are inputted to the CDF calculation unit
[0071] CDF{1}=4
[0072] CDF{
[0073] CDF{3}=20
[0074] CDF{4}=33
[0075] That is, CDF{2}=PDF{1}+PDF{2}, CDF{4}=PDF{1}+PDF{2}+PDF{3}+PDF{4}.
[0076] The CDF compensation unit
[0077] Herein, N is the highest luminance value displayable when the image signal forms an image, that is, for the luminance value of N=4, K denotes a luminance value ranging from 1 to 4 in this example.
[0078] The cumulative distribution functions can be re-configured according to Formula 2 as follows:
[0079] CDF{1}=(4−33/(4×1))+1=−3.25
[0080] CDF{2}=(12−33/(4×2))+2=−2.50
[0081] CDF{3}=(20−33/(4×3))+3=−1.75
[0082] CDF{4}=(33−33/(4×4))+4=+4.00
[0083] Herein, under the assumption that negative numbers (−3.25, −2.50, −1.75) are respectively mapped into a positive number “1”, re-configured cumulative distribution functions (hereinafter, referred to as Look Up Table (LUT)) are as follows:
[0084] LUT{1}=1
[0085] LUT{2}=1
[0086] LUT{3}=1
[0087] LUT{4}=4
[0088] The cumulative distribution functions re-configured as above are stored in the mapping unit
[0089] In the meantime, the implementation of Formula 2 in hardware requires an adder, a subtractor, a multiplier, and a divider, but the barrel shifter
[0090]
[0091] First, the PDF calculation unit
[0092] Next, an over-threshold value and an under-threshold value are set to remove luminance values such as “0” or “255” that greatly affect the luminance values of an entire image compared to a portion occupied on the image, that is, luminance values rendering the image excessively dark or bright (S
[0093] As stated above, when certain portions of an image are rendered very bright or dark, the phenomenon in which the entire image becomes abruptly bright or dark is reduced, thus decreasing the contrast degradation of the image. Further, the contrast compensation apparatus only uses the minimum number of multipliers, adders, and subtractors, so that the structure is simplified, and less electric power is consumed when the apparatus is implemented in hardware.
[0094] Although a few embodiments of the present invention have been shown and described, it would be appreciated by those skilled in the art that changes may be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the claims and their equivalents.