Image Brightness and Color Balancer

Application scenarios

  1. Poor on-site light conditions (such as: uneven on-site light source, dark on-site environment without make-up light, too strong ambient light, etc.)
  2. The quality of the 2D image is poor, and the project that requires the use of 2D image is required
  3. Prioritize the use of Mech-Eye’s 2D parameters for image optimization, and when the image brightness and color equalizer in Vision Step are still poor, you can use the image brightness and color equalizer in Vision Step to adjust the 2D image

The software adapts the color adjustment according to the captured photos, controls the color distribution of the image, and makes the image achieve the effect of color balance. The picture has no obvious features (too dark, too bright, uneven lighting, severe color cast), and the deep learning recognition effect is not good, so you can use software to adjust the picture with adaptive color balance. The software algorithm will adjust the adaptive parameters of the image (highlights, shadows, hues, brightness, etc.) through the brightness and color of the image. Due to the changeable ambient light on site, the adaptive adjustment parameters are adjusted according to the original RBG of the image, which improves the quality of the picture less and is rarely used in practical engineering applications.

CLAHE (Contrast Limit Adaptive Histogram Equalization)
The image is chunked, and then each piece of the image is equalized to enhance the contrast of the image and suppress noise. When the illumination of the picture is uneven, the picture is partially too bright or too dark, and the background noise of the picture is strong, you can use CLAHE for image adjustment. The parameter clip limit in CLAHE is the clipping limit value of CLAHE, and its value represents a multiple of the average pixels of the histogram grouping of each chunked image, when the number of pixels in a group exceeds this multiple value multiplied by the value of the histogram grouping average pixel (that is, the limit value), it means that the number of pixels corresponding to the grayscale of the group needs to be cropped. When the clip limit value is 1, the original image will be output. The recommended range of values is between 2-4.

Manually adjust the brightness of the photo and the offset of the red, green and blue colors to adjust the picture. For example, when there is light pollution or haze in the outdoor environment, the overall tone of the picture will be yellow, and the color adjustment of the picture needs to be corrected for its color cast and saturation. By adjusting the color balance, the problem of color cast and impermeability can be solved. Because the ambient color tone has deviated from the real color of the environment itself due to the influence of fluorescent lamps, flashes and other light effects, such as the use of incandescent lamps with high color temperature, which will lead to a warm environment, then the corresponding white balance preset will be cool, canceling out the warm color brought by incandescent lamps. Yellow and blue are contrasting colors, reduce the effect of yellow is to increase its contrasting color, that the environment is warm is yellow, white balance preset will make the picture blue, so that the displayed image color shift is canceled, the adjustment principle of color balance is to increase or decrease its contrasting color to eliminate the color cast of the picture. At present, field engineering applications are mostly black and white pictures, so this item is also less used.

Nonlinear operations or inverse operations are performed on the brightness of light or tristimulus values, and the brightness of the image as a whole is adjusted by modifying the gamma value. The attenuation of the light is inversely proportional to the square of the distance of the light source, and gamma correction is required to adjust the brightness of the picture when the light is uniform (or does not pay attention to the image contrast) and the brightness of the displayed picture is too low. (PS: Brightness is a physical quantity that indicates the actual feeling of the human eye on the luminous or reflected light intensity of the surface of the luminous body or the illuminated object, and the brightness and light intensity are not the same.) When the end result of any two surfaces being photographed is the same, or when both surfaces appear to be equally bright by the eye, they are the same brightness. A gamma value of 2.2 indicates that the grayscale perceived by the human eye is converted into a real grayscale in nature, which is a standard approximation. When the gamma value is 1, the output image is the original image, when the gamma value is greater than 1, the higher the gamma value, the greater the brightness of the picture, and the opposite effect when the gamma value is less than 1.

image (5)

Illumination Normalization
Image standardization is to realize centralized processing of data through deaveraging, and change the standard value of picture illuminance to process pictures. In general, this image processing method is not commonly used, but when using deep learning for image classification or object detection (for face recognition), we do not pay attention to the brightness of the image, but pay more attention to the content of the image. In image classification or object detection tasks, the overall brightness of the image does not affect what objects are present in the image, and different lighting changes do. At this time, using the image standardization processing method on the picture and subtracting the statistical average of the data can remove the common parts, sharpen the edges of the object, and highlight individual differences.

According to the scene environment and the application scenarios of each method, CLAHE (Contrast Limit Adaptive Histogram Equalization) and Gamma Correction are the two adjustment methods most commonly used in our projects, mainly for the adjustment of image contrast and brightness.