A product quality detection method based on machine vision
By employing Fourier transform and phase gradient tensor methods, the problem of phase fidelity and energy decoupling of fine defects in highly reflective and periodic textured backgrounds was solved, enabling efficient identification and detection of fine defects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN BOSHIYUAN MASCH VISION TECH CO LTD
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies struggle to effectively extract phase fidelity and energy decoupling from fine defects against highly reflective and periodic textured backgrounds, resulting in insufficient defect feature recognition capabilities.
The original signal energy distribution data is mapped to the complex frequency domain by Fourier transform, the phase gradient is calculated and the local structure tensor is constructed, the direction guidance vector of the background texture is established by using the direction consistency index, and the phase feedback compensation mechanism and signal gain adjustment loop are combined to achieve energy dispersion suppression in the phase domain and nonlinear energy redistribution of weak features.
Against a background of high reflectivity and periodic texture, phase-fidelity extraction and energy decoupling of micro-defects were achieved, ensuring the topological integrity of defect features and improving the signal-to-noise ratio, thereby enhancing the sensitivity and accuracy of the detection system.
Smart Images

Figure CN121678679B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of optical inspection technology, and in particular relates to a product quality inspection method based on machine vision. Background Technology
[0002] The surface quality of components such as busbars and power module substrates is crucial to the safety of power transmission. Currently, machine vision technology is the mainstream approach for acquiring surface images of these components and identifying defects such as scratches, cracks, and impurities by processing brightness differences in the pixel matrix. This method lays the foundation for automated component inspection. However, with advancements in manufacturing processes, conductive component surfaces exhibit specular reflection characteristics accompanied by periodic processing textures. Under these physical constraints, ambient light creates high-energy specular reflection zones on the component surface, leading to localized energy saturation in the data acquired by image sensors. To suppress strong reflection interference, existing technologies typically employ global threshold suppression or frequency domain filtering. This approach generates significant technical debt. While mitigating high-energy background noise, it fails to distinguish the distribution differences between background textures and random defects in phase space, resulting in the loss of phase information for weak defects at bright edges and causing the topological collapse of defect features.
[0003] Besides hardware limitations, the software control methods also have shortcomings. For example, Chinese invention patent CN121305312A discloses a method and system for detecting defects on the inner wall of a titanium cylinder. This method uses statistical high-gloss ratio and dynamic scaling of edge gradients to fit a dynamically changing illumination field using a Gaussian filter. However, this type of method is limited by linear or logarithmic mapping of spatial characteristics and fails to address the phase dispersion problem on highly reflective metal surfaces. Under high-intensity reflection conditions, due to the lack of background texture manifold continuity discrimination, simply relying on adaptive adjustment of the filter scale makes it difficult to decouple and eliminate the masking of weak feature energy in high-energy regions. When dealing with halo artifacts, it is difficult to guarantee the phase fidelity of defects, resulting in a low detection limit for subtle low-contrast defects. To address this bottleneck, attempts have been made to improve the system by increasing the supplementary lighting angle or improving the dynamic range of the photosensitive device. However, these approaches do not address the core issue. On the one hand, increasing sampling accuracy increases the computational load on the backend, leading to response delays. On the other hand, the non-stationarity of ambient lighting makes the preset amplitude compensation strategy unsuitable for production environments. This attempt to directly process interference in the energy domain falls into a fundamental contradiction: the detection sensitivity and background suppression cannot be balanced, resulting in the system's inability to recognize subtle low-contrast features.
[0004] Therefore, how to achieve phase-fidelity extraction and energy decoupling of fine defects against a background of high reflectivity and periodic texture is the technical problem to be solved by this invention. Summary of the Invention
[0005] This invention provides a product quality inspection method based on machine vision, comprising the following steps:
[0006] Step S101: Obtain the original signal energy distribution data that characterizes the surface energy density of the product under test through the sensor, map the original signal energy distribution data to the complex frequency domain space using Fourier transform, and analyze the phase components under multiple scales according to the preset frequency band bandwidth.
[0007] Step S102: Calculate the phase gradient of the phase component at each scale, and perform second-order tensor integration on the phase gradient in the spatial neighborhood to construct a local structure tensor. By extracting the eigenvalue distribution of the local structure tensor, calculate the coherence degree characterizing the anisotropy of the local phase manifold as a direction consistency index. Use the direction consistency index to establish the direction guidance vector of the background texture.
[0008] Step S103: Establish a phase feedback compensation mechanism based on the direction guidance vector, calculate the divergence change rate of the direction guidance vector on the preset spatial path, and adjust the phase consistency weighting coefficient at each scale according to the deviation between the divergence change rate and the preset phase fluctuation threshold, and perform local suppression of energy dispersion in the phase domain through the phase consistency weighting coefficient.
[0009] Step S104: Extract the residual signal after background suppression, calculate the energy complexity entropy of the residual signal within the local calculation window, establish a signal gain adjustment loop based on the energy complexity entropy, and use the signal gain adjustment loop to perform amplitude enhancement on the residual signal to generate a residual significance distribution map.
[0010] Step S105: The signal gain adjustment loop is used to perform nonlinear energy redistribution on the weak features that are masked in the high-energy range. Based on the geometric moment features in the residual significance distribution map, the defect type is determined, and control instructions are generated to drive the sorting mechanism to perform rejection actions on the non-conforming products.
[0011] Preferably, in step S101, a set of logarithmic Gaussian filters with a preset center frequency are used to perform multi-scale decomposition on the frequency domain signal to obtain complex components containing amplitude and phase information at each scale.
[0012] Preferably, step S102 includes: extracting the first feature value and the second feature value of the local structure tensor, and calculating the ratio of the first feature value to the second feature value; when the ratio is greater than a preset coherence criterion, determining that the local calculation window belongs to a background region with directional coherence, and locking the directional guiding vector of the region.
[0013] Preferably, step S103 includes: monitoring the phase change rate gradient of the phase component, and when the divergence change rate exceeds 5%, using negative feedback adjustment logic to reduce the phase consistency weight of the corresponding region to counteract optical interference fluctuations caused by the physical characteristics of the reflective surface.
[0014] Preferably, in step S104, the signal gain adjustment loop follows the following quantization rule: G=1+α⋅H, where G is the dynamic gain coefficient, α is the preset linear adjustment factor, and H is the energy complexity entropy of the residual signal within the local calculation window; the dynamic gain coefficient G is used to perform a product operation on the amplitude components of the residual signal to improve the local energy signal-to-noise ratio of weak features.
[0015] Preferably, the method further includes: extracting low-frequency energy components with frequencies below 0.5Hz from the original signal energy distribution data, establishing active phase compensation logic for mechanical transmission jitter, calculating the spatiotemporal displacement deviation by reversing the intermediate products in the frequency domain, and performing linear realignment correction on the phase components.
[0016] Preferably, before step S105, the method further includes: calculating the phase cyclic variance of signal sampling points at each scale, and combining the topological stability verification of phase singular points across scales to construct a physical isolation barrier against sensor shot noise.
[0017] Preferably, the topology stability verification includes: utilizing the difference between the scale continuity of the effective detection signal in the phase domain and the random discreteness of the noise signal, performing nonlinear filtering on the residual significance distribution map through a gating function to eliminate isolated interference points with a signal-to-noise ratio of less than 3dB.
[0018] Preferably, in step S105, the nonlinear energy redistribution performs contrast stretching on the processed residual signal through an adaptive dynamic range compression operator, so that the grayscale step value of the weak features is not less than 15.
[0019] Preferably, the defect type determination specifically includes: extracting connected component features from the residual significance distribution map, calculating the centroid coordinates and area of the connected component features, and mapping the centroid coordinates to the underlying sorting execution module.
[0020] Compared with existing technologies, the product quality inspection method based on machine vision of this invention has the following advantages:
[0021] 1. In product quality inspection based on machine vision, by introducing a complex domain phase gradient tensor in the multi-scale decomposition process, an adaptive correction mechanism based on manifold smoothness is constructed. By utilizing the phase continuity characteristics of the power distribution component surface, the phase of the background texture is accurately locked, solving the phase leakage problem caused by frequency dispersion on highly reflective metal surfaces. This allows the background suppression weight to be adjusted in real time according to changes in local physical properties, thereby filtering out strong reflective background interference while completely preserving the topological information of weak defects.
[0022] 2. The method combines a phase consistency attenuation operator with a dynamic gain adjustment loop based on residual signal entropy to form a cross-dimensional energy decoupling and enhancement method. It uses the complexity distribution of residual data to guide the secondary allocation of frequency domain resources, and performs nonlinear suppression on the amplitude spectrum components in the high-energy frequency domain interval to eliminate the masking effect of local energy saturation on the significant residual spectrum. This ensures that the extremely fine defect features under the high-brightness masking region have clear boundary contrast and signal-to-noise ratio in the reconstructed image.
[0023] 3. The method extracts the low-frequency energy distribution characteristics near the zero-frequency component in the Fourier transform, establishes an active phase compensation logic for physical jitter, and reuses the intermediate products in the frequency domain calculation process to invert the motion displacement of the image. It performs linear realignment compensation on the multi-scale phase components, eliminates the logical interference of micro-vibration of the conveyor belt or mechanical transmission deviation on the phase consistency index, eliminates false alarm signals caused by spatiotemporal incoherence, and enables the detection system to maintain the same phase extraction accuracy as the static state under dynamic conditions. Attached Figure Description
[0024] Figure 1 This is a flowchart of the product quality inspection method based on machine vision according to the present invention;
[0025] Figure 2 This is a hardware structure and logical interaction block diagram of the product quality inspection system based on machine vision according to 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] A product quality inspection method based on machine vision includes the following steps:
[0031] Step S101: Obtain the original signal energy distribution data that characterizes the surface energy density of the product under test through the sensor, map the original signal energy distribution data to the complex frequency domain space using Fourier transform, and analyze the phase components under multiple scales according to the preset frequency band bandwidth.
[0032] Step S102: Calculate the phase gradient of the phase component at each scale, and perform second-order tensor integration on the phase gradient in the spatial neighborhood to construct a local structure tensor. By extracting the eigenvalue distribution of the local structure tensor, calculate the coherence degree characterizing the anisotropy of the local phase manifold as a direction consistency index. Use the direction consistency index to establish the direction guidance vector of the background texture.
[0033] Step S103: Establish a phase feedback compensation mechanism based on the direction guidance vector, calculate the divergence change rate of the direction guidance vector on the preset spatial path, and adjust the phase consistency weighting coefficient at each scale according to the deviation between the divergence change rate and the preset phase fluctuation threshold, and perform local suppression of energy dispersion in the phase domain through the phase consistency weighting coefficient.
[0034] Step S104: Extract the residual signal after background suppression, calculate the energy complexity entropy of the residual signal within the local calculation window, establish a signal gain adjustment loop based on the energy complexity entropy, and use the signal gain adjustment loop to perform amplitude enhancement on the residual signal to generate a residual significance distribution map.
[0035] Step S105: The signal gain adjustment loop is used to perform nonlinear energy redistribution on the weak features that are masked in the high-energy range. Based on the geometric moment features in the residual significance distribution map, the defect type is determined, and control instructions are generated to drive the sorting mechanism to perform rejection actions on the non-conforming products.
[0036] Preferably, in step S101, a set of logarithmic Gaussian filters with a preset center frequency are used to perform multi-scale decomposition on the frequency domain signal to obtain complex components containing amplitude and phase information at each scale.
[0037] Preferably, step S102 includes: extracting the first feature value and the second feature value of the local structure tensor, and calculating the ratio of the first feature value to the second feature value; when the ratio is greater than a preset coherence criterion, determining that the local calculation window belongs to a background region with directional coherence, and locking the directional guiding vector of the region.
[0038] Preferably, step S103 includes: monitoring the phase change rate gradient of the phase component, and when the divergence change rate exceeds 5%, using negative feedback adjustment logic to reduce the phase consistency weight of the corresponding region to counteract optical interference fluctuations caused by the physical characteristics of the reflective surface.
[0039] Preferably, in step S104, the signal gain adjustment loop follows the following quantization rule: G=1+α⋅H, where G is the dynamic gain coefficient, α is the preset linear adjustment factor, and H is the energy complexity entropy of the residual signal within the local calculation window; the dynamic gain coefficient G is used to perform a product operation on the amplitude components of the residual signal to improve the local energy signal-to-noise ratio of weak features.
[0040] Preferably, the method further includes: extracting low-frequency energy components with frequencies below 0.5Hz from the original signal energy distribution data, establishing active phase compensation logic for mechanical transmission jitter, calculating the spatiotemporal displacement deviation by reversing the intermediate products in the frequency domain, and performing linear realignment correction on the phase components.
[0041] Preferably, before step S105, the method further includes: calculating the phase cyclic variance of signal sampling points at each scale, and combining the topological stability verification of phase singular points across scales to construct a physical isolation barrier against sensor shot noise.
[0042] Preferably, the topology stability verification includes: utilizing the difference between the scale continuity of the effective detection signal in the phase domain and the random discreteness of the noise signal, performing nonlinear filtering on the residual significance distribution map through a gating function to eliminate isolated interference points with a signal-to-noise ratio of less than 3dB.
[0043] Preferably, in step S105, the nonlinear energy redistribution performs contrast stretching on the processed residual signal through an adaptive dynamic range compression operator, so that the grayscale step value of the weak features is not less than 15.
[0044] Preferably, the defect type determination specifically includes: extracting connected component features from the residual significance distribution map, calculating the centroid coordinates and area of the connected component features, and mapping the centroid coordinates to the underlying sorting execution module.
[0045] Example 1: This example provides a specific application of a machine vision-based product quality inspection method in the detection of scratches on the surface of aluminum conductive busbars. After mechanical grinding, the surface of the aluminum busbar forms a periodic grinding texture. Due to its high reflectivity, specular reflection areas are generated under industrial lighting conditions, leading to localized energy saturation in the original signal energy distribution data acquired by the image sensor. Under these conditions, conventional brightness thresholding methods struggle to distinguish between background texture brightness fluctuations and subtle scratch defects, easily resulting in the loss of defect phase information. The detection system acquires the original signal energy distribution data characterizing the energy density of the aluminum busbar surface through a sensor. The processor performs a Fourier transform, mapping the original signal energy distribution data to the complex frequency domain. A set of logarithmic Gaussian filters with a preset center frequency is then used to perform multi-scale decomposition of the frequency domain signal, thereby analyzing the phase components at multiple scales. The system extracts the phase gradient of the phase component at each scale and performs a second-order tensor integral in the spatial neighborhood to construct a local structure tensor M. The calculation formula for the local structure tensor M is as follows: Where M is the local structure tensor, ∇ϕ is the spatial gradient vector of the complex phase component, and T is the transpose operator. The system extracts the first eigenvalue L1 and the second eigenvalue L2 of the local structure tensor M, and calculates the coherence component R=(L1-L2) / (L1+L2), where L1 is the largest eigenvalue of the local structure tensor M, L2 is the smallest eigenvalue, and R is the coherence component used to characterize the continuity of the local phase manifold. When the value of the coherence component R is close to 1, it is determined that the local calculation window belongs to the background texture region with directional coherence, and the directional guiding vector of the region is locked.
[0046] The system monitors the phase change rate gradient of the phase component and calculates the divergence rate of the direction guide vector along a preset spatial path. When the divergence rate exceeds 5%, negative feedback adjustment logic is used to reduce the phase consistency weighting coefficient in the corresponding region, suppressing optical interference fluctuations caused by the physical characteristics of the reflector and achieving local suppression of energy dispersion in the phase domain. After background suppression, the residual signal is extracted and the energy complexity entropy H of the residual signal within the local calculation window is calculated. A signal gain adjustment loop is established based on the energy complexity entropy H, following the quantization rule: G = 1 + α⋅H, where G is the dynamic gain coefficient, α is the preset linear adjustment factor, and H is the energy complexity entropy H of the residual signal within the local calculation window. The system utilizes the energy complexity entropy within the residual signal and performs a product operation on the amplitude components of the residual signal using the dynamic gain coefficient G to generate a residual significance distribution map. The system uses a signal gain adjustment loop to perform nonlinear energy redistribution on weak features masked in the high-energy region, ensuring that the gray-level step value of the weak features is not less than 15. Based on the geometric moment features in the residual significance distribution map, the system performs defect type determination and generates control commands to drive the sorting mechanism. Because this technical solution utilizes the manifold continuity and energy complexity distribution in the phase domain to suppress the background, the scratch defect presents a complete topological structure on the residual map, and its signal-to-noise ratio is improved compared to the original data. The system achieves stable detection of microcracks on the order of five parts per million.
[0047] Example 2: In an environment where an aluminum conductive busbar with periodic brushed texture and high-intensity specular reflection is being inspected, the test platform uses an industrial image sensor with an effective resolution of 2592 pixels by 1944 pixels and a matching coaxial cold light source. Due to the physical reflection characteristics of the aluminum substrate surface, a large area of energy saturation appears in the raw signal energy distribution data acquired by the sensor, causing the initial average signal-to-noise ratio of the image to drop to 7.85 dB. The detection system executes a determination procedure for the key linear adjustment factor α. The value of this parameter involves the balance between the enhancement intensity of the residual signal and the amplification rate of the background structural noise. Factors affecting the value of parameter α include the dynamic margin of the sensor in the saturated state and the local variance distribution of the residual signal. The decision rule is as follows: The system calculates the maximum statistical value of the energy complexity entropy H of the defect-free region. And combined with a preset output saturation threshold The calculation was performed to ensure that the enhanced signal amplitude was within the linear response range of the image sensor. Based on the measurement data of the high reflectivity of the aluminum alloy surface in this experiment, the parameter α was determined to be 0.50.
[0048] The experiment established control group A, control group B, and an experimental group. Control group A used a conventional frequency domain bandstop filtering method. Control group B removed the phase feedback compensation mechanism based on the local structure tensor M when using the scheme of this invention. The experimental group used the complete method of this invention. After the system started, the processor calculated the phase gradient of the phase components at each scale and constructed the local structure tensor M. Intermediate data observed in the experiment showed that in background regions with extremely high texture direction consistency, the coherence component R calculated by the system was stable in the range of 0.88 to 0.94. The ratio of the first eigenvalue L1 to the second eigenvalue L2 showed a difference, providing a basis for subsequent phase domain background suppression. With a fixed directional guiding vector, the system adjusts the phase consistency weighting coefficient according to the divergence rate of the directional guiding vector on the preset spatial path when executing step S103. Data monitoring shows that when the divergence rate fluctuates around 5.2%, the phase feedback compensation mechanism intervenes and corrects the phase component. In the processing result of control group A, the grayscale step value of the scratch feature is only 4.5, and a defect breakage phenomenon appears in the reflective area. The image signal-to-noise ratio of control group B is improved to 12.4dB, but the residual signal still contains obvious striped noise residue. The experimental group calculates the energy complexity entropy H of the residual signal at the defect location to be 4.35 bits through the signal gain adjustment loop.
[0049] The system utilizes a dynamic gain coefficient G with a linear adjustment factor α of 0.50 to enhance the amplitude of the residual signal, generating a residual significance distribution map. To verify the gradient response characteristics of the present invention, the output power of the coaxial cold light source was artificially adjusted to gradually increase the specular reflection energy from 150 gray units to 240 gray units. Experimental results show that the gray step value of the scratch edge output by the present invention changes from 18.2 to 21.6, and the signal-to-noise ratio remains stable at 22.8 dB. Based on the geometric moment characteristics in the residual significance distribution map, the system performs defect judgment on 50 samples, ultimately achieving deterministic detection of microcracks on the order of 5 μm. This confirms that the present invention solves the technical problem between background suppression and feature fidelity preservation in complex optical interference environments through geometric characterization of the phase manifold and nonlinear gain compensation.
[0050] Example 3: This example provides a specific application of a machine vision-based product quality inspection method in the detection of pinholes on the surface of electrolytic copper foil. In the copper foil production line, the raw signal energy distribution data collected by the image sensor is easily affected by electromagnetic induction noise, causing the characteristic manifold of the micro-pinhole defect to overlap with the background noise. The detection system uses a processor to select a spatial neighborhood of 7×7 pixels as an integration window, and uses a Gaussian kernel function within this integration window. The second-order tensor integral is calculated to construct the local structure tensor M. The discretization formula for the local structure tensor M is as follows: Where M is the local structure tensor, and * is the convolution operator. A Gaussian weighted kernel with a standard deviation σ of 1.2. and The spatial gradients of the phase components in the horizontal and vertical directions are respectively. The system extracts the feature distribution of the local structure tensor M and calculates the coherence component R. When the coherence component R is in the range of 0.85 to 0.95, the region is determined to be a background texture region and a directional guiding vector is established.
[0051] The system executes the parameter calibration procedure of the phase feedback compensation mechanism to determine the preset phase fluctuation threshold. The system collects 50 sets of defect-free background samples in self-test mode and calculates the average divergence μ and divergence standard deviation S of the phase gradient flow along a preset spatial path. The system then applies the formula... Determine the preset phase fluctuation threshold. ,in, The system calculates the rate of change of divergence of the directional guidance vector along the preset spatial path in real time, where μ is the average divergence and S is the standard deviation of divergence, and the divergence rate is the preset phase fluctuation threshold. When the deviation jumps positively, energy dispersion in the phase domain is suppressed by reducing the phase consistency weighting coefficient; the system extracts the residual signal after background suppression and calculates the energy complexity entropy H using a local computation window of size 15 by 15 pixels. The formula for calculating the energy complexity entropy H is as follows: Where H is the energy complexity entropy. The system measures the probability density of the i-th gray level of the residual signal within the local calculation window. It monitors the change in the energy complexity entropy H. When H is greater than 4.2 bits, it uses a signal gain adjustment loop with a linear adjustment factor α of 0.45 to perform amplitude enhancement, generates a residual significance distribution map, extracts the geometric moment features from the residual significance distribution map, and calculates its central moment and normalized invariant moment to perform defect type determination. The system uses a Gaussian weighted tensor to characterize the local manifold geometric features. By controlling the divergence of the phase gradient flow, it shields the unsteady interference energy, making the pinhole defect present a closed topological structure at the image data level. This technical solution ensures the stability of the detection system at a production speed of 80 meters per minute and achieves the identification of transmission defects on the order of 10 μm.
[0052] Example 4: In an application scheme for inspecting the surface quality of highly polished stainless steel substrates, the image processing unit faces the challenge of fluctuating substrate reflectivity from 70% to 90%. Before executing online inspection, the processor runs a pre-calibration procedure on-site, collects raw signal energy distribution data from 100 sets of defect-free samples, and maps it to the complex frequency domain to analyze the initial phase components. The system calculates the global divergence mean of the phase gradient flow along a preset spatial path at each scale. with global divergence standard deviation The processor is based on the formula Execute the preset phase fluctuation threshold The update operation, among which, To preset the phase fluctuation threshold, Let $k$ be the global divergence mean and $k$ be the proportionality coefficient. The global divergence standard deviation is used to correlate the triggering conditions of the phase feedback compensation mechanism with the micro-roughness of the substrate surface through this calibration procedure.
[0053] After acquiring the residual significance distribution map, the system executes a geometric moment threshold calibration program based on the feature space distribution. It extracts the normalized invariant moment sequence χ, which includes scratches and defect-free samples, and calculates the cluster center and dispersion of each sample in the feature space. Based on the Mahalanobis distance minimization criterion, it divides the decision surface in the feature space and determines the invariant moment decision threshold η used to distinguish between random noise and structural defects. Here, χ is the normalized invariant moment sequence, and η is the invariant moment decision threshold. During this process, when the distance between the normalized invariant moment of the target and the cluster center is less than the invariant moment decision threshold η, the processor generates a defect type identifier and outputs a sorting instruction. The detection system maintains the grayscale step value enhancement effect under the condition of reflectivity change.
[0054] Example 5: In an industrial inspection system with a production line operating speed of 1.2 m / s and a spatial resolution of 50 μm per pixel, the image processing unit faces a trade-off between data throughput rate and physical displacement synchronization accuracy. Before performing quality judgment, the processor runs a sampling frequency and phase window alignment procedure, calculating the sampling time interval Δt based on the camera's line frequency and the encoder pulses of the conveyor belt, where Δt is the sampling time interval. This procedure ensures that the physical region corresponding to the integral window size used when constructing the local structure tensor M remains constant. The system generates a reference phase field by acquiring a static standard plate and calculates the intrinsic variance of the phase gradient flow in the unbiased state. ,in The intrinsic variance is used as the standard deviation for calculating the global divergence. The initial perturbation operator, where To achieve the global divergence standard deviation, the weight distribution of the spatial convolution kernel is adapted to the wavelength of the abrasive texture on the substrate surface through the aforementioned physical alignment logic, so that the response curve of the coherence component R exhibits a monotonic distribution in the texture region.
[0055] When the detection system detects that the optical environment has entered an extremely low illumination boundary or that a local gray-level step value is below 10 due to high reflectivity, it initiates an adaptive criterion correction process to maintain the statistical stability of the energy complexity entropy H. It calculates the signal-to-noise ratio fluctuation component based on the second moment of the current image pixel gray-level distribution and applies it to the probability distribution function p. i The computational logic introduces a gray-level merging operator to map the original 256-level histogram to a 128-level or 64-level statistical domain to offset the entropy increment caused by sensor electrical noise. The system adjusts the saturation suppression threshold of the signal gain adjustment loop based on the product of energy complexity entropy H and linear adjustment factor α. When the calculated dynamic gain coefficient G exceeds the preset safe gain limit, the processor outputs an ambient light intensity compensation signal to drive the light source drive module to increase the power. Under this adjustment mechanism, the system realizes topological reconstruction of defect features in the nonlinear masking region. The reconstructed residual significance distribution map maintains the false alarm rate steady state under complex optical interference environment.
[0056] 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 product quality inspection method based on machine vision, characterized in that, Includes the following steps: Step S101: Obtain the original signal energy distribution data that characterizes the surface energy density of the product under test through the sensor, map the original signal energy distribution data to the complex frequency domain space using Fourier transform, and analyze the phase components under multiple scales according to the preset frequency band bandwidth. Step S102: Calculate the phase gradient of the phase component at each scale, and perform second-order tensor integration on the phase gradient in the spatial neighborhood to construct a local structure tensor. By extracting the eigenvalue distribution of the local structure tensor, calculate the coherence degree characterizing the anisotropy of the local phase manifold as a direction consistency index. Use the direction consistency index to establish the direction guidance vector of the background texture. Step S103: Establish a phase feedback compensation mechanism based on the direction guidance vector, calculate the divergence change rate of the direction guidance vector on the preset spatial path, and adjust the phase consistency weighting coefficient at each scale according to the deviation between the divergence change rate and the preset phase fluctuation threshold, and perform local suppression of energy dispersion in the phase domain through the phase consistency weighting coefficient. Step S104: Extract the residual signal after background suppression, calculate the energy complexity entropy of the residual signal within the local calculation window, establish a signal gain adjustment loop based on the energy complexity entropy, and use the signal gain adjustment loop to perform amplitude enhancement on the residual signal to generate a residual significance distribution map. Step S105: The signal gain adjustment loop is used to perform nonlinear energy redistribution on the weak features that are masked in the high-energy range. Based on the geometric moment features in the residual significance distribution map, the defect type is determined, and control instructions are generated to drive the sorting mechanism to perform rejection actions on the non-conforming products.
2. The product quality inspection method based on machine vision according to claim 1, characterized in that, In step S101, a set of logarithmic Gaussian filters with preset center frequencies are used to perform multi-scale decomposition on the frequency domain signal to obtain complex components containing amplitude and phase information at each scale.
3. The product quality inspection method based on machine vision according to claim 1, characterized in that, Step S102 includes: extracting the first eigenvalue and the second eigenvalue of the local structure tensor, and calculating the ratio of the first eigenvalue to the second eigenvalue; when the ratio is greater than a preset coherence criterion, determining that the local calculation window belongs to a background region with directional coherence, and locking the directional guiding vector of the region.
4. The product quality inspection method based on machine vision according to claim 1, characterized in that, Step S103 includes: monitoring the phase change rate gradient of the phase component, and when the divergence change rate exceeds 5%, using negative feedback adjustment logic to reduce the phase consistency weight of the corresponding region.
5. The product quality inspection method based on machine vision according to claim 1, characterized in that, In step S104, the signal gain adjustment loop follows the following quantization rule: G=1+α⋅H, where G is the dynamic gain coefficient, α is the preset linear adjustment factor, and H is the energy complexity entropy of the residual signal within the local calculation window; the dynamic gain coefficient G is used to perform a product operation on the amplitude components of the residual signal to improve the local energy signal-to-noise ratio of weak features.
6. The product quality inspection method based on machine vision according to claim 1, characterized in that, The method also includes: extracting low-frequency energy components below 0.5Hz from the original signal energy distribution data, establishing active phase compensation logic for mechanical transmission jitter, calculating the spatiotemporal displacement deviation by reversing the intermediate products in the frequency domain, and performing linear realignment correction on the phase components.
7. The product quality inspection method based on machine vision according to claim 1, characterized in that, Before step S105, the method also includes: calculating the phase cyclic variance of signal sampling points at each scale, and combining the topological stability verification of phase singular points across scales to construct a physical isolation barrier against sensor shot noise.
8. The product quality inspection method based on machine vision according to claim 7, characterized in that, Topology stability verification includes: utilizing the difference between the scale continuity of the effective detection signal in the phase domain and the random discreteness of the noise signal, performing nonlinear filtering on the residual significance distribution map through a gating function to eliminate isolated interference points with a signal-to-noise ratio below 3dB.
9. The product quality inspection method based on machine vision according to claim 1, characterized in that, In step S105, the nonlinear energy redistribution performs contrast stretching on the processed residual signal through an adaptive dynamic range compression operator, so that the grayscale step value of the weak features is not less than 15.
10. A product quality inspection method based on machine vision according to claim 1, characterized in that, The specific steps for determining the type of execution defect include: extracting connected component features from the residual significance distribution map, calculating the centroid coordinates and area of the connected component features, and mapping the centroid coordinates to the underlying sorting execution module.