Image data processing method based on AOI defect feature extraction
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-18
- Publication Date
- 2026-08-14
AI Technical Summary
[0002]当前在工业自动化外观检测中,利用视觉处理技术识别物体表面的划痕、裂纹以及凹坑是保障产品质量的关键环节,现有主流方案多采用基于一阶梯度的检测算子配合灰度阈值分割法,通过识别像素强度的变化来捕捉缺陷,然而,针对拉丝金属、碳纤维编织层或印刷电路板布线等周期性纹理表面,背景纹理产生高频梯度分量,导致微弱缺陷信号淹没在背景噪声中,为适配不同宽度的缺陷,业界引入多尺度空间理论,通过不同平滑尺度下的响应融合来捕获目标,导致随机纹理噪声在极小尺度下的强度与真实缺陷产生重叠,引发大量误报
[0021]1、在AOI缺陷特征提取中,通过构建二阶偏导数矩阵并解析主曲率特征,将图像数据的处理维度由传统的一阶灰度差异提升至二阶拓扑几何空间,这种机制利用像素邻域强度的曲率分布规律,将线状异常结构与各向同性的背景纹理进行本质剥离,由于该方式不依赖于绝对的对比度阈值,而是基于几何形状的各向异性进行判定,因此在低对比度或强纹理干扰环境下,依然能够保持较高的特征显著性,有效解决微弱缺陷特征容易被背景梯度海洋淹没的技术难题。
Smart Images

Figure CN122312612B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image data processing technology, and in particular relates to an image data processing method based on AOI defect feature extraction. Background Technology
[0002] Currently, in industrial automated appearance inspection, identifying scratches, cracks, and dents on object surfaces using visual processing technology is a key step in ensuring product quality. Most existing mainstream solutions use detection operators based on first-order gradients combined with grayscale thresholding to capture defects by identifying changes in pixel intensity. However, for periodic textured surfaces such as brushed metal, carbon fiber braided layers, or printed circuit board wiring, the background texture generates high-frequency gradient components, causing weak defect signals to be submerged in background noise. To adapt to defects of different widths, the industry has introduced multi-scale spatial theory, which captures targets by fusing responses at different smooth scales. This causes the intensity of random texture noise at extremely small scales to overlap with the real defects, leading to a large number of false alarms.
[0003] When the geometric size of the background texture is on the same order of magnitude as the actual damage, their second-order partial derivative matrices and eigenvalue distributions in the local neighborhood exhibit high topological equivalence. Existing algorithms lack constraints on the evolution of features along the scale axis and do not consider the periodic distribution characteristics of the manifold environment in which the pixel is located, making it difficult to distinguish periodic ridges from isolated defects from a physical mechanism perspective. Existing technologies mainly suffer from the following shortcomings: 1. The first-order gradient features of the pixel intensity field exhibit signal aliasing in complex texture environments; 2. Multi-scale fusion mechanisms lack a measure of the cross-scale stability of local geometric orientations; 3. Local feature extraction algorithms lack constraints on spatial context density, leading to an inability to distinguish periodic interference. For example, publicly available... Chinese invention patent application CN111223093A discloses an AOI defect detection method that utilizes Generative Adversarial Network (GAN) for unsupervised learning on a positive sample set. It locates anomalies by reconstructing the image and comparing the residual distribution of the original image. However, when processing high-frequency textures with surface geometric anisotropy based on a probability distribution learning mechanism, it lacks physical modeling of the second-order topological features of the underlying pixels. When the model faces the situation where metal wires are highly topologically equivalent to linear defects in the differential domain, it may miss detections due to the broad definition of normal manifolds or cause false alarms due to background manifold shifts caused by lighting fluctuations. Under dynamic production line conditions, the algorithm cannot distinguish between periodic ridges and isolated defects from the geometric mechanism, resulting in a mismatch between detection stability and the objective physical boundaries of the industrial scene.
[0004] Therefore, the technical problem to be solved by this invention is to delve into the second-order geometric curvature dimension of the local pixel array, use feature decomposition and scale coherence gating to decouple defect information from background texture, and combine positive AC sparsity to improve the system's ability to perceive non-ideal texture environments. Summary of the Invention
[0005] This invention provides an image data processing method based on AOI defect feature extraction, comprising the following steps:
[0006] Step S1: Obtain the image to be detected, and construct a Gaussian image sequence of the image to be detected under different scale parameters using a preset scale step size, so as to establish a multi-scale topological representation model in pixel space.
[0007] Step S2: For each scale image in the Gaussian image sequence, perform convolution operation using the second derivative of Gaussian to extract the second-order gray-level change features of the pixel neighborhood, construct the Hessian matrix at each pixel location, and obtain the first feature vector pointing to the direction of maximum pixel gradient change by performing eigenvalue decomposition on the Hessian matrix. and the second eigenvector pointing to the geometric extension direction of the defect. The initial feature response intensity of each pixel position is calculated by using the eigenvalues of the Hessian matrix.
[0008] Step S3: Extract the second feature vector at the same pixel coordinates in the scaled images corresponding to two adjacent scale parameters. By calculating the second eigenvector at different scales The cosine of the included angle between the two is used to determine the inter-scale directional coherence coefficient, which characterizes the stability of the geometric orientation.
[0009] Step S4: Centered on the target pixel, along the first feature vector Pixel discrete sampling is performed in the pointed normal space. The feature discreteness measure, which characterizes the degree of feature isolation, is determined by calculating the distribution density of sampling points with the same anisotropic features in the sampling neighborhood. Penalized response suppression is then performed on the periodic background texture in the initial feature response intensity based on the feature discreteness measure.
[0010] Step S5: Establish a nonlinear mapping relationship between the initial feature response intensity and the inter-scale directional coherence coefficient, and use the inter-scale directional coherence coefficient to perform weight modulation on the initial feature response intensity after the penalty response suppression, so as to extract the topological features of the target defect.
[0011] Preferably, step S2 includes: solving for the two eigenvalues of the Hessian matrix, determining the eigenvalue with the larger absolute value as the first eigenvalue, and the eigenvalue with the smaller absolute value as the second eigenvalue; defining the eigenvector corresponding to the first eigenvalue as the first eigenvector. The eigenvector corresponding to the second eigenvalue is defined as the second eigenvector. The initial feature response intensity is generated by taking the square root of the sum of the squares of the first and second eigenvalues.
[0012] Preferably, step S3 includes: the inter-scale directional coherence coefficient increases monotonically with the increase of the cosine value of the included angle; when the inter-scale directional coherence coefficient is higher than the preset stable threshold, the corresponding pixel position is determined to belong to the defect candidate region with structural continuity in the scale evolution process.
[0013] Preferably, step S4 includes: statistically analyzing the distribution density of sampling points with the same curvature polarity characteristics within the sampling neighborhood; determining the ratio of the sampling point distribution density to the preset density mean as the feature discreteness measure; when the feature discreteness measure is less than 1, determining that the corresponding pixel belongs to a periodically distributed industrial texture, and generating a decay factor positively correlated with the feature discreteness measure to perform penalized response suppression.
[0014] Preferably, step S5 includes: establishing an exponential correction function with the natural logarithm as the base and the inter-scale directional coherence coefficient as the independent variable; using the exponential correction function to perform nonlinear mapping on the initial characteristic response intensity, so as to attenuate the noise signal that has a random shift in vector direction due to the evolution of scale parameters while maintaining the defect topology.
[0015] Preferably, after constructing the Hessian matrix, the method further includes: calculating the ratio of the trace to the determinant of the Hessian matrix to determine the anisotropy index of each pixel position; when the anisotropy index is lower than a preset global threshold, determining that the neighborhood of the corresponding pixel is an isotropic region, and performing zeroing processing on the initial feature response intensity of the pixel position.
[0016] Preferably, the sampling step size of pixel discrete sampling is linearly set based on the Gaussian kernel standard deviation under the current scale parameter; the feature discrete metric is used to decouple the industrial wire drawing background from isolated linear defects in the structural feature space.
[0017] Preferably, after extracting the topological features of the target defect, the method further includes: performing maximum projection operation on the feature response maps under different scale parameters to generate an integrated feature map covering defects of different physical sizes; and performing geometric attribute filtering based on pixel connectivity on the integrated feature map to output the final defect detection result.
[0018] Preferably, the inter-scale directional coherence coefficient The calculation formula is: ,in, The first eigenvector under the scale parameter s1 , The second eigenvector under the scale parameter s2 .
[0019] Preferably, the geometric attribute filtering includes the aspect ratio of the statistical target defects and removes nonlinear interference targets with an aspect ratio lower than 1.5.
[0020] Compared with existing technologies, the image data processing method based on AOI defect feature extraction of this invention has the following advantages:
[0021] 1. In AOI defect feature extraction, by constructing a second-order partial derivative matrix and analyzing the principal curvature features, the processing dimension of image data is upgraded from the traditional first-order gray-level difference to a second-order topological geometric space. This mechanism utilizes the curvature distribution law of pixel neighborhood intensity to essentially separate linear abnormal structures from isotropic background textures. Since this method does not rely on an absolute contrast threshold but is based on the anisotropy of geometric shape for judgment, it can still maintain high feature saliency in low-contrast or strong texture interference environments, effectively solving the technical problem that weak defect features are easily submerged by the sea of background gradients.
[0022] 2. By combining the coupling mechanism of multi-scale Gaussian space and the coherence of eigenvectors between scales, a dynamic gating system for geometric orientation stability is established. Taking advantage of the physical difference that real structural defects maintain a consistent extension direction at different smooth scales, while background random noise undergoes drastic directional drift with scale evolution, the response intensity is nonlinearly modulated by extracting the directional coherence coefficients between scales. This cross-scale vector correlation logic not only enhances the algorithm's ability to capture defects of different physical sizes, but also suppresses false signals that present high contrast at a single scale but lack geometric continuity on the scale axis, thus solving the long-standing problem of scale ambiguity in the field of industrial vision.
[0023] 3. By introducing a sparsity evaluation mechanism based on eigenvector fields, the system achieves structural decoupling between deep periodic textures and isolated damage features. By comparing discrete sampling of the principal curvature normal with the background density, the system can identify step features with strong isolation characteristics in orthogonal topological space and perform penalized attenuation on interference terms that exhibit dense periodic distribution. This discrimination method based on spatial context density effectively breaks through the topological isomorphism barrier between deep groove textures and fine scratches in the local differential domain, and improves the adaptive stability of the visual analysis system to complex background conditions without adjusting the optical imaging link. Attached Figure Description
[0024] Figure 1 This is a flowchart of the multi-scale defect feature extraction and response modulation process of the present invention;
[0025] Figure 2 This is the defect determination and gating logic diagram for cross-scale coherence of the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0027] It should be noted that all directional and positional terms used in this invention, such as: up, down, left, right, front, back, vertical, horizontal, inner, outer, top, bottom, transverse, longitudinal, center, etc., are only used to explain the relative positional relationship and connection between components in a specific state (as shown in the accompanying drawings). They are only for the convenience of describing this invention and do not require that this invention be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention. In addition, the descriptions of "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated.
[0028] In the description of this invention, unless otherwise explicitly specified and limited, the terms installation, connection, and linking should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections; they can refer to direct connections or indirect connections through an intermediate medium; they can refer to the internal connection of two components. For those skilled in the art, the specific meaning of the above terms in this invention can be understood according to the specific circumstances.
[0029] In the description of this specification, references to the terms "an embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example, and the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0030] An image data processing method based on AOI defect feature extraction includes the following steps:
[0031] Step S1: Obtain the image to be detected, and construct a Gaussian image sequence of the image to be detected under different scale parameters using a preset scale step size, so as to establish a multi-scale topological representation model in pixel space.
[0032] Step S2: For each scale image in the Gaussian image sequence, perform convolution operation using the second derivative of Gaussian to extract the second-order gray-level change features of the pixel neighborhood, construct the Hessian matrix at each pixel location, and obtain the first feature vector pointing to the direction of maximum pixel gradient change by performing eigenvalue decomposition on the Hessian matrix. and the second eigenvector pointing to the geometric extension direction of the defect. The initial feature response intensity of each pixel position is calculated by using the eigenvalues of the Hessian matrix.
[0033] Step S3: Extract the second feature vector at the same pixel coordinates in the scaled images corresponding to two adjacent scale parameters. By calculating the second eigenvector at different scales The cosine of the included angle between the two is used to determine the inter-scale directional coherence coefficient, which characterizes the stability of the geometric orientation.
[0034] Step S4: Centered on the target pixel, along the first feature vector Pixel discrete sampling is performed in the pointed normal space. The feature discreteness measure, which characterizes the degree of feature isolation, is determined by calculating the distribution density of sampling points with the same anisotropic features in the sampling neighborhood. Penalized response suppression is then performed on the periodic background texture in the initial feature response intensity based on the feature discreteness measure.
[0035] Step S5: Establish a nonlinear mapping relationship between the initial feature response intensity and the inter-scale directional coherence coefficient, and use the inter-scale directional coherence coefficient to perform weight modulation on the initial feature response intensity after the penalty response suppression, so as to extract the topological features of the target defect.
[0036] Preferably, step S2 includes: solving for the two eigenvalues of the Hessian matrix, determining the eigenvalue with the larger absolute value as the first eigenvalue, and the eigenvalue with the smaller absolute value as the second eigenvalue; defining the eigenvector corresponding to the first eigenvalue as the first eigenvector. The eigenvector corresponding to the second eigenvalue is defined as the second eigenvector. The initial feature response intensity is generated by taking the square root of the sum of the squares of the first and second eigenvalues.
[0037] Preferably, step S3 includes: the inter-scale directional coherence coefficient increases monotonically with the increase of the cosine value of the included angle; when the inter-scale directional coherence coefficient is higher than the preset stable threshold, the corresponding pixel position is determined to belong to the defect candidate region with structural continuity in the scale evolution process.
[0038] Preferably, step S4 includes: statistically analyzing the distribution density of sampling points with the same curvature polarity characteristics within the sampling neighborhood; determining the ratio of the sampling point distribution density to the preset density mean as the feature discreteness measure; when the feature discreteness measure is less than 1, determining that the corresponding pixel belongs to a periodically distributed industrial texture, and generating a decay factor positively correlated with the feature discreteness measure to perform penalized response suppression.
[0039] Preferably, step S5 includes: establishing an exponential correction function with the natural logarithm as the base and the inter-scale directional coherence coefficient as the independent variable; using the exponential correction function to perform nonlinear mapping on the initial characteristic response intensity, so as to attenuate the noise signal that has a random shift in vector direction due to the evolution of scale parameters while maintaining the defect topology.
[0040] Preferably, after constructing the Hessian matrix, the method further includes: calculating the ratio of the trace to the determinant of the Hessian matrix to determine the anisotropy index of each pixel position; when the anisotropy index is lower than a preset global threshold, determining that the neighborhood of the corresponding pixel is an isotropic region, and performing zeroing processing on the initial feature response intensity of the pixel position.
[0041] Preferably, the sampling step size of pixel discrete sampling is linearly set based on the Gaussian kernel standard deviation under the current scale parameter; the feature discrete metric is used to decouple the industrial wire drawing background from isolated linear defects in the structural feature space.
[0042] Preferably, after extracting the topological features of the target defect, the method further includes: performing maximum projection operation on the feature response maps under different scale parameters to generate an integrated feature map covering defects of different physical sizes; and performing geometric attribute filtering based on pixel connectivity on the integrated feature map to output the final defect detection result.
[0043] Preferably, the inter-scale directional coherence coefficient The calculation formula is: ,in, The first eigenvector under the scale parameter s1 , The second eigenvector under the scale parameter s2 .
[0044] Preferably, the geometric attribute filtering includes the aspect ratio of the statistical target defects and removes nonlinear interference targets with an aspect ratio lower than 1.5.
[0045] Example 1: In the case of detecting defects in the appearance of metal casings with deep periodic wire drawing processes, weak scratch features are mixed with high-frequency background textures. When pixel intensity thresholding based on the first-order gradient increases the gain to capture scratches, the periodic wire drawing ridges, which are on the same order of magnitude as the physical size of the defect, exhibit highly overlapping second-order partial derivative features in the local neighborhood, generating a large number of false signals. The system acquires the image to be detected, constructs a Gaussian image sequence of the image under different scale parameters using a preset scale step size, and establishes a multi-scale topological representation model in pixel space. For the five generated discrete scale images, the system uses the pixel coordinates at the initial scale of 1.0 as the spatial reference, and in the adjacent higher-scale images... A local centroid search window with a range of 5 x 5 pixels is opened. The starting coordinates of the second feature vector are compensated for at the sub-pixel level using the centroid translation amount. This ensures that the overlap deviation of the feature vector extraction positions across scales in physical space is less than 0.2 pixels, thereby eliminating scale-space drift caused by Gaussian smoothing. For each scale image in the Gaussian image sequence, the system uses the second derivative of Gaussian to extract the second-order gray-level change features of the pixel neighborhood to construct a Hessian matrix. By solving for the two eigenvalues of the Hessian matrix, the eigenvalue with the larger absolute value is determined as the first eigenvalue, and the eigenvalue with the smaller absolute value is determined as the second eigenvalue. The eigenvector corresponding to the first eigenvalue is defined as the first eigenvector pointing to the direction of maximum pixel gradient change. The eigenvector corresponding to the second eigenvalue is defined as the second eigenvector pointing to the geometric extension direction of the defect. ,in Represents the first eigenvector. Representing the second eigenvector, the system generates the initial feature response intensity at each pixel location by taking the square root of the sum of the squares of the first and second eigenvalues. This process maps the spatial grayscale distribution of the pixel array into a local second-order topological feature matrix, distinguishing between background and anomalous manifolds based on the difference in the principal curvature direction, thus resolving signal aliasing caused by local morphological isomorphism. The scale step size Δs is set between 1.1 and 1.5, and Hessian matrix eigenvalue decomposition is performed on each pixel location in the Gaussian image sequence to obtain the first eigenvalue. With the second eigenvalue , For principal curvature components with larger absolute values, For the curvature components with smaller absolute values, the first eigenvalue The corresponding feature vector is the first feature vector pointing in the direction of the maximum change in pixel grayscale. Second eigenvalue The corresponding eigenvector is the second eigenvector pointing towards the geometric extension direction of the defect. The initial characteristic response intensity is calculated. It is determined that a normal vector is established within the second-order topological space of the pixel. With tangential vector They form an orthogonal local coordinate system.
[0046] The system extracts the second feature vector at the same pixel coordinate in the scaled images corresponding to two adjacent scale parameters. Calculate the second eigenvector at different scales The cosine of the included angle between the scales is used to determine the inter-scale directional coherence coefficient, which characterizes the stability of the geometric orientation. This coefficient monotonically increases with the increase of the cosine of the included angle. The inter-scale directional coherence coefficient C is then calculated to extract parameters from adjacent scales. and Second feature vector of the same pixel coordinate and The cosine of the included angle is obtained by calculating the ratio of the absolute value of the dot product to the product of the modulus. The inter-scale directional coherence coefficient C satisfies the formula. In the process of feature extraction, the same pixel coordinates here actually refer to the equivalent mapped coordinates that have achieved physical registration across multiple scale levels after local centroid search window translation compensation. Since the system has already performed inverse resampling interpolation on the grid array using the spatial translation vector when generating high-frequency scale image sequences, the features in the high-scale images have undergone geometric regression and seamlessly aligned to the absolute physical reference of the initial scale. Therefore, the data processing logic directly throws a completely equivalent Cartesian two-dimensional matrix index into each scale data frame, which can penetrate the scale level to lock the same physical object, thus eliminating the logical conflict between coordinate point extraction instructions from the underlying data structure. A preset stable threshold is set to collect defect-free sample images and statistically analyze the vector deflection angle distribution of background random noise during scale evolution. The 95th percentile of the distribution is determined as the judgment boundary. When the inter-scale directional coherence coefficient C is greater than the judgment boundary, the corresponding pixel position is judged to have structural continuity. High-frequency random speckle signals with unstable geometric orientation are removed before spatial manifold density sampling. The system, with the target pixel as the center, along the first feature vector... The system discretely samples pixels in the normal space according to a sampling step size linearly set based on the Gaussian kernel standard deviation under the current scale parameters. It statistically analyzes the distribution density of sampling points with the same curvature polarity characteristics within the sampling neighborhood, and determines the ratio of this density density to the preset mean density as a feature discreteness measure characterizing the degree of feature isolation. For the specific dimensionality reduction and mapping judgment logic from anisotropy to curvature polarity, when identifying a target pixel, the system first extracts the absolute value of the difference between its first and second feature values as the anisotropy amplitude, and simultaneously extracts the positive or negative sign of the first feature value with the larger absolute value as the curvature polarity identifier. Specifically, the system determines that the sampling point and the target pixel belong to the same homogeneous extension of the same physical structure only if the sign of the first feature value within the sampling point's grid region is completely consistent with the central target pixel, and the difference in their anisotropy amplitudes is within 10% of the initial feature response intensity tolerance. Such strongly correlated targets are then included in the effective spatial distribution density array with the same curvature polarity characteristics. The first feature vector... The system provides an orthogonal cross-section normal positioning reference. Based on this reference, it samples and obtains a feature discrete metric. Combining the inter-scale directional coherence coefficient with the feature discrete metric, it identifies periodic background textures. When the feature discrete metric is less than 1, the corresponding pixel is determined to belong to a periodically distributed industrial texture. An attenuation factor positively correlated with the feature discrete metric is generated to suppress the periodic background texture response. The system establishes an exponential correction function with the natural logarithm as the base and the inter-scale directional coherence coefficient as the independent variable. This exponential correction function is used to modulate the nonlinear mapping weights of the suppressed initial feature response intensity. Based on the difference between the continuity of the structural defect extension direction and the geometrical drift of random texture noise at different smooth scales, deep groove textures are filtered out simultaneously while weak scratch responses are retained. Pixel discrete sampling is performed with the target pixel as the center, along the first feature vector. A sampling path is established pointing to the positive and negative normal space. The sampling step size is set to 0.5 times the standard deviation σ of the Gaussian kernel under the current scale parameter s. The distribution density of pixels with the same curvature polarity on the sampling path is statistically analyzed. The ratio of the distribution density to the preset density mean is calculated to generate a feature discreteness metric, and an exponential correction function is established. Weight mapping is performed, where e is the natural constant, C is the inter-scale directional coherence coefficient, and β is a penalty factor set to a constant of 3 and used as a weight decay gradient control parameter. This value of 3 was determined by performing gradient ergodic tests on 20 sets of brushed background images with a signal-to-noise ratio of 15 dB during the system calibration phase. By suppressing the residual response value of the background texture to below 5% of the peak value of the defect response, a physical benchmark of 3 as the exponential decay slope was established, so that the system can maintain a steep noise suppression boundary under different material reflectivities. The function output value is used to perform a pixel-wise Hadamard product operation on the initial feature response intensity to maintain the defect topology and decay the densely periodically distributed industrial texture response in the orthogonal topological space.
[0047] The system projects the maximum value of the feature response map under different scale parameters to generate an integrated feature map covering defects of different physical sizes. The integrated feature map is then filtered for geometric attributes based on pixel connectivity, and the aspect ratio of the target defects is statistically analyzed. Nonlinear interference targets with aspect ratios below 1.5 are removed, and the final defect detection result is output. This process, based on inter-scale principal curvature vector coherence gating and spatial context density constraints, maintains the optical imaging link state unchanged by analyzing the two-dimensional pixel array topology matrix and modulating nonlinear weights. In industrial surface environments with high-frequency isotropic textures, the system outputs quantitative identification results of structural damage states. The system extracts the second feature vector at the same pixel coordinates in the scale images corresponding to two adjacent scale parameters. The system calculates the cosine of the angle between the two and constructs an association model that maps the inter-scale directional coherence coefficient to a positive algebraic function of the cosine of the angle. It limits the inter-scale directional coherence coefficient to monotonically increase with the increase of the cosine of the angle. The data processing module collects the generated inter-scale directional coherence coefficient and transmits it to the logic comparison unit. It compares it with the preset stability threshold written in the non-volatile register. The threshold is established based on the lower limit extreme value of the coherence coefficient attenuated by the physical boundary of the measured standard scratch. When the inter-scale directional coherence coefficient is numerically higher than the preset stability threshold, the logic comparison unit outputs a high-level state signal. The system flips the Boolean flag bit of the target pixel coordinate in the feature-preserving multidimensional array according to the state signal. Based on the state flip of the flag bit, it determines that the corresponding pixel position belongs to the defect candidate region with structural continuity in the scale evolution process. Before starting the spatial manifold density discrete sampling, the procedure establishes a first-order gated truncation mechanism based on the topological principal direction change rate to block the high-frequency random speckle data array that does not have geometric stability.
[0048] Example 2: This example utilizes a physical experimental platform to test the detection performance of subtle scratches on deeply periodically brushed metal surfaces. This platform includes a 10-megapixel monochrome industrial camera with a spatial resolution of 5μm and a coaxial light source. Simultaneously, the system actively superimposes Gaussian white noise with a signal-to-noise ratio of 15dB and 50Hz flicker interference harmonics at the image acquisition end to simulate electromagnetic and lighting disturbances in an industrial environment. The system sets the scale step size for the Gaussian image sequence, the value of which depends on a technical trade-off between the continuity of cross-scale feature capture and the computational load of the image processor. The decision rule is that the scale step size is inversely proportional to the spatial frequency bandwidth of the expected defect. When the defect bandwidth is narrow, indicating a severe local geometric change, the scale step size tends towards the lower limit of the value range to improve the scale spatial resolution. In this example, based on this rule, the scale step size is set to 1.2, generating five discrete-scale images starting from the initial scale of 1.0.
[0049] The experimental input consisted of raw image data containing scratches with a width of 10 μm superimposed on periodic filament grooves with a depth of 15 μm. The system processed this raw data in parallel using a comparative sample group and the sample group of the present invention. The comparative sample group employed a single-scale Hessian matrix feature extraction mechanism, and its output showed a maximum eigenvalue response of 145 at the scratches and 142 at the periodic grooves. The two types of geometric structures exhibited severe aliasing under this first-order metric. The sample group of the present invention extracted the Hessian matrix at each pixel location and calculated the first feature vector. With the second eigenvector The second feature vector at different scales is calculated through cross-scale tracking. The cosine value of the included angle at the actual scratch location remains above 0.92, and the corresponding inter-scale directional coherence coefficient is generated at 0.88. The cosine value of the included angle of the periodic groove affected by noise decays to 0.45, and the corresponding inter-scale directional coherence coefficient decreases to 0.21. The system along the first feature vector The sampling points are extracted in the indicated normal space. The feature discrete metric calculated at the real scratch is 3.2, and the feature discrete metric calculated at the dense periodic groove background is 0.6.
[0050] The system identifies periodically distributed industrial textures based on the aforementioned quantization criterion that the feature discreteness metric is less than 1. It generates an attenuation factor to suppress the groove background response and uses an exponential correction function with the inter-scale directional coherence coefficient as the independent variable to modulate the nonlinear weights of the initial feature response intensity. The integrated feature map outputs a scratch modulation response of 210 and a groove background response reduced to 15, thus separating structurally abnormal targets from noise through a dual quantization mapping of geometric topological characteristics. To set the aspect ratio threshold parameter based on connectivity filtering, the system establishes a problem intensity gradient comparison system to perform parameter optimization. Test data shows that when the aspect ratio threshold is set to 1.0, the system retains residual speckle noise, resulting in a false positive rate of 24.5%. When the aspect ratio threshold is set to 1.5, the false positive rate shows a nonlinear inflection point, decreasing to 1.2% and remaining at 98.5%. The defect detection rate was 64.0%. When the threshold exceeded 2.0 and reached the overload zone of 2.5, the system erroneously removed discontinuous segments of real scratches, causing the detection rate to deteriorate sharply to 64.0%. This performance degradation trend established the physical rationality of aspect ratio 1.5 as the optimal filtering boundary. The experimental data above confirmed that the cross-scale principal curvature vector coherence measurement, combined with the discrete sampling mechanism of positive manifold density, separated the background manifold and abnormal manifold of similar scale under the physical conditions of 15dB signal-to-noise ratio and power frequency interference. The inflection point data of the nonlinear performance of the aspect ratio filtering threshold provided a quantitative basis for parameter selection. The detection logic is based on the orthogonal decomposition and spatial statistics of the eigenvalues of the image's bottom-level topological matrix, moving away from the simple pixel intensity discrimination dimension, and outputting quantitative identification results of industrial surface structural damage with anti-interference capabilities.
[0051] Example 3: In dynamic real-world testing conditions facing periodic shifts in lighting environment and batch-to-batch reflectivity fluctuations in materials, the fixed texture density benchmark becomes ineffective due to the overall shift in background grayscale, causing a lack of quantitative reference when calculating discrete feature measurements. Before processing the image to be tested, the system imports a preset calibration image, delineates a defect-free reference region, traverses all pixels within this reference region, calculates the global mathematical expectation of the sampling point distribution density with the same curvature polarity characteristics, and stores the global mathematical expectation as a preset density mean in the system register. In the real-time data stream processing of the image to be tested, the system, centered on the target pixel, moves along the first feature vector... Extract the coordinate sequence from the pointed normal space, targeting the first feature vector. The system extracts the second-order grayscale variation features of four adjacent real pixels around the non-integer coordinate point, and applies a bilinear interpolation algorithm to calculate the virtual pixel features of the target spatial location. Based on the sub-pixel level features, the system statistically analyzes the distribution density of sampling points with the same anisotropic features, and divides it by the average of the preset density called in real time in the register to generate a feature discrete metric representing the degree of feature isolation. In the specific density calculation process in this discrete grid space, the system constructs a one-dimensional linear detection window with the target pixel as the origin and extends along the positive and negative normal directions by the total length of three Gaussian kernel standard deviations. The system extracts the Euclidean distance of each sub-pixel sampling point in the window from the origin one by one, and constructs a monotonically decreasing Gaussian weighted function with the reciprocal of the distance as the independent variable. The weighted function output value of the sampling points that meet the anisotropic matching conditions is continuously accumulated to ensure that the far-end background texture points produce a smooth physical distance attenuation to the current pixel core response. This process eliminates the background suppression failure caused by parameter drift by introducing dynamic expectation calibration of the physical reference plane and sub-pixel interpolation operation.
[0052] After obtaining the feature discrete measure, the system determines that pixels with a feature discrete measure lower than 1 belong to periodically distributed industrial textures. The feature discrete measure is input into a logistic regression function to generate a continuous decay factor with values between 0 and 1. This factor is multiplied by the initial feature response intensity to calculate the intermediate response amount after penalized response suppression. The system then extracts the second feature vector at different scales. The inter-scale directional coherence coefficients are used to construct an exponential correction function with the inter-scale directional coherence coefficients as independent variables and the natural logarithm as the base. The intermediate response quantity is multiplied by the output of the exponential correction function to complete the weight modulation. An algebraic mapping relationship between discrete metrics and nonlinear penalty weights is established. A continuous mapping function is used to replace numerical truncation, so that the feature extraction process can attenuate the response intensity of high-frequency isomorphic textures while preserving the continuity of the defect geometry, and output the topological structural features of the target defect.
[0053] Example 4: In the field calibration of an engineering environment where a vision inspection system is deployed in a mixed production line of multiple metal casings, facing the surface reflectivity jumps and periodic discrete fluctuations in texture caused by batch changes, the system initiates an offline parameter mapping construction procedure before going online to determine the distribution weights of the logistic regression function; the system accesses an engineering sample set containing standard scratches and normal high-frequency brushed textures, controls a coaxial structure light source to output a gradient light intensity sequence from the lower limit to the upper limit of the illuminance range on the surface of the engineering sample set, and the industrial camera simultaneously acquires sample images under the corresponding light intensities to construct an offline calibration image library; the system traverses all physical pixels in the offline calibration image library, calculates the feature discrete metric of pixels in the scratch area and assigns it to the target classification label space, and simultaneously calculates the feature discrete metric of pixels in the normal texture area and assigns it to the background classification label space, generating a calibration data pair set containing the feature discrete metric independent variable and the binary classification label dependent variable.
[0054] Based on a calibrated data set containing feature gradients, the system statistically analyzes the sample frequency corresponding to each discrete metric independent variable and filters out isolated feature noise. It iteratively solves for the regression coefficients and bias constants within the logistic regression function framework using a maximum likelihood estimation algorithm. The logistic regression function outputs a cross-entropy loss index when fitting the calibrated data set and monotonically converges to a preset convergence tolerance band. The completed convergence iteration logistic regression function framework is extracted, and its function body code is burned into the controller's non-volatile storage module. During continuous device operation, the data processing unit collects real-time feature discrete metrics and inputs them as independent variables into the solidified function body. Algebraic mapping operations are performed based on the calibrated regression coefficients and bias constants, and a continuous decay factor with values between 0 and 1 is output. The system delineates the algebraic operation boundary for nonlinear penalty weights based on the regression coefficients and bias constants established by the physical sample matrix mapping. When faced with heterogeneous physical material inputs, it continuously outputs structural classification data with numerical consistency.
[0055] Example 5: In cases where the defect exhibits non-rigid deformation, the method of calculating the aspect ratio using the circumscribed rectangle becomes distorted as the defect bends, causing the geometric attribute filtering to lose its quantitative benchmark. The system extracts the two-dimensional spatial coordinate sequence of independent pixel connected regions and internal pixels from the integrated feature map, and constructs a second-order central moment tensor M representing the spatial distribution based on this. Decomposing this second-order central moment tensor M yields the first spatial eigenvalue representing the principal axis variance. Spatial second eigenvalue of the secondary axis variance Where M represents the second-order central moment tensor, It is the first eigenvalue of the space. Given the second eigenvalue of the space, calculate the first eigenvalue of the space. With the second eigenvalue of space The square root of the ratio is used as the exact aspect ratio of the region and compared with a preset threshold. In order to eliminate the physical error that may be caused by the bending trajectory to artificially increase the secondary axis variance, thus causing the aspect ratio to be mistakenly deleted due to being below the 1.5 threshold, in the specific execution process of constructing and decomposing the second-order central moment tensor M, the system extracts the second feature vector of each pixel in the connected region that has been calculated in the scale space pointing to the geometric extension direction of the defect. The path integral is performed on the two-dimensional spatial coordinate sequence along the continuous vector field, and the absolute Cartesian coordinate system is mapped to a local positive manifold coordinate system with the cumulative arc length as the principal axis and the normal deviation distance as the secondary axis. By measuring the coordinate variance in this local manifold space, the calculated secondary axis variance only represents the true physical average width of the defect, thereby removing the geometric envelope expansion effect caused by C-shaped or S-shaped curling. This procedure transforms the size measurement into solving the second-order statistics of the space, so that the continuous bending structure can obtain an accurate physical proportion measurement.
[0056] In the modulation response weighting stage, the linear operator cannot provide a sufficient attenuation gradient for the isotropic noise in the critical ambiguity state; the system retrieves the inter-scale directional coherence coefficients. Construct algebraic relations as The exponential correction function W is given by $\mathbf{a}$, where $W$ represents the exponential correction function, $e$ represents the natural constant, and $β$ represents the scale penalty factor set to a value of 3. The system calculates the pixel-wise Hadamard product of the initial feature response intensity after punitive response suppression and the output value of the exponential correction function W to extract features. This procedure establishes a nonlinear mapping from coherence to response. When the main feature direction deflection causes the independent variable to deviate from the extreme value 1, the system attenuates the corresponding response intensity, suppressing the structured noise accompanied by directional perturbation within the defined physical boundary.
[0057] The embodiments of this application have been described above with reference to the accompanying drawings. Unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other. This application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit of this application and the scope of protection of this invention, and all of these forms are within the protection scope of this application.
Claims
1. An image data processing method based on AOI defect feature extraction, characterized in that, Includes the following steps: Step S1: Obtain the image to be detected, and construct a Gaussian image sequence of the image to be detected under different scale parameters using a preset scale step size, so as to establish a multi-scale topological representation model in pixel space. Step S2: For each scale image in the Gaussian image sequence, perform convolution operation using the second derivative of Gaussian to extract the second-order gray-level change features of the pixel neighborhood, construct the Hessian matrix at each pixel location, and obtain the first feature vector pointing to the direction of maximum pixel gradient change by performing eigenvalue decomposition on the Hessian matrix. and the second eigenvector pointing to the geometric extension direction of the defect. The initial feature response intensity of each pixel position is calculated by using the eigenvalues of the Hessian matrix. Step S3: Extract the second feature vector at the same pixel coordinates in the scaled images corresponding to two adjacent scale parameters. By calculating the second eigenvector at different scales The cosine of the included angle between the two is used to determine the inter-scale directional coherence coefficient, which characterizes the stability of the geometric orientation. Step S4: Centered on the target pixel, along the first feature vector Pixel discrete sampling is performed in the pointed normal space. The feature discreteness measure, which characterizes the degree of feature isolation, is determined by calculating the distribution density of sampling points with the same anisotropic features in the sampling neighborhood. Penalized response suppression is then performed on the periodic background texture in the initial feature response intensity based on the feature discreteness measure. Step S5: Establish a nonlinear mapping relationship between the initial feature response intensity and the inter-scale directional coherence coefficient, and use the inter-scale directional coherence coefficient to perform weight modulation on the initial feature response intensity after the penalty response suppression, so as to extract the topological features of the target defect.
2. The image data processing method based on AOI defect feature extraction according to claim 1, characterized in that, Step S2 includes: solving for the two eigenvalues of the Hessian matrix, determining the eigenvalue with the larger absolute value as the first eigenvalue, and the eigenvalue with the smaller absolute value as the second eigenvalue; defining the eigenvector corresponding to the first eigenvalue as the first eigenvector. The eigenvector corresponding to the second eigenvalue is defined as the second eigenvector. The initial feature response intensity is generated by taking the square root of the sum of the squares of the first and second eigenvalues.
3. The image data processing method based on AOI defect feature extraction according to claim 1, characterized in that, Step S3 includes: the inter-scale directional coherence coefficient increases monotonically with the increase of the cosine of the included angle; when the inter-scale directional coherence coefficient is higher than the preset stable threshold, the corresponding pixel position is determined to belong to the defect candidate region with structural continuity in the scale evolution process.
4. The image data processing method based on AOI defect feature extraction according to claim 1, characterized in that, Step S4 includes: statistically analyzing the distribution density of sampling points with the same curvature polarity within the sampling neighborhood; determining the ratio of the sampling point distribution density to the preset density mean as the feature discreteness measure; when the feature discreteness measure is less than 1, determining that the corresponding pixel belongs to the periodically distributed industrial texture, and generating a decay factor positively correlated with the feature discreteness measure to perform penalized response suppression.
5. The image data processing method based on AOI defect feature extraction according to claim 1, characterized in that, Step S5 includes: establishing an exponential correction function with the natural logarithm as the base and the inter-scale directional coherence coefficient as the independent variable; using the exponential correction function to perform nonlinear mapping on the initial characteristic response intensity, so as to attenuate the noise signal that has a random shift in vector direction as the scale parameter evolves while maintaining the defect topology.
6. The image data processing method based on AOI defect feature extraction according to claim 2, characterized in that, After constructing the Hessian matrix, the process also includes: calculating the ratio of the trace to the determinant of the Hessian matrix to determine the anisotropy index of each pixel location; when the anisotropy index is lower than a preset global threshold, the neighborhood of the corresponding pixel is determined to be an isotropic region, and the initial feature response intensity of the pixel location is zeroed out.
7. The image data processing method based on AOI defect feature extraction according to claim 4, characterized in that, The sampling step size for pixel discrete sampling is linearly set based on the Gaussian kernel standard deviation under the current scale parameters; the feature discrete metric is used to decouple the industrial wire drawing background from isolated linear defects within the structural feature space.
8. The image data processing method based on AOI defect feature extraction according to claim 1, characterized in that, After extracting the topological features of the target defect, the process also includes: performing maximum projection operation on the feature response maps under different scale parameters to generate an integrated feature map covering defects of different physical sizes; and performing geometric attribute filtering based on pixel connectivity on the integrated feature map to output the final defect detection result.
9. The image data processing method based on AOI defect feature extraction according to claim 3, characterized in that, Inter-scale directional coherence coefficient The calculation formula is: ,in, and scale parameters and The second eigenvector below .
10. The image data processing method based on AOI defect feature extraction according to claim 8, characterized in that, Geometric attribute filtering includes statistical analysis of the aspect ratio of target defects and removes nonlinear interference targets with an aspect ratio lower than 1.5.
Citation Information
Patent Citations
AOI defect detection method
CN111223093A
Road surface crack image detection method based on Hessian matrix multi-scale filtering
CN105719283A
Ceramic tile surface crack detection method based on multi-scale Hessian matrix filtering
CN111179260A