[ISP] Defog Algorithm (1)

论文:Optimized contrast enhancement for real-time image and video dehazing

Project and author homepage: http://mcl.korea.ac.kr/projects/dehazing/#userconsent#

Recommend an implementation: https://www.cnblogs.com/Imageshop/p/3925461.html

Suitable for vs2022 and opencv3. Several versions: https://github.com/Accustomer/TheThingsWithImage/tree/main/Code/6_OCEDehazing

Table of contents

1. Summary

2. Core algorithm

2.1 Core idea

2.2 Model

2.3 Image defogging

​Edit 2.3.1 Atmospheric Light Forecast A

2.3.2 Optimal transmission estimation t(x)

2.3.3 Fine-tuning of transmission estimation t

2.3.4 Experimental results

2.4 Video defogging

2.4.1 Temporal coherence

2.4.2 Cost function optimization

​2.4.3 Fast transmission refinement

2.4.4 Experimental results

3. Summary

reference


1. Summary

This paper proposes a fast and comprehensive dehazing algorithm for images and videos containing fog. It is observed that foggy images generally have low contrast, and we inpaint the image by enhancing the contrast. Excessive enhancement of these low contrasts can then truncate pixel values ​​and lead to loss of information. Therefore, we propose a loss function that incorporates both contrast and information loss . By minimizing the loss function, the algorithm not only enhances the contrast but also effectively preserves the image information. Additionally, we extend image dehazing algorithms to video dehazing. We reduce the amount of flicker when dehazing video by computing the correlation of transmittance. The experiment proves the effectiveness of the algorithm and the rapid real-time defogging.

2. Core algorithm

2.1 Core idea

Firstly, a cost function is designed to minimize the contrast while reducing information loss; secondly, the optimal scene depth of each block is found by minimizing the cost function;

For video dehazing, a consistency loss is added to the overall loss function, considering that the scene radiation of an object point is invariant between adjacent frames;

A fast parallel computing method is implemented for fast dehazing.

2.2 Model

Still a conventional dark channel-based model:

2.3 Image defogging


2.3.1 Atmospheric light prediction A


(1) It is found that the pixel variance in the fog area is generally small;

(2) Propose a classification method for opportunity quadtree subdivision: .

  1. We divide the image into four rectangular regions.
  2. Calculate the score of the region score = the average pixel value of each region ➖ the standard deviation of the region.
  3. Divide the area with the highest score into four small areas.
  4. Repeat steps 2 to 3 until the size of the highest score area is smaller than the preset threshold.
  5. Calculate the color vector that minimizes the distance as the atmospheric light value A.

2.3.2 Optimal transmission estimation t(x)

(1) Mean squared error (MSE) contrast [the loss function of the final selected t]

(2) Michelson contrast

Often used for periodic patterns and textures, to calculate the difference between the maximum and minimum values.

(3) Weber contrast

Poor normalization of background color and object color; often English human visual system.

Since the contrast measure is inversely proportional to the transmission value t, choosing a smaller t will enhance the image contrast. However, while enhancing the contrast, there will be loss of image information. According to the author's observation, choosing a relatively large t value will reduce the information loss (information loss).

As shown in the figure, the input pixels are mapped to the output pixels, and the pixel values ​​in the red area will cause information loss.

Therefore, the loss of information should be reduced while enhancing the contrast

The derivation process is omitted.

2.3.3 Fine-tuning of transmission estimation t

Problem (1) : Since our estimation is based on the assumption that the transmitted value of each block is the same, there will be "blocking effect". The authors use guided filtering to solve this problem.

Assumptions:


The optimal parameters for each window W are obtained by calculating the following formula:

 

>>>Corresponding solution : centered window scheme: The window moves pixel by pixel, and the transmission value of each pixel is the average value of t calculated by each window at that pixel.

Problem (2) : The centered window scheme will produce blur, especially in the boundaries of objects with significant depth changes. In the image for a long time as a "halo phenomenon".

>>>Corresponding solution : shiftable window scheme, which can reduce the contribution of unreliable transmission values ​​from edge areas, so blur artifacts can be alleviated.

Notice:

  • Limit t>0.1 (too small will generate noise);
  • Use gamma correction to optimize the image after defogging (there will be some parts that are darker than the original image);

2.3.4 Experimental results


 
2.4 Video defogging

Static image dehazing destroys the time continuity of video, so a fast and time continuous dehazing algorithm for video sequences is proposed.

2.4.1 Temporal coherence

The closer the physics is to the camera, the closer the obtained light is to the original scene light, and the farther away, the closer to the atmospheric light!

In video defogging, the video sequence is first converted to the YUV color space, and then only the luminance (Y) component is calculated to reduce the complexity of the algorithm.

Assumption 1 : Assume that the raw radiance of a scene point is the same between two consecutive image frames:

Hypothesis 2 : Generally, the luminance Ay of the atmospheric light of the entire video sequence is the same, and the environment mutation can be re-estimated in the following way;

Traditional motion evaluation is time-consuming. To save time, we use a simple probabilistic model based on the difference image between two frames:

Note: σ is generally 10.

Therefore, the Temporal coherence of B block is:

Therefore, the loss of Temporal coherence is defined as:

2.4.2 Cost function optimization


2.4.3 Fast transmission refinement

Problems arise: blocking artifacts

Solution: Gaussian window: Pixels around the center of the window have higher weights, while pixels farther from the center have lower weights. The final optimal transfer value for each pixel is then obtained by computing a Gaussian-weighted sum of the transfer values ​​associated with the overlapping windows.

To reduce complexity, the method downsamples an input image when computing the transfer value.

2.4.4 Experimental results


 
3. Summary

In this work, we propose a deazine algorithm based on optimized contrast enhancement. The algorithm first uses quadtree-based subdivision algorithm to select the atmospheric light in the blurred image. Then, due to the low contrast of the blurred image, the algorithm determines the transfer value appropriate for the depth of the scene to improve the contrast of the restored image. However, some pixels in the restored image can be saturated, resulting in information loss. To address this, we incorporate information loss into the optimized transfer computation. Extend static image dehazing algorithms to real-time video dehazing algorithms with temporal coherence cost. Experimental results show that the algorithm can effectively remove haze, restore images well, and realize real-time processing.

reference

Optimized contrast enhancement for real-time image and video dehazing_Queen's Exclusive Domain Blog-CSDN Blog

Guess you like

Origin blog.csdn.net/u013066730/article/details/130871911