Abstract
Surface defects affect the quality and safety of oil seals. It is a challenge to detect such defects in a vision system because of the unequal reflection property of oil seal surfaces and low contrast between the defect and the background. This article proposes a visual detection method (VDM) for oil seal surface defects and outlines two key issues of VDMs. First, we present a superpixel segmentation algorithm based on the significant gray level variation in the radial direction of an oil seal surface image. This image is then divided into several ring belts. Subsequently, considering the reflection inequality and low contrast, we propose a new circumferential background difference algorithm based on the small variation along the circumferential direction of the image. This algorithm eliminates the influence of the reflection inequality and improves the contrast distinction between the defects and the background. The experimental results verify the effectiveness of the proposed method with a recall and precision as high as 95.2% and 86.8%, respectively.
Keywords
Introduction
An oil seal is a mechanical part used for sealing oils. It helps lubricate the output part of a component while keeping the transmission part isolated, as it prevents lubricating oil from seeping. Because an oil seal sealing station is made of rubber, defects, such as burrs, dents, crack, cut mark, and blemish, will occur given the restricted process conditions. Because of such defects, dust would enter the transmission parts and cause lubricating oil leakage. This will significantly reduce the sealing performance and reliability and affect the machinery performance and life expectancy. Therefore, the detection of oil seal surface defects is an important aspect of oil seal production. 1,2 Conventionally, oil seal defects are inspected by trained personnel who scour the production line for potential damages. However, manual inspection is slow, inefficient, and even dangerous. With the advancement in automation, the inspection meets serious challenges. Recently, many studies have been conducted on developing machine vision and image processing techniques to detect oil seal dimensions with some good results.
Jiang and Jiang 2 employed the control chart concept and pixel voting procedure to obtain a feature matrix for the inspected surface and analyzed the feature matrix for defects. However, the parameters were complicated and difficult to control, and the misinspection rate was 17.31%. Recently, Bharathi et al. 3 proposed a rubber oil seal defect detection method based on texture analysis. In this method, an oil seal image is divided into several subimages, and the textural features are extracted from the gray level co-occurrence matrix with different spatial relationships to detect defects in the oil seal. However, texture-based analysis alone is not sufficient to detect the defects. 3 Moreover, the gray level co-occurrence matrix is too complicated to ensure the detection speed and meet real-time requirements. Chen and Zhao 4 proposed a method for burrs detection for sealing rubber ring using window template. Hsieh et al. 5 developed a LabVIEW-based visual dimensional inspection system. Xu 6 applied machine vision to develop a measurement system for oil seals. Jiang and Zhang proposed an inspection algorithm for an oil seal spring based on Gaussian filtering to reduce human operations and ensure consistent product quality. 7 Zheng et al. studied machine vision for inner diameter of skeleton oil seal. 8 However, the methods mentioned above 5 –8 mainly focus on dimensional inspection. Our group has done some research on the dimension 9,10 and detection of oil seal defects. 1,11 –13 Aiming at the geometric characteristics of lip edges and lip faces, we discussed the classification and recognition method using support vector machine and constructed a support vector machine classifier for detecting lip defects in oil seals. 1,12 Liu et al. used median filtering, image segmentation, and a canny operator to preprocess an image and employed mathematical morphology dilation 13 to highlight the defects in lip region. This method was effective in detecting bubble defects but is not known to detect crack, cut mark, and blemish in oil seals.
The surface defect is mainly induced in the inner and outer rings of an oil seal. The surface defects are due to degumming and material shortage as well as equipment failure in the production process. Although this type of defect is not observed in the sealing position and does not directly affect the sealing performance of an oil seal, the deformation or tear of the oil seal is due to this type of defect in the assembly process or during usage. Moreover, it significantly reduces the service life of oil seals. Hence, the detection of surface defects in oil seals is an important aspect of oil seal defect detection. Most studies have conducted visual inspection and processing for lip seals. However, there is little research on surface defects.
To overcome these problems, we propose a detection algorithm for oil seal surface defects based on superpixel segmentation and circumferential difference by analyzing the characteristics of an oil seal image. The simple linear iterative clustering (SLIC) algorithm is used to segment different detection regions. A distinct circumferential difference method is proposed to suppress the inhomogeneous illumination and variation in the surface reflection and enhance the desired defect regions. Thus, the defects can be easily detected with simple threshold binarization.
The novelties and contributions of our article are summarized as follows:
The method to detect oil seal surface defects using superpixel segmentation and circumferential difference is proposed;
The superpixel algorithm SLIC is used to segment different detection regions exactly on the base of priori dimensions;
A circumferential difference method proposed to obtain differential image with two advantages of proportion to the light intensity and uniform background, a simple binary thresholding, can then easily segment the defects and then can remove the influence of light variation and uneven reflection;
The proposed method has shown its effectiveness in the experimental setup and test data sets, as evident in the experimental results.
The remainder of this article is organized as follows. In the second section, a vision inspection system is presented, and the properties of an oil seal surface image are analyzed. The proposed algorithms are described in the third section. The experiment and evaluation results are given in the fourth section. Finally, the conclusions are drawn in the fifth section.
Detection scheme for oil seal surface defect
Analysis of oil seal defects and detection difficulties
In this study, the TC double-lip skeleton oil seal commonly used in transmission systems is taken as the research object. The typical defect characteristics and distribution position in the production are analyzed, and a visual inspection algorithm is designed to detect any defects on the surface of this oil seal. Figure 1 shows an actual image and the profile of the skeleton oil seal. Clearly, the oil seal surface contrast is low, and the gray value distribution is uneven.

Structure of oil seal. (a) Oil seal and (b) cross section of oil seal.
Therefore, it is difficult to detect the defects. Oil seal defects can be classified as lip region defects and surface defects, as shown in Figure 2. The lip region defects, such as burrs and dents, mainly appear in the inner lip mouth, inner lip area, and outer lip edge area. Notably, the inner lip mouth is the sealing position of the oil seal. Burrs and dents in the lip region will cause oil seal leakage. The surface defects, such as crack, cut mark, and blemish in the outer and inner rim areas, will easily lead to tear and deformation in the process of oil package matching, resulting in sealing failure.

Some types of defects: (a) dent, (b) burr, (c) cut mark, (d) blemish.
In a previous study, a method for detecting burrs and dents in the lip region of an oil seal was proposed with good results. 13 This article mainly discusses the extraction and detection methods for surface defects.
The main difficulties in detecting oil seal defects lie in the following aspects:
1) Inhomogeneous background and complex defects
Each region of the oil seal is a ring belt but is in different planes. As such, the different regions have different backgrounds. Moreover, the defect type is complex. This makes it impossible to extract all the defect features using just one method. Hence, it is necessary to detect the defects in each region separately. For this purpose, each region must be accurately divided to avoid mutual interference. Secondly, the gray value in each detection area is unevenly distributed because of reflection and surface oil pollution, which makes image segmentation difficult. 2) Low contrast between background and defect
Most oil seals are made of silica gel or fluorine glue. As the defect area and the defect-free area are black in color, the contrast is low. Because of the limited visual features, most object recognition methodologies that are based on sophisticated texture and shape features cannot be used in inspection systems.
Oil seal surface defect detection method
In this study, a superpixel region segmentation method based on SLIC is used to divide the oil seal into four regions: a lip region, an inner region, a groove region, and an outer region. Based on characteristics, such as the uneven distribution of the gray level along the radial direction and the uniform distribution of the same along the circumference, a background model of the oil seal ring belt is established. A differential image is then obtained by subtracting the background image from the original image. Finally, the differential image is binarized using an adaptive threshold value. Thus, any surface defect is detected. Figure 3 shows the flowchart of the detection method.

Flowchart of defect detection.
Multidetection region segmentation method based on superpixel segmentation
Because of the random gray-level distribution of the oil seal on the belt and the vibration due to the belt movement, the location of the oil seal and the extraction of the detection area are the main factors in the defect detection method. As shown in Figure 4, the oil seal is divided into a lip region with an inclined plane between

Definition of each region of oil seal.
Superpixel-based simple linear iterative clustering algorithm
Achanta et al.
14
proposed an SLIC algorithm based on color proximity and spatial distance relationship. Firstly, the color image is transformed into 5D vector [
where
After the initial clustering, the clustering center
where
The main advantages of SLIC are summarized as follows: (1) the generated superpixels are compact, and the neighborhood features are easy to express; (2) not only color image can be segmented but also gray image can be segmented; and (3) there are very few parameters to be set. By default, only one number of presegmented superpixels is needed. (4) Compared with other superpixel segmentation methods, SLIC is more ideal in terms of running speed, compactness of superpixel generation, and contour keeping.
Multidetection region extraction method based on superpixel segmentation and prior dimension information
In this study, the SLIC superpixel segmentation method is used to extract each detection region with the prior dimension information of the oil seal. Figure 5 shows the flowchart.

Flowchart of superpixel segmentation algorithm.
The superpixel number (

Different circumferential region. (a) Original image of oil seal, (b) superpixel segment by
To reduce the computational complexity, the center and radius of a circle can be fitted based on the boundaries of one region obtained by cluster segmentation, and the radii of the other regions can be obtained from the prior geometric dimensions of the boundaries of each region.
The fitting contour is obtained by determining the roundness of each boundary contour. The roundness calculation method is as follows
where
The experimental results show that the outer boundary of the inner ring region has the highest roundness, and the boundary is the metal skeleton of the oil seal, which makes it difficult to deform. The contour of the boundary is complete, and it is not affected by surface defects. Therefore, the outer boundary of the inner ring belt is selected to fit the center and radius of the circle.
The commonly used methods for circle fitting include the centroid method,
15
Hough transform,
16
and least squares method.
17
In this study, the least squares method is used to fit the circle and find its center, as it is fast and accurate.
18
The fitted radius of the oil seal is
According to the preacquired image, the inner and outer diameters of each detection region are calibrated offline, and the ratio
Oil seal detection method based on circumferential difference
Image analysis of oil seal
Because of the structural characteristics of the oil seal, the image of the surface of the oil seal shows a uniform gray level in the circumferential direction and a significant variation in the gray level along the radial direction.

(a–e) Gray value curve of radial and circumferential crossing lines.
Next, an effective oil seal surface defect detection method is proposed based on the properties of the oil seal image.
Circumferential difference for defect detection
1) Background modeling
Based on the fact that the gray level of the oil seal image varies in a narrow range along the circumference, the mean gray level along each circumference is calculated and a background model is established
where

(a) Image of outer zone and (b) its background image.
2) Background differencing
The differential image is obtained by subtracting the background image from the original image of the oil seal as follows
Figure 9(b) shows the differential image. The difference image has the following properties
Property 1: the difference image has a linear relationship with light intensity.
According to Phong illumination model 19 and camera photoelectric conversion model, image pixel value can be expressed as follows 20
where

Original and differential image and two circumferential lines across them and their profiles. (a) Outer ring zone and two across circumferential lines, (b) differential image, and (c) two circumferential lines across original and differential image and their profiles.
For any image,
where
Then, the background image can be expressed as
where
By introducing equations (7) and (8) into equation (5), it is concluded that
It can be seen from equation (9) that the difference image has a linear relationship with the light intensity.
Property 2: the difference image has the property of zero mean
Property 3: the difference image has uniform background
Under the compensation of an annular light source, the reflectivity of the image on the same annular band is the same. When there is no defect, the variance of each ring in the differential image approaches zero. Therefore, the differential image has a uniform background, making it easy to separate the defect from the background.
Figure 9(a) and (b) shows the original image and the corresponding differential image, respectively. Clearly, the original image is heterogeneous; in contrast, the differential image has a single background. Hence, the influence of reflection inequality is eliminated.
Moreover, Figure 9(c) shows the gray-level profiles (
3) Threshold segmentation
As shown in Figure 9(c), the gray level is largely the same, except in the defect and fluctuating regions of the differential image. Therefore, the defects can be segmented using a single adaptive threshold, which is defined as follows
where
Because the differential image has zero mean value property, that is,
Substituting formula (9) into equation (11), we can get the following results
It can be seen from equation (12) that there is a linear relationship between the threshold and the light intensity. Therefore, when the difference image is compared with the threshold size,
Figure 10 shows the binary image. It can be seen from the figure that the defect can be well segmented, but there is noise in the image.

Binary image.
4) Attribute-based filtering
From the result of the binary image, we can see that the defects can be detected using the adaptive threshold. However, the original regular texture of the outer ring of the oil seal is also detected with the gray level approximation of the defect. Fortunately, the texture features have invariance in terms of the length and area. Therefore, the defect area can be detected by open and close operation, connected region extraction, statistical pixel number of each region, and fitting length, if there are abnormal length and area, which is the defect area, as shown in Figure 11.

Defect image.
Experiment
In this study, the black skeleton oil seal with an inner diameter of 20 mm, an outer diameter of 30 mm, and a groove width of 7 mm was selected as the testing object to detect and analyze the surface defects in the outer ring belt. The visual inspection system for oil seal defect comprises a 1.4-megapixel CCD industrial camera (DH-SV411FC), a Computar telecentric lens (TEC-M55), and a circular surface light source, which are used to compensate for the illumination of the system. Figure 12 shows the experimental platform.

Visual detection experimental platform.
The real data of 100 oil seals with 120 surface defects from our own developed inspection system were used to evaluate the performance of the algorithms. Figure 13 shows the region segmentation and defect detection of the oil seal image collected by the platform. As shown in the second column of Figure 13, the zonal region is exactly segmented by the superpixel segmentation SLIC algorithm on the base of priori dimensions. The third column in the figure illustrates the zonal background differential image is evenly distributed, except in the defect parts, and the defect can be segmented using a single adaptive threshold, as shown in column 4 of Figure 13. Meanwhile, it also shows that it is not affected by illumination variation and uneven reflection. The experimental results verify the effectiveness of the algorithm.

Result images. Note: From left to right: (1) original images, (2) background images of the ring belt, (3) differential images of the ring belt, (4) binary images, and (5) defect images.
A quantitative analysis of the proposed algorithm is carried out with real images. Two indices, recall (
where TP denotes the number of correct detection, FP is the number of false detection, and TN is the number of correct and undetected. The obtained average values of recall and precision are presented in Table 1.
The average results of recall and precision.
Conclusions
In this article, an oil seal defect detection algorithm based on superpixel segmentation and circumferential difference is proposed by analyzing the characteristics of an oil seal surface image. Considering the significant variation in the radial direction of the oil seal surface image, an oil seal region segmentation algorithm based on SLIC was designed for detection region segmentation. Based on the fact that the variation in the oil seal surface image along the circumferential direction is small, a circumferential difference method based on the mean value was designed to detect the defects in the separated outer region. This method helped reduce the influence of reflection inequality due to the oil seal structure. Furthermore, to eliminate the unwanted noises, an attribute-based filter was employed in the postprocessing stage.
The experimental results show that the proposed method could effectively complete the segmentation of each detection area of the oil seal and detect surface defects. The recall of the defects reached 95.2%, and the precision was approximately 86.8%.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed the receipt of following financial support for the research, authorship, and/or publication of this article: This work was supported by the National Natural Science Foundation of China [62073299 and 62003312], Science and Technology Innovation Team and innovative talent support plan of universities in Henan Province [20IRTSTHN017], and Key Science and Technology Program of Henan Province [Nos 202102210306 and 202102110125].
