*5.4. Comparative Experiments and Analysis of Other Methods Based on Retinex*

Considering several commonly used image enhancement methods based on Retinex, we used different original side-scan sonar images to verify the stability and advantages of our proposed image enhancement algorithm, and used SSR, MSR, MSRCR, and MSRCP of four commonly used image enhancement methods based on Retinex for comparison with our methods. The parameters of bilateral filter were set as follows: diameter range of each pixel neighborhood was set to 35, sigma-color is set to one-seventh of the height of the original image, and sigma-color represented the sigma value of the color space filter. The larger the value of this parameter, the wider the colors in the neighborhood of the pixel are mixed together. Sigma-space was set to one-seventh of the width of the original image and sigma-spaces represent the sigma values of filters in coordinate space. The larger the sigma values, the more distant the pixels interact with each other. Our other experimental parameters were as follows: *A* was set to 140 and *a* was set to 15. The results are shown in Figure 9. For better illustration and display, we enlarged a local area of Figure 9, as shown in Figure 10.

**Figure 9.** Comparative experiment of common methods based on Retinex. Images enhanced with (**a**) SSR, (**b**) MSR, (**c**) MSRCR, (**d**) MSRCP, and (**e**) using our bilateral filtering method.

The experimental results show that SSR, MSR, MSRCR, and MSRCP produce considerable noise and the image sharpness of the enhancement is very poor and the image corrected by the SSR method cause blurred and excessive corrections. Therefore, these four methods are not suitable for gray correction of side-scan sonar images. The enhanced image color produced using the MSRCR algorithm is more consistent with the original side-scan sonar image color than using the MSR algorithm. The enhancement effect of our method is better than that of the other four methods. The enlarged detail map shows that the detail map of our method is more clear and stable.

To fairly evaluate the image enhancement algorithm, we used the peak signal-to-noise ratio (PSNR), information entropy, standard deviation, and average gradient as the evaluation indexes. PSNR represents the ability of an image enhancement algorithm to suppress noise. The larger the value, the better the ability to noise suppression and the smaller the image distortion. PNSR can be calculated with Equations (10) and (11).

$$MSE = \frac{1}{H \times W} \sum\_{i=1}^{H} \sum\_{j=1}^{W} \left( X(i, j) - Y(i, j) \right)^2 \tag{10}$$

$$PSNR = 10\log\_{10}(\frac{(2^n - 1)^2}{MSE})\tag{11}$$

where *MSE* represents the mean square error of the current image *X* and the reference image *Y*; *H* and *W* are the height and width of the image, respectively; *n* is the number of bits per pixel, which is generally 8, meaning the gray scale of the pixel is 256; and the unit of PSNR is dB.

Information entropy is a measure of image information richness and is calculated as

$$H(X) = -\sum\_{k=0}^{L-1} P\_k \lg P\_k \tag{12}$$

where *L* is the maximum gray level of image *X*, and *Pk* is the number of pixels whose gray value of image *X* is *K*.

The standard deviation reflects the dispersion of all image pixel values to the mean value; the smaller its value, the more balanced the gray distribution of the image. We can calculate standard deviation using Equation (13), where *v*(*xi*) is the gray value of the pixels in the image, *v*(*x*) is the average gray level of the image, and *n* is the number of pixel points in the image:

$$I\_{std} = \sqrt{\frac{1}{n} \sum\_{i}^{n} \left( v(\mathbf{x}\_i) - \overline{v(\mathbf{x})} \right)^2} \tag{13}$$

The average gradient represents the ability to express the details of the image, the image sharpness, and texture changes. The bigger the average gradient, the sharper the edge of the image, and the clearer the image. Average gradient can be calculated with

$$\overline{G} = \frac{1}{M \times N} \sum\_{i=1}^{M} \sum\_{j=1}^{N} \sqrt{\frac{\Delta I\_x^2 + \Delta I\_y^2}{2}} \tag{14}$$

where Δ*I* 2 *<sup>x</sup>* is the gradient in the horizontal direction, Δ*I* 2 *<sup>y</sup>* is the gradient in the vertical direction, and *M* and *N* are the height and width of the image, respectively.

According to the experimental results provided in Table 1, the proposed algorithm is superior to the other four algorithms in PNSR, information entropy, image standard deviation, and average gradient. So, we proved that the enhanced image produced using our algorithm is clearer, the ability to suppress noise is stronger, the gray distribution is more balanced, the image information is richer, and the details of the image are enhanced. Therefore, the image enhancement algorithm in this paper is better than the other three algorithms.


**Table 1.** Objective Evaluation Index of Image Enhancement Algorithms.

We compared the latest image enhancement algorithms based on Retinex theory. The experimental parameters of the algorithms were obtained from the parameters set by the respective authors. We did not change the parameters of the algorithm. We used the smoothing filter and bilateral filter to implement our method, and the experimental parameters were the same as those used above. The experimental code was realized using MATLAB (MathWorks, Natick, US). All the experiments were conducted on a PC running Windows 10 (Microsoft, Redmond, US) OS with 4 G RAM and a 2.4 GHz CPU. In this paper, three different side-scan sonar images were used for experiments, representing three types of side-scan sonar images: (a) An image with a large area of black due to the occlusion of seabed hills (Figure 11a), (b) an image with no black area and more texture (Figure 11b,c) an image with black areas, textures, and hills (Figure 11c).

**Figure 11.** Original side-scan sonar images: (**a**) a large area of black area, (**b**) an image with no black area and more texture, and (**c**) image with black areas, textures, and hills.

(a) (b) (c)

Three different types of side-scan sonar images were compared using low-light image enhancement (LIME), naturalness preserved enhancement (NPE), simultaneous reflection and illumination estimation (SRIE), multi-deviation fusion method (MF), and our two methods with mean filtering and bilateral filtering methods. The experimental results are shown in Figure 12. In terms of enhancement effect, LIME, NPE, SRIE, MF, and the two methods in this paper obviously enhance side-scan sonar images, but the image enhanced by NPS method produces a lot of noise in the dark area of the image. As shown in Figure 13, we enlarged the images of different methods for the second side-scan sonar image. The local enlarged image shows that there are some inadequate corrections at the left and right ends of the image enhanced with the LIME, NPE, SRIE, and MF methods, but no such situation was observed using the two methods in this paper.

**Figure 12.** Side-scan sonar images enhanced using (**a**) LIME, (**b**) NPE, (**c**) SRIE, (**d**) MF, and our method with (**e**) mean filtering, and (**f**) bilateral filtering.

**Figure 13.** Local enlargement of the second kind of enhanced image (**a**) LIME, (**b**) NPE, (**c**) SRIE, (**d**) MF, and our method with (**e**) mean filtering, and (**f**) bilateral filtering.

As shown in Figure 14, the histogram gray value of the enlarged image of the four methods, LIME, NPE, SRIE, and MF, has obvious peaks in the low gray part. However, the two methods in this paper have no obvious peaks in the low gray part of the histogram. LIME, NPE, SRIE, and MF do not effectively enhance the image at both ends and the enhancement effect is not as good as the two methods in this paper.

**Figure 14.** The histograms corresponding to Figure 13: (**a**) LIME, (**b**) NPE, (**c**) SRIE, (**d**) MF, and our method with (**e**) mean filtering, and (**f**) is bilateral filtering.

To better evaluate the performance of the algorithm, we used PSNR, information entropy, standard deviation, average gradient, and algorithm running time to evaluate the image enhancement algorithm as a whole. We calculated the index using the whole enhanced image instead of the local enlarged image. The evaluation index table is shown in Table 2.


**Table 2.** Objective evaluation index of image enhancement algorithms.

Among the PSNR, information entropy, standard deviation and average gradient of the evaluation indexes, our algorithm in this paper is similar to the other four latest algorithms. The information entropy of image enhancement based on bilateral smoothing is the highest, and the information entropy of image enhancement based on mean filtering method is the second. Our algorithm is faster. Our mean filter is the fastest, followed by our bilateral filter, then the MF algorithm, in which our mean

filter method is at least twice as fast as the other methods. The speed of our bilateral filtering method is equal to MF, which is faster than LIME, NPE, and SRIE. We can use the mean filter and bilateral filter to smooth the gray image of side-scan sonar image separately and use the two schemes to enhance side-scan sonar images. The evaluation index shows that the enhancement effect of the bilateral filtering method in this paper is slightly better than that of the mean filtering method, but the mean filtering method takes less time than that of the bilateral filtering method. Therefore, the mean filtering enhancement algorithm is more suitable for online processing situations when the image processing speed is more important, and the bilateral filtering method is more suitable for side-scan sonar image enhancement that requires better image enhancement during offline processing. The side-scan sonar image enhancement algorithm in this paper is simple but not inferior to other high-quality algorithms. The reasons for this situation are as follows: (1) The original side-scan sonar image is a gray-scale image, and there are no R, G, and B channels. The color side-scan sonar image is pretreated by pseudo-color application, so we do not need to use max-RGB technology to obtain the illumination map of the original side-scan sonar image. (2) The key to using the Retinex image enhancement algorithm is to obtain an accurate illumination map. The illumination map needs to smooth the details of the original image as much as possible while maintaining the boundaries of the gray distribution of the original image. So, the other four methods use more complex algorithms to obtain an accurate illumination map, which results in an increase in the running time. However, side-scan sonar images are different from natural illumination images. The gray gradient of the side-scan sonar image changes little, and there is no case of too large a gray gradient. Therefore, it is not necessary to use a complex algorithm to obtain a fine illumination image to ensure that the enhanced image does not display a halo phenomenon. To suppress halo generation, we can achieve the desired effect by increasing the value of *A*. (3) The illumination map produced by the other four methods is not smooth enough, which leads to poor gray level correction and enhancement effect on the left and right ends of the side-scan sonar waterfall image.
