Video Enhancement Technology - Contrast Enhancement

        In image processing, due to the poor quality of the acquired image, it is necessary to improve the image quality through contrast enhancement. The main problem is to solve the problem of low contrast caused by the small gray scale range of the image. The function is to make the gray scale of the image The range is enlarged to make the image clearer. The main contrast enhancement methods include linear transformation, histogram normalization, gamma transformation, global histogram equalization, adaptive histogram equalization with limited contrast, etc.

How to judge image contrast

A. The ratio of the maximum brightness to the minimum brightness

        The contrast of an image refers to the measurement of different brightness levels between the brightest white and the darkest black in the light and dark areas of an image, that is, the size of the gray contrast of an image, that is, the ratio of the maximum brightness to the minimum brightness of the image, and the contrast is defined as:

        Among them, I_max and I_min are the maximum brightness and minimum brightness in the image. The larger the contrast, the clearer and more eye-catching the image, and the more vivid the colors; while the lower the contrast, the whole picture will be gray.

B. Judging the proportion of low-brightness pixels in the entire image

Contrast Enhancement Method

1. Linear transformation

        The linear equation formula is y = a*x+b. For image brightness improvement, x and y are two-dimensional matrices at this time, and the range of image gray levels in the original image is adjusted by coefficient a (referring to The range after the image is converted to a grayscale image [minimum gray value, maximum gray value])

  • When 0<a<1, the gray level orientation of the image is reduced, and when a>0, the gray level range of the image is expanded.
  • When b>0, the brightness increases, and when b<0, the brightness decreases.

2. Histogram normalization

        For linear transformation, the coefficients a and b need to be set by themselves. The normalization coefficient of the histogram is fixed, and the pixel value range of the original image is generally mapped to the [0, 255] range. Assuming that the original image pixel value distribution range is [min, max], then the range after mapping is [0, 255], the corresponding coefficient a = (255 - 0) / (max - min), coefficient b = 0, the calculation formula as follows:

3. Global histogram equalization

        The purpose of histogram equalization is to redistribute the number of pixels of each pixel value of the original image to the 256 pixel values ​​of [0, 255], so that the number of pixels corresponding to each pixel value is approximately equal, that is After reallocation, the number of pixels corresponding to each pixel value of 0-255 is approximately (rows * cols / 256)

4. Contrast limited adaptive histogram equalization

        The histogram equalization in the global histogram equalization method is global, and the effect is not very good when the local area of ​​the image is too bright or too dark; in addition, the global histogram equalization may increase the background noise of the image. Compared with global histogram equalization, adaptive histogram equalization divides the image into non-overlapping small blocks, performs histogram equalization on each small block, and uses local information to solve global problems. However, if there is noise in the small block, it will have a great impact, and it needs to be suppressed by limiting the contrast, which solves the problem of background noise enhancement. Combining these two methods is Constrained Contrast Adaptive Histogram Equalization - CLAHE.

The CLAHE algorithm process mainly has the following steps:

  1. Preprocessing, such as image block filling, etc.;
  1. For each block processing, calculate the mapping relationship, and use the contrast limit when calculating the mapping relationship;
  1. Use an interpolation method to get the final enhanced image;

Try to use the contrast-limited adaptive histogram equalization-CLAHE in the video scene to improve the contrast and clarity of the video. The left side is the original video, and the right side is the contrast-enhanced video. The results are as follows:

 

 

Guess you like

Origin blog.csdn.net/xs1997/article/details/131871178
Recommended