# A 4K-Capable FPGA Implementation of Single Image Haze Removal Using Hazy Particle Maps
## 2 Haze Removal with Hazy Particle Maps  
The atmospheric scattering model, proposed by [PERSON] [24], is widely used to describe the formation of hazy images and is expressed as follows [6]:  
\[I(x,y)=J(x,y)t(x,y)+A(1-t(x,y)), \tag{1}\]  
where \((x,y)\) denotes the pixel locations in the hazy image \(I\), the haze-free image \(J\) as well as the transmission map \(t\), and \(A\) represents the global atmospheric light. Unfortunately, only the \(I\) value is known in this equation. The goal of haze removal algorithms is to identify robust estimators of \(A\) and \(t\) to restore \(J\) according to Equation (1). When white balance is performed correctly in an ideal environment, the haze looks completely white [7]. It means that the global atmospheric light \(A\) can be set to one (\(A=1\)). Then, the atmospheric scattering model is rewritten as follows:  
\[\hat{I}(x,y)=J(x,y)t(x,y)+1-t(x,y), \tag{2}\]  
where \(\hat{I}\) is the white-balanced image calculated using Equation (3) and \(wb(\cdot)\) refers to the operator denoting white-balance processing, which was described in Reference [7]. [PERSON] et al. defined a new variable termed hazy particle maps, shown in Equation (4), representing the haze distribution of the hazy image. Since the haze distribution correlates with the scene depth, it can change abruptly along the corners or lines of observed objects. Hence, the mHMF that preserves corners and edges can be used to estimate the hazy particle map, which is assumed to show positive values of the minimum color channel at each pixel [11]. The following equations are adopted to obtain the scene radiance:  
\[\hat{I}(x,y)=wb(I(x,y)), \tag{3}\]  
\[H(x,y)=1-t(x,y), \tag{4}\]  
\[\hat{H}(x,y)=k_{h}mhmf\Big{(}min_{RGB}\Big{(}\hat{I}(x,y)\Big{)}, \tag{5}\]  
\[J(x,y)=\frac{\hat{I}(x,y)-\hat{H}(x,y)}{1-\hat{H}(x,y)}, \tag{6}\]  
where \(\hat{H}\) stands for the estimated value of the hazy particle map \(H,k_{h}\) represents a weight factor of \(0\leq k_{h}\leq 1\), \(mhmf(\cdot)\) denotes the operator of mHMF, and \(min_{RGB}(\cdot)\) is the operator choosing each pixel'sminimum value. The last step is to perform adaptive tone remapping to expand the dynamic range of the recovered scene radiance _J_[25]:  
\[EL(x,y)=L(x,y)+G_{L}(x,y)W_{L}(x,y), \tag{7}\]  
\[EC(x,y)=C(x,y)+G_{C}(x,y)W_{C}(x,y)+128, \tag{8}\]  
where \(EL\) denotes the expanded luminance, \(L\) is the input luminance, \(G_{L}\) represents the luminance gain, \(W_{L}\) stands for the adaptive luminance weight, \(EC\) refers to the enhanced color, \(C\) is the input color, \(G_{C}\) is the color gain, and \(W_{C}\) is the adaptive color weight. Readers can refer to Reference [25] for a detailed description on the calculation of luminance/color gains and adaptive weights. A block diagram of the hazy particle map-based algorithm is shown in Figure 1. It comprises four consecutive steps: white balance, hazy particle map estimation, scene radiance recovery and adaptive tone remapping. \(EJ\) is the dehazed output image composed of \(EL\) and \(EC\) with expanded dynamic range. It can be seen from the block diagram in Figure 1 and Equations (3)-(8) that the haze removal using hazy particle maps is a fact and efficient algorithm, since the most complicated operation is solely the mHMF in the white balance and hazy particle map estimation blocks. Other computations are simple and then can be done in constant time. For an image of size H \(\times\) W and the mHMF of window size N \(\times\) N, the complexity of this approach is O(H \(\times\) W \(\times\) N\({}^{2}\)\(\times\) logN) when using brute-force implementation of mHMF, where logN refers to the binary logarithm of N. Fortunately, the mHMF operation can be done in constant time by virtue of the constant time median filter provided by Reference [26]. In this context, constant time means that the filtering operation is independent of the window size. Therefore, the algorithmic complexity of [PERSON] et al. 's algorithm is a linear function of the number of image pixels O (H \(\times\) W).