# Role of Restored Underwater Images in Underwater Imaging Applications
## 2 Proposed Restoration Method
### Depth Estimation and Background Light Estimation  
Blurriness map estimation \(p_{\text{blr}}\) is the first process in the restoration process, by estimating the refined blurriness map, through the initial map and rough map of the image [17]. This is then followed by background light estimation. To determine the background light, the input image \(I^{c}(x)\) is segmented into four quadrants, and the mean value of the pixels calculated. Equation (4) is then used to estimate background light \(\widetilde{B}^{c}\),  
\[\widetilde{B}^{c}=\max(I^{c}_{q_{BL}}(x)) \tag{4}\]  
where  
\[I^{c}_{q_{BL}}=q_{mid},\qquad q_{mid}\in\left\{q_{i=\{1,2,3,4\}}-q_{max}-q_{ min}\right\} \tag{5}\]  
The selected pixel, which constitutes the estimated background light \(\widetilde{B}^{c}\), may not be the brightest of all pixels in the entire input image, as two quadrants with extremes light intensity have been excluded from the selection process. The estimated background light \(\widetilde{B}^{c}\) shall be used for the scene radiance recovery using Equation (2). Background light neutralized image \(I^{c}_{BL}(x)\) needs to be estimated to find the depth map of the underwater image. Initially, average light intensity \(I^{c}_{q_{in}}\) in the two quadrants, excluding the two extremes, is determined, and taken as average of the underwater image,  
\[I^{c}_{q_{i}}=avg_{x\in q_{i}}\left(\sum_{c}I^{c}(x)\right) \tag{6}\]  
where \(q_{i}\) is the four quadrants \(i=1,\ 2,3,\ 4\), with \(I^{c}_{q_{i}}\) representing the average light intensity in the respective quadrant \(q_{i}\). The brightest \(q_{max}\) and darkest \(q_{\text{min}}\) quadrants are neglected,  
Figure 2: Flow chart of the proposed method. as they are two extremes of the spectrum. Average light intensity in the remaining two quadrants is then calculated, and taken as average of the underwater image:  
\[I^{c}_{tag}=avg_{q_{l}\in d_{init}}\left(I^{c}_{q_{i}}\right) \tag{7}\]  
This average light intensity \(I^{c}_{tag}\) is then used to modify all the pixels of the input image \(I^{c}(x)\) to retrieve the contrast neutralized image \(I^{c}_{cn}(x)\), as follows:  
\[I^{c}_{cn}(x)=I^{c}(x)+I^{c}_{tag} \tag{8}\]  
To denoise the image, discrete wavelet transform (DWT) is applied on the contrast-neutralized image \(I^{c}_{cn}(x)\) and the gray version of the input image \(I^{\delta}(x)\). Inverse discrete wavelet transform (IWDT) is finally applied to retrieve the background light-neutralized image, with approximation and detailed coefficients modified based on the average of approximation coefficients and max rule applied on detailed coefficients. The blurriness map, background light-neutralized image, and intensity of the red channel can then be used for the depth-estimation process [18]. The maximum intensity of the red channel, known as red channel map \(r(x)\) of the image, is represented by  
\[r(x)=\max_{y\in\varphi(x)}I^{r}(y) \tag{9}\]  
where \(I^{r}\) is the intensity of the red channel and \(\varphi(x)\) is a square local patch centred at \(x\). The factors used for estimating depth are passed through a stretching function given by Equation (10) [18]. \[d_{f(x)}(x)=1-F_{s}(f(x)),\;f(x)\in\{r(x),p_{blr}(x),I^{c}_{BL}(x)\} \tag{10}\]  
where \(f(x)\in\left\{r(x),p_{blr}(x),I^{c}_{BL}(x)\right\}\) can either be the red channel map \(r(x)\), blurriness map \(p_{blr}(x)\) or background neutralised image \(I^{c}_{BL}(x)\), to give \(d_{r}(x)\), \(d_{p_{blr}}(x)\) and \(d_{I^{c}_{BL}}(x)\), respectively. \(F_{s}(\mathbf{v})\) is a stretching function, which accepts vector \(\mathbf{v}\) as its input. \[F_{s}(\mathbf{v})=\frac{\mathbf{v}-\min(\mathbf{v})}{\max(\mathbf{v})-\min( \mathbf{v})} \tag{11}\]  
The final depth estimation can be found by Equation (12),  
\[\widetilde{d}(x)=\theta_{b}\Big{[}\theta_{a}d_{I^{c}_{BL}}(x)+(1-\theta_{a})d _{r}(x)\Big{]}+(1-\theta_{b})d_{P_{blr}} \tag{12}\]  
where \(\theta_{b}\) and \(\theta_{a}\) are \(\theta_{a}=S\big{(}avg\big{(}I^{c}_{BL}\big{)},0.5\big{)}\big{)}\) and \(\theta_{b}=S(avg(I^{r}),0.1))\), respectively; with \(avg(.