A Segmentation Algorithm of Wear Debris Reflected image Based on Watershed and H-minima Transform for On-Line Visual Ferrograph Analysis

Aiming to solve the problems of identifying the over-brightness and over-dark parts in the reflected light wear debris image, this paper proposed a new OLVF (on-line visual ferrgraph) reflected light wear debris segmentation algorithm. If the wear debris image is bright and dark, the morphological black-hat operation is used to eliminate these interferences. Then the H-minima transform is applied to corrected image local extreme value interference and the threshold is obtain through Otsu algorithm. The watershed algorithm is adopted to separate over-bright and over-dark wear debris. Eventually the morphological dilate corrosion of opening and closing reconstruction is applied to filled holes and connected wear debris profile. On the basis of the above-mentioned method, the OLVF reflected light wear debris are accurate shape and continuous profile in the final result. Compared with other wear debris divide algorithms, the proposed method effectively suppresses the influence of reflected light, and better retain the information of wear debris image. At the same time, the signal-to-noise ratio is 12dB higher than others at the maximum, and the root mean square error is reduced by 0.051 at the maximum.


Introduction
With the continuous development of fault diagnosis technology, more and more sensors are used for online fault monitoring of machines [1] . Online monitoring and fault diagnosis technology has become a significant method to reduce costs and improve efficiency. It will generate wear debris with characteristic tribological information of the wear state of the machine when the machine running [2][3][4] . Therefore, it's necessary to acquire characteristic wear debris information. Imaging technology is widely used to obtain ferrograph for wear debris analysis and equipment wear prediction [5] . Thereinto, the wear debris image segmentation is an essential method which evaluating the wear rate and equipment wear status. High-resolution instruments have also been used to study the characteristics of individual wear debris in two-dimensional and three-dimensional images [6] . It's difficult to identify the characteristic wear debris in the wear debris image only by experience, especially in the ferromagnetic imaging technology. Therefore, traditional wear debris analysis methods cannot quickly and automatically collecting wear debris information [7] .
The gradual maturity of online image acquisition technology makes online analysis of wear debris images and monitoring the wear status of equipment become popular [8] . More and more wear debris image segmentation methods have been proposed. Wu [9] proposed a wear debris recognition method based on wear debris color statistics. According to the intensity and chromaticity distribution of the wear debris, the colors of three common metal wear debris are distinguished. When multiple color wear debris are mixed together, they cannot be accurately divided. In the existing online system, the wear debris will become chains or clusters under the magnetic force in the micro-magnetic field and the identification of wear debris more difficult. Therefore, a morphology-based method for wear debris segmentation is proposed. The watershed method has been widely used in the segmentation of wear debris images, and it can segment images accurately and effectively [10] . Wu [11] proposed an extraction method that uses morphology to segment wear debris. The gray-scale reflected light wear debris image is processed through an improved watershed algorithm, and the wear debris chain is accurately segmented, but the edges of the wear debris are not smooth. In addition, Wang [12] proposed a new algorithm combining principal component analysis and grey relational analysis (CPGA). This algorithm solve the problem of information redundancy caused by multiple parameters quickly and accurately. However, this method has high requirements on the image quality of wear debris, and cannot accurately segment the image of wear debris under the conditions of reflected light interference and oil pollution. The interference of environmental factors and the highly irregular shape of the wear debris make the segmentation of the image of the wear debris a difficult point in the online ferrograph application.
This paper proposes an OLVF reflection light wear debris image segmentation algorithm based on watershed and H-minima transform. First, the reflected light wear debris image is enhanced to show the contours of high-brightness wear debris and over-dark area wear debris. Secondly, Canny edge detection is used to pre-segment the image, and the pre-segmented image is subjected to H-minima transform to correct local extrema. Then, the watershed algorithm is applied to segment the wear debris image. Finally, the expansion and corrosion opening and closing are used to reconstruct the contour of the wear debris and fill the holes. This method identifies the wear debris in the high-brightness and over-dark areas, reduces the excessive segmentation of the watershed, and improves the segmentation accuracy of the wear debris image and the efficiency of online monitoring.

Method for dividing wear debris
The imaging method of the OLVF probe is reflected light imaging, because the reflected light imaging can display the contours of the wear debris and the characteristic topography of the wear debris. However, the reflected light will cause the problem of high brightness and over dark wear debris in the wear debris image. This paper proposes a new method for OLVF reflected light wear debris image segmentation. First, the background subtraction is applied on the original wear debris image to roughly distinguish the wear debris. Then, the morphological black hat operation [13] is used, which is the closed operation result image is subtracted from the original image to enhance the part of the wear debris close to the background color. Superimpose the image after background subtraction and morphological black hat operation to make the wear debris appear more accurately. The Gaussian filtering is used to remove noise interference in the image. The adaptive Canny operator is used to detect the edge of the denoised wear debris image. The Otsu [14] method is used to obtain the threshold of the H-minima transform, and then the H-minima transform is performed to further eliminate local noise interference. Then the watershed transform is used to segment the image after removing the noise. Finally, the segmented wear debris image is opened and closed to reconstruct the discontinuous contour and fill the hole, and the final result is obtained. The schema of the algorithm is shown in Figure 1.

Wear grain image enhancement
The wear debris image is shown in Figure 2. First, the background subtraction operation is performed to obtain the preliminary processed wear debris image. The result is shown in Figure 3(a). The image of wear debris after background removal has noise caused by uneven illumination. The wear debris in the dark is difficult to identify because of low contrast.

Fig 2. Wear debris image
Use morphological black hat to highlight areas that darker than the original image outline, as shown in Figure 3(b). Superimposing Figure 3 (a) and (b) can enhance the wear debris in the dark area, and the result is shown in Figure 3 (c). The Gaussian filtering is applied on the superimposed wear debris image to eliminate noise. The result is shown in Figure 3(d).

Wear debris edge detection and image pre-segmentation
After the wear debris image is enhanced, the adaptive Canny operator edge detection is applied. The main process of Gaussian function filtering includes calculating gradient and amplitude, and constructing gradient histogram. Use the first derivative of the two-dimensional Gaussian function to perform low-pass filtering on the wear debris image. The two-dimensional Gaussian function is: Where k is constant and  control the smoothness of the image. For the enhanced wear debris image, the image gradients in the x and y directions are denoted as ( ) The gradient histogram of the wear debris image is constructed by the above formula.In order to determine the optimal segmentation threshold of the high and low gradient regions in the gradient histogram, the steps of the adaptive Canny algorithm are as follows: 1)Set the initial threshold 0 T ; T to divide the image to generate two sets of pixels: image 1 I is composed of all pixels whose gray value is greater than or equal to 0 T , and image 2 I is composed of all pixels whose gray value is less than 0 After obtaining the best segmentation threshold, image edge tracking is performed to realize edge detection. The result is shown in Figure 4.
The threshold H is obtained by Otsu method. The Otsu algorithm divides the gray histogram into two parts, the wear debris area and the background area, according to a given threshold. Set the threshold with the largest or smallest variance between the two categories as the optimal threshold.
Where W is watershed transformation.

Expansion and corrosion opening and closing reconstruction
Comparing the image after watershed transformation with the original wear debris image, there are still some contour discontinuities and holes. It is necessary to use dilation and corrosion opening and closing reconstruction operations on the watershed transformation image. This operation can reconstruct the discontinuous wear debris profile, filling holes and restore the wear debris profile, and retain the shape information of the wear debris. The expansion-corrosion opening and closing reconstruction includes Open reconstruction is performed on the watershed transform image first, and then close reconstruction. The combination of opening and closing operations keeps the contour of the wear debris intact, filling the holes, and the wear debris are accurately divided.

Qualitative analysis
The segmentation result of the wear debris image of this algorithm is shown in Figure 5. Use online oil wear debris monitoring equipment to randomly acquire reflected light wear debris deposition spectra, and use traditional watershed segmentation algorithm, watershed segmentation algorithm based on Otsu threshold, and watershed segmentation algorithm based on Canny to segment the same wear debris image. The results are compared with the proposed method in this paper, qualitatively evaluated the performance and feasibility of the proposed method, as shown in Figures 7, 8, 9, and 10. The test input image is shown in Figure 6. The results of the method proposed and related methods are shown in Figures 7 to 10. With reference to the input image, a qualitative assessment is made by visually comparing the degree of scattered light removal, artifacts and the appearance of wear debris. The image quality is poor for uneven light environment and oil contamination. Moreover, most of the wear debris pixels have high brightness and similar colors. The color of some wear debris is the same as the background color, and still have the influence of reflected light. Therefore, it is difficult to accurately identify wear debris. For scattered light and artifacts, the wear debris segmentation algorithm based on watershed transform mistakes some artifacts for wear debris, which leads to the phenomenon of excessive separation. It is hard to obtain effective information from the image. The watershed segmentation algorithm based on Otsu threshold mistaken part of the scattered light for wear debris, which leads to partial shadows in the image, and the wear debris are not accurately identified. The scattered light is basically eliminated in the result of the watershed segmentation algorithm based on Canny, but the interference of artifacts is still mistaken for wear debris. The proposed method eliminates the interference of scattered light and artifacts, and can accurately identify wear debris. For the recognition of noise, there is a lot of noise interference in the watershed algorithm, and it is impossible to distinguish which are wear debris. Although the watershed segmentation algorithm based on Otsu threshold removes some noise interference, there is shadow interference, so it is unable to distinguish wear debris from background. The Canny-based watershed segmentation algorithm also has noise interference and cannot accurately identify wear debris. The proposed method effectively suppresses the interference of noise, and the wear debris are clearly distinguished from the background.
Regarding the appearance of the wear debris, although the image is enhanced based on the watershed algorithm, the bright wear debris are mistaken for the background and not recognized. The bright wear debris of the watershed segmentation algorithm based on Otsu threshold were not identified, and some noises were mistaken for wear debris. The watershed segmentation algorithm based on Canny fails to identify the contours of small wear debris, and there is also the problem that bright wear debris are not recognized. The proposed method can identify bright wear debris, as well as fine wear debris. Compared with other methods, proposed method is more accurate and reliable. Experimental results show that the algorithm can effectively identify the location of wear debris and segment them, retaining the edge and texture features of the wear debris image.

Quantitative analysis
The signal-to-noise ratio (SNR) and root mean square error (RMSE) of the processing results of the four different algorithms are calculated to quantitatively illustrate effects of the different algorithms. The results are shown in Table 1. ij, respectively. The larger the signal-to-noise ratio, the better the image quality [15,16] . It can be seen from Table 1 that the SNR of the proposed method is 5-16dB higher than other methods. The root mean square error is 0.003~0.051 lower than other methods. Therefore, the proposed method is more accurate and reliable than other algorithms.

Conclusion
In order to accurately segment the wear debris, this paper proposes an OLVF reflected light wear debris image segmentation method based on the fusion of watershed and H-minima transform. First, The background subtraction operation is used to roughly distinguish the wear debris. Applying the morphological black hat operation to the wear debris image makes the brightness of the dark area in the image increase, and the brightness of the high brightness area is reduced. The image after the background subtraction and the image of the morphological black hat operation are superimposed, and Gaussian