Image enhancing method using mean-separate histogram equalization and a circuit therefor

Abstract: An image enhancing method using a mean-separate histogram equalization method is disclosed. An input image signal is divided into two sub-images in a picture unit according to a mean level of the input image signal. Then, cumulative density functions for each sub-image are calculated. Afterwards, the input sample is mapped into two gray levels, each of which belongs to a first range and a second range, by using a first and a second transform functions defined by use of the cumulative density functions, respectively. Finally, one of two mapped levels is selected depending on the magnitude of the input sample. As a result, the brightness of the given image can be preserved while the contrast is enhanced.

Description: The present invention relates to an image enhancing method using mean-separate histogram equalization (MSHE) and a circuit therefor. More particularly, the present invention relates to an image enhancing method in which a given image is separated into a predetermined number of sub-images based on a mean level of the image and the respective sub-images are histogram-equalized independently, and a circuit therefor. A histogram of gray levels provides an overall description of the appearance of an image. Properly adjusted gray levels for a given image can enhance the appearance or contrast thereof. Among the many methods for contrast enhancement, the most widely known one is histogram equalization, in which the contrast of a given image is enhanced according to the sample distribution thereof. The method is disclosed in documents: [1] J.S. Lim, "Two-dimensional Signal and Image Processing," Prentice Hall, Englewood Cliffs, New Jersey, 1990, and [2] R.C. Gonzalez and P. Wints, "Digital Image Processing," Addison-Wesley, Reading, Massachusetts, 1977. The useful applications of the histogram equalization method for medical image processing and radar image processing are disclosed in documents: [3] J. Zimmerman, S. Pizer, E. Staab, E. Perry, W. McCartney and B. Brenton, "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. A problem with some contrast enhancement methods is that the average brightness may become either too light or too dark. If, for example, the average brightness becomes too light and the brightness displayable on the display device is limited then all the elements of the image above the limit may appear as the maximum brightness. This reduces the information content of the image. A similar situation can be envisaged if the average brightness becomes too dark, when a proportion of the elements of the image below the average level will be darker than the minimum brightness displayable on the display device. European patent number 516 084 discloses a video signal gradation corrector employing histogram equalisation which suppresses excessive alternation of the average brightness by controlling what levels of brightness are included in the histogram. A number of other techniques for contrast enhancement, including adaptive histogram equalization and moving histogram equalization, are reviewed in the document: K.W. Leszczynski and S. Shalev, "Digital contrast enhancement for online portal imaging", Medical & Biological Engineering & Computing, pp. 507-512, Sep. 1989. This document discusses both global and local contrast enhancement techniques, in which the image can be enhanced as a whole, or divided into position dependent sub-images that are processed separately. The sub-images are related to one another by interpolation between neighbouring to one another by interpolation between neighbouring regions, which can be very computationally intensive. In general, since histogram equalization causes the dynamic range of an image to be stretched, the density distribution of the resultant image is made flat and the contrast of the image is enhanced as a consequence thereof. However, such a widely-known feature of the histogram equalization becomes a defect in some practical cases. That is, as the output density of the histogram equalization becomes uniform, the mean brightness of an output image approaches the middle gray level value. Actually, for the histogram equalization of an analog image, the mean brightness of the output image is exactly the middle gray level regardless of the mean brightness of the input image. It is obvious that this feature is not desirable in some real applications. For instance, an image taken at nighttime can appear to be an image taken in the daytime after histogram equalization has been performed. Meanwhile, too dark or too bright image signals result in a low contrast after the equalization. With a view to solving or reducing the above problems, it is an aim of preferred embodiments of the present invention to provide an image enhancing method in which a given image is separated into a predetermined number of sub-images based on a mean level of the image and the respective sub-images are histogram-equalized independently, so that the mean brightness of the given image is preserved while the contrast of the image is enhanced. It is another aim of embodiments of the present invention to provide an image enhancing method in which an input image is separated into a predetermined number of sub-images based on a mean level of the image and the respective sub-images are histogram-equalized independently according to a gray level distribution of the sub image and a compensated mean level which results from adding a brightness compensation value to the mean level. It is yet another aim of embodiments of the present invention to provide an image enhancing method by which a given image is separated into predetermined number of sub-images based on a mean level of the image and the respective sub-images are histogram-equalized independently, so that the mean brightness of the given image is preserved while the contrast of the image is enhanced. It is still yet another aim of preferred embodiments of the present invention to provide an image enhancing circuit by which an input image is separated into a predetermined number of sub-images based on a mean level of the image and the respective sub-images are histogram-equalized independently according to a gray level distribution of the sub image and a compensated mean level which results from adding a brightness compensation value to the mean level. According to a first aspect of the invention, there is provided a method for enhancing an image by histogram-equalizing an image signal represented by a predetermined number of gray levels, said method comprising the steps of: (a) calculating a mean value of an input image signal in a picture unit; (b) dividing the input image signal into a predetermined number of sub-images on the basis of a comparison result of the mean level and a gray level of each sample of the input image signal; (c) calculating cumulative density functions for each sub-image; and (d) histogram-equalizing each sub-image independently by mapping each sample of the sub-image into a new gray level on the basis of the cumulative density functions. Preferably, the input image signal is divided into two sub-images in said step (b). Said step (d) may comprise the steps of: (d1) mapping the input sample into a gray level of a first range by using a first transform function which is defined by use of one of the cumulative density functions; (d2) mapping the input sample into a gray level of a second range by using a second transform function which is defined by use of another one of the cumulative density functions; (d3) comparing the input sample with the mean level; and (d4) selecting one of two mapped gray levels in said step (d1) and (d2), respectively, according to the result of said step (d3). There, may further be provided a step (a1) comprising obtaining a gray level distribution of the input image signal in a picture unit; and wherein said step (c) is performed on the basis of the gray level distribution. The first range in said step (d1) preferably comprises gray levels from a minimum level X 0 to a mean level X m and the second range in said step (d2) preferably comprises gray levels from a gray level next to the mean level X m+1 to the maximum level X L-1 . A compensated mean level may be obtained by adding a brightness compensation value according to a predetermined correction function based on the mean brightness of the input image to said mean level; and in said step (d) of histogram-equalizing, each sub-image, may be histogram equalized independently by mapping each sample of the sub-image into a new gray level on the basis of the cumulative density functions and the compensated mean level. The gray level distribution may be divided into two sub-images according to the mean level in said step (b). Said step (d) may comprise the steps of: (d1) mapping the input sample which is equal to or less than the mean level to a gray level from the minimum level X 0 to a compensated mean level B m according to a corresponding cumulative density function value of the input sample; and (d2) mapping the input image signal which is greater than the mean level to a gray level from B m ' to a maximum gray level X L-1 according to a corresponding cumulative density function value of the input sample, wherein B m '=B m +X L-1 /(L-1). In obtaining said compensated mean level, the brightness compensation value is preferably greater than zero when the mean level is less than a first threshold, and the brightness compensation value is less than zero when the mean level is greater than a second threshold. According to a second aspect of the invention, there is provided a circuit for enhancing image by histogram-equalizing an image signal represented by a predetermined number of gray levels, the circuit comprising: first calculating means for calculating a gray level distribution of an input image signal in a picture unit; second calculating means for calculating a mean level of the input image signal in a picture unit; third calculating means for dividing the gray level distribution into a predetermined number of sub-images based on a comparison result of the mean level and a gray level of each example of the input image signal, and calculating cumulative density functions for each sub-image; mapping means for mapping each input sample of each of the sub-images into a plurality of gray levels on the basis of the cumulative density functions; and outputting means for comparing the input sample with the mean level and selecting one of the mapped gray levels output by said mapping means to output the selected level. A unit of picture is preferably a frame and a predetermined number is two. Preferably, there is further provided a picture memory for delaying the input image signal by a picture unit and wherein said mapping means maps each input sample of the sub-image output by said picture memory into a plurality of gray levels on the basis of the cumulative density functions. Said mapping means may be arranged for mapping each input sample of each sub-image into a plurality of gray levels on the basis of the cumulative density functions calculated for the picture just before the current picture. Said mapping means may comprise: a first mapper for mapping the input sample into a gray level from a minimum level X 0 to a mean level X m by using a first transform function which is defined by use of one of the cumulative density functions; and a second mapper for mapping the input sample into a gray level from a level X m+1 next to the mean level to a maximum level X L-1 by using a second transform function which is defined by use of the other one of the cumulative density functions. Said outputting means may comprise: a comparator for comparing the input sample with the mean level to output a selection control signal; and a selector for selecting one of the output levels from said first and second mappers according to the selection control signal. Compensation means may be provided for calculating a compensated mean level by adding a brightness compensation value according to a predetermined correction function to the mean level based on the mean brightness of the input image and wherein said mapping means is arranged for mapping each input sample of each of the sub-images output by the picture memory into a plurality of gray levels on the basis of the cumulative density functions and the compensated mean level. The circuit may further comprise compensation means for calculating a compensated mean level by adding a brightness compensation value according to a predetermined correction function to the mean level based on the mean brightness of the input image, and wherein said mapping means is arranged for mapping each input sample of each of the sub-images into a plurality of gray levels on the basis of the cumulative density functions and the compensated mean level. Preferably, said mapping means comprises: a first mapper for mapping the input sample into a gray level from a minimum level X 0 to a compensated mean level B m according to a first transform function which is defined by use of one of the cumulative density functions; and a second mapper for mapping the input sample into a gray level from B m ' to a maximum level X L-1 according to a second transform function which is defined by use of the other one of the cumulative density functions, wherein B m ' = B m + X L-1 /(L-1). Said compensation means preferably adds a brightness compensation value which is greater than zero to the mean level when the mean level is less than a first threshold, and a brightness compensation value which is less than zero to the mean level when the mean level is greater than a second threshold. Said outputting means may comprise: a comparator for comparing the mean level with the input sample from said picture memory to output a selection control signal; and a selector for selecting one of the output levels from said first and second mappers according to the selection control signal. Said outputting means may comprise: a comparator for comparing the mean level with the input sample to output a selection control signal; and a selector for selecting one of the output levels from said first and second mappers according to the selection control signal. The circuit may further comprise a buffer for storing the cumulative density functions calculated by said third calculating means updating the stored functions by a picture unit, and providing a predetermined number of cumulative density function values to said mapping means. According to an embodiment of the invention, there is provided an image enhancing circuit in which an image signal expressed as a predetermined number (L) of gray levels is histogram-equalized, said circuit comprising: first calculating means for calculating a gray level distribution of an input image signal in a picture unit; second calculating means for calculating a mean level of the input image signal in a picture unit; compensation means for adding a brightness compensation value according to a predetermined correction function to the mean level based on the mean brightness of the input image to output a compensated mean level; third calculating means for dividing the gray level distribution into a predetermined number of sub-images according to the mean level and calculating cumulative density functions for each sub-image; mapping means for mapping the samples of each sub-image to gray levels according to the cumulative density functions and the compensated mean level; and outputting means for selectively outputting one of the mapped samples output from said mapping means as an enhanced signal, according to the result obtained through the comparison between the input image signal and the mean level. Preferably, said mapping means comprises: a first mapper for mapping the input image signal which is equal to or less than the mean level to a gray level from a minimum level X 0 to a compensated mean level B m according to a corresponding cumulative density function value of the input image signal; and a second mapper for mapping the input image signal which is greater than the mean level to a gray level from B m ' to a maximum level X L-1 according to a corresponding cumulative density function value of the input image signal, wherein B m '=B m +X L-1 /(L-1). Said outputting means preferably comprises: a comparator for comparing the level of the input image signal with the mean level to output a selecting control signal; and a selector for selecting an output of one of said first and second mappers according to the selecting control signal. Preferably, the circuit further comprises a buffer for updating said cumulative density functions and providing previously stored cumulative density functions to said mapping means. Preferably, said compensation means adds a brightness compensation value which is greater than zero to the mean level when it is very low, that is, the input image is very dark, and a brightness compensation value which is less than zero to the mean level when it is very high, that is, the input image is very bright, to output a compensated mean level by which the brightness of the enhanced signal is controlled. Said picture unit is preferably a frame unit and the predetermined number of sub-images is two. The unit of a picture may be frame or a field. For a better understanding of the invention, and to show how embodiments of the same may be carried into effect, reference will now be made, by way of example, to the accompanying diagrammatic drawings, in which: Figure 1 is a block diagram of an image enhancing circuit according to a first embodiment of the present invention; Figure 2 is a block diagram of an image enhancing circuit according to a second embodiment of the present invention; Figure 3 is a block diagram of an image enhancing circuit according to a third embodiment of the present invention; Figures 4A and 4B are graphs showing examples of a brightness correction function applied to the present invention; Figures 5A and 5B are graphs showing examples of the relation between the mean level of an input image and the mean level compensated by the brightness correction functions shown in Figures 4A and 4B, respectively; and Figure 6 is a block diagram of an image enhancing circuit according to a fourth embodiment of the present invention. An image enhancing method using mean-separate histogram equalization (MSHE) according to embodiments of the present invention will be described. Here, {X} denotes a given image, and X m denotes the mean brightness level (hereinafter, will be abbreviated as "mean level") of {X}. The given image {X} is composed of L discrete gray levels denoted by {X 0 , X 1 ,..., X L-1 }, where X 0 =0 represents a black level and X L-1 =1 represents a white level. Also, it is assumed that X m ∈{X 0 , X 1 ,..., X L-1 }. Based on the mean level X m , the input image is divided into two sub-image groups denoted by {X} L and {X} U , wherein all samples in {X} L are equal to or less than the mean level X m and those in {X} U are greater than the mean level X m . Probability density functions (PDFs) for each of the sub-images {X} L and {X} U are defined, respectively, as following equations (1) and (2). p L ( X k ) = n L k n L , for k = 0, 1,...,m p U ( X k ) = n U k n U , for k = m + 1, m + 2,..., L-1 where, L represents the number of gray levels, p L (X k ) represents a probability of k-th gray level X k in the sub-image {X} L , p U (X k ) represents a probability of k-th gray level X k in the sub-image {X} U , n L / k and n U / k represent the number of occurrences of samples having the gray level X k in the sub-images {X} L and {X} U , respectively, and n L and n U represent the total number of samples in each of the sub-images {X} L and {X} U . Also, Cumulative density functions (CDF) for each of the sub-images {X} L and {X} U are defined, respectively, as following equations (3) and (4). Based on the above CDFs, an output Y H of the proposed MSHE of the present invention, for the given input sample X k , is given by the following equation (5). That is, the samples of {X} L are mapped into (0,X m ) according to the CDF of equation (3), and the samples of {X} U are mapped into (X m+1 , X L-1 ), respectively. Thus, each sub-image is equalized independently by the mean-separate histogram equalization (MSHE) according to the present invention. Also, it can easily be seen that the average output of the mean-separate histogram equalization (MSHE) is given by (0.5+X m )/2 when the number of gray levels L are large enough and the PDF of the input image X is symmetrical about the mean level of the input image. That is, the average output of the proposed mean-separate algorithm is the arithmetical average of the middle gray level (0.5) and ideal mean level (0.5), while the average output of the conventional histogram is 0.5. In another image enhancement method of the present invention, which carries out a brightness compensation along with the contrast enhancement, an output Y H of the proposed MSHE is given by the following formula (6) for a given input sample X k . where, B m = X m + Δ Here, B m is a compensated mean level and Δ is a brightness compensation value which is preset by use of a predetermined compensation function according to the brightness level. Thus, the compensated mean level B m results from adding the brightness compensation value Δ to the mean level X m . At this time, we also assume that B m ∈ {X 0 , X 1 , ..., X L-1 }. Meanwhile, B m ' in the equation (6) is given by the following equation (8), B m ' = B m + X L -1 /( L -1) and represents the first gray level in the higher sub-image group, in other words, the gray level next to the compensated mean level B m . As a consequence, according to the equation (6), the input samples which are equal to or less than the mean level X m are mapped into a gray level of from 0 to B m (0, B m ), and the samples greater than the mean level X m are mapped into a gray level of from B m ' to X L-1 (B m ', X L-1 ). Thus, the equalized output Y H becomes brighter when the brightness compensation value is greater than 0 (Δ>0), and the equalized output Y H becomes darker when the brightness compensation value is less than 0 (Δ<0). As Δ is increased, the dynamic range of a lower portion of the image is enhanced, and as Δ is decreased, the dynamic range of an upper portion is enhanced. The compensated mean level B m is appropriately compensated according to the mean level X m of the given image signal, that is, the brightness and darkness of the image, enhances greatly the quality of the input image along with the mean separate histogram equalization. Next, preferred embodiments of an image enhancing circuit according to the present invention using MSHE will be described with reference to Figures 1 to 6. Figure 1 is a block diagram of an image enhancing circuit according to a preferred embodiment of the present invention. In Figure 1, a frame histogram calculator 102 calculates the probability density function p(X k ) which represents a gray level distribution in the input image {X} according to the equation (1) by a unit of a picture. At this stage, a frame is used for the picture unit. However, a field may be used for the picture unit alternatively. A frame mean calculator 104 calculates the mean level X m of the input image {X k } in a frame unit. A divider 106 divides the gray level distribution calculated by histogram calculator 102 into a predetermined number (here, two) of sub-image distributions based on the mean level X m , and outputs the probability density functions p L (X k ) and p U (X k ) of two sub-images {X} L and {X} U . A first CDF calculator 108 receives the probability density function p L (X k ) of the sub-image {X} L (hereinafter, referred to as a "first sub-image") in which all image samples are equal to or less than the mean level X m output by the divider 106, and calculates the CDF c L (X k ) by use of the equation (3). A second CDF calculator 110 receives the probability density function p U (X k ) of the sub-image {X} U (hereinafter, referred to as a "second sub-image") in which all image samples are greater than the mean level X m output by the divider 106, and calculates the CDF c U (X k ) by use of the equation (4). A CDF memory 112 stores the cumulative density function c L (X k ) and c U (X k ) calculated by the CDF calculators 108 and 110 by a unit of one frame, updates the stored values according to a synchronization signal, and outputs the cumulative density function value c(X k ) corresponding to a sample X k output by the frame memory 100 and the cumulative density function value c(X m ) corresponding to the mean level X m output by the frame mean calculator 104. At this stage, the CDF memory 112 is used as a buffer. Here, the synchronous signal is a field synchronization signal when the picture unit is a field and a frame synchronization signal when the picture unit is a frame. The frame memory 100 stores the input image {X} by a frame unit. Since the cumulative density functions c L (X k ) and c U (X k ) output by the first and the second CDF calculators 108 and 110 are the cumulative density functions of an image delayed by one frame compared with the currently input image {X}, the input image {X} is delayed by one frame by the frame memory 100 so that the image signal of the frame corresponding to the cumulative density functions c L (X k ) and c U (X k ) is input to the first and the second mappers 114 and 116. The first mapper 114 receives the cumulative density function value c L (X k ) from the first CDF calculator 108, the mean level X m from the frame mean calculator 104 and the one-frame delayed input sample X k from the frame memory 100, and maps the one-frame delayed input sample X k of the first sub-image {X} L to a gray level of from 0 to X m according to the first expression in the equation (5). The second mapper 116 receives the cumulative density function value c U (X k ) from the second CDF calculator 110, the mean level X m from the frame mean calculator 104 and the one-frame delayed input sample X k from the frame memory 100, and maps the one-frame delayed input sample X k of the second sub-image {X} U to a gray level of from X m+1 to X L-1 according to the second expression in the equation (5). A comparator 118 compares the input sample X k output from frame memory 100 with the mean level X m output from frame mean calculator 104, and outputs a select control signal according to the compared result. A selector 120 selects the signal output by the first mapper 114 or that by the second mapper 116 in accordance with the selection control signal. Specifically, the selector 120 selects the signal output by the first mapper 114 in case that the selection control signal indicates that the input sample X k belongs to the first sub-image {X} L . Meanwhile, the selector 120 selects the signal output by the second mapper 116 in the case that the selection control signal indicates that the input sample X k belongs to the second sub-image {X} U . Meanwhile, in the present invention, the histogram calculator 102 and the CDF calculator 104 can be incorporated into a single block for calculating the gray level distribution and calculating the CDF also according to the gray level distribution in a unit of a picture with respect to the input image {X}. Figure 2 is a block diagram of an image enhancing circuit according to another preferred embodiment of the present invention. In Figure 2, a frame histogram calculator 202 calculates the probability density function p(X k ) which represents a gray level distribution in the input image {X} according to the equation (1) by a unit of a picture. A frame mean calculator 204 calculates the mean level X m of the input image {X k } in a frame unit. A divider 206 divides the gray level distribution calculated by histogram calculator 202 into two sub-image distributions based on the mean level X m , and outputs the probability density functions p L (X k ) and p U (X k ) of two sub-images {X} L and {X} U . A first CDF calculator 208 receives the probability density function p L (X k ) of the first sub-image {X} L , and calculates the CDF c L (X k ) by use of the equation (3). A second CDF calculator 210 receives the probability density function p U (X k ) of the second sub-image {X} U , and calculates the CDF c U (X k ) by use of the equation (4). A CDF memory 212 stores the cumulative density function c L (X k ) and c U (X k ) calculated by the CDF calculators 208 and 210 by a unit of one frame, updates the stored values according to a synchronization signal, and outputs the cumulative density function value c(X k ) corresponding to a sample X k and the cumulative density function value c(X m ) corresponding to the mean level X m output by the frame mean calculator 204. The first mapper 214 receives the cumulative density function value c L (X k ) from the first CDF calculator 208, the mean level X m from the frame mean calculator 204 and the input sample X k , and maps the input sample X k of the first sub-image {X} L to a gray level of from 0 to X m according to the first expression in the equation (5). The second mapper 216 receives the cumulative density function value c U (X k ) from the second CDF calculator 210, the mean level X m from the frame mean calculator 204 and the input sample X k , and maps the input sample X k of the second sub-image {X} U to a gray level of from X m+1 to X L-1 according to the second expression in the equation (5). A comparator 218 compares the input sample X k with the mean level X m output from frame mean calculator 204, and outputs a select control signal according to the compared result. A selector 220 selects the signal output by the first mapper 214 or that by the second mapper 216 in accordance with the selection control signal. Specifically, the selector 220 selects the signal output by the first mapper 214 in case that the selection control signal indicates that the input sample X k belongs to the first sub-image {X} L . Meanwhile, the selector 220 selects the signal output by the second mapper 216 in the case that the selection control signal indicates that the input sample X k belongs to the second sub-image {X} U . In this embodiment of Figure 2, a frame memory has been omitted, compared with the first embodiment of the present invention of Figure 1, considering the feature that there exists a high correlation between the neighbouring frames. Thus, the sample X k input to the first and the second mappers 210 and 212 belong to a frame next to the one to which the output signals of the CDF memory 208 is related. Consequently, the hardware is reduced. Figure 3 is a block diagram of an image enhancing circuit according to yet another preferred embodiment of the present invention. The components of the circuit shown in Figure 3 are similar to those of the circuit shown in Figure 1 except for a brightness compensator 314, and a first and a second mappers 316 and 318. Thus, the description will be focused on the brightness compensator 314, and the first and the second mappers 316 and 318. In Figure 3, the brightness compensator 314 receives the mean level X m output by a frame mean calculator 304, adds a brightness compensation value (Δ) corresponding to the mean brightness of an input image, as described in the equation (7), and outputs the compensated mean level B m . The brightness compensation value Δ is determined by use of a predetermined compensation function such as ones shown in Figures 4A and 4B. However, the compensation functions shown in Figures 4A and 4B are not more than exemplary ones, and other functions of different shape can be contemplated as well. The brightness of the equalized output is controlled the brightness compensation value according to the compensation function as shown in Figures 4A and 4B. Specifically, when the mean level X m of the input image is very low, i.e., for a quite dark image, the equalized output becomes brighter by the mean-matching histogram equalization method of the present invention since a brightness compensation value Δ greater than "0" is added to the mean level X m . Meanwhile, when the mean level X m of the input image is very high, i.e., for a quite brightness image, the equalized output becomes darker by the mean-matching histogram equalization method of the present invention since a brightness compensation value Δ less than "0" is added to the mean level X m . Accordingly, the compensated mean level B m compensated by a suitable brightness compensation value Δ according to the mean level X m drastically improves the quality of the input image. Figures 5A and 5B show the relation between the compensated mean level B m compensated by a compensated brightness compensation value Δ in accordance with the brightness compensation function shown in Figures 4A and 4B and the mean level X m of the input image. Meanwhile, the first mapper 316 receives the cumulative density function value c L (X k ) from the first CDF calculator 308, the compensated mean level B m from the brightness compensator 314 and the one-frame delayed input sample X k from the frame memory 300, and maps the one-frame delayed input sample X k of the first sub-image {X} L to a gray level of from 0 to B m according to the first expression in the equation (6). The second mapper 318 receives the cumulative density function value c U (X k ) from the second CDF calculator 310, the compensated mean level B m from the bright compensator 314 and the one-frame delayed input sample X k from the frame memory 300, and maps the one-frame delayed input sample X k of the second sub-image {X} U to a gray level of from B m ' to X L-1 according to the second expression in the equation (6). Here, B m ' is given by the equation (8). Figure 6 is a block diagram of an image enhancing circuit according to still yet another preferred embodiment of the present invention. The components of the circuit shown in Figure 6 are similar to those of the circuit shown in Figure 2 except for a brightness compensator 414, and a first and a second mappers 416 and 418. Thus, the description will be focused on the brightness compensator 414, and the first and the second mappers 416 and 418. In Figure 6, the brightness compensator 414 receives the mean level X m output by a frame mean calculator 404, adds a brightness compensation value (Δ) corresponding to the mean brightness of an input image, as described in the equation (7), and outputs the compensated mean level B m . The first mapper 416 receives the cumulative density function value c L (X k ) from the first CDF calculator 408, the compensated mean level B m from the bright compensator 414 and the input sample X k , and maps the input sample X k of the first sub-image {X} L to a gray level of from 0 to B m according to the first expression in the equation (6). The second mapper 418 receives the cumulative density function value c U (X k ) from the second CDF calculator 410, the compensated mean level B m from the bright compensator 414 and the input sample X k , and maps the input sample X k of the second sub-image {X} U to a gray level of from B m ' to X L-1 according to the second expression in the equation (6). Here, B m ' is given by the equation (8). As was the case for the image enhancing circuit of Figure 2, the hardware is reduced by omitting the frame memory considering the characteristics that there exists a high correlation between the neighbouring frames. The image enhancing method using the MSHE and the circuit adopting the method effectively reduces the abrupt changes in brightness as well as any artefact generated by the conventional histogram equalization, so that image contrast is enhanced and the brightness of the entire image can be preserved. Also, according to the image enhancing method of the present invention and the circuit adopting the method, the MSHE is performed considering the brightness compensation value according to the mean brightness of the input image, so that the contrast of an input image signal which is excessively dark or bright is enhanced, and thereby image quality is improved. Thus, the present invention can be applied to various fields related to image enhancing, such as broadcasting, radar signal processing, medical engineering and home appliances.

Claims: A method for enhancing an image by histogram-equalizing an image signal represented by a predetermined number of gray levels, said method comprising the steps of: (a) calculating a mean level value of an input image signal in a picture unit; (b) dividing the input image signal into a predetermined number of sub-images on the basis of a comparison result of the mean level and a gray level of each sample of the input image signal; (c) calculating cumulative density functions for each sub-image; and (d) histogram-equalizing each sub-image independently by mapping each sample of the sub-image into a new gray level on the basis of the cumulative density functions. A method for enhancing an image as claimed in claim 1, wherein the input image signal is divided into two sub-images in said step (b). A method for enhancing an image as claimed in claim 1 or 2, wherein said step (d) comprises the steps of: (d1) mapping the input sample into a gray level of a first range by using a first transform function which is defined by use of one of the cumulative density functions; (d2) mapping the input sample into a gray level of a second range by using a second transform function which is defined by use of another one of the cumulative density functions; (d3) comparing the input sample with the mean level; and (d4) selecting one of two mapped gray levels in said step (d1) and (d2), respectively, according to the result of said step (d3). A method according to claim 1, 2 or 3, wherein there is further provided a step (a1) comprising obtaining a gray level distribution of the input image signal in a picture unit; and wherein said step (c) is performed on the basis of the gray level distribution. A method according to claim 4, wherein the first range in said step (d1) comprises gray levels from a minimum level X 0 to a mean level X m and the second range in said step (d2) comprises gray levels from a gray level next to the mean level X m+1 to the maximum level X L-1 . A method according to claim 4, wherein: a compensated mean level is obtained by adding a brightness compensation value according to a predetermined correction function based on the mean brightness of the input image to said mean level; and in said step (d) of histogram-equalizing, each sub-image, is histogram equalized independently by mapping each sample of the sub-image into a new gray level on the basis of the cumulative density functions and the compensated mean level. A method for enhancing an image as claimed in claim 6, wherein the gray level distribution is divided into two sub-images according to the mean level in said step (b). A method for enhancing image as claimed in claim 7, wherein said step (d) comprises the steps of: (d1) mapping the input sample which is equal to or less than the mean level to a gray level from the minimum level X 0 to a compensated mean level B m according to a corresponding cumulative density function value of the input sample; and (d2) mapping the input image signal which is greater than the mean level to a gray level from B m ' to a maximum gray level X L-1 according to a corresponding cumulative density function value of the input sample, wherein B m '=B m +X L-1 / (L-1). A method for enhancing an image as claimed in claim 6, wherein in obtaining said compensated mean level, the brightness compensation value is greater than zero when the mean level is less than a first threshold, and the brightness compensation value is less than zero when the mean level is greater than a second threshold. A circuit for enhancing image by histogram-equalizing an image signal represented by a predetermined number of gray levels, the circuit comprising: first calculating means (102; 202; 302; 402) for calculating a gray level distribution of an input image signal in a picture unit; second calculating means (104; 204; 304; 404) for calculating a mean level of the input image signal in a picture unit; third calculating means (106-112; 206-212; 306-312; 406-412) for dividing the gray level distribution into a predetermined number of sub-images based on a comparison result of the mean level and a gray level of each example of the input image signal; mapping means (114, 116; 214, 216; 316, 318; 416, 418) for mapping each input sample of each of the sub-images into a plurality of gray levels on the basis of the cumulative density functions; and outputting means (118, 120; 218, 220; 320, 322; 420, 422) for comparing the input sample with the mean level and selecting one of the mapped gray levels output by said mapping means to output the selected level. A circuit for enhancing image as claimed in claim 10, wherein a unit of picture is a frame and a predetermined number is two. A circuit according to claim 10 or 11, wherein there is further provided a picture memory (100, 300) for delaying the input image signal by a picture unit and wherein said mapping means (114, 116; 316, 318) maps each input sample of the sub-image output by said picture memory into a plurality of gray levels on the basis of the cumulative density functions. A circuit according to claims 10 or 11, wherein said mapping means (214, 216) is arranged for mapping each input sample of each sub-image into a plurality of gray levels on the basis of the cumulative density functions calculated for the picture just before the current picture. A circuit for enhancing images as claimed in claim 12 or 13, wherein said mapping means (144, 116; 214, 216) comprises: a first mapper (114; 214) for mapping the input sample into a gray level from a minimum level X 0 to a mean level X m by using a first transform function which is defined by use of one of the cumulative density functions; and a second mapper (116; 216) for mapping the input sample into a gray level from a level X m+1 next to the mean level to a maximum level X L-1 by using a second transform function which is defined by use of the other one of the cumulative density functions. A circuit according to claim 14 as dependant upon claim 15, wherein said outputting means (218, 220) comprises: a comparator (218) for comparing the-input sample with the mean level to output a selection control signal; and a selector (220) for selecting one of the output levels from said first and second mappers. (214, 216) according to the selection control signal. A circuit according to claim 12 further comprising compensation means (314) for calculating a compensated mean level by adding a brightness compensation value according to a predetermined correction function to the mean level based on the mean brightness of the input image and wherein said mapping means (316, 318) is arranged for mapping each input sample of each of the sub-images output by the picture memory (300) into a plurality of gray levels on the basis of the cumulative density functions and the compensated mean level. A circuit according to claim 10 or 11, further comprising compensation means (414) for calculating a compensated mean level by adding a brightness compensation value according to a predetermined correction function to the mean level based on the mean brightness of the input image, and wherein said mapping means (416, 418) is arranged for mapping each input sample of each of the sub-images into a plurality of gray levels on the basis of the cumulative density functions and the compensated mean level. A circuit according to claim 16 or 17, wherein said mapping means (316, 318; 416, 418) comprises: a first mapper (316; 416) for mapping the input sample into a gray level from a minimum level X 0 to a compensated mean level B m according to a first transform function which is defined by use of one of the cumulative density functions; and a second mapper (318; 418) for mapping the input sample into a gray level from B m ' to a maximum level X L-1 according to a second transform function which is defined by use of the other one of the cumulative density functions, wherein B m ' = B m + X L-1 /(L-1). A circuit according to claim 16 or 17, wherein said compensation means (314; 414) adds a brightness compensation value which is greater than zero to the mean level when the mean level is less than a first threshold, and a brightness compensation value which is less than zero to the mean level when the mean level is greater than a second threshold. A circuit according to claim 14 as dependant upon claim 12 or claim 18 as dependant upon claim 16, wherein said outputting means comprises: a comparator (118; 320) for comparing the mean level with the input sample from said picture memory (100; 300) to output a selection control signal; and a selector (120; 322) for selecting one of the output levels from said first (144; 316) and second (116; 318) mappers according to the selection control signal. A circuit according to claim 18 as dependant upon claim 17, wherein said outputting means (420, 422) comprises: a comparator (420) for comparing the mean level with the input sample to output a selection control signal; and a selector (422) for selecting one of the output levels from said first and second mappers (416, 418) according to the selection control signal. A circuit for enhancing images as claimed in any of claims 10 to 21, further comprising a buffer (112; 212; 312; 412) for storing the cumulative density functions calculated by said third calculating means (106-110; 206-210; 306-310; 406-410), updating the stored functions by a picture unit, and providing a predetermined number of cumulative density function values to said mapping means. A method or a circuit according to any of claims 1-22 wherein the unit of a picture is a frame or a field.

Inventors: CHO YONG-HUN, KIM YOUNG-TAEK, CHO, YONG-HUN, KIM, YOUNG-TAEK
Applicants: SAMSUNG ELECTRONICS CO LTD, SAMSUNG ELECTRONICS CO., LTD.
Application year: 1997
Main classification: G06T5
IPC codes: G06T5, H04N5