## 2 Methods
### Acquisition of Crack Defect Candidate Regions  
#### 2.1.1 Centerline Extraction Based on the Steger Algorithm  
The retention of magnetic particles on the surface makes the detection images form a complex textured background. The intensities of crack defects are similar to those of magnetic particles on the surface, which results in low contrast between the defect and background. The crack regions cannot be extracted completely by threshold segmentation of the grey images. By analyzing the geometric characteristics of crack defects and surface magnetic particles, it is concluded that the crack defects are usually linear with a certain width, while the magnetic particle particles are randomly distributed points. Therefore, crack defects in the inspection images can be considered curvilinear stripes.  
The Steger algorithm is one of the most commonly used algorithms in curvilinear stripe center extraction due to its precision and robustness [29]. The center of the curvilinear stripe is given by the extreme point of greyscale in the normal direction. The normal direction of the curvilinear structure is determined by calculating the eigenvalues and eigenvectors of the Hessian matrix as follows:  
\[H(x,y)=\left[\begin{array}{cc}d_{xx}&d_{xy}\\ d_{xy}&d_{yy}\end{array}\right] \tag{1}\]  
In the normal direction, the extreme point of the section grey distribution curve is regarded as the subpixel location. \(d_{xx}\), \(d_{xy}\), and \(d_{yy}\) are the partial derivatives of the image obtained by convoluting the image \(d(x,y)\) with discrete two-dimensional Gaussian partial derivative kernels, which are computed as follows.  
\[d_{xx}=\frac{\partial G(x,y)}{\partial^{2}x}\otimes d(x,y) \tag{2}\]  
\[d_{yy}=\frac{\partial G(x,y)}{\partial^{2}y}\otimes d(x,y) \tag{3}\]  
\[d_{xy}=\frac{\partial G(x,y)}{\partial x\partial y}\otimes d(x,y) \tag{4}\]  
The formula \(G(x,y)\) is a two-dimensional Gaussian convolution kernel, and the values in the kernel are defined as follows:  
\[G(x,y)=\frac{1}{2\pi\sigma^{2}}e^{\frac{-(x^{2}+y^{2})}{2\sigma^{2}}} \tag{5}\]  
where \(\sigma\) represents the standard deviation. \(d(x,y)\) is an image matrix centered on the point \((x,y)\), which is equal to the size of the Gaussian kernel \(G(x,y)\).  
Figure 2: Overview of the bearing ring defect identification method.  
Then, the normal direction of the pixel point \((x_{0},y_{0})\) is given by the eigenvector \((n_{x},n_{y})\) corresponding to the maximum Eigenvalue of \(H(x,y)\) at pixel point \((x_{0},y_{0})\). The gray distribution function in the normal direction of the point \((x_{0},y_{0})\) is expanded by the second-order Taylor expansion, which is computed as follows:  
\[d(x_{0}+tn_{x},y+tn_{y})=d(x,y)+t\cdot(n_{x},n_{y})\cdot(d_{x},d_{y})^{T}+\frac {t^{2}}{2!}\cdot n^{T}\cdot H(x,y)\cdot n \tag{6}\]  
We take the extreme point of gray in the normal direction as the center point. The point can be obtained by setting the first derivative of \(d(x_{0}+tn_{x},y+tn_{y})\) to zero. Therefore, the subpixel center point is \((x_{0}+tn_{x},y_{0}+tn_{y})\), the value of t is shown below:  
\[t=\frac{n_{x}d_{x}+n_{y}d_{y}}{n_{x}^{2}d_{xx}+2n_{x}n_{y}d_{xy}+n_{y}^{2}d_{ yy}} \tag{7}\]  
where  
\[d_{x}=\frac{\partial G(x,y)}{\partial x}\otimes d(x,y) \tag{8}\]  
\[d_{y}=\frac{\partial G(x,y)}{\partial y}\otimes d(x,y) \tag{9}\]