Histogram equalization

As point operators refers to a broad class of image processing operations in digital image processing, which - compared to local and global operators - are characterized in that in all methods of this class, a new color or gray value of a pixel solely a function of its own previous color or gray value and its own previous position is calculated in the picture without having to take care of his neighborhood and / or the context of the pixel.

  • 5.1 Correction of inhomogeneous illumination
  • 5.2 window function
  • 6.1 Literature
  • 6.2 External links

classification

Under the heading of point operators to find various frequently used methods of digital image processing such as Levels, contrast enhancement, brightness correction, etc., and visualization together, and, accordingly, ranging far is also the area of ​​application of point operators in a typical image processing system:

They usually represent the first step of preprocessing in order to enhance the image contrast or to compensate for exposure errors during image acquisition. Segmentation of an image is often achieved by the application of a global thresholding. Following the segmentation, the objects found are often classified, that is, in individual classes " sorted ". In the visualization of the results of segmentation or classification for humans the process of Pseudokolorierung or false color representation are common.

In addition to the point operators that transform each pixel of an image individually, there is in digital image processing with local operators and global operators, two other classes of image processing operations. Local operators calculate a new color or gray value of a pixel is always based on a neighborhood or a localized region around the pixel. Here may be mentioned as examples rank operators or morphological operators. Global operators consider the transformation of each pixel of the entire still image, which is the case for example, in the Fourier transform.

Most point operators belong to the class of low-level operators. In this class are all primitive preprocessing such as noise reduction or contrast enhancement are summarized. A low-level operator distinguished in that both the input and the output is an image. In contrast, there are the mid-level operators that compute a segmentation of an image and extract features of the segments, and the high-level operators that analyze the interaction of the objects detected in the image and try to understand the image.

General definition

A dot operator T assigns an input image f by transforming the gray values ​​of each pixel to a resulting image f *. The gray scale value f (x, y ) of a pixel (x, y) is possible only in dependence on the gray scale value itself, and possibly modified by the position of the pixel in the image:

Is to transform the position of the pixel in the image dependent, it is inhomogeneous. The indices x and y are intended to illustrate this dependence of T. In the majority of cases, however, are homogeneous transformations for use, in which this dependence is not given. The indices are then superfluous:

About the reversibility of such transformations can not make a general statement. Some method presented below, such as the negative transformation are reversible without any restrictions. Some other method, such as the histogram spread, are reversible as long as a continuous gray scale is present. However, if the common practice in discrete gray values ​​are used (see application), rounding errors occur and the transformations are not reversible from a strictly mathematical point of view. In most cases, the rounding errors affect only very small, and since the human eye the subtle difference between two adjacent gray values ​​normally can not perceive the inverse of the transformation results in subjectively again the original image. Finally, there are some methods such as the limiting histogram that are not reversible, as in the application information irretrievably lost.

A dot operator can also be used as an operator on a neighborhood of size 1 × 1, ie a single pixel, construed, and therefore represents the simplest form of a neighborhood operator

Application

In practice, the input image has an operation in most applications is a grayscale image with a discrete domain. The value " 0" stands for " Black ", the value "G" for " white". So G represents the largest possible gray value and is calculated for a picture of the color depth n bits according to the formula:

For n = 8 bit, 12 bit or n = n = 16 bits, the three most common grayscale image formats, G is therefore 255, 4095 or 65535.

The alternative to a discrete gray value scale is a continuous scale. In such an image, there are theoretically infinite number of gray values ​​, which are represented by floating-point numbers, typically in the range of values ​​. The term " discrete " means that the image a discrete gray scale is based, while means a continuous scale " in Continuous ".

In the application of a homogeneous point operator on an image scale with discrete transform in practice is often not calculated separately for each pixel. It is enough to transform any gray value once and store it in a so-called lookup table. The transformation result for each pixel must be looked up in the table only.

Example: An image of size 640x480 is composed of 307,200 pixels. Instead of over 300,000 gray values ​​to transform one comes with a color depth of 12 bits, for example, with 4096 conversions for all values ​​of the lookup table. However, In addition there are 307,200 write accesses to the table. For simpler methods, such as the negative transition, in which only a simple subtraction is performed, the transform of a pixel requires less computing time than the table look-up. The use of lookup table is worthwhile only for compute-intensive transformations such as the histogram spreading.

Since homogeneous spot operators, the use of a look-up table is in principle possible, defined in the previous section, transformation T of the gray value f (x, y) of a pixel (x, y ) to f * (x, y) generally as the transformation of a be formulated gray value g to g *:

Homogeneous image of the gray values ​​g of the input image to the gray values ​​g * in the resulting image can be described by a so-called transformation curve which is given in discrete by the lookup table. It is generally not linear but monotonic over its domain, the gray scale, which also represents their range of values. In the field of digital image processing, the transformation characteristic tone curve is called.

The statistical frequency of the different gray values ​​in the input and in the resulting image can be displayed graphically using histograms. They allow statements about the occurrence of gray values ​​, the contrast and brightness of an image and the quality of a possible image segmentation using a threshold method.

The imaging behavior of a point operator may be clearly illustrated with reference to a gray-level histogram of the input image that is superimposed with the transformation law characteristic used. This representation has the advantage that it is relatively easy to read, which the gray value of the input image is mapped to which gray value in the resulting image ( see example ).

Almost all presented in the following procedures are applicable in principle to color images. One possibility is to calculate from the various color channels of a picture a common gray scale image and to transform this to the desired point operator. The result in this case is, however, itself a grayscale image. Somewhat more complicated it is, if the resulting image should be a color image. For a transformation of each color channel, for example red, green and blue channel when using the RGB color space, leading to unsightly to false results. If so, a conversion of the RGB image to the YCbCr color model. The Y- channel, which represents the brightness, can then be transformed, such as a grayscale image. Subsequently, the image must then back to RGB color space to be back calculated.

Homogeneous standard transformations

Below are some homogeneous point operators are presented below, the. In digital image processing, some of them in digital image processing, often apply

The most homogeneous transformations can be divided into two classes: The first class includes the methods, their transformation curves look the same no matter which image they are applied. These include the negative transformation, power transformation, the Logarithmustransformation and the exponential transformation ( for a comparison see figure ). The second class, the method can be summarized, their transformation characteristics are calculated based on the gray value histogram of the input image, so the histogram shift histogram spreading, the histogram boundary and the Histogrammäqualisation. Only the thresholding and the Pseudokolorierung can not fit into this classification.

Without loss of generality, it is angegommen below for all the images that they are gray-scale images with a discrete range of values. All presented methods are also applicable to floating-point grayscale images. In this case, account for the rounding and normalization factors have to be adapted.

Negative transformation

The inversion of the gray values ​​of a gray-level image is called negative transformation. Since the human visual system subtle differences between gray values ​​in different brightness ranges perceives differently well, a negative transformation for better perception of fine structures can result. The resulting image is a negative, as it is known from analog photography. It can be easily computed by a simple subtraction is performed for each pixel:

This transformation is in contrast to most of the other both in the continuous and in the discrete, without limitation, by repeated application reversible:

Histogram transformation characteristic

Negative image after transformation

Histogram

Power transformation

The power transformation (also called gamma correction ) is a monotonic transformation based on a power function. With this method, the brightness change of an image by a non-linear spreading is performed for a part of the gray scale values ​​, while the other part is non-linearly compressed.

The parameter specifies the exact behavior of the transformation. If selected, the transformation forms a small number of gray values ​​at the lower end of the scale to a larger range of values ​​from (the area is spread ), while the remaining gray values ​​are projected onto a correspondingly smaller area (this area is compressed ). The image is brightened by the result. This behavior is more pronounced, is the smaller. If selected, the transformation behaves exactly the opposite. A large number of gray values ​​at the lower end of the scale is so compressed and then spread a corresponding smaller number at the upper end of the scale. Thereby, the image is darkened more stronger, is the greater. The special case is the identity function, i.e. the image is not modified by the transformation. The transformation characteristics for various parameters are shown in the figure above.

Since the transformation must be applied to the range of values ​​, the gray values ​​are first normalized by dividing by g G thereon. After the exponentiation with the exponent, the result is normalized to the desired range by multiplying by G and a rounding:

The reversal of the power transformation is possible in a continuous, without limitation, by a subsequent application by the reciprocal value of the parameter. In Discrete although it can be calculated only approximately, due to the rounding errors:

The power transformation offers the possibility of gray scale or color characteristics of technical devices to manipulate (eg digital camera or monitor ). This is necessary to adjust the recording or imaging behavior of gray or color values ​​of the individual device to another. In this way, also the brightness profile of a monitor on the logarithmic brightness perception of the human visual system can be adjusted.

Logarithmustransformation

The Logarithmustransformation is a monotonic transformation on the basis of the logarithm. It depicts a small gray value range in the lower range of the scale in the input image to a larger gray value range in the resulting image, while the upper gray scale data to be compressed. So the image will total brightened.

Since, the value range of gray values ​​g in front of the logarithm must by adding 1 are mapped first to the area. To obtain the logarithm of a result in the interval, is thus used as a base. Multiplication by G and rounding the result finally normalized again to the desired area:

The associated transformation characteristic is shown in a figure above. The reversal of the Logarithmustransformation is possible in Continuous without limitation by applying the exponential transformation. In Discrete although it can be calculated only approximately due to rounding error.

The Logarithmustransformation is often applied after a Fourier transform of an image for the purpose of visualization of the power spectrum. In such spectra there are many individual points, which have a greater by many orders of magnitude spectral density than the rest. A simple normalization of all values ​​to the range would in such a case means that these outstanding points would be represented with value G and all remaining points with value 0 (see example below). By Logarithmustransformation high densities are weakened so far that in the spectrum after the normalization is actually something can be seen. Note that in this application the maximum occurring thickness must be used as a base of the logarithm. In contrast to above, the addition of 1 n, and if the density of a point should have the value 0, it must be simply mapped instead of a logarithm to 0.

Exponential transformation

The exponential transformation is a monotonic transformation on the basis of the exponential function. It depicts a small gray value range in the upper range of the scale in the input image to a larger gray value range in the resulting image, while the lower gray values ​​of the scale are compressed. So the image will total darkened.

The division by G normalizes the gray values ​​g to the value range. The range of values ​​of the power function is represented by the subtraction of 1 to the desired range:

The associated transformation characteristic is shown in a figure above. The inverse of this transformation is possible in Continuous without limitation by applying the Logarithmustransformation. In Discrete although it can be calculated only approximately due to rounding error.

Histogram shifting

Histogram shift is a simple procedure for the regulation of the brightness of an image. In this case, all gray values ​​g of the image by a fixed constant c on the gray scale in the light or dark area to be moved:

The histogram shifting is not reversible, as more gray values ​​are " pushed out " of the scale. An exception is the case when the deferred gray level area in the image was unused.

Histogram transformation characteristic

Image after histogram shift with c = -64

Histogram

Histogram spreading and deformation-

The histogram spreading, also called input levels, is a common method for contrast enhancement in low-contrast gray-scale images. In such images, many gray values ​​of the gray scale did not occur. The larger the unused areas at the two edges of the scale, the greater the distance between the darkest and lightest gray value can be increased, the more so the gray values ​​can be " pulled apart " in the image.

The calculation of the gray values ​​is done by means of a piecewise linear transformation that maps the gray value range used on the entire available area:

The reversal of the histogram spreading, the histogram compression ( Tonwertreduktion ), is possible in Continuous without restriction. In Discrete although it can be calculated only approximately due to rounding error. It reduces the contrast in the image by " collapses " the gray values ​​in the image closer. In the discrete case, the number of gray levels used is reduced because of adjacent gray values ​​are mapped to a single gray value. Due to this loss of information, the histogram compression is not reversible in the discrete. It takes place in the digital image processing application rather rare.

Histogram transformation characteristic

Image after histogram spreading

Histogram

Histogram boundary

Is in a gray-scale image a differentiated view of a particular gray value range is desired, then a histogram boundary can be performed. The gray values ​​below and above this range, or " clipped " by to 0 ( black ) or G ( white) are shown. The remaining gray scale values ​​are then passed through a suitable process, typically a contrast histogram spreading amplified:

The histogram limit is obviously associated with a loss of information because it depicts many gray values ​​to black or white in most cases. Therefore, it is not reversible.

Histogram transformation characteristic

Image after histogram limitation and spreading

Histogram

Histogrammäqualisation

The Histogrammäqualisation (including histogram equalization, Histogrammeinebnung, Histogrammegalisierung or Histogrammequalisierung ) is an important method for contrast enhancement in grayscale images, which goes beyond a mere contrast enhancement. It is calculated from a uniform distribution of the gray value distribution in the histogram, so that the whole available range is optimally utilized.

This method is particularly in such cases, the application for which the interesting areas of the image a relatively large part of the image represent ( the corresponding gray values ​​above average so often happen ) and their gray values ​​are limited to a small range of the gray scale.

Unlike a histogram boundary with subsequent histogram spreading, where, although the contrast in interesting gray value range is amplified, the information is out of range, however, completely lost, at the Histogrammäqualisation frequent gray values ​​" pulled apart " ( the gray scale is stretched in these areas ) and less frequent gray values ​​" pushed together " ( the gray scale is compressed in these areas ).

Such a beautiful uniform distribution as in the adjacent schematic representation will, however, never achieved in practice. The histogram of the resulting image is rather more or less large gaps included (see example below). This is because that a discrete gray value can be mapped to only one other discrete gray value and not " pulled apart ". If a gray value very frequently, so will no longer occur on the gray scale according to the uniform distribution in the image its direct "neighbors".

As the basis for determination of the transformation curve, the so-called cumulative gray level histogram of the image is used. This is calculated by the sum of the relative frequencies of g H of the gray values ​​is mapped to G 0 each gray value:

This cumulative gray level histogram represents a sequence of values ​​in the interval dar. By multiplying each follower with G and subsequent rounding results in the transformation curve with values:

The Histogrammäqualisation is lossy, since larger areas of the scale with gray values ​​lower frequency to a few gray values ​​are compressed. Therefore, it is not reversible.

Histogrammhyperbolisation

After a Histogrammäqualisation the gray values ​​in the resulting image are indeed uniformly distributed, to a human observer but this often seems too bright is because the brightness sensation of our visual system is not linear but logarithmic. By Histogrammhyperbolisation instead of a - äqualisation the gray values ​​are adjusted to the subjective human perception:

The transformation characteristic of the uniform distribution is displaced slightly in the direction of a hyperbolic curve. The dark gray values ​​get a higher probability than the light, the image is darkened by a total of. can take values ​​from the interval. Are usual values ​​of up to, for the corresponding Hyperbolisation the Äqualisation. Is dispensed the gray scale value 0, may be achieved by a logarithmic probability distribution of the gray values.

Since the Histogrammhyperbolisation based on the irreversible Histogrammäqualisation and similar lossy, it is also not reversible.

Global thresholding

Global thresholding methods are frequently used in the image segmentation for use. Each pixel of a gray -scale image based on its gray value is one of two classes assigned. In this way the foreground, for example, often separated from the background or to distinguish between different bright objects. The boundary between the two classes is determined by a threshold t:

The application of the threshold leads to a binarization of the image, that is, the resulting image contains only the values ​​0 and 1 set retained the color depth of the image, the gray values ​​alternatively to 0 ( black) and the largest possible gray value G can ( white) are shown:

However, such a separation can only function optimally when a bimodal histogram is present as in the example below, so if there are two local maxima in the histogram. To select an optimal threshold value there are different approaches, the most famous being the Otsu method is probably the most non-trivial.

In addition to the global there are also local thresholding. However, these are not point operators, for with them the threshold values ​​based on a small image region or a neighborhood individually for each region and each pixel is determined individually.

Additional information on this topic can be found in the article thresholding.

Pseudokolorierung

The Pseudokolorierung is a process for coloring intensity images, such as thermal imaging to make small differences in brightness within an image more visible. This is done by a mapping of the definition range of the intensity values ​​(which can be considered as gray values ​​) to a high-contrast color scale. Each intensity value g is assigned to it a vector:

The composition of the vector is determined by the color space used. In this case, the three components are R *, G *, and b * for the red, green and blue color in the RGB color space.

A problem that must be taken into account in this method is the difference in brightness perception of the human visual system to different colors. Humans, for example, takes on a yellow surface much brighter than a blue surface of equal intensity exercise. Therefore, the selection and sequence of each color is not arbitrary for the color scale. Subjectively, " dark colors " such as blue or purple, are used at the lower end of the scale, whereas the " bright colors " are placed at the upper end of the scale. That's very nice to see on the example opposite, where the right of the colored thermal image of a dog with the used color scale is shown. Since the sequence of the individual colors is not trivial, they often can not be described by a simple function. Therefore, in this method, a look-up table is typically used, which is called in this particular case also color map.

It is also possible to map the color values ​​of a color image to another color scale. This so-called false color display works similarly to the Pseudokolorierung, only with the difference that each color component vector on another vector is assigned to:

Inhomogeneous standard transformations

Inhomogeneous point operators are generally much less frequently used than the homogeneous operators. This is due to the fact that the applications are just not as often given, and secondly to the fact that the implementation of many methods is non- trivial. In the following two selected simple inhomogeneous transformations are presented.

Correction of inhomogeneous illumination

In scientific trials, the experimental set-up including image capture, for example, images of cell cultures or microscopy images of cells in liquid, various interference effects can occur which interfere with further processing of the images sometimes significantly. Despite a high burden on the experimental setup and the utmost care is so ( even if only minimally ) where non-uniform illumination of the scene always. A further source of interference is small dust particles on a lens or the glass front of the CCD sensor. Although these are taken very out of focus because the focus of the camera is in another area, and are not directly visible in the image, but absorb light and reduce the brightness in one part of the picture. Another problem with devices with digital recording technology, especially when inexpensive CMOS sensors are used, is a non-uniform sensitivity of the individual photoreceptors.

All of these effects make it difficult to image analysis, in particular the segmentation of objects and background. This can go so far that the background in some areas is darker than the objects and a segmentation with a global threshold is completely impossible. However, a reference image was taken before or after the experiment, so a picture of unevenly lit scene under experimental conditions, but without objects, the interference effects described above can be eliminated and the resulting image is ideally a white background with homogeneous brightness. Calculates there is f by pointwise division of the test image by the reference image and subsequent normalization to the desired range of values ​​:

This process is possibly even more applicable when a series of experiments, there is no reference image. Because when the received objects are small and randomly distributed in the images, there is the possibility of a mean value of a plurality or all of the images of the series to be used as reference image.

Window function

For the calculation of the Fourier transform of an image, this is assumed to be periodic. If, however, a possible periodicity not given, ie have the left and right or the top and bottom of the picture different brightness or structures occurs, then a periodic repetition of discontinuities at the edges. These are in the range as high spectral densities along the axes visible (see example below). In the application of secondary operations in Fourier space, such as a convolution with a smoothing operator, these high densities can significantly disturb.

The interference effect can f by multiplying the image with a suitable window function w, which takes values ​​in the interval and the margin of the picture falls from the center to 0, be avoided:

In the exemplary use of a cosinous window (as in the example below) results in the following transformation rule, wherein X and Y represent the number of pixels in the x and y direction:

Of course, also the entire spectrum changes slightly by the windowing of the image.

Fourier spectrum of the image ( high spectral densities along the axes )

Fenestration of the sample image

Fourier spectrum of the windowed image

Credentials

277878
de