1 Introduction

As we all know, distributed optical fiber sensing technology based on stimulated Brillouin scattering (SBS) is gradually improving in recent years (Zhao et al. 2017; Qian et al. 2016; Sun et al. 2016). But conventional method of scattered data processing has inherent shortcoming such as a long processing time, a poor integrity and complex processes, so the process of scattered data still need a novel technical means to improve (Hotate and Ong 2003; Soto et al. 2016). The common ways to process data mainly include the following: cumulative average (Wang et al. 2014) wavelet transform (Farahani et al. 2012) and the method combined with cumulative average and wavelet transform (Hou et al. 2010).When we use cumulative average, data processing time will be extended with longer sensing distance and average number increased (Azad et al. 2016), which influences the timeliness of the sensor system. Furthermore, the use of wavelet transform cannot meet the requirements of the system. Although the cumulative average and the wavelet transform are combined, too much processing time cannot be avoided in a longer sensing distance (Hou et al. 2010).

In order to avoid a longer processing time in conventional data processing, a novel method in distributed optical fiber sensing system based on SBS has been proposed (Soto et al. 2016). Brillouin scattering data is seen as pixel point of image, and the peak in Brillouin scattering spectrum can be seen as roof edge. Edge detection (Marr and Hildreth 1980; Zhang and Bao 2002; Wang et al. 2017) can sharpen the peak, which will improve accuracy of measurement and make the judgement more intuitive. And this method can achieve less noise (Zhu et al. 2013). Meanwhile, frequency sweeping time is reduced largely, which only spends a cycle (ΔT*) and reduces system measurement time.

2 Principle and method

In image processing, edge detection can sharply reduce data size and eliminate irrelevant information, while retained important structural attributes. Sobel algorithm is a popular edge detection algorithm which is considered in this work. In the edge function, the Sobel method uses the derivative approximation to find edges. Therefore, it returns edges at those points where the gradient of the considered image is maximum. The Sobel operator performs a 2-D spatial gradient measurement on images (Gupta and Mazumdar 2013). This method generally includes three steps: smoothing, sharpening, detection.

2.1 Smoothing

This method is first-order derivative and second-order derivative based on the intensity of the image, so it is pretty sensitive to noise. To solve this problem, smoothing filter is necessary. Assuming that matrix X which can be seen as original data of Brillouin scattering spectrum is filtered by wavelet transform firstly, where a mn represents the amplitude of the pixels, m and n represent the location in the matrix.

$$X = \left( {\begin{array}{*{20}c} {a_{11} } & \ldots & {a_{1n} } \\ \vdots & \ddots & \vdots \\ {a_{m1} } & \cdots & {a_{mn} } \\ \end{array} } \right)$$
(1)

Considering the influence of amount of calculation and the set length on the boundary, a wavelet function called db5 (Daubechies 1992) is used to filter X as the first step, and a matrix{f(ij)}is obtained.

2.2 Sharpening

Next, we use the Sobel operators to sharpen the image and intuitively distinguish location information. The weighted difference of every pixel point’s neighborhood in the matrix {f(ij)}is investigated, the most close is the most weighty. Accordingly, the definition of Sobel operator is as follows:

$$\begin{aligned} s_{i} = & \left\{ {f\left( {i + 1,j - 1} \right) + 2f\left( {i + 1,j} \right) + f\left( {i + 1,j + 1} \right)} \right\} \\ & - \,\left\{ {f\left( {i - 1,j - 1} \right) + 2f\left( {i - 1,j} \right) + f\left( {i - 1,j + 1} \right)} \right\} \\ \end{aligned}$$
(2)
$$\begin{aligned} s_{j} = & \left\{ {f\left( {i - 1,j + 1} \right) + 2f\left( {i,j + 1} \right) + f\left( {i + 1,j + 1} \right)} \right\} \\ & - \,\left\{ {f\left( {i - 1,j - 1} \right) + 2f\left( {i,j - 1} \right) + f\left( {i + 1,j - 1} \right)} \right\} \\ \end{aligned}$$
(3)

The magnitude of the gradient, which represents the change in unit distance, will be larger in the edge. The definition of magnitude of the gradient (G(ij)) is as follows:

$$G\left( {i,j} \right) = \sqrt {s_{i}^{2} + s_{j}^{2} }$$
(4)

In matrix form:

$$s_{i} = \left( {\begin{array}{*{20}c} { - 1} & { - 2} & { - 1} \\ 0 & 0 & 0 \\ 1 & 2 & 1 \\ \end{array} } \right)$$
(5)
$$s_{j} = \left( {\begin{array}{*{20}c} { - 1} & 0 & 1 \\ { - 2} & 0 & 2 \\ { - 1} & 0 & 1 \\ \end{array} } \right)$$
(6)

The operator s i has the most important influence in vertical edges, while s j has the most in horizontal edges. Then we use these two operators to convolve with matrix {f(ij)}. In formula (7). ‘⊗’ represents convolution and the maximum is output as matrix{R(ij)}.

$$\left\{ \begin{aligned} s_{i} \otimes \left\{ {f\left( {i,j} \right)} \right\} \hfill \\ s_{j} \otimes \left\{ {f\left( {i,j} \right)} \right\} \hfill \\ \end{aligned} \right\} \Rightarrow \left\{ {R\left( {i,j} \right)} \right\}$$
(7)
$$\left\{ {R\left( {i,j} \right)} \right\}\left\{ \begin{aligned} R\left( {i,j} \right) \ge TH,R\left( {i,j} \right) \hfill \\ R\left( {i,j} \right) < TH,0 \hfill \\ \end{aligned} \right\} \Rightarrow \left\{ {R^{\prime } \left( {i,j} \right)} \right\}$$
(8)

It is well known that the appropriate threshold should be selected for edge detection (Gupta and Mazumdar 2013). Further, we use adaptive threshold selection based on Stein’s Unbiased Risk Estimate (SURE) to set TH (Bakhtazad et al. 1999).

$$\lambda = \sigma \sqrt {2\log \left( n \right)/n} ,\quad \sigma = MAD/0.6745$$
(9)

The λ has been set and MAD represents the absolute average value of the estimation of the wavelet coefficients in the optimal scale. The constant 0.6745 is the choice of Gaussian distribution. σ and n represent intensity of noise and signal length.

$$ST_{\lambda }^{G} \equiv 1 + \left( {Y^{2} - 2} \right)I\left( {\left| Y \right| \le \lambda } \right) + \frac{{\lambda^{4} + 2\lambda^{2} }}{{Y^{2} }}I\left( {\left| Y \right| > \lambda } \right)$$
(10)

Y is equal to {f(ij)}, I(∘) represents guiding function. There is \(\lambda \,\sim\,{\text{N}}\left( {\theta ,1} \right)\),

$$E\left\{ {ST_{\lambda }^{G} \left( Y \right)} \right\} = R_{\lambda }^{G} \left( \theta \right)$$
(11)
$$R\left( {\hat{f},f} \right) = \frac{1}{n}\sum\limits_{i = 1}^{n} {E\left( {\hat{f}_{i} - f_{i} } \right)}$$
(12)

The SURE of \(R\left( {\hat{f},f} \right)\) is as follows:

$$SURE = \left( {\lambda ;W} \right) = \frac{{\sigma^{2} }}{{2^{J} }} + \frac{{\sigma^{2} }}{n}\sum\limits_{j = 1}^{J} {\sum\limits_{k} {ST_{j}^{G} } } \left( {\frac{{d_{j} ,k}}{\sigma }} \right)$$
(13)

λ = (λ 1, …, λ j ) is noise level correlation threshold, and so the SURE is ultimately as follows:

$$TH = \arg \mathop {\hbox{min} }\limits_{\lambda } \left\{ {SURE\left( {\lambda ;W} \right)} \right\}$$
(14)

2.3 Detection

When we select appropriate threshold as TH, if R(ij) ≥ TH, R(ij) is output and (ij) is the pixels on the edge. If \(R\left( {i,j} \right) < TH\), the corresponding point is zero. Finally, the output points constitute a new matrix named {R (ij)}.

Furthermore, it can reduce measurement time largely by using edge detection to identify the Brillouin scattering spectrum. In conventional optical fiber sensing system based on SBS, frequency sweeping range includes multi frequency, and the data processing time t 1 is about

$$t_{1} =\Delta T \times M \times N$$
(15)

N is amounts of frequency sweeping points, and ΔT represents time of cumulative average only once (includes time of data collection). M stands for times of cumulative average.

In this article, the measuring time t 2is about:

$$t_{2} =\Delta T^{ * } \times N$$
(16)

A sensing period spends ΔT*. And in actual optical fiber sensing system, there is \(\Delta T^{ * } < <\Delta T \times M\), so \(t_{2} < < t_{1}\). The measuring time achieves less.

3 Analysis and discussion

Stimulated Brillouin scattering spectrum is obtained with simulation, as shown in Fig. 1. The peak of Brillouin gain spectrum without noise can be seen as edge of the roof shape, and the brightness has changed significantly at the edge. The sensing distance is 1 km. Additionally, the frequency scanning range is from 9.96 to 10.06 GHz with 10 MHz scanning and the Brillouin frequency shift is set as 10 GHz (Fig. 1). From the theory of optical fiber sensors based on SBS, we know that the scattering signal mainly consists of Gaussian white noise, so the simulated signal is added 75 dB noise for instance (Fig. 2). Note that different signal to noise ratio is corresponds to different filters.

Fig. 1
figure 1

Stimulated Brillouin scattering spectrum obtained by simulating

Fig. 2
figure 2

The simulated signal is added 75 dB Gaussian white noise

In the simulation program, the positions of mutation are preset as 200–400 and 600–800 m and the differences of Brillouin frequency shifts are preset as 0.04 and 0.02 GHz (Fig. 3).

Fig. 3
figure 3

Stimulated Brillouin scattering spectrum with sensing information. The positions of mutation are preset as 200–400 and 600–800 m and the differences of Brillouin frequency shifts are preset as 0.04 and 0.02 GHz

Next smoothing the backscattering signal of SBS is performed (Fig. 4). As is seen from the image, noise has been reduced and the image achieves smooth more.

Fig. 4
figure 4

Stimulated Brillouin scattering spectrum after smoothing by wavelet

Finally, we can use the method of edge detection to process the image signal (Fig. 4) by MATLAB, the final image signal is output after judging by the adaptive threshold (Figs. 5, 6) and the edges has been sharpened (red line).

Fig. 5
figure 5

Stimulated Brillouin scattering spectrum after edge detection

Fig. 6
figure 6

Identification of breaking positions and frequency shifts after edge detection

With the help of MATLAB, the breaking positions (202–402, 603–802 m) and the differences of Brillouin frequency shifts (\(\Delta \nu_{1} = 0.04\;{\text{GHz}}\), \(\Delta \nu_{2} = 0.02\;{\text{GHz}}\)) can be identified intuitively(Figs. 5, 6). The processing time is about 0.0332 s by simulation over 1 km distance. The simulation result shows that the Brillouin frequency shifts along the fiber from 0 to 201, 403 to 602 and 803 to 1000 m identified in Fig. 6 are about 10.014 GHz which is larger than 10 GHz in Fig. 4, it is caused by the convolution operation of Sobel algorithm. But the differences of Brillouin frequency shifts (Δν 1, Δν 2) are changeless.

4 Conclusion

The scattering signal spectrum collected by distributed optical fiber sensing system based on SBS can be identified by edge detection in image processing. The fitting and cumulative average can be omitted and the time of system measurement reduces largely by this method and the research has very important practical value in the field of optical fiber sensing system.