# Haze Removal Based on Refined Transmission Map for Aerial Image Matching
## 2 Physical-Based Image Dehazing and Matching
### Correction of Transmission Map Using Hidden Markov Random Field  
The application of an HMRF-EM algorithm [45; 46; 48] to estimate the transmission map is proposed. The HMRF-EM algorithm improves the transmission map and enhances the dehazing performance based on a double stochastic process that uses the maximum likelihood to remove and smooth the areas of block artifacts. The input image is represented by \(\mathbf{y}=(y_{1},\ldots,y_{N})\) when the intensity is \(y_{i}\). The labels \(\mathbf{x}=(x_{1},\ldots,x_{N})\) are estimated using the HMRF method. Here, \(x_{i}\in L\) and \(L\) is the set of possible block artifact labels. \[\mathbf{x}^{\ast}= \begin{array}{c}argmax\\ \mathbf{x}\end{array} [P(\mathbf{y}|\mathbf{x},\theta)P(\mathbf{x})] \tag{5}\]  
where \(P(\mathbf{x})\) is the prior probability that represents the Gibbs distribution and the probability of joint maximum-likelihood is expressed as follows:  
\[P(\mathbf{y}|\mathbf{x},\theta)=\prod_{i}P(y_{i}|\mathbf{x},\theta)\mathbf{= }\prod_{i}P(y_{i}|x_{i},\theta_{x_{i}}) \tag{6}\]  
Here, \(P(y_{i}|x_{i},\theta_{i})\) is the Gaussian distribution of the variable \(\theta_{x_{i}}=(\mu_{x_{i}},\sigma_{x_{i}})\), and \(\theta=\{\theta_{i}|l\in\ L\}\) is the variable set from the EM method. After determining the variable set, the Gaussian distribution function \(G(z,\theta_{l})\) can be represented using \(\theta=(\theta_{l},\sigma_{l})\) as follows:  
\[G(z;\theta_{l})=\frac{1}{\sqrt{2\pi\sigma_{l}^{2}}}\left(-\frac{(z-\mu_{l})^{2 }}{2\sigma_{l}^{2}}\right) \tag{7}\]  
Next, two assumptions are required that are used to approximate the proposed HMRF-EM algorithm. The prior probability is defined as:  
\[P(\mathbf{x})=\frac{1}{Z}exp(-U(\mathbf{x})) \tag{8}\]  
where \(U(\mathbf{x})\) denotes the prior energy function. The second assumption is as follows:  
\[ \begin{array}{c}P(\mathbf{y}|\mathbf{x},\theta)=\prod_{i}P(y_{i}|x_{i}, \theta_{x_{i}})\\ =\prod_{i}G(y_{i};\theta_{x_{i}})\\ =\frac{1}{Z}exp(-U(\mathbf{y}|\mathbf{x}))\end{array}  \tag{9}\]  
From these two assumptions, the variable \(\theta^{(0)}\) is initialized. The probability distribution \(P^{(t)}(y_{i}|x_{i},\theta_{x_{i}})\) is also estimated. The labels are then estimated using \(\theta^{(0)}\). During this process, the estimation of the maximum a posteriori (MAP) probability is utilized, as shown below. \[ \begin{array}{c}\mathbf{x}^{(t)}=\begin{array}{c}argmax\\ x\in\chi\end{array}\left[P\Big{(}\mathbf{y}|\mathbf{x},\theta^{(t)}\Big{)}P( \mathbf{x})\right]\\ =\begin{array}{c}argmax\\ x\in\chi\end{array}\left[U\Big{(}\mathbf{y}|\mathbf{x},\theta^{(t)}\Big{)}+U( \mathbf{x})\right]\end{array}  \tag{10}\]  
Next, the posterior  
and  
\[P\Big{(}I|x_{N_{i}}^{(t)}\Big{)}=\frac{1}{Z}exp\left(-\sum_{j\in N_{i}}V_{c}\Big{(} I,x_{j}^{(t)}\Big{)}\right) \tag{13}\]  
Next, the variables are updated using the \(P^{(t)}\left(I|y_{i}\right)\) as follows:  
\[\mu_{l}^{(t+1)}=\frac{\sum_{i}P^{(t)}(I|y_{i})y_{i}}{\sum_{i}P^{(t)}(I|y_{i})} \tag{14}\]  
\[\Big{[}\sigma_{l}^{(t+1)}\Big{]}^{2}=\frac{\sum_{i}P^{(t)}(I|y_{i})\Big{(}y_{i }-\mu_{l}^{(t+1)}\Big{)}^{2}}{\sum_{i}P^{(t)}(I|y_{i})} \tag{15}\]  
Equations (5)-(15) are related to the HMRF-EM method. Equations (16)-(20) are related to MAP estimation and edge preservation. Equation (16) is defined to solve \(\mathbf{x}^{*}\) and minimize the posterior energy [48]. \[\mathbf{x}^{*}= \begin{array}{c}argmax\\ x\in\chi\end{array} \left[U(\mathbf{y}|\mathbf{x},\theta)+U(x)\right] \tag{16}\]  
The likelihood energy is defined in Equation (17) as follows:  
\[U(\mathbf{y}|\mathbf{x},\theta)=\sum_{i}U(y_{i}|x_{i},\theta)=\sum_{i}\left[ \frac{\left(y_{i}-\mu_{x_{i}}\right)^{2}}{2\sigma_{x_{i}}{}^{2}}+\ln\sigma_{x _{i}}\right] \tag{17}\]  
The prior energy is defined using \(U(x)\), as shown in Equation (18). \[U(x)\ =\ \sum_{c\ \in\ C}V_{c}(x) \tag{18}\]  
The clique potential is defined as in (19) for the neighboring pixels.