Keywords

1 Introduction

At present, people are constantly exploring the application field of smart perception, among which the application field of underwater robot is expanding, including ocean exploration and ocean development. The sonars installed on underwater robots can obtain sonar images for the smart perception of underwater objects. In general, the contrast of the sonar images is low. It is not conducive to the subsequent sonar image segmentation and target recognition. The sonar image contrast enhancement refers to improving the contrast of the image, making the dark region of the image darker and the bright region brighter, so as to highlight the target region, facilitating machine recognition and human eye observation. At present, there are many methods applied to image enhancement, among which gray scale transformation, histogram equalization and unsharp masking method [1] are traditional classical algorithms, but have their disadvantages. In the literature [2], an image enhancement method based on fuzzy gray scale transformation is proposed. According to the characteristics of poor contrast of sonar images, the traditional fuzzy enhancement algorithm is improved to achieve the effect of stretching gray scale range and improving the contrast of image. Literature [3] proposed a new gray scale enhancement method of sonar image. Firstly, the sonar image is divided into low gray scale region, medium gray scale region and high gray scale region by using the statistical feature of gray scale histogram. Then, the method of piecewise nonlinear enhancement is used to enhance the contrast of the sonar image. The multi-resolution analysis method based on the wavelet transform has become an effective way for image contrast enhancement [4]. Literature [5] used the discrete wavelet transform to enhance the contrast of sonar image. The sonar image contrast enhancement based on wavelet transform uses the wavelet technology to divide a sonar image into low-frequency and high-frequency sub-bands. Most of the information of the image corresponds to the low-frequency sub-band, and the detail information of the image such as edges and noise features corresponds to the high-frequency sub-band. Hence, different sub-bands are processed with different ways for image contrast enhancement.

Usually, the speckle noise is strong and the contrast is low of the sonar image, which is not conducive to the subsequent image segmentation and target recognition. Therefore, the sonar image contrast enhancement is a necessary step in the process of sonar image. This paper intends to investigate the application of gray scale transformation, histogram equalization, unsharp masking and discrete wavelet transform method in the contrast enhancement of sonar images.

2 Image Contrast Enhancement Method

This paper introduces four methods for image contrast enhancement, which are the gray scale transformation, the histogram equalization, the unsharp masking and the discrete wavelet transform.

2.1 Gray Scale Transformation

The gray scale transformation is a simple and classic method for image contrast enhancement. This method directly adjusts the gray value of pixels in the image. The grayscale piecewise linear transformation is adopted in this paper, and the formula is:

$$y = \left\{ {\begin{array}{*{20}l} {(c/a)x} \hfill & {0 \le x < a} \hfill \\ {[(d - c)/(b - a)](x - a) + c} \hfill & {a \le x < b} \hfill \\ {[(255 - d)/(255 - b)](x - b) + d} \hfill & {b \le x \le 255} \hfill \\ \end{array} } \right.$$
(1)

where x and y represent the gray value of pixel before and after the image contrast enhancement, respectively, a, b, c and d are constants. This function is used to convert the gray value of most pixels of the original image from the interval a to b to the interval c to d, to improve the contrast of image. The gray value of pixels of the image are centrally distributed between a and b, and the values of a and b can be obtained on the gray value histogram. In addition, c and d can be adjusted according to actual needs.

2.2 Histogram Equalization

The histogram equalization is also a common method for image contrast enhancement. This method changes the histogram of the image into a form of uniform distribution. This increases the dynamic range of pixel gray values and enhances the contrast of image.

2.3 Unsharp Masking

The unsharp masking technique [1] was first used in photography to enhance the edges and details of an image. Its basic principle is: firstly, the fuzzy image is obtained by the process of fuzzy passivation (the equivalent of using a low-pass filter) for original image, then the fuzzy image is subtracted from the original image and the result is multiplied by the correction factor, finally, the original image is added to the above results, so that to improve the image high-frequency component, and enhance the image. The formula of the unsharp masking method can be expressed as:

$$f\left( {i,j} \right) = x\left( {i,j} \right) + C \times \left[ {x\left( {i,j} \right) - m\left( {i,j} \right)} \right]$$
(2)

where C represents the correction factor, x(i, j) represents the original image, m(i, j) represents the fuzzy image, and f(i, j) represents the enhanced image.

2.4 Discrete Wavelet Transform

The wavelet basis selected is represented by ψ(x), and the wavelet function ψa, b(x) is obtained after translation and expansion transformation for ψ(x).

$$\psi_{a,b} (x) = \left| a \right|^{ - 1/2} \psi \left( {\frac{x - b}{a}} \right)$$
(3)

where a, bR and a ≠ 0 is the scale factor, b is the translation factor. The wavelet function and the scale function are related by the double scale equation, in accordance with Eq. (4):

$$\psi \left( x \right) = \sqrt 2 \sum\limits_{k = - \infty }^{\infty } {h\left( k \right)\varphi \left( {2x - k} \right),k \in Z}$$
(4)

where φ(∙) is the scale function, and the filter sequence {h(k)}∈L2(Z), L2(Z) is a finite space. The fourier transform of the scale function has the property of low-pass filter, while the fourier transform of the wavelet function has the property of high-pass filter.

Let the low-pass filter in the discrete wavelet transform be U and the high-pass filter be T. For the one-dimensional discrete wavelet decomposition of the signal, firstly, the signal passes through the low-pass filter U and the high-pass filter T, and then the low-frequency and high-frequency components are obtained by down-sampling operation. The discrete wavelet reconstruction of signal is the inverse process of decomposition. Firstly, the up-sampling operation is carried out for the decomposed low-frequency and high-frequency components respectively, then the reconstructed signal is obtained through low-pass filter and high-pass filter.

Suppose the original signal bj, bj+1 represents the low-frequency component and cj+1 represents the high-frequency component, then the decomposition formula of the discrete wavelet transform of the signal is as follows [6]:

$$\left\{ \begin{aligned} & b_{j + 1} = D_{\varepsilon } Ub_{j} \\ & c_{j + 1} = D_{\varepsilon } Tb_{j} \\ \end{aligned} \right.$$
(5)

where DƐ is the down-sampling operator. Then, the low-pass filter U* and the high-pass filter T* required in signal reconstruction are the dual operators of U and T, respectively. The discrete wavelet reconstruction formula of the signal is:

$$b_{j} = Z_{\varepsilon } U^{ * } b_{j + 1} + Z_{\varepsilon } T^{ * } c_{j + 1}$$
(6)

where ZƐ is the up-sampling operator. The decomposition and reconstruction process of the discrete wavelet transform of signals is shown in Fig. 1 [7]:

Fig. 1
figure 1

Discrete wavelet decomposition and reconstruction of signals

The above is the discrete wavelet transform of one-dimensional signal, while the present paper is concerned with the two-dimensional image. Just like the decomposition and reconstruction principle of the one-dimensional signal, the two-dimensional image is only divided into row direction and column direction, that is, firstly, the low-frequency and high-frequency components are obtained by the original signal passing through the low-pass filter and the high-pass filter in the row direction, and then, the obtained components in the previous step are passed through a low-pass filter and a high-pass filter in the column direction, respectively. After the discrete wavelet transform, the original image will get the low-frequency sub-band LL, and the high-frequency sub-bands LH, HL and HH in the horizontal, vertical and diagonal directions. The decomposition and reconstruction process of two-dimensional images by discrete wavelet transform is shown in Fig. 2 [4].

Fig. 2
figure 2

Discrete wavelet decomposition and reconstruction process of a two-dimensional image

The original sonar image was decomposed by discrete wavelet transform to obtain four sub-bands of LL, LH, HL and HH, namely low-frequency sub-band, horizontal high-frequency sub-band, vertical high-frequency sub-band and diagonal high-frequency sub-band.

Wavelet transform is used to decompose the image into high-frequency sub-band and low-frequency sub-band. In this paper, the image contrast enhancement is realized by enhancing the low-frequency sub-band coefficients and decreasing the high-frequency sub-band coefficients. In this paper, the low-frequency sub-band coefficients is increased to 1.35 times, and the high-frequency sub-band coefficients is reduced to 0.75 times.

3 Experimental Results and Analysis

In this paper, four methods are used to enhance a sonar image: gray scale transformation, histogram equalization, unsharp masking and discrete wavelet transform.

The experimental results are shown in Fig. 3. Figure 3(a) is a sonar image of a manmade object. Figure 3(b)–(e) are the enhancement results obtained with various methods. For enhancement by the gray scale transformation, a = 40, b = 130, c = 10, d = 200. For enhancement by unsharp masking, the correction factor is C = 2. For enhancement by discrete wavelet transform, two-layer discrete wavelet transform is adopted. The Symlet wavelet (the compact-supported orthogonal wavelet with approximate symmetry) is selected.

Fig. 3
figure 3

Experimental results of sonar image contrast enhancement

In addition, in order to further compare the above methods, the contrast [8] and the signal to noise ratio (SNR) of image are selected as objective evaluation criteria.

The higher the contrast of image is, the more obvious the improvement degree of the contrast is. The higher the SNR of image, the less the image is affected by noise and the higher the image quality. The experimental data are shown in Table 1.

Table 1 Objective evaluation indexes for the four image contrast enhancement methods

In terms of subjective evaluation, the results are shown in Fig. 3. The gray scale transformation method and histogram equalization method enhance the contrast of image obviously, but enlarge the noise in the image to a great extent. The unsharp masking method is not good at improve the contrast and suppress the noise of image. Discrete wavelet transform method is not ideal in improving contrast of image, but it is outstanding in suppressing noise. The data in Table 1 can reflect the effect of contrast enhancement to some extent.

4 Conclusion

The gray scale transformation method and histogram equalization method can not suppress the noise effectively while enhancing the contrast of sonar image. The unsharp masking method is not ideal in contrast enhancement and noise suppression. Discrete wavelet transform method is not so good at enhancing image contrast, but it can suppress the noise well, which is very helpful for sonar image processing in later stage. In the following research, the stationary wavelet transform can be used to enhance the image contrast. The stationary wavelet transform is an improvement of the discrete wavelet transform, which can effectively avoid the image edge distortion. Based on the stationary wavelet transform and combined with the corresponding image enhancement methods, the sonar image is enhanced to improve the overall visual effect of the image.