A metal surface processing quality detection method and system
Patent Information
- Application Number
- CN202610942396.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2046-06-29
AI Technical Summary
[0005]本发明旨在解决工艺纹理与疵点数据在空间域高度耦合导致的检测误报与漏检并存的问题
1、在金属表面加工质量检测中,实现复杂背景噪声与微弱目标特征在底层数据维度的正交解耦,本发明通过利用二维频率变换算子,将混叠于空间域的信号特征映射至频域拓扑空间,使具有周期性属性的加工纹理数据坍缩为高能量的离散坐标簇,而具有随机属性的疵点数据呈现为宽频带的弥散分布,这种数据拓扑结构的重构,从原理层面消解传统空间域处理中加工纹理产生的灰度梯度与真实疵点产生的异常梯度互为干扰的固有缺陷,使系统在执行判定逻辑时无需在漏检与误报之间进行权衡,从而在数字处理架构内确立区分本底噪声与异常突变信号的确定性物理前提。
Smart Images

Figure CN122451379B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electronic digital data processing technology, and in particular relates to a method and system for detecting the quality of metal surface processing. Background Technology
[0002] Currently, metal surface processing quality inspection is a core aspect of quality control in precision manufacturing production lines. Digital inspection architecture maps the collected reflected light intensity into a two-dimensional grayscale data matrix, determining surface features through analytical operators of spatial grayscale gradients. In precision milling or turning scenarios, the periodic textures generated on the metal surface by the cutting process cause regular fluctuations in grayscale data. In the spatial topological dimension, the high-frequency gradient data generated by this process texture overlaps with abnormal data generated by defects. Due to limitations in the data presentation format, the underlying computational logic cannot effectively decouple the processing background noise from abnormal abrupt signals. When the judgment threshold is increased, weak defect data is missed; when the judgment threshold is decreased, massive amounts of process texture data trigger false alarms. This logical constraint within the spatial domain constitutes the underlying obstacle to data processing efficiency in this field.
[0003] Simply improving optical resolution or applying spatial convolution operators cannot extract macroscopically consistent process components from the data layer. Feed rate fluctuations or tool wear during processing cause instantaneous shifts in texture frequency, rendering static filtering schemes with preset fixed parameters ineffective. This uncertainty in data fluctuations caused by physical conditions leads to a very high risk of misjudgment in data processing systems integrated into production line automation. Existing technologies often fall into a contradiction between redundant computing power and decreased detection accuracy when dealing with such complex periodic background noise. In addition to limitations in hardware roller shape or optical imaging, software control methods and digital processing logic also lack stability in handling complex conditions. For example, [the following is an example of a technical specification] with authorization announcement number CN121. Chinese invention patent 147212B discloses a cable shield braid density detection system based on image analysis, which attempts to suppress the periodic signal of braid texture in the frequency domain using a band-stop filter. The underlying logic of such schemes relies on the determinism and static stability of the energy distribution of texture features in the frequency domain space. In actual metal cutting conditions, small fluctuations in feed rate or nonlinear tool wear cause transient drift and bandwidth broadening of the frequency domain energy spectrum. Preset weighted fixed filter operators are difficult to accurately cover the dynamically evolving noise region, resulting in residual spectral energy or signal distortion caused by excessive filtering. Erasing high-energy frequency components will cause irreversible damage to the edge sharpness of defects in the spatial domain, resulting in a decrease in the ability to capture weak abnormal states.
[0004] Therefore, how to separate process texture background data from random abnormal signals in the underlying mathematical space in the electrical digital data processing architecture, and how to build an adaptive data flow mechanism that can adapt to changes in physical conditions, has become the technical problem to be solved by this invention. Summary of the Invention
[0005] The present invention aims to solve the problem of both false alarms and missed detections caused by the high coupling of process texture and defect data in the spatial domain.
[0006] In this technical solution, a method for inspecting the quality of metal surface processing includes the following steps: Step S1: Obtain the two-dimensional grayscale data matrix of the surface object to be detected; Step S2: The two-dimensional grayscale data matrix is mapped into a frequency domain energy matrix by a two-dimensional spatial frequency transformation operator; Step S3: Calculate the global energy mean of the frequency domain energy matrix and multiply it by the preset first weight coefficient to generate the energy decision threshold; Step S4: Extract the set of local energy peak coordinates where the energy value is greater than the energy decision threshold from the frequency domain energy matrix. The set of local energy peak coordinates represents the center of the periodic characteristic frequency distribution of the surface object to be detected. Step S5: Extract the radial energy distribution values around the coordinates of each local energy peak and calculate the energy attenuation gradient between adjacent coordinate points; Step S6: When the energy decay gradient drops below the preset background threshold, determine the corresponding radial distance as the hindrance radius and generate a dynamic hindrance mask matrix accordingly. Step S7: Perform logical dot multiplication on the dynamic hindrance mask matrix and the frequency domain energy matrix to remove periodic components, and extract the basic diffuse energy integral value of the masked area. Allocate the basic diffuse energy integral value according to the reciprocal of the distance from each coordinate point to the local energy peak coordinate to generate the residual frequency domain matrix. Step S8: The residual frequency domain matrix is reconstructed into a spatial domain data matrix using the inverse transformation operator, and the quality detection result is output.
[0007] Preferably, step S6, generating the dynamic hindrance mask matrix, includes: in the original mask matrix with the same dimension as the frequency domain energy matrix, setting the position of the corresponding local energy peak coordinate as the mask center; setting the weight of the elements in the circular region of the original mask matrix with the mask center as the center and the hindrance radius as the radius to 0, and setting the weight of the elements outside the circular region to 1.
[0008] Preferably, before extracting the local energy peak coordinate set, the method further includes: establishing a low-frequency protection data index area with the origin of the frequency domain energy matrix as the center and a preset low-frequency cutoff frequency as the radius; determining whether the local energy peak coordinate falls into the low-frequency protection data index area; if the determination result is yes, then suppressing the comparison logic of the energy decision threshold and blocking the coordinate from entering the local energy peak coordinate set.
[0009] Preferably, step S7, generating the residual frequency domain matrix, includes: compensating the basic diffuse energy integral value to the high-frequency data nodes in the residual frequency domain matrix that are not covered by the mask using a nonlinear discrete mapping method.
[0010] Preferably, step S8 outputs the quality inspection result including: counting the number of target pixels in the spatial domain data matrix whose gray values are greater than a preset deviation threshold; calculating the clustering index of the target pixels in the spatial domain data matrix; and outputting a processing quality failure instruction when the number of target pixels exceeds a preset size threshold and the clustering index exceeds a preset connectivity threshold.
[0011] Preferably, step S1, obtaining the two-dimensional grayscale data matrix of the surface object to be detected, includes: acquiring the optical image signal of the surface object to be detected; performing discrete sampling and amplitude quantization on the optical image signal to generate the original grayscale matrix; and using the mean shift operator to smooth the original grayscale matrix to remove grayscale deviations caused by non-uniform illumination.
[0012] Preferably, after generating the residual frequency domain matrix, a high-frequency feature enhancement step is further included: extracting the edge high-frequency energy values at the stagnation radius boundary; multiplying the edge high-frequency energy values by a preset second weight coefficient to obtain a gain term, and accumulating the gain term to the frequency domain coordinate points corresponding to the residual frequency domain matrix.
[0013] Preferably, the calculation of the clustering index includes: performing connected component analysis on the target pixels to identify pixel clusters; calculating the equivalent diameter to the ratio of the major and minor axes of each connected component, and determining the clustering index by the weighted sum of the equivalent diameter to the ratio of the major and minor axes.
[0014] Preferably, the two-dimensional spatial frequency transformation operator is a two-dimensional fast Fourier transform operator.
[0015] A metal surface processing quality inspection system, used to implement a metal surface processing quality inspection method, includes: The data acquisition module is used to acquire a two-dimensional grayscale data matrix of the surface object to be detected; The frequency transformation module is used to map a two-dimensional grayscale data matrix into a frequency domain energy matrix through a two-dimensional spatial frequency transformation operator. The threshold generation module is used to calculate the global energy mean of the frequency domain energy matrix and multiply it by a preset first weight coefficient to generate an energy decision threshold. The feature center extraction module is used to extract the set of local energy peak coordinates where the energy value is greater than the energy decision threshold from the frequency domain energy matrix; The energy gradient calculation module is used to extract the radial energy distribution value around the local energy peak coordinates and calculate the energy attenuation gradient between adjacent coordinate points; The mask generation module is used to determine the corresponding hindrance radius and generate a dynamic hindrance mask matrix when the energy decay gradient drops below a preset background threshold. The feature reconfiguration module is used to perform logical dot multiplication between the dynamic hindrance mask matrix and the frequency domain energy matrix, and extract the basic diffuse energy integral value of the masked area. The basic diffuse energy integral value is reconfigured based on the reciprocal of the distance from the coordinate point to the local energy peak coordinate to generate the residual frequency domain matrix. The quality inspection result output module is used to reconstruct the residual frequency domain matrix into a spatial domain data matrix through the inverse transformation operator and output the quality inspection result.
[0016] Compared with existing technologies, the metal surface processing quality inspection method of the present invention has the following advantages: 1. In the quality inspection of metal surface processing, this invention achieves orthogonal decoupling between complex background noise and weak target features in the underlying data dimension. By utilizing a two-dimensional frequency transformation operator, the signal features superimposed in the spatial domain are mapped to the frequency domain topological space. This causes the processing texture data with periodic attributes to collapse into a high-energy discrete coordinate cluster, while the defect data with random attributes presents as a wide-band diffuse distribution. This reconstruction of the data topology structure eliminates the inherent defect in traditional spatial domain processing where the gray-level gradient generated by the processing texture and the abnormal gradient generated by the real defect interfere with each other. This eliminates the need for the system to weigh between missed detections and false alarms when executing the judgment logic, thereby establishing a deterministic physical premise for distinguishing between background noise and abnormal abrupt signals within the digital processing architecture.
[0017] 2. Constructing a dynamic shielding mechanism with transient adaptive capability to complex physical working condition fluctuations: This invention extracts the energy attenuation gradient radiated outward from the local energy peak in the frequency domain energy matrix, calculates the corresponding hindrance radius in real time, and generates a dynamic hindrance mask matrix. Compared with the static filtering method with preset fixed parameters, the logic closed loop of this invention can respond instantly to the texture frequency drift caused by changes in feed rate or tool wear during the processing, ensuring that the hindrance boundary always maintains a precise match with the real noise distribution characteristics. This mask generation logic driven by the data flow itself not only avoids the systemic risk of filtering failure due to small deformations in the working condition, but also improves the engineering robustness of the data processing algorithm in discrete production line environments.
[0018] 3. Establishing high-fidelity reconstruction and signal-to-noise ratio gain capabilities for extremely weak anomalous signals, this invention establishes a low-frequency protection data index area and executes algebraically conserved diffuse energy compensation logic. While strongly suppressing periodic high-energy noise, it simultaneously maintains the continuity of macroscopic illumination background data and recovers high-frequency energy at defect edges lost due to mask obstruction. This cross-frequency energy reallocation mechanism enables nonlinear compensation of the characteristic intensity of minute defects in the final reconstructed spatial domain defect data matrix, solving the technical problem of signal edge sharpness attenuation after traditional filtering. Based on the digital mapping capability of the underlying architecture to capture extremely subtle physical deviations, this mechanism achieves deterministic capture of weak anomalous states without changing the front-end detection accuracy. Attached Figure Description
[0019] Figure 1 This is a flowchart of the metal surface processing quality inspection process using the dynamic retardation mask of the present invention; Figure 2 This is the functional architecture and feature decoupling logic diagram of the electronic digital data processing system of the present invention. Detailed Implementation
[0020] 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.
[0021] 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.
[0022] 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.
[0023] 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.
[0024] A method for inspecting the quality of metal surface processing includes the following steps: Step S1: Obtain the two-dimensional grayscale data matrix of the surface object to be detected; Step S2: The two-dimensional grayscale data matrix is mapped into a frequency domain energy matrix by a two-dimensional spatial frequency transformation operator; Step S3: Calculate the global energy mean of the frequency domain energy matrix and multiply it by the preset first weight coefficient to generate the energy decision threshold; Step S4: Extract the set of local energy peak coordinates where the energy value is greater than the energy decision threshold from the frequency domain energy matrix. The set of local energy peak coordinates represents the center of the periodic characteristic frequency distribution of the surface object to be detected. Step S5: Extract the radial energy distribution values around the coordinates of each local energy peak and calculate the energy attenuation gradient between adjacent coordinate points; Step S6: When the energy decay gradient drops below the preset background threshold, determine the corresponding radial distance as the hindrance radius and generate a dynamic hindrance mask matrix accordingly. Step S7: Perform logical dot multiplication on the dynamic hindrance mask matrix and the frequency domain energy matrix to remove periodic components, and extract the basic diffuse energy integral value of the masked area. Allocate the basic diffuse energy integral value according to the reciprocal of the distance from each coordinate point to the local energy peak coordinate to generate the residual frequency domain matrix. Step S8: The residual frequency domain matrix is reconstructed into a spatial domain data matrix using the inverse transformation operator, and the quality detection result is output.
[0025] Preferably, step S6, generating the dynamic hindrance mask matrix, includes: in the original mask matrix with the same dimension as the frequency domain energy matrix, setting the position of the corresponding local energy peak coordinate as the mask center; setting the weight of the elements in the circular region of the original mask matrix with the mask center as the center and the hindrance radius as the radius to 0, and setting the weight of the elements outside the circular region to 1.
[0026] Preferably, before extracting the local energy peak coordinate set, the method further includes: establishing a low-frequency protection data index area with the origin of the frequency domain energy matrix as the center and a preset low-frequency cutoff frequency as the radius; determining whether the local energy peak coordinate falls into the low-frequency protection data index area; if the determination result is yes, then suppressing the comparison logic of the energy decision threshold and blocking the coordinate from entering the local energy peak coordinate set.
[0027] Preferably, step S7, generating the residual frequency domain matrix, includes: compensating the basic diffuse energy integral value to the high-frequency data nodes in the residual frequency domain matrix that are not covered by the mask using a nonlinear discrete mapping method.
[0028] Preferably, step S8 outputs the quality inspection result including: counting the number of target pixels in the spatial domain data matrix whose gray values are greater than a preset deviation threshold; calculating the clustering index of the target pixels in the spatial domain data matrix; and outputting a processing quality failure instruction when the number of target pixels exceeds a preset size threshold and the clustering index exceeds a preset connectivity threshold.
[0029] Preferably, step S1, obtaining the two-dimensional grayscale data matrix of the surface object to be detected, includes: acquiring the optical image signal of the surface object to be detected; performing discrete sampling and amplitude quantization on the optical image signal to generate the original grayscale matrix; and using the mean shift operator to smooth the original grayscale matrix to remove grayscale deviations caused by non-uniform illumination.
[0030] Preferably, after generating the residual frequency domain matrix, a high-frequency feature enhancement step is further included: extracting the edge high-frequency energy values at the stagnation radius boundary; multiplying the edge high-frequency energy values by a preset second weight coefficient to obtain a gain term, and accumulating the gain term to the frequency domain coordinate points corresponding to the residual frequency domain matrix.
[0031] Preferably, the calculation of the clustering index includes: performing connected component analysis on the target pixels to identify pixel clusters; calculating the equivalent diameter to the ratio of the major and minor axes of each connected component, and determining the clustering index by the weighted sum of the equivalent diameter to the ratio of the major and minor axes.
[0032] Preferably, the two-dimensional spatial frequency transformation operator is a two-dimensional fast Fourier transform operator.
[0033] A metal surface processing quality inspection system, comprising: The data acquisition module is used to acquire a two-dimensional grayscale data matrix of the surface object to be detected; The frequency transformation module is used to map a two-dimensional grayscale data matrix into a frequency domain energy matrix through a two-dimensional spatial frequency transformation operator. The threshold generation module is used to calculate the global energy mean of the frequency domain energy matrix and multiply it by a preset first weight coefficient to generate an energy decision threshold. The feature center extraction module is used to extract the set of local energy peak coordinates where the energy value is greater than the energy decision threshold from the frequency domain energy matrix; The energy gradient calculation module is used to extract the radial energy distribution value around the local energy peak coordinates and calculate the energy attenuation gradient between adjacent coordinate points; The mask generation module is used to determine the corresponding hindrance radius and generate a dynamic hindrance mask matrix when the energy decay gradient drops below a preset background threshold. The feature reconfiguration module is used to perform logical dot multiplication between the dynamic hindrance mask matrix and the frequency domain energy matrix, and extract the basic diffuse energy integral value of the masked area. The basic diffuse energy integral value is reconfigured based on the reciprocal of the distance from the coordinate point to the local energy peak coordinate to generate the residual frequency domain matrix. The quality inspection result output module is used to reconstruct the residual frequency domain matrix into a spatial domain data matrix through the inverse transformation operator and output the quality inspection result.
[0034] Example 1: In the in-situ optical image data stream processing node of a high-precision milling production line for aluminum alloys, the surface object to be detected has periodic process textures generated by tool feed. In the spatial domain grayscale topology, these textures appear as dense, regular grayscale gradient fluctuations, and their fluctuation amplitudes are on the same order of magnitude as the scratches and defects on the real surface. When the system processes the data using spatial domain gradient threshold segmentation, the background signal generated by the process texture and the random defect signal exhibit feature overlap in the spatial domain, making it difficult for the system to achieve orthogonal decoupling of the interference components in a single spatial dimension. To solve this technical problem, the system acquires a two-dimensional grayscale data matrix containing metal surface information as the basic input source, calls a two-dimensional spatial frequency transformation operator to map the two-dimensional grayscale data matrix into a frequency domain energy matrix, calculates the global energy mean of the frequency domain energy matrix and multiplies it by a preset first weight coefficient to generate an energy decision threshold, and locates the set of local energy peak coordinates where the energy value is greater than the energy decision threshold in the coordinate space of the frequency domain energy matrix. The set of local energy peak coordinates represents the frequency mapping center of the periodic processing texture in the frequency domain.
[0035] The system extracts the radial energy values around the coordinates of each local energy peak and calculates the energy attenuation gradient between adjacent frequency domain coordinate points. When the energy attenuation gradient drops below the preset background threshold, the corresponding radial distance is determined as the hindrance radius, and a dynamic hindrance mask matrix is generated in memory accordingly. By performing a logical dot product operation between the dynamic hindrance mask matrix and the frequency domain energy matrix, discrete high-energy frequency components representing process textures are suppressed, and the basic diffuse energy integral value of the mask-covered area is extracted simultaneously. Based on the reciprocal of the distance from each coordinate point to its respective local energy peak coordinate, the basic diffuse energy integral value is reassigned to the mask-covered area to generate a residual frequency domain matrix. The inverse transform operator is used to reconstruct the residual frequency domain matrix into a spatial domain data matrix, so that the real defect features obtain a signal-to-noise ratio gain after removing background texture interference. Finally, the processing quality detection result is output based on the discrete distribution attributes of pixel values in the spatial domain data matrix.
[0036] Example 2: On a metal surface processing quality testing platform equipped with a high-precision milling execution unit, the optical acquisition module acquires an original two-dimensional grayscale data matrix with a resolution of 2048 pixels by 2048 pixels and a pixel depth of 12 bits. To simulate random electrical signal fluctuations in the metal processing environment, Gaussian white noise with a signal-to-noise ratio of 20dB is superimposed on the original two-dimensional grayscale data matrix at the input of the data processor to establish a test benchmark. Regarding the setting of the first weighting coefficient, the consideration is to balance the depth of background texture frequency suppression with the retention of defect signal features. The system constructs a parametric mapping model based on the energy distribution entropy of the local energy peak coordinate set in the frequency domain energy matrix. When the energy distribution entropy is lower than the preset entropy weight threshold and the half-width of the local energy peak narrows, the value of the first weighting coefficient is reduced, causing the energy decision threshold to shift towards the global energy mean of the frequency domain energy matrix, thereby improving... The positioning accuracy of the texture frequency mapping center; in the detection of aluminum alloy surface cutting texture with a feed step of 0.2mm, the sampling window size is set to 512 pixels by 512 pixels. According to the parameter mapping model, the first weight coefficient is determined to be 1.25. The global energy mean is obtained by the two-dimensional spatial frequency transformation operator, which is 45.3. The calculated energy decision threshold is 56.63. The energy distribution entropy here is obtained by extracting the probability distribution density sequence of the normalized energy amplitude within the local energy peak coordinate envelope and calculating the cumulative sum of the negative logarithms of the sequence. It is used to accurately quantify the dispersion of the feature spectrum. The preset entropy weight threshold is specifically set to 3.8. This value is based on the statistical mean of the background texture entropy of 500 sets of abnormal standard metal cutting parts under rated speed collected offline by the system. This defines a clear physical upper limit of the high-frequency convergence state of background noise under normal working conditions.
[0037] The experimental group used the method claimed in this invention, while the control group used spatial domain high-pass filtering combined with global threshold segmentation to process the data. After inputting a two-dimensional grayscale data matrix of a metal surface containing scratch features with a depth of 0.05 mm, the system located the coordinates of four local energy peaks corresponding to the periodic processing texture in the coordinate space of the frequency domain energy matrix. By extracting the radial energy values around the local energy peak coordinates and calculating the ratio of the energy difference between adjacent frequency domain coordinate points to the coordinate distance, the system obtained the energy attenuation gradient. When the energy attenuation gradient decreased from the initial 8.5 to 0.42, since this value was lower than the preset background threshold of 0.5, the system determined the corresponding radial distance of 12.6 pixels as the hindrance radius. The dynamic hindrance mask matrix generated by the hindrance radius and the frequency domain energy matrix were used to perform a logical dot product operation in memory to suppress the discrete high-energy frequency components representing the process texture. Simultaneously, the system integrated and extracted the basic diffuse energy integral value of 1258.4 within the mask coverage area. The basic diffuse energy integral value was reassigned based on the reciprocal of the distance from the frequency domain coordinate point to its corresponding local energy peak coordinate. The residual frequency domain matrix was generated by covering the mask area. The spatial domain data matrix reconstructed using the inverse transform operator showed that the scratch feature with an initial signal-to-noise ratio (SNR) of 1.15 improved to a local SNR of 8.72 after processing. In contrast, the control group's processed data matrix showed a scratch feature SNR of 2.13 with periodic ringing fringes at its edges due to phase loss. In the functional loss control test after removing the energy reconfiguration step, the gray-scale gradient at the edge of the reconstructed scratch feature decreased from 124.5 to 81.2. The data results confirm the relationship between frequency domain suppression and energy reconfiguration. The reconfiguration mechanism collaboratively improves the extraction quality of defect features. In this nonlinear reconfiguration process, in order to resolve the inherent technical conflict between pure algebraic addition and complex matrix phase, the system decouples the amplitude level and phase level of the frequency domain complex array. The compensation action only adds the basic diffuse energy integral value to the independent amplitude matrix of the target high-frequency data node in scalar form, while the initial real-to-imaginary ratio of each node (i.e., phase angle parameter) is extracted synchronously and locked throughout the process. This avoids reconstruction artifacts and topological distortions caused by phase information contamination in the inverse transformation stage.
[0038] Boundary pressure verification for the deviation of the first weight coefficient from the optimal working window shows that when the first weight coefficient is increased to 1.5, the increase in the energy decision threshold causes the texture frequency components located at the edge of the energy spectrum to fail to be covered by the dynamic retardation mask. The gray-scale mean of the residual texture in the reconstructed image increases from 3.2 to 15.6, causing the false alarm rate in the final output result to increase from 0.15% to 4.2%. When the first weight coefficient is decreased to 1.0, the energy decision threshold is too low, causing the retardation mask to over-filter the background energy, resulting in a 35.2% decrease in the global gray-scale contrast of the reconstructed image and morphological distortion of the topological contours of small defects. The observed performance inflection point confirms that the parameter range is the physical boundary for balancing background suppression depth and feature fidelity. The experimental results confirm that the proposed solution has stable detection performance under real noise interference and can solve the judgment contradiction caused by spatial domain gray-scale gradient aliasing through adaptive mapping of frequency domain features.
[0039] Example 3: This example combines Figures 1 to 2 A description of a method and system for detecting the quality of metal surface processing, such as... Figure 1 As shown, step S1 is executed to obtain a two-dimensional grayscale data matrix of the surface object to be detected. Step S2 is then executed to map the two-dimensional grayscale data matrix into a frequency domain energy matrix using a two-dimensional spatial frequency transformation operator. Next, in step S3, the global energy mean of the frequency domain energy matrix is calculated and multiplied by a preset first weight coefficient to generate an energy decision threshold. In step S4, the set of local energy peak coordinates with energy values greater than the energy decision threshold is extracted from the frequency domain energy matrix. Step S5 is then executed to extract the radial energy distribution values around each local energy peak coordinate and calculate the energy attenuation gradient between adjacent coordinate points. In step S6, when the energy attenuation gradient drops below a preset background threshold, the corresponding radial distance is determined as the hindrance radius, and a dynamic hindrance mask matrix is generated accordingly. Then, in step S7, the dynamic hindrance mask matrix and the frequency domain energy matrix are logically multiplied to remove periodic components, and the basic diffuse energy integral value of the masked area is extracted. The basic diffuse energy integral value is allocated according to the reciprocal of the distance from each coordinate point to the local energy peak coordinate to generate a residual frequency domain matrix. Finally, in step S8, the residual frequency domain matrix is reconstructed into a spatial domain data matrix using the inverse transform operator, and the quality detection result is output.
[0040] like Figure 2As shown, the system receives input signals from the surface object to be inspected. Its internal processing flow consists of functional units such as acquiring optical image signals, establishing a low-frequency protection data index area, mapping the frequency domain energy matrix, extracting the local energy peak coordinate set, generating a dynamic hindrance mask matrix, performing diffusion energy compensation, reconstructing the spatial domain data matrix, and outputting the processing quality inspection results. Each elliptical primitive in the figure represents a specific algorithm processing node, and the dashed arrows between the nodes clearly indicate the evolution path of the data flow from the original signal acquisition to the final quality judgment. Finally, the instructions output by the system act on the precision manufacturing production line to achieve automated quality control.
[0041] Example 4: In the online optical monitoring of high-speed milling of aerospace aluminum alloy panels, the surface to be inspected exhibits periodic machining textures generated by the coupling of the spindle rotation frequency and the table feed speed. Due to the axial runout of the spindle during operation, the periodic machining textures appear as energy clusters with specific frequency band broadening in the frequency domain. To adjust the first weighting coefficients... During calibration, the system acquires a set of grayscale images of standard samples without physical defects during the initialization phase. It calculates the energy distribution entropy of the local energy peak coordinate set in the frequency domain energy matrix of the standard samples, and determines the coefficient value that minimizes the residual texture variance in the reconstructed image through a step-search method. This serves as the target value, thereby establishing a texture-to-noise ratio... Pointing to the first weight coefficient The parameter mapping table allows the system to extract the current two-dimensional grayscale data matrix in real time during the detection process. The measured value is 18.5. The first weight coefficient is retrieved and locked based on the parameter mapping table. The value is 1.32. Based on this, the system calculates and generates the energy decision threshold and locates the set of local energy peak coordinates.
[0042] The system uses the identified local energy peak coordinates as the origin, extracts the energy value sequence in a radial direction with a step unit of 1 pixel, and calculates the second-order rate of change of the energy value sequence. When the second-order rate of change changes from negative to close to 0 and the fluctuation amplitude of three consecutive sampling points is less than the preset background threshold, the system determines that the radial distance at this time covers the main energy distribution area of the texture features, thus locking this position as the hindrance radius. In the process of generating the residual frequency domain matrix, the system calls the energy reassignment operator to allocate the basic diffuse energy integral value. The energy reassignment operator is based on any coordinate point within the mask coverage area. Corresponding local energy peak coordinates Euclidean distance between Calculate the assigned weights, specifically the components of the residual frequency domain matrix within the mask region. The following functional relationship is satisfied: ,in, The residual frequency domain matrix at coordinate points The energy value at that location, The extracted baseline diffusion energy integral value is used to characterize the baseline energy of the masked region before it is suppressed. Coordinates The pixel distance to the local energy peak coordinates is used to allocate energy. Instead of re-gathering energy towards the center of the interference band, the logic introduces the 1 / f spatial frequency reciprocal decay law unique to the micro-surface defects in the frequency domain broadband as a topological constraint mechanism. Since the high-frequency scattering energy generated by the edge of the real defect naturally follows the distribution eigenvalue of reciprocal decay in the frequency domain, the basic diffuse energy obtained by integration is projected to the unobstructed area outside the mask in this inverse relationship. That is, at the algebraic operation level, the high-frequency envelope of the defect continuous spectrum that is damaged by the suppression of background texture is fitted with high fidelity.
[0043] The system uses this mapping logic to compensate in situ for the high-frequency components containing defect edge information that were filtered out by the blocking mask in a manner consistent with energy dispersion characteristics, so that the true defect feature edges maintain a grayscale gradient sharpness of more than 4.2 pixels after spatial domain reconstruction; when the system detects an increase in the amplitude of spindle vibration leading to When the value drops to 12.4, the calibration logic automatically adjusts the first weight coefficient. The value was reduced to 1.15, and the hindrance radius was simultaneously increased from 8.5 pixels to 11.2 pixels through second-order rate of change detection. This adjustment process enabled the reconstructed spatial domain data matrix to maintain its ability to extract scratch features with a depth of 0.02 mm under the condition of tool degradation. Finally, the system outputs the machining quality detection result by analyzing the discrete distribution attributes of pixel values in the spatial domain data matrix.
[0044] Example 5: In the surface inspection scenario of ductile iron with diffuse reflection physical properties, the surface to be inspected has high-frequency random roughness characteristics, and there is a non-stationary background noise floor in the frequency domain energy matrix. During the deployment and initialization phase, the system collects a two-dimensional grayscale data matrix for a defect-free standard block with consistent process parameters. Through a two-dimensional spatial frequency transformation operator, the frequency domain energy distribution characteristics of the standard block are extracted, the radial energy variance of the non-texture center region is calculated, and the background disturbance benchmark is established. Centered on the local energy peak coordinates, multiple candidate values for the retardation radius with a step increment of 0.1 pixels are established. By iteratively calculating the pixel dispersion of the reconstructed image in the flawless region, a baseline perturbation is established. The background threshold for determining the energy decay cutoff point The mapping relationship between the monotonically increasing functions is as follows: As the baseline for background disturbance, The baseline threshold, the baseline threshold The determination is based on the physical reflectivity parameters of the surface to be tested.
[0045] Based on Kirchhoff's theory of electromagnetic scattering at surfaces, the system establishes the aforementioned mapping relationship as a linear compensation model, with the mathematical expression being: ,in, Characterization calculation generates a baseline threshold; The scattering gain coefficient is characterized by being calibrated by the optical roughness of the surface to be tested, and its value is a positive real number. Characterizes the real-time calculation of the baseline disturbance reference value; The inherent dark current noise compensation constant of the optical detector is characterized, with dimensions consistent with the amplitude units of the frequency domain energy matrix. During the detection initialization procedure, the system acquires at least three sets of discrete energy variance samples of flawless standard blocks under different ambient light intensities. The least squares method is used to fit and extract the gain coefficient and noise compensation constant to determine their values. An absolute generation path for the background threshold is established in the underlying logic. During the fitting and extraction process, the three sets of discrete samples are limited to standard controlled illumination conditions of 500 Lux, 1000 Lux, and 1500 Lux. The system extracts the root mean square variance sequence outside the non-low-frequency protection data index area as the input independent variable. The least squares method is used to iteratively optimize within the positive real physical boundary range of 0.5 to 2.0 to obtain the gain coefficient. Simultaneously, the nominal substrate charge accumulation value of the imaging optical detector in a completely dark environment is extracted as the inherent dark current noise compensation constant. This ensures that all extracted parameters have a clear experimental measurement source and physical boundary benchmark.
[0046] When the system is in a machining environment where the feed rate deviates by 15%, radial energy broadening occurs at the center of the frequency domain mapping of the machined texture. The system retrieves the mapping relationship based on the real-time mean background energy of the frequency domain energy matrix and adjusts the background threshold accordingly. The numerical value is adjusted to 0.85 times the absolute value of the radial energy decay slope. The system collects gradient samples along the normal direction of the local energy peak. When the moving average of the energy decay gradient at 5 consecutive sampling points decreases below the background threshold... When the corresponding radial physical displacement distance is locked as the hindrance radius, the optimal path of the mask boundary is determined when the frequency band is broadened due to the working condition drift. The data is reconstructed by the dynamic hindrance mask matrix and the residual frequency domain matrix determined by the hindrance radius. Correspondingly, in an environment where the background noise power fluctuates by 1.2 times, the scratch contrast in the spatial domain data matrix is improved by 28.4% compared with the fixed threshold processing method. Finally, the processing quality detection result characterizing the deviation of the surface micro-geometric morphology is output.
[0047] Example 6: For different spindle feed step distances In the deployment procedure of the online inspection system for metal cutting surfaces, the system acquires the physical characteristic parameters of the surface to be inspected to determine the sampling window specifications of the two-dimensional grayscale data matrix. Physical characteristic parameters include tool feed stepover. Spatial resolution of image acquisition system Sampling window specifications The values of satisfy the following functional constraints: ,in, For sampling window specifications, This is the tool feed step distance. For spatial resolution; when the feed step... With a spatial resolution of 0.2mm When the value is 0.002mm, the system will adjust the sampling window size. The unit is determined to be 512 pixels. The first-order spatial autocorrelation function of the two-dimensional grayscale data matrix is calculated, and its peak offset is extracted to verify the consistency of the periodic process texture. When the variance fluctuation of the peak offset is less than the preset stability threshold, the current working condition is determined to be in a standard steady state. Based on this, the system establishes an offline feature database to carry features corresponding to specific feed steps. The energy distribution characteristic sequence.
[0048] Regarding the first weight coefficient In the initialization and calibration phase, the system uses probability distribution mapping to calculate the energy distribution entropy of the set of local energy peak coordinates in the frequency domain energy matrix. Entropy of energy distribution To quantify the concentration of periodically processed textures in the frequency domain, a set of first weighting coefficients with values ranging from 0.5 to 2.5 are used. The system iteratively calculates the reconstruction residual in the candidate sequence, determines the coefficient value that makes the contrast improvement of defects in the reconstructed image reach the preset target, and modifies it with the corresponding energy distribution entropy. Construct mapping nodes and fit them in coordinate space to generate the energy distribution entropy. Pointing to the first weight coefficient The regression curve, where the energy distribution entropy When the value decreases, the regression curve guides the first weight coefficient. The range of the energy decision threshold is narrowed by synchronously reducing the threshold; when the system detects that the spindle load fluctuation causes the texture spectral line broadening and the energy distribution entropy is measured in real time... When the value is increased from 4.2 to 5.8, the calibration logic adjusts the first weight coefficient based on the regression curve. The value was adjusted to 1.45 to ensure that the reconstructed spatial domain data matrix maintains an edge response consistency of over 0.85 even with background noise interference of 3 pixel amplitude.
[0049] 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. A method for inspecting the quality of metal surface processing, characterized in that, Includes the following steps: Step S1: Obtain the two-dimensional grayscale data matrix of the surface object to be detected; Step S2: The two-dimensional grayscale data matrix is mapped into a frequency domain energy matrix by a two-dimensional spatial frequency transformation operator; Step S3: Calculate the global energy mean of the frequency domain energy matrix and multiply it by the preset first weight coefficient to generate the energy decision threshold; Step S4: Extract the set of local energy peak coordinates where the energy value is greater than the energy decision threshold from the frequency domain energy matrix. The set of local energy peak coordinates represents the center of the periodic characteristic frequency distribution of the surface object to be detected. Step S5: Extract the radial energy distribution values around the coordinates of each local energy peak and calculate the energy attenuation gradient between adjacent coordinate points; Step S6: When the energy decay gradient drops below the preset background threshold, determine the corresponding radial distance as the hindrance radius and generate a dynamic hindrance mask matrix accordingly. Step S7: Perform logical dot multiplication on the dynamic hindrance mask matrix and the frequency domain energy matrix to remove periodic components, and extract the basic diffuse energy integral value of the masked area. Allocate the basic diffuse energy integral value according to the reciprocal of the distance from each coordinate point to the local energy peak coordinate to generate the residual frequency domain matrix. Step S8: The residual frequency domain matrix is reconstructed into a spatial domain data matrix using the inverse transformation operator, and the quality detection result is output.
2. The method for detecting the quality of metal surface processing according to claim 1, characterized in that, Step S6, generating the dynamic hindrance mask matrix, includes: in the original mask matrix with the same dimension as the frequency domain energy matrix, setting the position of the corresponding local energy peak coordinate as the mask center; setting the weight of the elements in the circular region of the original mask matrix with the mask center as the center and the hindrance radius as the radius to 0, and setting the weight of the elements outside the circular region to 1.
3. The method for detecting the quality of metal surface processing according to claim 1, characterized in that, Before extracting the local energy peak coordinate set, the process also includes: establishing a low-frequency protection data index area with the origin of the frequency domain energy matrix as the center and the preset low-frequency cutoff frequency as the radius; determining whether the local energy peak coordinate falls into the low-frequency protection data index area; if the determination result is yes, then suppressing the comparison logic of the energy decision threshold and blocking the coordinate from entering the local energy peak coordinate set.
4. The method for detecting the quality of metal surface processing according to claim 1, characterized in that, Step S7, generating the residual frequency domain matrix, includes: compensating the basic diffuse energy integral value to the high-frequency data nodes in the residual frequency domain matrix that are not covered by the mask using a nonlinear discrete mapping method.
5. The method for detecting the quality of metal surface processing according to claim 1, characterized in that, Step S8 outputs the quality inspection results, including: counting the number of target pixels in the spatial domain data matrix whose gray values are greater than a preset deviation threshold; calculating the clustering index of the target pixels in the spatial domain data matrix; and outputting a processing quality failure instruction when the number of target pixels exceeds a preset size threshold and the clustering index exceeds a preset connectivity threshold.
6. The method for detecting the quality of metal surface processing according to claim 1, characterized in that, Step S1, obtaining the two-dimensional grayscale data matrix of the surface object to be detected, includes: acquiring the optical image signal of the surface object to be detected; performing discrete sampling and amplitude quantization on the optical image signal to generate the original grayscale matrix; and using the mean shift operator to smooth the original grayscale matrix to remove grayscale deviations caused by non-uniform illumination.
7. The method for detecting the quality of metal surface processing according to claim 1, characterized in that, After generating the residual frequency domain matrix, a high-frequency feature enhancement step is also included: extracting the edge high-frequency energy values at the hindrance radius boundary; multiplying the edge high-frequency energy values by a preset second weight coefficient to obtain a gain term, and accumulating the gain term to the frequency domain coordinate points corresponding to the residual frequency domain matrix.
8. The method for detecting the quality of metal surface processing according to claim 5, characterized in that, The calculation of the clustering index includes: performing connected component analysis on the target pixels to identify pixel clusters; calculating the equivalent diameter and the ratio of the major and minor axes of each connected component; and determining the clustering index by the weighted sum of the equivalent diameter and the ratio of the major and minor axes.
9. A method for detecting the quality of metal surface processing according to claim 1, characterized in that, The two-dimensional spatial frequency transform operator is a two-dimensional fast Fourier transform operator.
10. A metal surface processing quality inspection system, used to implement the metal surface processing quality inspection method according to claim 1, characterized in that, include: The data acquisition module is used to acquire a two-dimensional grayscale data matrix of the surface object to be detected; The frequency transformation module is used to map a two-dimensional grayscale data matrix into a frequency domain energy matrix through a two-dimensional spatial frequency transformation operator. The threshold generation module is used to calculate the global energy mean of the frequency domain energy matrix and multiply it by a preset first weight coefficient to generate an energy decision threshold. The feature center extraction module is used to extract the set of local energy peak coordinates where the energy value is greater than the energy decision threshold from the frequency domain energy matrix; The energy gradient calculation module is used to extract the radial energy distribution value around the local energy peak coordinates and calculate the energy attenuation gradient between adjacent coordinate points; The mask generation module is used to determine the corresponding hindrance radius and generate a dynamic hindrance mask matrix when the energy decay gradient drops below a preset background threshold. The feature reconfiguration module is used to perform logical dot multiplication between the dynamic hindrance mask matrix and the frequency domain energy matrix, and extract the basic diffuse energy integral value of the masked area. The basic diffuse energy integral value is reconfigured based on the reciprocal of the distance from the coordinate point to the local energy peak coordinate to generate the residual frequency domain matrix. The quality inspection result output module is used to reconstruct the residual frequency domain matrix into a spatial domain data matrix through the inverse transformation operator and output the quality inspection result.
Citation Information
Patent Citations
A cable shielding layer weaving density detection system based on image analysis
CN121147212B
Image data processing method in food surface tiny flaw detection
CN121962139A
High-temperature alloy defect intelligent detection system based on deep learning
CN122262783A