# Underwater Degraded Image Restoration by Joint Evaluation and Polarization Partition Fusion
## 2 Underwater Degraded Image Restoration Methods
### Joint Estimation of Target Light Polarization  
Cosine similarity, also known as cosine distance, is a measure of the difference between two images; it uses the cosine of the angle between two vectors in a vector space. A cosine value close to 1 indicates that the angle tends to 0, and the more similar the two vectors are, and a cosine value close to 0 indicates that the angle tends to 90 degrees, and the less similar the two vectors are. When images are similarly presented as a vector, the similarity of two pictures is characterized by computing the cosine distance. The cosine similarity algorithm transforms the feature set of each image into vectors in a high-dimensional space, and the cosine of the angle between two vectors can be effectively used to determine the similarity of two images.  
\[\cos(\theta)=\frac{\sum_{i=1}^{n}(S_{i}*B_{i})}{\sqrt{\sum_{i=1}^{n}(S_{i})^{2} }*\sqrt{\sum_{i=1}^{n}(B_{i})^{2}}} \tag{32}\]  
Figure 4: Polarization difference diagram.  
EME (Edge Model Estimation) is the expression of the degree of local gray scale variation of the image; the stronger the local gray scale variation of the image, the more detailed the representation of the image, and the higher the calculated EME value [20].  
\[EME=\left|\frac{1}{K_{1}K_{2}}{\sum_{l=1}^{K_{2}}\sum_{k=1}^{K_{1}}20\log\frac{i _{max\_k,l}^{\omega}(x,y)}{i_{min\_k,l}^{\omega}(x,\ y)}}\right| \tag{33}\]  
According to Equation (33), the image is divided into \(K_{1}\times K_{2}\) small regions, and the logarithmic mean of the ratio of the largest to the smallest values of gray scale in each small region is calculated. The result obtained is the evaluation result. \(EME\) is often used to measure the quality of an image; the larger the value of \(EME\), the better the quality of the image.  
Using Iterative EME to estimate the target light polarization, in the range of 0 to 1, in steps of 0.01, is a common method. However, the estimation of the polarization of the target light only by EME also suffers from certain drawbacks. In most cases, when the polarization of the target light is too low, the image is poorly observed subjectively, with little structural and detailed similarity to the original image, but at this time, the image has a high EME value, which interferes with the use of EME to accurately estimate the polarization of the target light, as shown in Figure 5.  
To this end, a method for joint estimation of target light polarization by cosine similarity and EME is induced in this paper; comparing the target light (S) and the backscattered light (B), the target light polarization is first pre-estimated using cosine similarity in the range of 0 to 1, iteratively with a step size of 0.01. The initial optimized selections were screened to exclude cases where the estimation result had a low structural and detail similarity to the original image, but the result had a high EME value. Next, after screening, the EME was used to iteratively estimate the target polarization within the optimized selection area in steps of 0.01 to determine the final estimate. The specific process is shown in Figure 6 below.  
Figure 5: (**a**) Using traditional EME method to estimate Ptar. The estimation results have low structural and detail similarity, but have high EME values; (**b**) EME single estimated target light polarization curve, where the horizontal coordinate represents the value of polarizability, and the vertical coordinate represents the value of EME.