**5. Experiments and Analysis**

In this section, we provide the overall framework of the proposed algorithm, as shown in Figure 3. First, we obtain the gray image from the original side-scan sonar data, or gray the pseudo-color side-scan sonar image to obtain the gray image of side-scan sonar image. Then, the gray image of the side-scan-sonar image is filtered to obtain the smooth image. The constant coefficient *a* is added to the smoothed image as the illumination map *L* in the Retinex model, and then the reflected map *R* is obtained based on an element-wise division using Equation (4). The reflected map *R* is multiplied by a constant coefficient *A* as the enhanced image. Finally, the enhanced gray image is pseudo-color processed to obtain the final gray scale corrected side-scan sonar image.

**Figure 3.** The overall framework of the algorithm in this paper.

#### *5.1. Experiments and Analysis of Parameter A*

The constant coefficient *A* can be adjusted using this method. If a brighter gray scale correction image is needed, the value of *A* can be set higher, and vice versa. We analyzed it through experiments. In the experiment, the size of the original sonar image was 800 × 525 pixels. We set the constant *a* to 15. Then, we smoothed the image using the mean filter. The size of the filter template was set to 1/17 of the size of original image, and *A* was set to 80, 140, and 200.

The experimental results are shown in Figure 4. The results show that the side-scan sonar image corrected using this method can correct the original gray distortion image, so that the image scene information scanned by sonar can be displayed normally. The size of *A* only affects the overall brightness of the enhanced image and does not cause secondary distortion of the enhanced image. The enlarged detail image shown in Figure 5 shows that the gray distortion of the original image is serious. After gray scale correction, the gray distortion of the image disappears, and the texture information of the image is displayed normally. In the experiment, the bigger the value of *A*, the higher the gray value of the corrected image, and the clearer the image. The adjustment of *A* does not affect the overall gray distribution of the enhanced image, but only the overall brightness of the enhanced image. However, when the value of *A* is set too large, the image is too bright, and the enhanced brightness is not suitable for human perception. We did not fix *A* to a size. If different brightness enhancement images are required, adjust the value of *A*. If A must have a fixed value, we recommend A = 140, because we do a lot of experiments in Appendices A and B, A = 140 meets the experimental requirements.

**Figure 4.** Experimental comparison using mean filter. (**a**) Original image and corrected image with (**b**) *A* = 80, (**c**) *A* = 140, and (**d**) *A* = 200.

**Figure 5.** Local enlargement of Figure 4. (**a**) Original image and corrected image with (**b**) *A* = 80, (**c**) *A* = 140, and (**d**) *A* = 200.

#### *5.2. Experiments and Analysis of Parameter a*

In our algorithm, constant *a* is used to suppress the noise. We experimentally analyzed the selection of the *a* value. In the experiment, we set the constant *A* to 140. Then, we smoothed the image using the mean filter. The size of the filter template was set to 1/17 of the size of original image, and *a* was set to 0, 5, 10, 15, 30, 40, and 60.

As shown in Figure 6, when we changed the value of *a* while the other parameters remained unchanged, the noise in the dark area of the enhanced image was amplified with the decrease in the value of *a*, and vice versa. However, since we add *a* to the smoothed original image as the illumination estimation of the original image, when *a* increases excessively, the estimated illumination cannot accurately represent the illumination map of the original image. If the *a* value is too large, the effect of image correction worsens, as supported by our experimental results. The parameters setting of the side-scan sonar may be different in different batches of sonar data, which leads to differences in the image characteristics of side-scan sonars. Thus, the value of *a* is an empirical value. According to our experiment and as shown in the experimental results in Appendix B, the value of *a* is about 15. The value of *a* does not need to be adjusted for the same batch of side-scan sonar images, and different batches may require fine-tuning.

**Figure 6.** Experimental comparison using mean filter. (**a**) Original image and corrected image with and (**b**) *a* = 0, (**c**) *a* = 5, (**d**) *a* = 10, (**e**) *a* = 15, (**f**) *a* = 30, (**g**) *a* = 40, and (**h**) *a* = 60.

### *5.3. Experiments and Analysis of Smoothing Function*

In this algorithm, the gray image from a side-scan sonar can be smoothed using many methods. Bilateral filtering was used to smooth side-scan sonar images, which was compared with the experimental results of mean filtering. In the contrast experiment, *A* was set to 140 and *a* to 15. Figure 7 compares the experimental results produced when using the mean filter and bilateral filter.

**Figure 7.** Experimental comparison of images. (**a**) Smoothed image using mean filter, (**b**) mean method results, (**c**) smoothed image using bilateral filter, and (**d**) bilateral method image.

As shown in Figure 7, the enhanced images produced by these two methods are similar overall, but in terms of image details, the experimental results show that the illumination map *L* produced by bilateral filtering is clearer than the illumination map *L* obtained by mean filtering in the water column area, and the mean filtering is blurred. The smoothed image obtained by bilateral filtering reflects the illumination distribution of the original image better, and the corrected image obtained in the experiment is more stable and clear. To see more clearly, we enlarged part of Figure 7. As shown in Figure 8, because the gray image is smoothed with only the mean filter, the gray image after smoothing has an unclear gray boundary in the region with a large gray gradient. The illumination map smoothed by mean filter cannot accurately express the illumination distribution of the original image, especially around the region with a large gray gradient. Therefore, the corrected image obtained using the mean filter will show some over-enhancement and the halo phenomena in the areas where the gray level of the original image changes too much. The corrected image produced using the bilateral filter is more normal, and there is no halo phenomenon because the map produced with bilateral filtering is more in line with the actual gray distribution of the original image.

**Figure 8.** Comparison of experimental details: (**a**) smoothed image using mean filter, (**b**) mean method results, (**c**) smoothed image using bilateral filter, and (**d**) bilateral method results.
