A method and system for detecting edge collapse of a neodymium iron boron magnetic steel sheet based on polarized light
Patent Information
- Application Number
- CN202611080362.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-08-18
AI Technical Summary
例如,公开号为CN119762430A的中国专利申请公开了一种钕铁硼磁铁表面缺陷检测方法及系统,该方法搭建封闭暗箱式图像采集平台,采用灰度共生矩阵提取图像特征,并基于深度学习模型进行缺陷检测,然而该方案仅采用灰度共生矩阵这一单一纹理特征提取方式,特征表达能力有限,难以有效区分外观相似的各类缺陷,且未针对崩边这一特定缺陷类型的棱边检测场景进行专门设计
Smart Images

Figure CN122597412A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of defect detection technology, specifically to a method and system for detecting edge chipping of neodymium iron boron magnet sheets based on polarized light. Background Technology
[0002] Neodymium iron boron (NdFeB) magnets are an important permanent magnet material widely used in motors, sensors, medical devices, and other fields. During the production and processing of NdFeB magnet sheets, various defects may occur on the surface due to factors such as raw materials, process parameters, and equipment conditions. These defects include cracks, peeling, corrosion, coating defects, and dimensional deviations. Edge chipping is particularly common because NdFeB materials are brittle powder metallurgy sintered materials, and it is easily generated at the edges during cutting, grinding, and handling.
[0003] Currently, defect detection of NdFeB magnet sheets mainly relies on manual visual inspection and image processing methods based on white light illumination. For example, Chinese patent application CN119762430A discloses a method and system for detecting surface defects of NdFeB magnets. This method builds a closed dark box image acquisition platform, uses gray-level co-occurrence matrix to extract image features, and performs defect detection based on a deep learning model. However, this scheme only uses gray-level co-occurrence matrix as a single texture feature extraction method, which has limited feature representation capabilities and is difficult to effectively distinguish various defects with similar appearances. Furthermore, it is not specifically designed for edge detection scenarios, such as edge chipping, a specific defect type.
[0004] For example, Chinese patent application CN118583876A discloses a defect detection system and method for neodymium iron boron (NdFeB) blank products. This scheme achieves defect identification through image acquisition and threshold comparison. However, this scheme uses a fixed threshold for defect judgment, lacks adaptability, and has poor robustness when facing defects generated by different batches and under different lighting conditions. The above schemes are all based on conventional white light illumination for image acquisition. However, the surface of NdFeB magnet sheets is usually coated with metals such as Ni or Zn. Under white light illumination, this coating produces strong specular reflection, causing the weak scattering signal of the chipped edge area to be severely submerged by the bright background. Conventional grayscale or color features are difficult to effectively extract the accurate boundary information of the chipped edge.
[0005] Polarization imaging technology can distinguish defects from the background by utilizing the physical difference between the high linear polarization maintained by the specular reflection of the intact coating and the depolarization effect produced by the scattering of the rough surface of the chipped edge. However, existing polarization detection schemes face the bottleneck of extremely large dynamic range between the strong polarization reflection of the coating and the weak polarization scattering of the chipped edge. Conventional sensors cannot simultaneously acquire both effectively in a single exposure. They usually need to rely on multiple exposure fusion or fixed threshold segmentation to cope with this. The former sacrifices the detection cycle and has the risk of motion artifacts, while the latter lacks the ability to adapt to batch fluctuations in the coating and is not robust enough. Neither of these can meet the needs of high-speed production lines for high-precision real-time detection of chipped edge defects. Summary of the Invention
[0006] This application provides a method and system for detecting edge chipping of neodymium iron boron magnet sheets based on polarized light, so as to at least solve the above-mentioned technical problems existing in the prior art.
[0007] According to a first aspect of this application, a method for detecting edge chipping of NdFeB magnet sheets based on polarized light is provided, comprising: Step 1: performing polarization physical parameter calculation and dynamic range logarithmic compression on the original polarization array data acquired by a single exposure of the edge region of the NdFeB magnet sheet using a split-plane polarization camera under dark-field polarization illumination to obtain a logarithmic light intensity map and a linear polarization degree map of the magnet sheet; Step 2: constructing a joint phase space of light intensity and polarization degree from the logarithmic light intensity map and the linear polarization degree map of the magnet sheet to obtain a scatter set of polarization feature phase space points; Step 3: ... Step 4: Based on the Gaussian distribution parameters of the edge-breaking defect clusters, the logarithmic intensity map and the linear polarization degree map of the magnetic steel sheet are identified as edge-breaking defect clusters by performing expectation-maximization iterative clustering on the scatter point set of polarization feature phase space, and the clusters with low logarithmic intensity mean and low polarization degree mean are identified as edge-breaking defect clusters. Step 5: Based on the Gaussian distribution parameters of the edge-breaking defect clusters, the phase space Mahalanobis distance mapping and contrast reconstruction are performed on the logarithmic intensity map and the linear polarization degree map of the magnetic steel sheet to obtain the high-contrast reconstruction map of edge-breaking defects. Step 6: Subpixel edge extraction and contour output are performed on the high-contrast reconstruction map of edge-breaking defects to obtain the subpixel edge-breaking contour data of the magnetic steel sheet.
[0008] According to a second aspect of this application, a polarized light-based edge chipping detection system for NdFeB magnet sheets is provided, comprising: a parameter calculation module for performing polarization physical parameter calculation and dynamic range logarithmic compression on the original polarization array data acquired by a single exposure of the edge region of a NdFeB magnet sheet by a focal plane polarization camera under dark-field polarization illumination to obtain a logarithmic light intensity map and a linear polarization degree map of the magnet sheet; a phase space construction module for performing light intensity-polarization degree joint phase space construction on the logarithmic light intensity map and the linear polarization degree map of the magnet sheet to obtain a scatter set of polarization feature phase space points; and a clustering recognition module. The system is used to perform expectation-maximization iterative clustering on the scatter set of polarization feature phase space points, and to identify clusters with low mean log intensity and mean polarization degree as edge-break defect clusters based on coating optical priors, and to extract the Gaussian distribution parameters of the edge-break defect clusters; the contrast reconstruction module is used to perform phase space Mahalanobis distance mapping and contrast reconstruction on the log intensity map and linear polarization degree map of the magnetic steel sheet based on the Gaussian distribution parameters of the edge-break defect clusters to obtain a high-contrast reconstruction map of the edge-break; the contour extraction module is used to extract sub-pixel edges and output contours from the high-contrast reconstruction map of the edge-break to obtain sub-pixel edge-break contour data of the magnetic steel sheet.
[0009] Compared with existing technologies, the polarized light-based method and system for detecting edge chipping defects in NdFeB magnet sheets provided in this application have the following technical advantages: Through a dual nonlinear mapping mechanism of logarithmic compression and phase space probability weighting, the problem of the coating specular reflection signal overwhelming the weak polarization scattering characteristics of the chipped edge is effectively solved, resulting in an order-of-magnitude improvement in the contrast between the chipped edge area and the intact coating background. Simultaneously, the adaptive clustering mechanism based on the expectation-maximization algorithm eliminates the need for manually preset fixed segmentation thresholds, automatically adapting to polarization baseline drift caused by fluctuations in coating thickness and surface roughness across different batches of magnet sheets, ensuring robustness and consistency across batches. Furthermore, the entire detection process can acquire and calculate all polarization parameters in a single exposure using a split-focus plane polarization camera, avoiding the time loss and motion artifact risks associated with multiple exposures, thus meeting the engineering requirements of real-time online detection of edge chipping defects in NdFeB magnet sheets for high-speed production lines. Attached Figure Description
[0010] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily understood by reading the following detailed description with reference to the accompanying drawings. Several embodiments of this application are illustrated in the drawings by way of example and not limitation, wherein: in the drawings, the same or corresponding reference numerals denote the same or corresponding parts.
[0011] Figure 1 This is an overall flowchart of the method for detecting edge chipping of neodymium iron boron magnet sheets based on polarized light according to an embodiment of this application; Figure 2A schematic flowchart of step S1 in the polarized light-based neodymium iron boron magnet edge chipping detection method of this application embodiment is shown; Figure 3 A schematic flowchart of step S3 in the polarized light-based neodymium iron boron magnet edge chipping detection method of this application embodiment is shown; Figure 4 A schematic flowchart of step S4 in the polarized light-based neodymium iron boron magnet edge chipping detection method of this application embodiment is shown; Figure 5 A schematic flowchart of step S5 in the polarized light-based neodymium iron boron magnet edge chipping detection method of this application embodiment is shown; Figure 6 This is a schematic block diagram of a polarized light-based neodymium iron boron magnet sheet chipping detection system according to an embodiment of this application. Detailed Implementation
[0012] To further illustrate the technical means and effects adopted by this application in order to achieve the intended purpose, the following detailed description of the specific implementation methods, structures, features and effects of this application is provided in conjunction with the accompanying drawings and preferred embodiments.
[0013] Figure 1 This is an overall flowchart of the method for detecting edge chipping of neodymium iron boron magnet sheets based on polarized light, according to an embodiment of this application. Figure 1 As shown, this application provides a method for detecting edge chipping of neodymium iron boron magnet sheets based on polarized light, including: Step 1: Perform polarization physical parameter calculation and dynamic range logarithmic compression on the raw polarization array data acquired by a single exposure of the edge region of a NdFeB magnet under dark-field polarized illumination using a split-plane polarization camera to obtain the logarithmic intensity map and linear polarization map of the magnet. It should be understood that the surface of the NdFeB magnet is usually coated with a Ni-Cu-Ni or Zn anti-corrosion metal coating. This coating is highly prone to specular reflection during image acquisition, with reflected light intensity reaching hundreds of times that of the scattered light from the chipped edge region. If the raw acquired data is directly used for subsequent processing, the values of the bright areas of the coating will occupy most of the effective range of the sensor's quantization bits, causing the weak polarization scattering signal from the chipped edge region to be compressed into an extremely narrow numerical range or even submerged in background noise, making effective feature extraction and boundary localization impossible. Therefore, logarithmic compression of the intensity components needs to be performed based on the polarization parameter calculation to preserve details in the dark areas of the chipped edge while limiting the numerical swing of the bright areas to a usable range.
[0014] Specifically, the raw polarization array data refers to the raw pixel grayscale data acquired by a single exposure of the edge region of a neodymium iron boron magnet under dark-field polarization illumination conditions using a focal plane polarization camera. This data includes grayscale values in the 0°, 45°, 90°, and 135° polarization directions. A focal plane polarization camera is an imaging device that integrates a periodically arranged array of micro-polarizers onto the pixel array of an image sensor. Each 2×2 pixel unit is covered with micro-polarizers in four transmission directions: 0°, 45°, 90°, and 135°. This allows for the simultaneous acquisition of intensity information from all four polarization channels in a single exposure, without the need for mechanical rotation of the polarization devices or timing switching. Dark-field polarization illumination refers to illuminating the edge region of the magnet with a linearly polarized light source at a low angle. This causes the specular reflection beam from the intact coating surface to deviate from the camera's main optical axis, thus initially compressing the specular reflection light energy entering the lens at an optical physics level and reducing the dynamic range burden on the sensor.
[0015] In one embodiment of this application, such as Figure 2 As shown, step one includes: S11, performing bilinear demosaic interpolation on the original polarization array data to obtain a four-way polarization intensity map group; S12, performing polarization Stokes parameter analysis on the four-way polarization intensity map group to obtain a Stokes parameter matrix group containing the total light intensity component and two linear polarization components; S13, performing light intensity and linear polarization degree separation calculation on the Stokes parameter matrix group to obtain the linear polarization degree map of the magnetic steel sheet and the initial light intensity spatial distribution map; S14, performing high dynamic range logarithmic light intensity compression on the initial light intensity spatial distribution map to obtain the logarithmic light intensity map of the magnetic steel sheet.
[0016] First, bilinear demosaic interpolation is performed on the original polarization array data to obtain a set of four-directional polarization intensity maps. Since the micro-polarizer array of the focal plane polarization camera is arranged in a 2×2 period, the effective pixels for each specific polarization direction are sparsely distributed in space at twice the interval. For this original interlaced array data, the spatial arrangement pattern of the underlying micro-polarizers is analyzed, and the pixel grayscale values for the four polarization directions (0°, 45°, 90°, and 135°) are extracted into independent sparse matrices. Then, a bilinear interpolation algorithm is applied to each sparse matrix, using the average grayscale value of spatially adjacent pixels in the same direction to fill in missing pixels, reconstructing four unidirectional polarization intensity maps with the same physical resolution as the original image. This ensures that the data for each spatial point corresponds one-to-one with the four polarization directions in subsequent calculations.
[0017] Secondly, polarization Stokes parameters are analyzed on the four-directional polarization intensity map group to obtain a Stokes parameter matrix group containing the total light intensity component and two linear polarization components. Within the spatial domain of the entire image, the 0° polarization intensity and the 90° polarization intensity are summed pixel-by-pixel to obtain the first Stokes parameter characterizing the total light intensity. The second Stokes parameter, characterizing the difference between horizontal and vertical linear polarization, is obtained by calculating the difference between the 0° polarization intensity and the 90° polarization intensity pixel by pixel. The third Stokes parameter, characterizing the ±45° linear polarization difference, is obtained by calculating the difference pixel by pixel between the 45° polarization intensity and the 135° polarization intensity. The formula corresponding to the above calculation is: , , , in, For image spatial coordinate index, , , and These are the grayscale values of light intensity received at coordinates (x,y) through micropolarizers at 0°, 45°, 90°, and 135°, respectively, after de-mosaic interpolation. This indicates the total reflected light intensity amplitude at that location. This represents the intensity difference between the horizontal and vertical linearly polarized components. This represents the intensity difference between the +45° linear polarization component and the -45° linear polarization component.
[0018] Next, the Stokes parameter matrix group is separated and calculated to obtain the linear polarization degree map of the magnetic steel sheet and the initial spatial distribution map of the light intensity. The first Stokes parameter... This is directly used as the initial spatial distribution map of light intensity. The second Stokes parameter is then extracted. and the third Stokes parameter The linear polarization amplitude is obtained by squaring each of the two values pixel by pixel, adding them together, and then taking the square root. This amplitude is then divided pixel by pixel by the total light intensity. This yields the linear polarization degree value at each spatial location, forming a linear polarization degree map of the magnetic sheet. The corresponding calculation formula is: , in, The value represents the degree of linear polarization at coordinates (x, y). The closer the value is to 1, the better the polarization state of the reflected light is maintained at that point. The closer the value is to 0, the stronger the depolarization effect.
[0019] Finally, high dynamic range logarithmic compression of the initial light intensity spatial distribution map is performed to obtain the logarithmic light intensity map of the magnetic sheet. A bias constant of 1 is added to each pixel value in the initial light intensity spatial distribution map to avoid mathematical singularities where the argument is zero in the logarithmic operation. Then, a nonlinear dynamic range compression is performed using a logarithmic function with the natural constant e as its base. The corresponding calculation formula is: , in, This represents the light intensity value at coordinates (x, y) after logarithmic compression. Let be the natural logarithm function with the natural constant e (approximately 2.71828) as its base. The effect of this logarithmic mapping is that, for high-intensity reflective areas of coated mirrors, the original values may reach thousands to tens of thousands, but after logarithmic mapping, they are compressed to the range of single digits to tens digits; while for low-intensity scattering signals in chipped areas, the relative numerical resolution is preserved or even enhanced because the slope of the logarithmic function is larger in the low-value region.
[0020] In one specific implementation example, a Sony IMX250MZR focal plane polarization sensor with a resolution of 2448×2048 pixels and a pixel size of 3.45 micrometers is used as the imaging device. Its micro-polarizer array is arranged in a 2×2 periodic pattern of 0°, 45°, 90°, and 135°. Dark-field polarization illumination uses a linearly polarized LED ring light source with a wavelength of 635 nanometers. The incident angle of the light source is set to a low angle range of 60° to 75° relative to the normal of the magnet surface, causing the primary specular reflection direction of the coating surface to deviate from the camera lens receiving cone angle. The single exposure time of the camera is set to 200 to 500 microseconds according to the production line cycle time. The acquired raw array data is a 12-bit quantized grayscale image, where the typical grayscale value range for intact coating areas is 3000 to 4000, while the typical grayscale value range for chipped areas is 50 to 300. After Stokes parametric calculations, the typical linear polarization degree of the intact coating region is 0.7 to 0.95, while that of the chipped region is 0.05 to 0.25. After logarithmic compression, the logarithmic light intensity value of the coating region is compressed to approximately 8.0 to 8.3, while the logarithmic light intensity value of the chipped region ranges from approximately 3.9 to 5.7. The ratio between these two values is reduced from more than ten times to approximately 1.5 times, ensuring that the feature points of both types of regions fall within the effective numerical range for clustering operations in subsequent phase space construction.
[0021] Step 2: Construct a joint phase space of intensity and polarization degree for the logarithmic intensity map and linear polarization degree map of the magnetic steel sheet to obtain a scatter set of polarization feature phase space points. It should be understood that in the image spatial domain, pixels in the chipped edge region and pixels in the coating background are spatially adjacent, and the grayscale difference between them is difficult to directly distinguish due to the sensor's dynamic range. However, intact coatings and chipped edges have fundamental differences at the polarization optical physics level: intact coatings exhibit both high reflectivity and high linear polarization degree, while chipped edges exhibit both low scattered intensity and low linear polarization degree. After combining these two dimensions to construct a phase space, the pixels in the two types of regions will spontaneously form clusters that are far apart in the phase space based on their respective optical commonalities, providing a structured data foundation for subsequent adaptive clustering using a probability density model. If this phase space construction is not performed, and threshold segmentation is performed separately on a single intensity dimension or a single polarization degree dimension, the numerical distributions of the two types of regions may overlap, leading to blurred segmentation boundaries and an increased misclassification rate. The joint phase space utilizes the correlation between the two dimensions to increase the degree of freedom for feature differentiation, making the separability of the two types of regions in the high-dimensional space significantly better than that of any single dimension.
[0022] In one embodiment of this application, step two includes: synchronously traversing the logarithmic light intensity map and the linear polarization degree map of the magnetic steel sheet using a unified spatial coordinate index; extracting the logarithmic light intensity scalar and the linear polarization degree scalar at the same pixel position and assembling them into a two-dimensional feature vector in a fixed dimensional order to obtain a two-dimensional polarization feature vector flow; and performing spatial topological deconstruction and phase space scatter set aggregation on the two-dimensional polarization feature vector flow to obtain a polarization feature phase space scatter set.
[0023] First, using a unified spatial coordinate index, the logarithmic intensity map and the linear polarization map of the magnetic steel sheet are synchronously traversed. The logarithmic intensity scalar and linear polarization scalar at the same pixel location are extracted and assembled into a two-dimensional feature vector in a fixed-dimensional order. Specifically, a globally unified two-dimensional image spatial coordinate system is established, and the global width W and global height H of the image matrix are obtained. The traversal coordinate (x, y) is initialized, and a synchronous addressing mechanism using this index as a pointer is established to ensure the absolute binding of the logarithmic intensity map and the linear polarization map at physical spatial points. Following the raster scan order, the logarithmic intensity scalar value at coordinate (x, y) in the logarithmic intensity map of the magnetic steel sheet is synchronously read within the same clock cycle. And the scalar value of the degree of linear polarization at coordinates (x, y) in the linear polarization degree diagram of the magnetic steel sheet. The two scalars read from the same coordinate system are assembled according to a fixed dimensional order, that is, the logarithmic intensity scalar is set as the first dimensional component and the linear polarization degree scalar is set as the second dimensional component, constructing a two-dimensional feature column vector. The corresponding construction formula is: , in, Let be the two-dimensional polarization feature vector located at coordinates (x, y). The logarithmic scalar value of the light intensity at coordinates (x, y) in the logarithmic light intensity diagram of the magnetic steel sheet. The linear polarization degree scalar value at coordinates (x, y) in the linear polarization degree diagram of the magnetic steel sheet. As the scan index progresses, this column vector is continuously generated, forming an ordered output of a two-dimensional polarization feature vector stream.
[0024] Secondly, spatial topological deconstruction and phase space scattering are performed on the two-dimensional polarization feature vector stream to obtain a polarization feature phase space scattering set. Specifically, a two-dimensional feature phase space independent of the original image space is established in memory, with its horizontal axis mapping to logarithmic light intensity values and its vertical axis mapping to linear polarization values. Each column vector in the generated two-dimensional polarization feature vector stream is projected into this phase space, making it appear as an independent scattering point. During this projection process, the original image two-dimensional spatial coordinate index (x, y) carried by each vector is deliberately discarded, thereby removing the spatial topological connection constraints between adjacent pixels. The physical significance of this spatial topological deconstruction is that it allows the fragmented pixels originally scattered at various positions on the edge of the magnetic sheet to no longer be bound by their image positions and can spontaneously aggregate in the phase space based on their pure optical physical commonalities. Exhaustive merging of all pixels within the image matrix... After projecting the scatter points of each pixel, a complete, disordered set of polarization feature phase space scatter points is formed. The mathematical definition of this aggregation process is: , in, It is a scatter set of polarization characteristic phase space points. This is the global width of the image, i.e., the upper limit of the number of columns. This represents the global height of the image, i.e., the upper limit of the number of rows. The total number of scatter points contained in this scatter set is equal to the total number of pixels in the image. indivual.
[0025] In a specific implementation example, following the example in step one, the image resolution is 2448×2048 pixels, therefore the polarization feature phase space scatter plot contains approximately 5 million two-dimensional scatter points. In this phase space, pixels in the intact coating region, due to their typical logarithmic light intensity of 8.0 to 8.3 and linear polarization of 0.7 to 0.95, are concentrated in the upper right region of the phase space; pixels in the chipped defect region, due to their typical logarithmic light intensity of 3.9 to 5.7 and linear polarization of 0.05 to 0.25, are concentrated in the lower left region of the phase space. The Euclidean distance between the distribution centers of the two types of regions in the phase space is approximately 3 to 5 units, exhibiting a clear bi-cluster separation structure, providing a good initial separability condition for the convergence of the expectation-maximization algorithm in subsequent steps. Since the number of pixels in the coated area is much greater than that in the chipped area (chipped pixels usually only account for one to five percent of the whole image), the two clusters have significantly different sizes in the scatter plot. Therefore, a probabilistic model with unequal weighted mixing coefficients is needed in subsequent clustering to adapt to this imbalanced distribution.
[0026] Step 3: Perform expectation-maximization iterative clustering on the scatter plot of polarization feature phase space points, and identify clusters with low mean logarithmic light intensity and mean polarization degree as edge-break defect clusters based on coating optical priors. Extract the Gaussian distribution parameters of the edge-break defect clusters. It should be understood that in actual inspection scenarios, due to differences in coating thickness, surface roughness, and electroplating process parameters, the specific distribution positions and diffusion ranges of intact coating areas and edge-break defect areas in phase space will shift between different batches of NdFeB magnet sheets. If a fixed threshold is used for segmentation, manual calibration is required for each batch of products, resulting in poor robustness when facing defects generated by different batches and under different lighting conditions. The expectation-maximization algorithm, as a data-driven probabilistic model parameter estimation method, can automatically learn the distribution centers and diffusion patterns of the two types of regions based on the current image data, without the need for manually preset segmentation thresholds. This adaptively adapts to polarization baseline drift between batches, ensuring consistency in cross-batch inspection.
[0027] In one embodiment of this application, such as Figure 3 As shown, step three includes: S31, performing fast pre-clustering on the scatter set of polarization feature phase space to perform initial bisection partitioning and statistically analyzing the mixing weights, two-dimensional mean vectors, and covariance matrices of the two initial clusters to obtain the initial parameters of the model; S32, based on the initial parameters of the model, performing expectation maximization iterative optimization on the scatter set of polarization feature phase space to obtain the bivariate Gaussian convergence parameters; S33, comparing the mean vectors of the two clusters in the bivariate Gaussian convergence parameters, and based on the coating optics prior, determining the clusters with lower logarithmic light intensity mean and polarization degree mean as edge-break defect clusters, and extracting their mean vectors and covariance matrices as Gaussian distribution parameters of the edge-break defect clusters.
[0028] First, a fast pre-clustering method is used to initially divide the scatter point set of polarization feature phase space into two clusters. The mixing weights, two-dimensional mean vectors, and covariance matrices of the two initial clusters are then calculated to obtain the initial parameters of the model. Specifically, the scatter point set of polarization feature phase space output from step two is received, and the number of clustering components in the Gaussian mixture model is set to K=2. The K-Means++ algorithm is applied to perform fast pre-clustering on the input scatter point set, initially dividing the entire scatter point set into two clusters. Based on the pre-clustering results, the prior mixing weights, two-dimensional mean vectors, and 2×2 covariance matrices of these two clusters are calculated respectively, serving as initial estimates of the Gaussian mixture distribution. The global probability density function of this Gaussian mixture model consists of the weighted sum of the two components, and its mathematical form is: , in, Given a two-dimensional feature vector Global marginal probability density values under a binary Gaussian mixture model; Let k be the prior mixture weight of the k-th Gaussian component in the entire mixture model, satisfying... And all weights are positive; Let be the multivariate Gaussian probability density function of the k-th Gaussian component, representing the two-dimensional eigenvector. In a two-dimensional mean column vector Covariance Matrix The conditional probability density in the parameterized Gaussian distribution; Let be the two-dimensional mean column vector of the k-th Gaussian distribution, representing the cluster center of the corresponding physical state in the characteristic phase space; Let be the 2×2 covariance matrix of the k-th Gaussian distribution, representing the diffusion pattern of the corresponding physical state in phase space. The reason for using K-Means++ as the initialization method instead of random initialization is that K-Means++ selects the initial cluster centers based on distance probability sampling, which can keep the two initial centers as far apart as possible, thus effectively avoiding the expectation-maximization algorithm from getting trapped in local optima and accelerating the convergence speed of subsequent iterations.
[0029] Secondly, based on the initial parameters of the model, the expectation-maximization iterative optimization is performed on the scattered point set of polarization feature phase space to obtain the bivariate Gaussian convergence parameters. The expectation-maximization algorithm consists of alternating E-steps and M-steps, with each iteration containing a complete E-step and M-step loop.
[0030] In the E-step, using the current model parameters, for each discrete eigenvector in the scatter plot of the polarization characteristic phase space, The posterior probability generated by the k-th Gaussian distribution is calculated using Bayes' theorem; this posterior probability is also called the responsivity. This calculation is used to evaluate the soft assignment probability of each scatter point belonging to each cluster, that is, the scatter point simultaneously belongs to two clusters with different probabilities, rather than being rigidly assigned to one or the other. The formula for calculating the posterior probability is: , in, For the i-th eigenvector The posterior probability generated by the k-th Gaussian distribution has a value ranging from 0 to 1, and the sum of the posterior probabilities of all components for the same data point is equal to 1; i is the index of the data point in the scatter plot; k and j are the Gaussian component indices, with values of 1 or 2.
[0031] In the M-step, based on the posterior probabilities of all data points calculated in the E-step, the posterior probabilities are used as weighting coefficients to recalculate and update the mixing weights, mean vector, and covariance matrix of the k-th cluster, thereby maximizing the log-likelihood function of the current model. The updated model parameters can more accurately fit the actual distribution of the data, allowing the model's descriptive ability to gradually approach the true generation mechanism of the data.
[0032] After each E-step and M-step, the increment of the log-likelihood function value between two consecutive iterations is calculated. If the absolute value of this increment is less than a preset minimum convergence threshold, the model is considered to have converged, and iteration stops. Alternatively, iteration also stops if the number of iterations reaches a preset maximum number of iterations. The convergence threshold can be set to 10. -5 Up to 10 -6 The maximum number of iterations can be set from 100 to 300. The distribution parameters of the two clusters finally determined after iteration convergence, namely their respective mixing weights, mean vectors, and covariance matrices, are extracted as bivariate Gaussian convergence parameters.
[0033] Finally, the mean vectors of the two clusters in the bi-dimensional Gaussian convergence parameters are compared. Based on the coating optics prior, the cluster with lower mean logarithmic intensity and mean polarization is identified as the edge-break defect cluster, and its mean vector and covariance matrix are extracted as Gaussian distribution parameters for the edge-break defect cluster. Specifically, the bi-dimensional Gaussian convergence parameters are analyzed, and the mean vector of cluster 1 is extracted. The mean vector of cluster 2 An optical prior criterion for the coating is introduced: a healthy coating exhibits high light intensity and high linear polarization, while chipped edges exhibit low light intensity and low linear polarization due to multiple scattering and depolarization effects. Therefore, the distribution center of the chipped edge defect cluster in phase space must be closer to the origin. A characteristic scalar evaluation function is constructed, and the weighted sums of the logarithmic light intensity component and the linear polarization component within the two mean vectors are calculated respectively. By comparing the magnitudes of these two weighted scalar sums, the index with the minimum value is found. The formula for this recognition logic is: , in, This is the target index representing the edge-break defect cluster that was finally identified after evaluation using physical prior criteria; To find the minimum point operator, return the independent variable k that minimizes the function following it; The first element of the k-th mean vector represents the mean level of the cluster in the logarithmic light intensity dimension; is the second dimension element of the k-th mean vector, representing the mean level of the cluster in the linear polarization dimension; This is a dimensionless positive scalar weighting coefficient used to balance the contributions of logarithmic light intensity and linear polarization degree to the judgment criterion on a physical scale. Because the numerical ranges of logarithmic light intensity and linear polarization degree differ in dimension, Its function is to normalize and balance the two dimensions, so that the judgment criterion is not biased towards either dimension. The value can be set according to the proportional relationship between the numerical ranges of the two dimensions. In this method, the value can be 5 to 10. For example, when the logarithmic light intensity value range is approximately 4 to 8 and the linear polarization degree value range is approximately 0 to 1. A value of 6 ensures that the two dimensions contribute equally to the discrimination result.
[0034] Based on the determined target index The first parameter is extracted separately from the bivariate Gaussian convergence parameters. The mean vector of Gaussian components Covariance Matrix The other Gaussian composition parameter characterizing the intact coating is discarded. This set of extracted parameters is packaged and output as the Gaussian distribution parameters of the edge chipping defect cluster to subsequent steps.
[0035] In a specific implementation example, K-Means++ pre-clustering completes the initial bipartition within approximately 5 to 10 iterations. The expectation-maximization algorithm sets the convergence threshold to 10. -5 With the maximum number of iterations set to 200, convergence typically occurs within 30 to 80 iterations. The mean vector of the coating background cluster obtained after convergence is approximately... The diagonal elements of the covariance matrix are approximately [0.01, 0.005], and the mixing weights are approximately 0.95 to 0.99; the mean vector of the edge-break defect cluster is approximately The diagonal elements of the covariance matrix are approximately [0.3, 0.01], and the mixture weights are approximately 0.01 to 0.05. Weight coefficients. When the value is 6, the evaluation scalar value of the coating background cluster is The evaluation scalar value of the edge chipping defect cluster is The latter is significantly smaller than the former, therefore the cluster with the smaller scalar value is identified as the edge-break defect cluster. Finally, the mean vector of the edge-break defect cluster is extracted. The sum and covariance matrix are used as Gaussian distribution parameters for the edge-collapse defect cluster and are passed to step four for Mahalanobis distance calculation.
[0036] Step 4: Based on the Gaussian distribution parameters of the chipped edge defect clusters, perform phase space Mahalanobis distance mapping and contrast reconstruction on the logarithmic intensity map and linear polarization map of the magnetic steel sheet to obtain a high-contrast reconstructed image of the chipped edge. It should be understood that after clustering in Step 3, although the statistical distribution parameters of the chipped edge defect clusters have been separated at the probabilistic model level, this separation result remains in the abstract phase space and has not been reflected back to the spatial domain of the original image. In the original linear polarization map of the magnetic steel sheet, although the polarization degree values of the chipped edge region are generally low, the difference between them and the coating transition region is still limited. Directly thresholding the linear polarization map will face the problems of boundary blurring and misjudgment of the transition region. This step, through Mahalanobis distance mapping and probabilistic weighting mechanisms, projects the clustering separation results in the phase space back into the image space with pixel-level precision. This forces coating pixels far from the center of the chipped edge defect cluster distribution to be suppressed to near zero values, while chipped edge pixels near the center are preserved and enhanced, thus obtaining a reconstructed image with significantly improved contrast between the chipped edge and the background.
[0037] In one embodiment of this application, such as Figure 4 As shown, step four includes: S41, synchronously traversing the logarithmic light intensity map and the linear polarization map of the magnetic steel sheet using a unified coordinate index to reconstruct the two-dimensional feature vector of each pixel, and calculating the Mahalanobis distance based on the covariance matrix in the Gaussian distribution parameters of the edge-collapse defect cluster to obtain the pixel-by-pixel Mahalanobis distance matrix; S42, performing nonlinear mapping of defect attribution probability weights on each Mahalanobis distance scalar in the pixel-by-pixel Mahalanobis distance matrix to obtain the edge-collapse defect attribution probability weight matrix; S43, based on the edge-collapse defect attribution probability weight matrix, performing extreme background suppression and local contrast reconstruction fusion on the linear polarization map of the magnetic steel sheet to obtain the edge-collapse high-contrast reconstruction map.
[0038] First, using a unified coordinate index, the logarithmic intensity map and linear polarization map of the magnetic steel sheet are synchronously traversed to reconstruct the two-dimensional feature vectors of each pixel. Then, based on the covariance matrix in the Gaussian distribution parameters of the edge-collapse defect cluster, Mahalanobis distance is calculated to obtain the pixel-by-pixel Mahalanobis distance matrix. Specifically, a two-dimensional image spatial coordinate index (x, y) is established, and the logarithmic intensity map and linear polarization map of the magnetic steel sheet are scanned synchronously to extract the logarithmic intensity scalar value at coordinate (x, y). and linear polarization scalar value Reorganized into two-dimensional feature column vectors in a fixed order Unlike the phase space construction in step two, this step preserves the binding relationship between each feature vector and its image space coordinates to ensure that the calculation results can be rearranged according to the original pixel positions to form an image matrix.
[0039] The Gaussian distribution parameters of the edge-break defect clusters output in step three are analyzed, and the two-dimensional mean vector of the edge-break defect clusters is extracted from them. With 2×2 covariance matrix And calculate the inverse matrix of the covariance matrix. As the precision matrix, the Mahalanobis distance between each feature vector and the center of the edge defect cluster distribution is calculated pixel by pixel. The calculation process is as follows: first, the deviation vector between the current feature vector and the mean vector is obtained; then, this deviation vector is subjected to a spatial variance weighted transformation through the inverse covariance matrix; finally, the square root of the weighted quadratic result is taken to obtain a non-negative scalar value. The formula for calculating the Mahalanobis distance is: , in, The distance between the polarization eigenvector at coordinates (x, y) and the center of the edge-collapse defect cluster distribution is the Mahalanobis distance, which is a non-negative scalar. The two-dimensional feature column vector at this coordinate. ; Let be the two-dimensional mean vector of the edge-break defect cluster, representing the statistical distribution center of the edge-break pixels in phase space; It is the inverse matrix of the covariance matrix of the edge-break defect cluster, used to eliminate the distance calculation bias caused by the inconsistency of the dimensions and variance scale between the two dimensions; This is the matrix transpose operator.
[0040] The physical meaning of Mahalanobis distance is as follows: if the feature vector of a pixel is exactly located at the mean center of a cluster of edge defects, its Mahalanobis distance is zero; if the feature vector of the pixel is far from the center of the edge defect cluster and located in the distribution area of the coating background cluster, its Mahalanobis distance will increase significantly. The introduction of the inverse covariance matrix allows the distance calculation to take into account the diffusion pattern of the edge defect cluster itself. That is, deviations along the major axis of the covariance ellipse are given smaller weights, while deviations along the minor axis are given larger weights, thus matching the distance metric with the actual distribution pattern of the data. The Mahalanobis distance scalars of all pixels are rearranged according to the original spatial coordinates (x, y) to generate a pixel-by-pixel Mahalanobis distance matrix with the same resolution as the original image.
[0041] Secondly, a nonlinear mapping of defect attribution probability weights is performed on each Mahalanobis distance scalar in the pixel-by-pixel Mahalanobis distance matrix to obtain the edge collapse defect attribution probability weight matrix. Specifically, each Mahalanobis distance scalar in the pixel-by-pixel Mahalanobis distance matrix is traversed. A negative exponential decay function based on the natural constant e is introduced to perform a nonlinear mapping of the Mahalanobis distance. The characteristics of this mapping function are: when the Mahalanobis distance approaches zero (indicating that the pixel is extremely close to the center of the chipping defect cluster in phase space), the output probability weight approaches 1; when the Mahalanobis distance increases (indicating that the pixel deviates from the center of the chipping defect cluster and approaches the coating background area), the output probability weight decays exponentially to approach 0. This mapping transforms the unbounded distance range into a physical confidence probability weight strictly constrained to the interval between 0 and 1. The formula for calculating the defect attribution probability weight is: , in, is the confidence probability weight for the pixel at coordinates (x,y) to belong to the edge chipping defect, with a value range of 0 to 1; e is the natural constant, approximately equal to 2.71828; The decay rate adjustment factor is a positive real constant used to control the steepness of the probability mapping function. The larger the value, the faster the probability weight decays with distance, and the stronger the suppression of the coating background, but at the same time it may suppress the transition pixels at the edge of the chipped area. The smaller the value, the gentler the decay, the less the suppression of the background, but the more fully the edge regions are preserved. The value can be adaptively set based on the inter-cluster distance between the chipping defect cluster and the coating background cluster, and in practical engineering, it can be set to 0.5 to 2.0. For example, when the Mahalanobis distance between the centers of two clusters is approximately 3 to 5 standard deviations, A value of 1.0 ensures that pixels within two standard deviations of the center of the edge-break defect cluster maintain a weight of 0.13 or higher, while the weight of coated pixels more than five standard deviations away decays to below 0.007. All calculated probability weights are stored in a matrix according to their coordinates, completing the mode transformation from the distance domain to the probability domain, resulting in the edge-break defect attribution probability weight matrix.
[0042] Finally, based on the probability weight matrix of edge chipping defects, the linear polarization degree map of the magnetic steel sheet is fused with extreme background suppression and local contrast reconstruction to obtain a high-contrast reconstructed image of the edge chipping. Specifically, the linear polarization degree map of the magnetic steel sheet is extracted. Based on the physical characteristic that the depolarization effect in the edge chipping area is strong and the linear polarization degree is close to 0, the value of each pixel in the matrix is subtracted by a constant of 1 to obtain the inverse polarization degree matrix. The physical meaning of the inverse operation is that the linear polarization degree at the intact coating is close to 1, and after inversion, it approaches 0; the linear polarization degree at the edge chipping defect is close to 0, and after inversion, it approaches 1. This inversion operation makes the edge chipping area appear as a high-brightness value in the inverse matrix, and the coating area as a low-brightness value, thus initially realizing the positive expression of the edge chipping characteristics.
[0043] The inverse polarization matrix and the probability weight matrix for edge chipping defects are multiplied pixel-by-pixel using a Hadamard product, which directly multiplies the two scalar values at corresponding coordinate positions. The mechanism of this fusion operation is as follows: for pixels in the coating background area, although their inverse polarization value may not be completely zero (especially in the coating transition area), their probability weight value approaches zero due to their distance from the edge chipping defect cluster; the result of the multiplication is forcibly suppressed to an extremely low value. For pixels in the edge chipping defect area, their inverse polarization value is higher and their probability weight value is also close to 1; the result of the multiplication is preserved. This dual suppression mechanism results in the coating background being extremely cleared in the reconstructed image, while edge chipping features are selectively highlighted. The formula for contrast reconstruction is: , in, The final grayscale value at coordinates (x, y) after double suppression and reconstruction constitutes the pixel value in the high-contrast reconstruction image of the edge-damped image; The probability weight for assigning edge breakage defects at this coordinate; The Hadamard product operator represents the element-wise scalar multiplication of two matrices at the same spatial coordinates. This represents the original value of the degree of linear polarization at that coordinate. This represents the degree of polarization in reverse phase.
[0044] In a specific implementation example, the mean vector of the edge-break defect cluster is The covariance matrix is Decay rate adjustment factor The value is 1.0. For a typical pixel with a perfectly coated surface, its feature vector is approximately... After calculation using Mahalanobis distance, the distance value is approximately 8 to 12. Substituting this into the probability weight formula, the resulting weight value is approximately... The value is close to zero; its degree of anti-phase polarization is 1 - 0.85 = 0.15. Multiplying the two together, the reconstructed value is approximately... The coated pixel is suppressed to near zero in the reconstructed image. For a typical chipped pixel, its feature vector is approximately... After calculation using Mahalanobis distance, the distance value is approximately 0.3 to 0.8. Substituting this into the probability weight formula, the resulting weight value is approximately... Its degree of anti-phase polarization is 1 - 0.12 = 0.88. Multiplying the two together, the reconstructed value is approximately... As can be seen, the ratio of chipped pixels to coated pixels in the reconstructed image increased from about 6 times in the original linear polarization image to about 80,000 times in the reconstructed image, resulting in a significant improvement in the contrast between the chipped edges and the background.
[0045] Step 5: Perform sub-pixel edge extraction and contour output on the high-contrast reconstructed image of the chipped edge to obtain sub-pixel chipped edge contour data of the magnetic steel sheet. It should be understood that after phase space probability weighting reconstruction, the chipped edge region is sufficiently highlighted in the grayscale image, but the image at this point is still a continuous grayscale distribution and has not yet been converted into structured boundary coordinate information that can be directly used by the industrial control system. Furthermore, the positioning accuracy of conventional integer-pixel-level edge detection methods is limited by the discrete spacing of the pixel grid, which is insufficient for the precise dimensional measurement of chipped edge defects in NdFeB magnetic steel sheets. This step obtains a single-pixel-width edge skeleton through gradient field calculation and non-maximum suppression, then calculates the sub-pixel offset along the skeleton normal using orthogonal moments, and finally connects the discrete positioning points into a closed contour curve through spatial topology tracing and performs validity screening to output high-precision chipped edge contour data.
[0046] In one embodiment of this application, such as Figure 5 As shown, step five includes: S51, performing gradient field calculation and non-maximum suppression skeletonization on the high-contrast reconstruction image of the chipped edge to obtain the edge skeleton of the chipped single pixel and the skeleton normal angle; S52, extracting the local circular neighborhood grayscale along the skeleton normal angle direction of each point of the edge skeleton of the chipped single pixel on the high-contrast reconstruction image of the chipped edge, and calculating the sub-pixel normal offset and superimposing it on integer coordinates to obtain the sub-pixel positioning point set; S53, performing spatial topology tracing and closed contour fitting on the sub-pixel positioning point set to obtain the sub-pixel chipped edge contour data of the magnetic steel sheet.
[0047] First, gradient field calculation and non-maximum suppression skeletonization are performed on the high-contrast reconstructed image with edge damage to obtain the edge skeleton of each individual pixel with edge damage and the skeleton normal angle. Specifically, a 3×3 Sobel gradient operator is applied to the high-contrast reconstructed image with edge damage output in step four, and two-dimensional discrete convolution operations are performed in the horizontal and vertical directions to obtain the horizontal gray-level partial derivative at each pixel position. and the partial derivative of gray level in the vertical direction The edge gradient magnitude and gradient normal angle are calculated pixel-by-pixel using the horizontal and vertical partial derivatives. The calculation formula is as follows: , , in, The comprehensive gradient magnitude at coordinates (x, y) represents the degree of drastic change in gray level at that location; Let (x, y) be the gradient normal angle at coordinates (x, y), representing the angle between the direction of the fastest gray-level change and the horizontal axis of the image, in radians, with a value range distributed in... Within the range; This is the result of a Sobel convolution in the horizontal direction; The result is a Sobel convolution in the vertical direction; It is the arctangent function with quadrant correction.
[0048] Using the gradient normal angle field obtained above, a non-maximum suppression algorithm is executed along the local gradient direction of each pixel: For each pixel, the gradient magnitudes of its preceding and following adjacent positions are checked along its gradient normal direction. If the gradient magnitude of the current pixel is not a local maximum in its normal neighborhood, its gradient magnitude is set to zero to suppress it. After non-maximum suppression, the edge response, which originally had a certain width, is refined into a single-pixel width skeleton that retains only the extreme value positions. Based on this, a hysteresis double threshold judgment method is used for the final confirmation of edge points: two gradient magnitude thresholds are set, a high threshold and a low threshold. Pixels with gradient magnitudes higher than the high threshold are directly confirmed as strong edge points. Pixels with gradient magnitudes between the high and low thresholds are only confirmed as weak edge points if they have an 8-adjacent connectivity relationship with strong edge points. Pixels with gradient magnitudes lower than the low threshold are directly discarded. The high threshold can be set to 0.3 to 0.5 times the maximum gradient magnitude, and the low threshold can be set to 0.3 to 0.5 times the high threshold. The integer coordinates of all edge pixels confirmed by the double threshold are extracted as the single-pixel edge skeleton of the collapsed edge, and the gradient normal angle value of the corresponding position of each skeleton point is saved to form the skeleton normal angle.
[0049] Secondly, local circular neighborhood grayscale values are extracted from the high-contrast reconstruction image of the collapsed single-pixel edge skeleton along the skeleton normal angle direction of each point, and the sub-pixel normal offset is calculated and superimposed to integer coordinates to obtain the sub-pixel positioning point set. Specifically, each integer pixel coordinate (x, y) in the collapsed single-pixel edge skeleton is traversed, and grayscale data within a local circular neighborhood template with radius R is extracted from the high-contrast reconstruction image of the collapsed edge with the current coordinate as the center. The value of R needs to ensure that the neighborhood covers the grayscale transition area on both sides of the edge, and can be set to 3 to 5 pixels. Two-dimensional Zernike orthogonal moments are calculated within this circular neighborhood, and the lower-order moments in the Zernike moments are used. , and The numerical relationship is used to analyze the one-dimensional normal compensation distance between the actual gray-level centroid of the image and the geometric center of the current pixel, based on the ideal step edge model. This compensation distance represents the sub-pixel level offset of the true edge position relative to the integer grid center along the gradient normal direction, and its absolute value does not exceed 0.5 pixels.
[0050] Read the gradient normal angle corresponding to the current skeleton point (x, y) from the skeleton normal angle. The one-dimensional normal compensation distance is orthogonally decomposed along the normal angle using trigonometric functions, projected onto the horizontal and vertical components respectively, and then added to the original integer coordinates to obtain two-dimensional floating-point coordinates with sub-pixel precision. The coordinate compensation formula is: , in, and These are the floating-point x and y coordinates after subpixel compensation; x and y are the original integer pixel coordinates. It is a one-dimensional normal compensation distance scalar obtained based on Zernike moments, and its absolute value is usually between 0 and 0.5 pixels; This is the gradient normal angle at the skeleton point; and These are cosine and sine trigonometric functions used to project the horizontal and vertical components of the normal offset distance onto a Cartesian coordinate system. The floating-point coordinates obtained after subpixel compensation of all skeleton points are aggregated to form a subpixel positioning point set.
[0051] Finally, spatial topology tracing and closed contour fitting are performed on the sub-pixel positioning point set to obtain the sub-pixel edge collapse contour data of the magnetic steel sheet. At this point, the sub-pixel positioning point set represents spatially discrete, disordered floating-point coordinates. Topology tracing is needed to concatenate these coordinates into a closed contour curve according to spatial geometric order. After effectiveness filtering to remove noisy pseudo-contours, the final result is output. Two implementation examples are given below.
[0052] In the first embodiment, spatial topology tracing generates a closed contour by performing an indiscriminate graph traversal based on the spatial connectivity of an 8-adjacent grid. Specifically, each point in the sub-pixel location point set is mapped back to its underlying integer grid coordinate system to construct an 8-adjacent connected graph, meaning that each skeleton point establishes undirected connections with its neighboring skeleton points in eight directions (horizontal, vertical, and four diagonal directions). Starting from any unmarked skeleton point as the seed node, topology tracing is performed along the edge direction based on the 8-adjacent connectivity, connecting the disordered discrete points into a one-dimensional ordered sequence according to their spatial adjacency. During the tracing process, each point is marked as visited to avoid repeated visits. When the tracing pointer backtracks to the starting seed node, the sequence is truncated to form a closed polygon curve. If there are no unmarked skeleton points in the 8-adjacent neighborhoods of a point, the sequence forms a non-closed curve segment. The above process is repeated until all discrete location points have been marked and visited, forming an initial set of closed edge contour curves.
[0053] For each independent closed curve in the initial set of closed edge-collapsed contour curves, area calculation and noise filtering are performed. Suppose a certain closed curve is formed by... Composed of ordered sub-pixel coordinate points, the area of the two-dimensional projected curve enclosed by the curve is integrally solved using a variant of Green's theorem for discrete polygon area. The area calculation formula is as follows: , in, The two-dimensional projected area enclosed by a single closed polygonal outline; This represents the total number of ordered sub-pixel nodes that constitute the closed curve; For the traversal index of an ordered set of points in a polygon, when hour Cyclic mapping back to the first node ensures the integral continuity of the closed curve, i.e. , ; and Let x and y be the x and y coordinates of the j-th sub-pixel node. Set a noise area threshold. Only retain those that meet the requirements. The closed contour is identified, and contours with an area smaller than the threshold are identified as spurious defects caused by dust or isolated optical noise and are therefore removed. The value can be set according to the production line's process requirements for the minimum acceptable chipping defect size. For example, when the pixel size is 3.45 micrometers and the minimum chipping area to be detected is 50 micrometers × 50 micrometers, It can be set to approximately 200 square pixels. The valid contours retained through area filtering are serialized and encapsulated according to a standard common data format, and the output is subpixel chipped edge contour data of the magnetic steel sheet.
[0054] The tracking mechanism in the first embodiment has a structural limitation: the tracking process only performs indiscriminate graph traversal based on the spatial connectivity of the 8-adjacent grid, completely ignoring the inherent local curvature direction continuity constraints between skeleton points. Neodymium iron boron (NdFeB) material is a typical brittle body formed by powder metallurgy sintering. Its edge chipping defects follow intergranular fracture or transgranular cleavage propagation mechanisms. Governed by this material mechanics mechanism, the boundary direction of edge chipping cracks on a macroscopic scale must exhibit a gradually changing curve with continuous curvature. Physically, the rate of change of the normal angle between adjacent edge points cannot exhibit a drastic jump that deviates from the constraints of fracture mechanics. However, the 8-adjacent tracking algorithm does not encode this prior physical knowledge of material fracture into the tracking decision logic. When encountering a bifurcation node (i.e., when a skeleton pixel has more than two 8-adjacent candidate successor nodes simultaneously), it lacks a direction selection criterion, selecting successor nodes only according to a fixed scanning priority or arbitrary order.
[0055] This limitation can lead to three types of problems in actual production line inspection scenarios. First, two physically independent chipped edges may be spatially adjacent at the corner of the magnetic steel sheet. The tracking path may incorrectly cross to the other edge at the fork, connecting the two separate chipped edges into a pseudo-closed curve containing physically unreasonable sharp angles. Second, a physically continuous chipped edge may break into multiple fragments due to a misguided tracking path. The enclosing area of each fragment may drastically drop below the area filtering threshold and be incorrectly discarded. Third, subsequent area filtering may rely solely on a single area threshold as the sole criterion for contour validity, failing to identify pseudo-contours with excessively large areas due to misconnection but containing sharply angled geometric shapes.
[0056] In the second embodiment, to address the aforementioned limitations of the first embodiment, a directional cost-guided tracking and dual-criteria filtering mechanism based on curvature continuity constraints is introduced. In this second embodiment, spatial topology tracking and closed contour fitting are performed on the sub-pixel positioning point set to obtain the sub-pixel chipping contour data of the magnetic steel sheet. This includes: estimating the local curvature direction trend of each point in the sub-pixel positioning point set along the skeleton direction using a preset neighborhood window to obtain the skeleton point curvature direction trend vector field; based on the skeleton point curvature direction trend vector field, performing directed optimal path tracking guided by curvature continuity costs on the sub-pixel positioning point set to obtain a curvature-guided closed chipping contour curve set; and performing area and curvature smoothness combined dual-criteria filtering on each contour in the curvature-guided closed chipping contour curve set to obtain the magnetic steel sheet sub-pixel chipping contour data.
[0057] First, using a preset neighborhood window along the skeleton's orientation, the local curvature direction trend of each point in the sub-pixel positioning point set is estimated to obtain the skeleton point curvature direction trend vector field. Specifically, for each coordinate point in the sub-pixel positioning point set, several adjacent skeleton points are collected along the skeleton's orientation in both forward and backward directions, centered on that point and with a preset neighborhood window radius. The preset neighborhood window radius can be set to 3 to 5 skeleton points forward and backward. The collected normal angle values are arranged in spatial order and then subjected to a first-order finite difference operation to obtain a scalar of the spatial rate of change of the normal angle at the current position. This scalar is the numerical quantization expression of the local curvature. Based on this, the curvature scalar and the normal angle of the current point are used to jointly calculate the most likely direction range that the skeleton will point to when it continues to extend at this point, and this is encoded into a two-dimensional direction vector. After covering the entire skeleton, the skeleton point curvature direction trend vector field is formed. The physical significance of this vector field is that the fracture front of a neodymium iron boron edge chipping crack is constrained by the grain boundaries and stress distribution inside the material during the propagation process. The direction of crack propagation at the current position is inevitably affected by the curvature inertia of the previous propagation path. The vector field of the curvature direction trend of the skeleton point is the data layer expression of this physical inertial constraint. It provides a quantitative prediction benchmark based on the laws of fracture mechanics for each step of the subsequent tracking process.
[0058] Secondly, based on the curvature direction trend vector field of the skeleton points, a directed optimal path tracing guided by curvature continuity cost is performed on the sub-pixel positioning point set to obtain a set of curvature-guided closed collapse edge contour curves. Specifically, a directed weighted adjacency graph is constructed on the underlying mesh mapped from the sub-pixel positioning point set. Each connecting edge from the current skeleton point to a candidate successor skeleton point is no longer assigned an equal connectivity weight, but rather its direction cost is determined by calculating the angle deviation between the actual direction angle of the connecting edge and the corresponding trend vector in the curvature direction trend vector field of the skeleton point at the starting node. The cost function adopts the inverse mapping form of cosine similarity, and its calculation formula is as follows: , in, To start from the skeleton point Move to candidate successor skeleton point The directional substitution value represents the degree to which the connection violates the curvature continuity constraint, and its value ranges from 0 to 2. From point Point of view The actual connection direction angle, that is, the angle between the candidate edge and the horizontal axis of the image; Midpoint of the field of the curvature direction trend vector of the skeleton point The curvature direction trend angle at the location represents the most likely extension direction predicted by fracture mechanics priors; The cosine function is used to measure the degree of consistency between two direction angles. The epoch value is zero when the candidate successor direction is perfectly aligned with the curvature trend direction, and reaches its maximum value of 2 when the directions are completely opposite. This mathematical property corresponds to the physical scenario of edge breakage: the physical resistance to crack leading edge extending along the inertial direction is minimal, while the material fracture resistance to be overcome is greater the further the propagation path deviates from the inertial direction.
[0059] Starting from any unmarked seed node, the tracing algorithm selects the candidate successor node that minimizes the cumulative path cost as the extension direction at each step, forming a locally optimal path sequence. When the path closes and backtracks to the seed node, it is truncated to form a closed contour. When the single-step cost of all candidate nodes exceeds the preset curvature abrupt cutoff threshold, the position is determined to be the actual physical boundary termination point, and the path is truncated. The curvature abrupt cutoff threshold can be set to 1.2 to 1.5. The physical meaning of this threshold is that directional jumps exceeding this cost upper limit violate the curvature continuity constraint of macroscopic fracture propagation in NdFeB sintered bodies and belong to physically impossible tracing directions. The above process is repeated until all discrete positioning points are marked and consumed, finally obtaining the curvature-guided closed fracture contour curve set. The direction cost mechanism is equivalent to reproducing the physical inertial law of material fracture propagation at the algorithm level. The tracing path always moves along the curvature continuity direction that is reasonable in fracture mechanics, and automatically rejects physically impossible sharp turn candidates at bifurcation nodes, fundamentally eliminating false connections and false fractures.
[0060] Finally, the contours in the curvature-guided closed edge collapse contour curve set are screened using a dual criterion of area and curvature smoothness to obtain sub-pixel edge collapse contour data for the magnetic steel sheet. Although the curvature-guided closed edge collapse contour curve set generated after cost-guided tracking has reduced the number of abnormal contours, there may still be a small number of unreasonable contours remaining due to local noise interference or extreme bifurcation. Therefore, it is necessary to introduce quantitative constraints on the rationality of contour geometry in addition to the area criterion.
[0061] For each independent closed contour curve in the set of curvature-guided closed edge collapse contour curves, firstly, the two-dimensional projected area A enclosed by the curve is solved by integrating using a discrete polygon variant of Green's formula, with the area calculation method the same as described in the first embodiment. Simultaneously, the absolute value of the tangent direction angle difference between adjacent nodes is calculated node by node along the contour curve. The sum of all absolute differences is then divided by the total number of nodes to obtain the average curvature change rate scalar of the contour, which is defined as the curvature smoothness score. The formula for calculating the curvature smoothness score is: , in, The curvature smoothness score is given to the current closed contour curve. The physical meaning is the average jump amplitude of the tangent direction angle along the contour direction. The lower the value, the smoother the contour. This represents the total number of ordered subpixel nodes that constitute the closed contour curve; For the node traversal index along the contour-ordered sequence, when hour The loop returns to the first node to ensure the continuity of the closed-loop calculation; For the contour sequence of the th The local tangent direction angle at each node is determined by the coordinate difference between adjacent nodes; As an absolute value operator, it ensures that angle jumps in both directions are equivalently accumulated.
[0062] True edge chipping, due to the continuity of its extension along grain boundaries or cleavage planes, exhibits a slight gradual change in its macroscopic profile along the tangential direction, inevitably resulting in a lower curvature smoothness score. Conversely, pseudo-profiles formed by tracking residual errors or noise, containing unreasonable sharp angles, show abrupt changes in the tangential direction angle at the angles, leading to a significantly higher curvature smoothness score after accumulation. A joint screening logic is established using area and curvature smoothness criteria: only when the area enclosed by a closed profile... Greater than or equal to the preset noise area threshold And its curvature smoothness score Below the preset upper limit of curvature change If the contour can be verified by both criteria, it will be determined as a real chipping defect contour and retained for output; otherwise, it will be discarded. The value is the same as in the first embodiment, and can be set to approximately 200 square pixels. The value can be set from 0.3 to 0.6 radians. For example, a value of 0.4 radians means that a contour whose average change in the tangent direction between any two adjacent nodes does not exceed approximately 23 degrees is considered to have a reasonable geometric shape. After filtering, all valid contours are serialized and encapsulated in a standard format and output as subpixel chipped edge contour data of the magnetic steel sheet.
[0063] In a specific implementation example, following the example in step four, the resolution of the high-contrast reconstructed image with edge collapse is 2448×2048 pixels. The Sobel gradient operator uses a standard 3×3 convolution kernel. The high threshold in the hysteresis dual threshold is set to 0.4 times the maximum gradient magnitude, and the low threshold is set to 0.4 times the high threshold. The local circular neighborhood radius R calculated by Zernike moments is 4 pixels. The single-pixel edge skeleton of the collapsed edge obtained after gradient field calculation and non-maximum suppression typically contains 500 to 5000 skeleton points. After Zernike moment subpixel compensation, the positioning accuracy of each skeleton point is improved from 1 pixel to about 0.1 pixels, and the corresponding physical size accuracy is improved from 3.45 micrometers to about 0.35 micrometers. In the second embodiment, the neighborhood window radius for local curvature direction trend estimation is set to 4 skeleton points before and after, the curvature abrupt change truncation threshold is set to 1.3, and the upper limit of the curvature smoothness score is set to 0.4 radians. In the final output of the subpixel chipping contour data of the magnetic steel sheet, each valid contour contains a unique contour identifier number, a bounding area value, and a closed coordinate chain consisting of tens to hundreds of ordered subpixel floating-point coordinates. This data is directly transmitted to the production line control system for the size determination and quality grading of chipping defects.
[0064] In summary, the polarization-based neodymium iron boron magnet sheet chipping detection system based on the embodiments of this application is explained. It abandons the traditional processing path of directly performing threshold segmentation or multiple exposure fusion on the polarization image in the image spatial domain. Instead, it decouples the physical parameters of polarization light from the image space and projects them onto a two-dimensional joint feature phase space composed of logarithmic light intensity and linear polarization degree. It utilizes the statistically separable cluster structure spontaneously formed by the intact coating and chipping defects in this phase space due to the difference in optical physics. Through adaptive fitting of the probability density model, it accurately locates the distribution parameters of the chipping defect clusters. Then, it applies nonlinear probabilistic weighting reconstruction to the original polarization image using the Mahalanobis distance of the phase space as a metric. At the algorithm level, it achieves extreme suppression of the bright coating background and adaptive amplification of the weak polarization scattering characteristics of the chipping. Finally, it achieves high contrast highlighting and sub-pixel-level accurate positioning of chipping defects under single exposure conditions.
[0065] Figure 6 The following is a schematic block diagram of a polarized light-based neodymium iron boron magnet edge chipping detection system according to an embodiment of this application, as shown below.Figure 6 As shown, the NdFeB magnet edge chipping detection system 600 based on polarized light includes: a parameter calculation module 610, used to perform polarization light physical parameter calculation and dynamic range logarithmic compression on the original polarization array data acquired by a single exposure of the edge region of the NdFeB magnet by a split-plane polarization camera under dark-field polarized illumination to obtain a logarithmic light intensity map and a linear polarization degree map of the magnet; a phase space construction module 620, used to construct a joint light intensity-polarization degree phase space from the logarithmic light intensity map and the linear polarization degree map of the magnet to obtain a scatter set of polarization feature phase space points; and a clustering recognition module 630, used to... The polarization feature phase space scatter set is subjected to expectation-maximization iterative clustering, and based on the coating optical prior, clusters with low logarithmic intensity mean and low polarization degree mean are identified as edge-break defect clusters. Gaussian distribution parameters of the edge-break defect clusters are extracted. The contrast reconstruction module 640 is used to perform phase space Mahalanobis distance mapping and contrast reconstruction on the logarithmic intensity map and linear polarization degree map of the magnetic steel sheet based on the Gaussian distribution parameters of the edge-break defect clusters to obtain a high-contrast reconstruction map of the edge-break. The contour extraction module 650 is used to extract sub-pixel edges and output contours from the high-contrast reconstruction map of the edge-break to obtain sub-pixel edge-break contour data of the magnetic steel sheet.
[0066] Here, those skilled in the art will understand that the specific operations of each step in the above-described method for detecting edge chipping of NdFeB magnet sheets based on polarized light have been referenced above. Figures 1 to 5 The description of the polarized light-based neodymium iron boron magnet sheet chipping detection system is detailed here, and therefore, its repeated description will be omitted.
[0067] The terms "first," "second," etc., are used only to distinguish different technical features and do not imply their importance or number. The designation of a feature as "first" or "second" does not preclude the possibility of additional similar features. The scope of protection of this application shall be determined by the claims; any modifications, substitutions, or combinations that do not depart from the core idea of this application shall fall within the scope of protection of this application.
[0068] The above description is merely a preferred embodiment of this application and is not intended to limit this application in any way. Although this application has been disclosed above with reference to preferred embodiments, it is not intended to limit this application. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this application. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.
Claims
1. A method for detecting edge chipping of neodymium iron boron magnet sheets based on polarized light, characterized in that, include: Step 1: Perform polarization physical parameter calculation and dynamic range logarithmic compression on the polarization raw array data obtained by a single exposure of the edge region of the NdFeB magnet sheet under dark field polarization illumination using a split-focus plane polarization camera to obtain the logarithmic light intensity map and the linear polarization degree map of the magnet sheet. Step 2: Construct a joint phase space of intensity and polarization degree from the logarithmic intensity map and the linear polarization degree map of the magnetic steel sheet to obtain a scatter set of polarization characteristic phase space points; Step 3: Perform expectation-maximization iterative clustering on the scatter set of polarization feature phase space points, and identify the clusters with low mean log light intensity and low mean polarization degree as edge-break defect clusters based on the coating optical prior. Extract the Gaussian distribution parameters of the edge-break defect clusters. Step 4: Based on the Gaussian distribution parameters of the chipped edge defect cluster, perform phase space Mahalanobis distance mapping and contrast reconstruction on the logarithmic light intensity map and the linear polarization degree map of the magnetic steel sheet to obtain a high-contrast reconstruction map of the chipped edge. Step 5: Perform subpixel edge extraction and contour output on the high-contrast reconstructed image of the chipped edge to obtain the subpixel chipped edge contour data of the magnetic steel sheet.
2. The method for detecting edge chipping of NdFeB magnet sheets based on polarized light according to claim 1, characterized in that, The original polarization array data includes gray values in the 0° polarization direction, 45° polarization direction, 90° polarization direction, and 135° polarization direction.
3. The method for detecting edge chipping of neodymium iron boron magnet sheets based on polarized light according to claim 2, characterized in that, Step one includes: Bilinear demosaic interpolation was performed on the original polarization array data to obtain a four-directional polarization intensity map. Polarization Stokes parameters were analyzed on the four-directional polarization intensity map group to obtain a Stokes parameter matrix group containing the total light intensity component and two linear polarization components. The Stokes parametric matrix group is separated and calculated to obtain the linear polarization map of the magnetic steel sheet and the initial spatial distribution map of the light intensity. The initial light intensity spatial distribution map is subjected to high dynamic range logarithmic light intensity compression to obtain the logarithmic light intensity map of the magnetic steel sheet.
4. The method for detecting edge chipping of NdFeB magnet sheets based on polarized light according to claim 1, characterized in that, Step two includes: Using a unified spatial coordinate index, the logarithmic light intensity map and the linear polarization map of the magnetic steel sheet are traversed synchronously. The logarithmic light intensity scalar and the linear polarization scalar at the same pixel position are extracted and assembled into a two-dimensional feature vector in a fixed dimension order to obtain a two-dimensional polarization feature vector flow. Spatial topological deconstruction and phase space scatter set aggregation are performed on the two-dimensional polarization feature vector flow to obtain the polarization feature phase space scatter set.
5. The method for detecting edge chipping of neodymium iron boron magnet sheets based on polarized light according to claim 1, characterized in that, Step three includes: Fast pre-clustering is performed on the scatter set of polarization feature phase space points to perform initial binary partitioning, and the mixing weights, two-dimensional mean vectors and covariance matrices of the two initial clusters are calculated to obtain the initial parameters of the model; Based on the initial parameters of the model, the expected maximization iterative optimization is performed on the scattered point set of polarization characteristic phase space to obtain the binary Gaussian convergence parameters. Compare the mean vectors of the two clusters in the binary Gaussian convergence parameters, and based on the coating optics prior, identify the cluster with lower mean logarithmic light intensity and mean polarization degree as the edge-break defect cluster, and extract its mean vector and covariance matrix as the Gaussian distribution parameters of the edge-break defect cluster.
6. The method for detecting edge chipping of neodymium iron boron magnet sheets based on polarized light according to claim 1, characterized in that, Step four includes: The two-dimensional feature vectors of each pixel are reconstructed by synchronously traversing the logarithmic light intensity map and the linear polarization degree map of the magnetic steel sheet using a unified coordinate index, and the Mahalanobis distance is calculated based on the covariance matrix in the Gaussian distribution parameters of the edge defect cluster to obtain the pixel-by-pixel Mahalanobis distance matrix. A nonlinear mapping of defect attribution probability weights is performed on each Mahalanobis distance scalar in the pixel-by-pixel Mahalanobis distance matrix to obtain the edge collapse defect attribution probability weight matrix. Based on the probability weight matrix of edge chipping defects, the background extreme suppression and local contrast reconstruction of the linear polarization degree map of the magnetic steel sheet are fused to obtain a high-contrast reconstruction map of edge chipping.
7. The method for detecting edge chipping of NdFeB magnet sheets based on polarized light according to claim 1, characterized in that, Step five includes: Gradient field calculation and non-maximum suppression skeletonization are performed on the high-contrast reconstructed image with edge damage to obtain the edge skeleton and skeleton normal angle of the single pixel with edge damage. Local circular neighborhood grayscale values are extracted from the high-contrast reconstruction image of the collapsed edge by extracting the skeleton normal angle direction of each point of the single pixel edge skeleton along the collapsed edge. After calculating the sub-pixel normal offset, the values are superimposed on integer coordinates to obtain the sub-pixel positioning point set. Spatial topology tracing and closed contour fitting are performed on the sub-pixel positioning point set to obtain the sub-pixel chipping contour data of the magnetic steel sheet.
8. The method for detecting edge chipping of neodymium iron boron magnet sheets based on polarized light according to claim 7, characterized in that, Spatial topology tracing and closed contour fitting are performed on the sub-pixel positioning point set to obtain the sub-pixel chipping contour data of the magnetic steel sheet, including: Using a preset neighborhood window along the skeleton direction, the normal angle value of each point in the sub-pixel positioning point set in the skeleton normal angle is estimated locally to obtain the skeleton point curvature direction trend vector field. Based on the curvature direction trend vector field of skeleton points, a directed optimal path tracing guided by curvature continuity cost is performed on the sub-pixel positioning point set to obtain the curvature-guided closed edge collapse contour curve set. The area and curvature smoothness of each contour in the curvature-guided closed edge collapse contour curve set are used as dual criteria to filter and obtain the sub-pixel edge collapse contour data of the magnetic steel sheet.
9. A chipping detection system for neodymium iron boron magnet sheets based on polarized light, characterized in that, include: The parameter calculation module is used to perform polarization physical parameter calculation and dynamic range logarithmic compression on the polarization raw array data obtained by a single exposure of the edge region of the NdFeB magnet sheet under dark field polarization illumination by a split-focus plane polarization camera to obtain the logarithmic light intensity map and the linear polarization degree map of the magnet sheet. The phase space construction module is used to construct a joint phase space of light intensity and polarization degree from the logarithmic light intensity map and the linear polarization degree map of the magnetic steel sheet to obtain a scatter set of polarization feature phase space points. The clustering identification module is used to perform expectation-maximization iterative clustering on the scatter set of polarization feature phase space points, and to identify clusters with low mean log light intensity and low mean polarization degree as edge-break defect clusters based on coating optical priors, and to extract the Gaussian distribution parameters of the edge-break defect clusters. The contrast reconstruction module is used to perform phase space Mahalanobis distance mapping and contrast reconstruction on the logarithmic light intensity map and linear polarization degree map of the magnetic steel sheet based on the Gaussian distribution parameters of the edge chipping defect cluster to obtain a high-contrast reconstruction map of the edge chipping. The contour extraction module is used to extract subpixel edges and output contours from the high-contrast reconstructed image of the chipped edge to obtain the subpixel chipped edge contour data of the magnetic steel sheet.
Citation Information
Patent Citations
System and method for detecting defects of neodymium iron boron blank product
CN118583876A
Neodymium-iron-boron magnet surface defect detection method and system
CN119762430A