Background of the Invention
The present invention relates to a method for enhancing an image using quantized mean-separate histogram equalization (MSHE) and a circuit therefor, and more particularly, to a method and a circuit for implementing the method, in which the input image signals are quantized and split into a predetermined number of sub-images, and then each sub-image is independently histogram-equalized.
The histogram of gray levels completely describes the appearance of an image. Properly adjusting the gray levels for a given image enhances the appearance or the contrast of the image.
Among the various types of methods used for enhancing the contrast of an image, histogram-equalization, which enhances the contrast of a given image according to the sample distribution of the image is most widely known and disclosed in the following documents: 1! J. S. Lim, "Two-Dimensional Signal and Image Processing", Prentice Hall, Englewood Cliffs, N.J., 1990; and 2! R. C. Gonzales and P. Wints, "Digital Image Processing", Addition-Wesley, Reading, Mass., 1977.
In addition, useful applications of the histogram-equalization method, including medical image processing and a radar image processing, are disclosed in the following documents: 3! J. Zimmerman, S. Pizer, E. Staab, E. Perry, W. McCartney and B. Breton, "Evaluation of the Effectiveness of Adaptive Histogram Equalization for Contrast Enhancement," IEEE Tr. on Medical Imaging, pp. 304-312, Dec. 1988; and 4! Y. Li, W. Wang and D. Y. Yu, "Application of Adaptive Histogram Equalization to X-ray Chest Image," Proc. of the SPIE, pp. 513-514, vol. 2321, 1994.
Generally, since histogram equalization extends through the dynamic range, the distribution density of the resultant image is made uniform. As a result, the contrast of the image is enhanced.
This widely known characteristic of histogram equalization is disadvantageous in some cases. That is, because the output density of the histogram equalization is uniform, the mean brightness of an output image is near the middle of the gray level range.
Actually for the histogram equalization of an analog image, the mean brightness of the output image due to the histogram equalization is the middle gray level regardless of the mean brightness of the input image. This characteristic is undesirable for some applications. For instance, the fact that an image taken in the night looks like an image taken in the daytime after histogram equalization is a problem.
In addition, because the conventional histogram equalizer requires the storage of each gray level number, the cost for hardware is high. For example, if 256 gray levels (L) are used, 256 memory devices are required for storing the occurrence numbers of all levels, and 256 accumulators are required for accumulating every occurrence number of each level.
Summary of the Invention
To overcome the above problem, it is an object of the present invention to provide a method for image enhancing in which the level of an input image signal is quantized, and split into a predetermined number of sub-images and then each sub-image is independently histogram-equalized, thereby enhancing the contrast.
It is another object of the present invention to provide a circuit for image enhancing which quantizes the level of an input image signal, splits the quantized input image signals into a predetermined number of sub-images, and independently histogram-equalizes each sub-image, thereby reducing the amount of hardware required for image enhancement.
To achieve the above first object, there is provided a method for enhancing the image of histogram-equalizing image signals represented as a predetermined number of gray levels, the method comprising the steps of: (a) quantizing levels of input image signals and outputting quantized input image signals; (b) quantizing the mean of the quantized input image signals by a unit of a picture and outputting a quantized mean level; (c) splitting the quantized input image signals into a predetermined number of quantized sub-images according to the quantized mean level; (d) obtaining a cumulative density function value for each quantized sub-image; (e) interpolating the cumulative density function value of each quantized sub-image based on the input image signals and the cumulative density function value obtained for each quantized sub-image and outputting an interpolated cumulative density function value obtained for each quantized sub-image; and (f) independently performing histogram-equalization for each quantized sub-image according to the interpolated cumulative density function value for each quantized sub-image.
To achieve the above second object there is provided a circuit for enhancing the image of histogram-equalizing image signals represented as a predetermined number of gray levels, the circuit comprising: first quantizing means for quantizing levels of input image signals and outputting quantized input image signals; first calculating means for calculating a gray level distribution of the quantized input image signals by a unit of a picture; second calculating means for calculating the mean level of input image signals by a unit of a picture; second quantizing means for quantizing the mean level and outputting a quantized mean level; third calculating means for calculating a cumulative density function value for each quantized sub-image by splitting the gray level distribution calculated in the first calculating means into a predetermined number of quantized sub-images according to the quantized mean level; interpolating means for interpolating the cumulative density function value of each quantized sub-image based on the input image signals and the cumulative density function value for each quantized sub-image and outputting an interpolated cumulative density function value for each quantized sub-image; mapping means for mapping the sample of each quantized sub-image to a gray level based on the interpolated cumulative density function value for each quantized sub-image; and outputting means for outputting one of the samples mapped to the gray level for each quantized sub-image according to the comparison result of the quantized mean level and the input image signals.
Brief Description of the Drawings
The above objects and advantages of the present invention will become more apparent by describing in detail a preferred embodiment thereof with reference to the accompanying drawings in which:
FIG. 1 is a view illustrating an example of quantizing L level discrete signals to Q level discrete signals according to the present invention;
FIG. 2 illustrates the concept of interpolation adopted in the present invention; and
FIG. 3 is a block diagram of a circuit for enhancing image according to an embodiment of the present invention.
Detailed Description of the Invention
First of all, the quantized mean-separate histogram equalization (MSHE) method proposed in the present invention will be described.
A given image {X} is composed of L discrete gray levels {X.sub.0, X.sub.1, . . . , X.sub.L-1 }. Here, X.sub.0 =0 represents a black level and X.sub.L-1 =1 represents a white level.
The original discrete input level {X.sub.0, X.sub.1, . . . , X.sub.L-1 } is quantized to Q discrete levels defined as {Z.sub.0, Z.sub.1, . . . , Z.sub.Q-1 }, where it is assumed that Z.sub.Q-1 =X.sub.L-1, Q.sub.23 L and {Z.sub.0, Z.sub.1, . . . , Z.sub.Q-1 } C {X.sub.0, X.sub.1, . . . , X.sub.L-1 }.
The example in which L level discrete signals are quantized to Q level discrete signals is illustrated in FIG. 1.
QX.sub.k ! represents a quantizing operation which is defined as follows.
if Z.sub.q-1 <X.sub.k.sbsb..ltoreq. Z.sub.q
Assuming that {Z}=Q{X}! and Z.sub.m =QX.sub.m !, X.sub.m represents the mean level of the original input image, {Z} the quantized input image, and Z.sub.m the quantized mean level. The quantized input image {Z} is split into two sub-images {Z}.sub.L and {Z}.sub.U according to Z.sub.m. At this stage, all the samples of the quantized sub-image {Z}.sub.L are equal to or less than the quantized mean level Z.sub.m and all the samples of the quantized sub-image {Z}.sub.U are greater than the quantized mean level Z.sub.m.
The quantized probability density function (PDF) of each sub-image {Z}.sub.L and {Z}.sub.U can be expressed as the following equations (1) and (2). ##EQU1##
Here, P.sub.L (Z.sub.q) is the probability of the q-th gray level Z.sub.q of the quantized sub-image {Z}.sub.L, P.sub.U (Z.sub.q) is the probability of the q-th gray level Z.sub.q of the quantized sub-image {Z}.sub.U, N.sub.q.sup.L and N.sub.q.sup.U represent the respective numbers of times that the gray level Z.sub.q appears in quantized sub-images {Z}.sub.L and {Z}.sub.U, respectively, and N.sub.L and N.sub.U represent the total numbers of pixels in the quantized sub-images {Z}.sub.L and {Z}.sub.U, respectively.
Each cumulative density function (CDF) of the quantized sub-images {Z}.sub.L and {Z}.sub.U is defined as shown by the following equations (3) and (4). ##EQU2##
Here, C.sub.L (Z.sub.m)=1 and C.sub.U (Z.sub.Q-1)=1.
Interpolated cumulative density function, C.sub.L (X.sub.k) and c.sub.U (X.sub.k) can be approximately calculated by a linear interpolation from c.sub.L (Z.sub.q) and c.sub.U (Z.sub.q). The linear interpolation is illustrated in FIG. 2.
Assuming that Q (X.sub.k)=Z.sub.q.sbsb..ltoreq. Z.sub.m, Z.sub.q-1 =0 and C.sub.L (X.sub.k) is interpolated as shown by the following equation (5). ##EQU3##
Similarly, assuming that Q (X.sub.k)=Z.sub.q >Z.sub.m, c.sub.U (X.sub.k) is interpolated as shown by the following equation (6). ##EQU4##
Finally, on the basis of the interpolated cumulative density function, the output Y of the proposed mean-separate histogram equalization (MSHE) with respect to the input image (X.sub.k) is given as the following equation (7). ##EQU5##
Here Z.sub.m '=Z.sub.m +X.sub.L-1 /(L-1) which is the next gray level after Z.sub.m at {X.sub.0, X.sub.1, . . . X.sub.L-1 }.
Next, a circuit for enhancing an image using the quantized mean-separate histogram equalization (MSHE) will be described with reference to FIG. 3.
FIG. 3 shows the circuit for enhancing image using quantized mean-separate histogram equalization (MSHE).
Referring to FIG. 3, a first quantizer 102 quantizes the input image {X} of L discrete levels to Q discrete levels, and outputs the quantized input image {Z}.
A frame histogram calculator 104 calculates the gray level distribution in a unit of a picture of the quantized input image signal {Z}. Here the picture unit can be a field, but in this embodiment it is a frame.
A frame mean calculator 106 calculates the mean level X.sub.m of the input image in a unit of a frame.
A second quantizer 108 quantizes the mean level X.sub.m of input image {X} and outputs the quantized mean level Z.sub.m.
A splitter 110 splits the quantized gray level distribution which is calculated by frame histogram calculator 104 into a predetermined number (2 in this embodiment) of quantized sub-images {Z}.sub.L and {Z}.sub.U based on the quantized mean level Z.sub.m output from quantizer 108, and outputs each probability density function of the quantized sub-image.
Here the probability density functions P.sub.L (Z.sub.q) and P.sub.U (Z.sub.q) are calculated using the above equations (1) and (2).
Here each sample of quantized sub-image {Z}.sub.L is equal to or less than the mean level Z.sub.m and each sample of the quantized sub-image {Z}.sub.U is greater than the mean level Z.sub.m.
A first cumulative density function (CDF) calculator 112 receives the probability density function (PDF) of the quantized sub-image {Z}.sub.L including the quantized image sample being equal to or less than the quantized mean level Z.sub.m and calculates the cumulative density function (CDF) of the quantized sub-image {Z}.sub.L using equation (3).
A second cumulative density function (CDF) calculator 114 receives the probability density function (PDF) of the quantized sub-image {Z}.sub.U including the quantized image sample being greater than the quantized mean level Z.sub.m and calculates the cumulative density function (CDF) of the quantized sub-image {Z}.sub.U using equation (4).
A cumulative density function (CDF) memory 116 updates the cumulative density functions C.sub.L (Z.sub.q) and C.sub.U (Z.sub.q) of the quantized sub-images {Z}.sub.L and {Z}.sub.U calculated in first and second cumulative density function (CDF) calculators 112 and 114 according to the synchronous signal(SYNC) by the unit of a frame, and provides the prestored cumulative density function (CDF) to first and second interpolators 118 and 122 during the updating.
Here, if the unit of a picture is a field, the synchronous signal is a field synchronous signal, and if it is a frame, the synchronous signal is a frame synchronous signal. Also, the cumulative density function (CDF) memory is used as a buffer.
The first interpolator 118 receives the cumulative density function (CDF) of the quantized sub-image {Z}.sub.L and input sample X.sub.k, and outputs an interpolated cumulative density function C.sub.L (X.sub.k) which is linearly interpolated using equation (5).
A first mapper 120 receives the interpolated cumulative density function C.sub.L (X.sub.k), input sample X.sub.k, and quantized mean level Z.sub.m and maps the sample of sub-image {Z}.sub.L which has a level equal to or less than the quantized mean level Z.sub.m to the gray level of from 0 to Z.sub.m according to the interpolated cumulative density function C.sub.L (X.sub.k).
The second interpolator 122 receives the cumulative density function (CDF) of the quantized sub-image {Z}.sub.U and input sample X.sub.k, and outputs interpolated cumulative density function C.sub.U (X.sub.k) which is linearly interpolated using equation (6).
A second mapper 124 receives the interpolated cumulative density function C.sub.U (X.sub.k) input sample X.sub.k, and quantized mean level Z.sub.m and maps the sample of sub-image {Z}.sub.U which has a level greater than the quantized mean level Z.sub.m to the gray level of from Z.sub.m ' to X.sub.L-1 according to the interpolated cumulative density function C.sub.U (X.sub.k). Here Z.sub.m '=Z.sub.m +X.sub.L-1 /(L-1).
Meanwhile, the input sample X.sub.k applied to first and second interpolators 118 and 122 is the image signal of the next frame to compared cumulative density functions C.sub.L (Z.sub.q) and C.sub.U (Z.sub.q)calculated by first and second CDF calculators 112 and 116.
Therefore, the input sample applied to the first and second interpolators 118 and 122 can be applied after a delay of one frame. Because there is a high correlation between the adjacent frames, the frame memory may be omitted to thereby reduce the quantity of hardware used to enhance the image.
A comparator 126 compares the input sample X.sub.k with the quantized mean level Z.sub.m output from the second quantizer 108, and outputs a selecting control signal which selects the output of the first mapper 120 if the input sample is equal to or less than the quantized mean level Z.sub.m, and otherwise selects the output of the second mapper 124.
The selected output, which is the equalized signal Y, is represented by equation (7).
The equalized signal Y enhances the contrast and preserves the entire brightness of the image.
It is possible to apply the present invention to a wide variety of image enhancing devices, such as broadcasting equipment, radar signal processing system, and electronic home appliances as well as medical engineering equipment.
As described above, the method of the present invention effectively reduces artifacts and the abrupt change of brightness generated during a conventional histogram equalization, to thereby enhance the contrast and preserve the overall brightness of the image.
Moreover, the circuit of the present invention stores and accumulates only the number of the quantized levels by quantizing the input image signals, splitting the quantized input image signals into a predetermined number of a sub-image, and independently histogram-equalizing each sub-image. As a result, hardware is simplified and the manufacturing cost is reduced.