Image detection method and system with defect candidate region reinforcement
Patent Information
- Application Number
- CN202611007578.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2046-07-08
AI Technical Summary
[0006]为解决上述现有技术无法在极端的光学环境下同时实现高光抑制与暗场微弱目标保护,导致图像检测误检率与漏检率较高的技术问题,本发明在如下的多个方面提供方案
本发明通过深入剖析管帽透镜在特定工业视觉检测场景下产生的极端物理反光现象,打破了传统图像处理技术单纯依赖绝对数值对比度或固定参数阈值的局限:
Smart Images

Figure CN122573944B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to an image detection method and system for enhancing defect candidate regions. Background Technology
[0002] In the industrial manufacturing field, cap lenses are used in various precision optical equipment. This component is usually composed of an outer metal material and a central glass material, and there is a huge physical difference in the optical reflectivity between the two. When the detection system uses common industrial light sources such as coaxial rings for image acquisition, the junction between the metal cap and the glass lens will inevitably produce a very strong specular reflection phenomenon. This extreme physical optical environment results in an extremely wide dynamic range of the acquired image, and the pixels in the reflective area exhibit severe physical saturation and grayscale overflow.
[0003] Existing defect detection methods typically extract spatial gradient features directly from the original two-dimensional grayscale image and use a fixed preset threshold based on global statistical laws to truncate the features to identify defects. However, since light undergoes severe spatial attenuation at the edges of bright metal areas, this optical attenuation manifests as extremely high artifact gradient amplitudes in digital images. When processing image data with such a wide dynamic range, conventional algorithms are prone to mistakenly extracting the abrupt grayscale jumps at reflective edges as defect features, resulting in serious false defect detections.
[0004] On the other hand, real, subtle scratches or dirt are often hidden in the dark areas around reflective halos or in the glass region. Their scattered light energy is extremely weak, resulting in actual local contrast and gradient amplitude that are far lower than those of highlight artifacts. If existing technologies attempt to process the dark area using local linear contrast enhancement algorithms, although they can barely amplify the subtle defect features in the dark area, they will also exponentially amplify the inherent dark current thermal noise of the underlying optical sensor. Ultimately, the diffusion of the noise floor will completely drown out the real microscopic defects.
[0005] In summary, existing technologies, when dealing with composite material components with complex reflective properties, always face a fundamental technical contradiction between suppressing highlight artifacts and preserving weak defects. They cannot simultaneously achieve physical suppression of highlight artifacts and feature protection of weak targets in dark fields under extreme optical environments, resulting in consistently high false detection and false negative rates in image inspection in actual industrial settings. Summary of the Invention
[0006] To address the technical problem that existing technologies cannot simultaneously achieve high light suppression and protection of weak targets in dark fields under extreme optical environments, resulting in high false detection and false negative rates in image detection, this invention provides solutions in the following aspects.
[0007] In a first aspect, the present invention provides an image detection method for enhancing defect candidate regions, comprising: acquiring a lens image to be inspected; extracting the local region mean and local region standard deviation of each pixel in the lens image to be inspected based on a preset neighborhood window, and extracting the local dominant gradient direction angle based on the weighted average of the gradient magnitude and gradient direction angle of each neighboring pixel in the neighborhood window; extracting the global illumination mean based on grayscale operations of all pixels in the lens image to be inspected; adjusting the local contrast based on the global illumination mean to construct a local relative albedo fluctuation rate; constructing a nonlinear physical damping term based on the local region mean and the global illumination mean; and adjusting the local relative albedo fluctuation rate. A reflection suppression enhancement factor is constructed by fusing the rate with the nonlinear physical damping term; a wavefront divergence penalty operator is constructed based on the cosine relationship between the gradient direction angle of a pixel and the local dominant gradient direction angle; the wavefront divergence penalty operator, the gradient magnitude of the pixel, and the reflection suppression enhancement factor are fused to construct a defect candidate response value; the mean and standard deviation of the response values of the defect candidate response values corresponding to all pixels are calculated, and an adaptive truncation limit is constructed by combining a preset environmental tolerance coefficient; the defect candidate response values in the lens inspection image are compared with the adaptive truncation limit to extract candidate region pixels, and a defect candidate region image is generated and output.
[0008] This invention constructs a reflectivity suppression and enhancement factor with a physical damping mechanism by extracting global and local photometric features, and introduces a wavefront divergence penalty operator that characterizes the spatial diffuse reflection geometry to construct candidate defect response values. Finally, adaptive truncation is performed based on global dynamic statistical features. This process breaks through the limitations of traditional methods that directly extract grayscale gradients and use fixed threshold truncation. It can both forcibly remove deceptive artifacts caused by physical specular overflow in the logic and accurately capture topological diffuse reflection anomalies caused by real physical scratches. While protecting weak features in the dark field, it avoids the linear amplification of thermal noise, and ultimately resolves the core technical contradiction of high false detection and high false negative detection in high reflectivity and high dynamic conditions.
[0009] Preferably, the local dominant gradient direction angle is extracted based on the weighted average of the gradient magnitude and gradient direction angle of each neighboring pixel within the neighborhood window, including: taking each pixel as the center, statistically analyzing the pixel gradient direction angle of each adjacent pixel within its neighborhood window and mapping it to a physical direction vector, and using the normalized result of the gradient magnitude as the magnitude weight of the physical direction vector, wherein the normalized result is the ratio of the gradient magnitude to the sum of the gradient magnitudes of all adjacent pixels within the two-dimensional sliding window; decomposing the physical direction vector with the magnitude weight into a horizontal gradient component and a vertical gradient component, and independently linearly accumulating the horizontal gradient component and the vertical gradient component of all adjacent pixels to obtain a horizontal composite vector and a vertical composite vector; based on the vertical composite vector and the horizontal composite vector, reconstructing the composite angle using a bivariate arctangent function, and using the composite angle as the local dominant gradient direction angle.
[0010] Preferably, the reflectivity suppression enhancement factor satisfies the expression: In the formula, Indicates a reflectivity suppression and enhancement factor; Indicates the standard deviation of a local area; This represents the mean of a local region. This represents the global average illumination. Represents an exponential function with the natural constant as its base; This represents the local relative albedo volatility; This represents the nonlinear physical damping term.
[0011] This invention introduces a global illumination mean that represents the baseline of the environmental energy of the entire image. This not only eliminates mathematical singularities in the nonlinear calculation process, but also establishes an adaptive light-transmitting film in the pixel feature space through a physical damping term. This ensures that real, subtle fluctuations are fully preserved while suppressing specular highlight artifacts.
[0012] Preferably, the defect candidate response value satisfies the expression: In the formula, Indicates the candidate response value for the defect; This represents the gradient magnitude of a pixel. Indicates a reflectivity suppression and enhancement factor; Indicates the gradient direction angle of a pixel; This represents the local dominant gradient direction angle of a pixel; Represents the cosine function; This represents the wavefront divergence penalty operator.
[0013] This invention expands the dimension of feature selection from simple grayscale energy adversarial to spatial topological divergence adversarial. It uses the cosine triangle relationship to zero out the compliant specular boundaries that are smooth and have consistent light direction, and effectively amplifies the microscopic anomalies of omnidirectional scattering of light caused by rough scratches, thus greatly improving the confidence of artifact truncation.
[0014] Preferably, the adaptive cutoff limit satisfies the expression: In the formula, Indicates an adaptive cutoff limit. This represents the mean of the response value across the entire graph. This represents the environmental tolerance coefficient. This represents the standard deviation of the response values across the entire graph.
[0015] This invention utilizes statistical principles to use the mean of the response value across the entire image as the image's underlying base. It combines the tolerance coefficient and standard deviation to construct a dynamic offset, ensuring that the final cutoff boundary closely matches the optical baseline drift caused by batch differences in the material itself. This solves the problem that fixed hard thresholds are prone to failure in cross-batch detection.
[0016] Preferably, the process of comparing the candidate defect response values in the lens image to be inspected with the adaptive truncation limit to extract candidate region pixels and generating and outputting a candidate defect region image includes: sequentially traversing each pixel in the lens image to be inspected; comparing and retaining pixels in the lens image to be inspected whose candidate defect response values are greater than the adaptive truncation limit, marking the retained pixels as candidate region pixels and setting their grayscale; and generating and outputting the candidate defect region image based on the marked candidate region pixels.
[0017] By comparing pixel-by-pixel values and using a strategy of marking the position of candidate region pixels and filling the grayscale, the high-dimensional energy anomaly map obtained by multi-dimensional topology calculation is mapped back to the binary two-dimensional image space, providing visual positioning input for the grasping and sorting of downstream automated equipment.
[0018] Preferably, acquiring the image of the lens to be inspected includes: controlling the product tray to move along the conveyor track and fixing it at the vision inspection station; based on the sensor sensing that the product tray has been fixed, triggering the programmable logic controller to synchronously output a hard trigger signal; based on the down-shooting vision component configured with a ring light source and a telecentric lens, acquiring the two-dimensional electrical signal of the cap lens through an industrial camera after receiving the hard trigger signal, and converting the two-dimensional electrical signal into the image of the lens to be inspected.
[0019] Preferably, the method for calibrating the empirical value of the environmental tolerance coefficient is as follows: establish a standardized physical test set including high-gloss overflow good products and minor scratch defective products; use the boundary value of the three sigma confidence interval of shot noise as the test center to perform parameter traversal, and output the steady-state value that makes the current batch test false negative rate and false positive rate lower than the acceptance standard as the empirical value of the environmental tolerance coefficient.
[0020] In a second aspect, the present invention provides an image detection system for enhancing defect candidate regions, comprising a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the aforementioned image detection method for enhancing defect candidate regions is implemented.
[0021] By adopting the above technical solution, the image detection method for enhancing defect candidate regions described above is generated into a computer program and stored in a memory for loading and execution by a processor. This allows for the creation of a terminal device based on the memory and processor, making it convenient to use.
[0022] The beneficial effects of this invention are as follows: This invention breaks through the limitations of traditional image processing techniques that rely solely on absolute numerical contrast or fixed parameter thresholds by deeply analyzing the extreme physical reflection phenomenon generated by cap lenses in specific industrial visual inspection scenarios: 1. This invention abandons the conventional approach of global threshold truncation and uses a two-dimensional sliding window and differential operator to extract the underlying spatial photometric features of the lens image to be inspected in order to build a data foundation.
[0023] 2. This invention constructs a local relative albedo fluctuation rate and introduces a nonlinear physical damping term constrained by the dynamic feedback of global light intensity. By combining the two, a reflection suppression and enhancement factor is constructed. The exponential decay law of the natural constant is used to accurately simulate the photoelectric overload phenomenon of the sensor, and the path of the specular edge artifact deteriorating into a false defect is cut off at the physical logic level.
[0024] 3. This invention makes deep use of the objective law of wavefront deflection caused by diffuse reflection of light waves. By constructing a wavefront divergence penalty operator and fusing it with underlying parameters such as gradient magnitude to construct defect candidate response values, it successfully extracts weak real defects hidden in dark fields or strong light halos and exhibiting severe directional divergence from a highly consistent background.
[0025] 4. Based on the full-image statistical features of response values combined with the environmental tolerance coefficient, this invention dynamically establishes an adaptive truncation limit to generate the final defect candidate region image. The entire feature extraction and candidate region locking process completely abandons the absolute hard parameters that are prone to failure across batches. This enables the system to maintain extremely high detection accuracy and robustness even when facing harsh working conditions with extremely uneven lighting and strong reflections from composite materials, thus resolving the technical contradiction of high false detection and high false negative detection in industrial vision. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating an image detection method for enhancing defect candidate regions according to the present invention; Figure 2 This is a schematic diagram illustrating the structural layout of a lens cap appearance inspection and screening device. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0029] This invention discloses an image detection method for enhancing defect candidate regions, referring to... Figure 1 This includes steps S1-S4: S1. Obtain the image of the lens to be inspected, and extract the underlying spatial photometric features based on the two-dimensional sliding window and the difference operator.
[0030] It should be noted that, given the significant difference in reflectivity between the metal and glass materials on the surface of the lens cap, relying solely on the absolute grayscale value of pixels cannot accurately reflect the physical morphology of the object's surface. Strong specular reflection will cause a severe imbalance in the global grayscale distribution, and direct threshold judgment will inevitably lead to a large number of misjudgments. By extracting statistical features and fine-grained spatial features from local areas within a specific spatial neighborhood, low-frequency interference caused by uneven global illumination can be effectively removed. This transforms the underlying photoelectric signals captured by the optical system into structured data characterizing the physical roughness of the surface, thus providing a data foundation for subsequent analysis of light wave scattering patterns.
[0031] Specifically, the product tray moves forward along the conveyor track and is fixed at the vision inspection station. Then, a downward-facing vision component equipped with a ring light source and a telecentric lens begins image inspection. When the sensor detects that the product tray is fixed, it triggers the programmable logic controller to synchronously output a hard trigger signal. Upon receiving the hard trigger signal, the industrial camera acquires the two-dimensional electrical signal of the tube cap lens and converts it into an image of the lens to be inspected. A schematic diagram of the structural layout of the tube cap lens appearance inspection and screening equipment is shown below. Figure 2 As shown.
[0032] Furthermore, a two-dimensional sliding window of a preset size is set as a neighborhood window. The input lens image to be inspected is processed by performing a pixel-by-pixel neighborhood traversal. The mean and standard deviation of the local region of each pixel within the neighborhood window are extracted. At the same time, grayscale accumulation and averaging are performed on all pixels of the lens image to be inspected to calculate the global illumination mean value representing the basic energy level of the current overall lighting environment.
[0033] The preset size of the two-dimensional sliding window directly determines the physical receptive field of the local area mean and local area standard deviation. It is necessary to determine the equivalent pixel line width of the defect based on the physical scale of the target defect and the spatial resolution of the optical system. The pixel side length of the preset size is set to the smallest positive integer that is greater than the equivalent pixel line width of the defect and is odd, so as to ensure that when the center pixel of the two-dimensional sliding window is aligned with the real physical defect, its outer edge can completely cover the background pixels around the defect.
[0034] It should be further noted that, considering the extreme physical anomalies that may occur in actual industrial settings, such as the complete failure of the coaxial ring composite light source or the blockage of the hardware optical path of the industrial camera, the acquired lens image may present an absolute black field with no photon energy, resulting in the extracted global illumination mean being equal to zero. In this case, the pre-interception logic is triggered, and the system immediately terminates the subsequent low-level spatial feature extraction and fusion calculation process of the current lens image and sends a fault alarm command representing the hardware-level visual blind zone to the upper-level device to prompt manual intervention for maintenance. If it is determined that the global illumination mean is greater than zero, it indicates that the current low-level photoelectric signal has a normal physical baseline, and the system continues to execute subsequent steps.
[0035] Furthermore, differential operators are introduced along two orthogonal directions, horizontal and vertical, to extract the gradient magnitude and gradient direction angle of each pixel in the lens image under inspection. Based on this, to avoid physical direction inversion anomalies caused by directly averaging angle data with periodic characteristics, all adjacent pixels within their neighborhood window are traversed, with each pixel as the center. The gradient direction angle of each adjacent pixel is mapped to a physical direction vector in two-dimensional geometric space, and the normalized result of the corresponding gradient magnitude is used as the magnitude weight of the physical direction vector. Using the spatial orthogonal projection rule, each physical direction vector with magnitude weight within the neighborhood window is projected onto a horizontal orthogonal reference. Using a perpendicular orthogonal reference, the corresponding horizontal and vertical gradient components are decomposed and obtained. Then, the horizontal gradient components of all adjacent pixels within the neighborhood window are independently and linearly accumulated to obtain the horizontal composite vector of the neighborhood window. Simultaneously, the vertical gradient components of all adjacent pixels within the neighborhood window are independently and linearly accumulated to obtain the vertical composite vector of the neighborhood window. Finally, based on the geometric algebraic ratio between the vertical and horizontal composite vectors in two-dimensional space, the composite angle representing the overall physical energy direction of the neighborhood window is reconstructed using a bivariate arctangent function. This angle is then used as the local dominant gradient direction angle within the neighborhood window of the pixel and output.
[0036] The normalized result of the gradient magnitude of each adjacent pixel is equal to the ratio of the gradient magnitude of each adjacent pixel to the sum of the gradient magnitudes, where the sum of the gradient magnitudes refers to the sum of the gradient magnitudes of all adjacent pixels within the neighborhood window.
[0037] S2. A reflection suppression and enhancement factor is constructed based on the fusion of local relative albedo volatility and nonlinear physical damping term.
[0038] It should be noted that existing image local contrast enhancement techniques often lack consideration of the physical mechanisms of overexposure in industrial camera sensors. In extreme specular reflective areas, the true physical morphological information has been truncated by optical saturation. At this point, any linear contrast amplification will lead to disordered dispersion of background noise. To overcome the limitations of traditional linear amplification, this invention introduces nonlinear optical damping based on global illumination dynamic feedback, forming a mechanism to protect weak targets in dark areas and punish interference noise in bright areas: when a pixel is in a dark area, the target protection mechanism is activated to retain weak fluctuations; when the probe sweeps over a high-risk specular reflective area, the noise punishment mechanism adaptively suppresses artifact activity according to the physical overload of the local albedo of the image, effectively suppressing the artifact response value below the background noise baseline, achieving highlight suppression without losing weak signals in dark areas, thereby solving the problem of background noise amplification caused by local contrast enhancement.
[0039] Specifically, based on the local region standard deviation, local region mean, global illumination mean, and nonlinear optical overload response law, a calculation model for the reflection suppression and enhancement factor is constructed; then the reflection suppression and enhancement factor satisfies the expression:
[0040] In the formula, Indicates a reflectivity suppression and enhancement factor; Indicates the standard deviation of a local area; This represents the mean of a local region. This represents the global average illumination. This represents an exponential function with the natural constant as its base.
[0041] Conventional contrast ratios are typically represented by dividing the local standard deviation by the local mean to reflect relative fluctuations. However, in the case of high reflectivity with cap lenses, the local mean is extremely large at the highlight center while the standard deviation approaches zero, whereas the highlight edges exhibit both high mean and high standard deviation. When the field of view shifts to the absolute dark field at the center of the glass lens, the local mean easily approaches zero, and the conventional linear Weber model is prone to producing drastic computational singularities at the boundary between light and dark areas and at the center of the dark field. Therefore, this invention introduces the global illumination mean, representing the baseline of the overall environmental energy, into the denominator. A characterization of local relative albedo volatility was obtained. This improvement not only eliminates the risk of the mathematical denominator approaching zero, but also, in a physical sense, limits the dark field noise amplification effect to within the baseline range allowed by global ambient light.
[0042] Meanwhile, a nonlinear physical damping term driven by the ratio of local light intensity to global light intensity was constructed at the end of the calculation formula. When a pixel is in a dark area, i.e., the target protection zone, the smaller the local mean value, the closer the exponent term is to 1, meaning that the true subtle fluctuations are completely preserved. When the probe scans through the high-risk specular reflection area, i.e. the noise penalty zone, the local mean value is extremely high. This damping term strictly follows the objective physical law of photon energy saturation decay in nature and drops sharply, with the value approaching zero. This forcibly erases the activity of highlight artifacts, thereby cutting off the path for highlight artifacts to be mistakenly amplified as defect features.
[0043] S3. Defect candidate response values are constructed by fusing wavefront divergence penalty operator and gradient magnitude.
[0044] It should be noted that the curved metal surface structure of the cap lens gives the smooth edges a specific geometric curvature. Real physical micro-defects, whether at the bright edges or in the dark areas, interfere with incident light through diffuse reflection and scattering, inevitably leading to chaotic deflection of the wavefront at the microscale. In contrast, the edges of regular metal cap components or large-area bright halos follow the law of specular reflection, exhibiting a high degree of geometric consistency and continuity in the spatial gradient direction of the reflected light. By constructing a wavefront divergence penalty operator, a target protection and noise penalty mechanism is formed: when light shines on micro-scratches caused by material damage... The rough interface forces light waves to scatter, causing the gradient direction to deviate and triggering a target protection mechanism to improve the response. When encountering a regular reflective edge, the angle between the gradients of adjacent pixels approaches zero and the noise penalty mechanism causes it to decay to zero, effectively suppressing the response value of the smooth structure. This solves the problem that it is difficult to distinguish between processing tolerances and abnormal defects by simply relying on grayscale amplitude. By accurately capturing the spatial wavefront deflection law, this invention can break through the limitations of simply relying on grayscale amplitude, peel out the real microscopic physical defects hidden in the complex optical background, and transform the simple brightness confrontation into spatial topological confrontation.
[0045] Specifically, based on the reflection suppression enhancement factor, the gradient magnitude of the pixel, the gradient direction angle, and the local dominant gradient direction angle, combined with the spatial scattering deflection law of light waves, a defect candidate response value calculation model is constructed; then the defect candidate response value satisfies the expression:
[0046] In the formula, Indicates the candidate response value for the defect; This represents the gradient magnitude of a pixel. Indicates a reflectivity suppression and enhancement factor; Indicates the gradient direction angle of a pixel; This represents the local dominant gradient direction angle of a pixel; This represents the cosine function.
[0047] In the formula, The wavefront divergence penalty operator, based on the physical law of diffuse reflection, determines that when light shines on a compliant, smooth material boundary, the gradient direction angle of a pixel will be highly parallel to its local dominant gradient direction angle, with the included angle approaching 0. This causes the overall value of the wavefront divergence penalty operator to approach absolute zero, thus forming a penalty mechanism at the physical space level, completely eliminating deceptive structural boundaries and bright halos. Conversely, when light shines on microscopic scratches caused by material damage, the extremely rough microscopic interface forces the incident light wave to undergo omnidirectional scattering, causing a sharp angular deviation between the gradient direction angle of the pixel and the local dominant gradient direction angle. The operator value quickly rebounds to a high level, thus achieving a target protection mechanism for real physical defects. This mechanism expands the focus of feature extraction from a simple brightness dimension to a spatial topological dimension, following the objective law of spatial deflection of light beams scattering on rough media surfaces in nature. This ensures the accuracy of real defect feature enhancement in lens images with strong halo interference.
[0048] S4. Establish adaptive truncation limits based on the full-map statistical features of response values to generate and output defect candidate region images.
[0049] It should be noted that after completing the preliminary physical feature correction and multi-dimensional parameter enhancement, the energy distribution in the defect candidate response value spectrum has deviated from the original two-dimensional grayscale space, forming a new energy field characterizing the surface microscopic anomaly. Due to the objective slight batch physical fluctuations in the surface coating process and material roughness of the cap lenses produced in different batches, which manifest as a drift in the baseline of the overall response value, using any fixed absolute empirical value as the final judgment boundary condition will lead to the loss of flexibility of the detection system. This invention introduces the dynamic offset characteristics of Gaussian statistical distribution, retains abnormal abrupt changes that deviate from the environmental background, and uses the background fluctuation variance to adaptively raise the judgment threshold to remove the regular fluctuations of the system, thereby solving the problem of fixed parameter failure caused by slight material fluctuations during cross-batch automatic detection.
[0050] Specifically, a global traversal is performed on the entire image of the lens to be inspected, and the mean and standard deviation of the response values of the candidate defect response values corresponding to all pixels in the image are calculated. Then, an adaptive truncation limit calculation model is constructed based on the Gaussian statistical truncation formula; the adaptive truncation limit satisfies the expression:
[0051] In the formula, Indicates an adaptive cutoff limit; This represents the mean of the response value across the entire graph. This represents the environmental tolerance coefficient; This represents the standard deviation of the response values across the entire graph.
[0052] In the formula, Characterizing the tolerance margin for background fluctuations, the specific operating mechanism of this formula utilizes the statistical confidence interval law, taking the mean of the response value across the entire image as the basic background energy and the tolerance margin for background fluctuations as the dynamic offset. The larger the value of the adaptive truncation limit, the stronger the system's adaptive lifting of the baseline drift of the current batch's physical environment, thereby accurately truncating background noise and retaining significant anomalies in the data stream.
[0053] Furthermore, each pixel in the lens inspection image that has a defect candidate response value greater than the adaptive cutoff limit is compared and retained. These pixels are then used as candidate region pixels for position marking and grayscale filling. Finally, a defect candidate region image is generated and output for subsequent equipment to execute sorting or yield statistics instructions.
[0054] It should be further added that the environmental tolerance coefficient in this invention is directly limited by the quantum efficiency of the silicon-based sensor of the industrial camera and the physical constraints of the thermal noise substrate. Since the dark current shot noise in the photoelectric conversion process strictly conforms to the Gaussian statistical distribution model in the full-frame spatial distribution, in order to completely retain the weak real defect scattering signal while stripping away the physical thermal noise, this invention establishes a standardized physical test set including good products with high light overflow and defective products with slight scratches in the early stage of trial production of the deployed equipment. In the dynamic optimization process, the boundary value of the three sigma confidence interval of dark current shot noise in the photoelectric conversion process, 3.0, is used as the test center. The parameters are traversed in the real number interval from 2.5 to 3.5 with a step size of 0.1. The system-level false negative rate is locked as the core indicator of the control variable. The steady-state value that makes the false negative rate and false positive rate of this batch of tests lower than the acceptance standard is used as the empirical value of the environmental tolerance coefficient. The setting of this empirical value is precisely matched with the physical signal-to-noise ratio extreme value boundary of the current photoelectric sensor under normal temperature conditions, ensuring that the adaptive cutoff limit always floats above the physical noise substrate and is close to the lower edge of the real signal.
[0055] This invention also discloses an image detection system for enhancing defect candidate regions, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement an image detection method for enhancing defect candidate regions according to the present invention.
[0056] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
Claims
1. An image detection method for enhancing defect candidate regions, characterized in that, include: Acquire the image of the lens to be inspected; Based on a preset neighborhood window, the mean and standard deviation of the local region of each pixel in the lens image to be inspected are extracted, and the local dominant gradient direction angle is extracted based on the weighted average of the gradient magnitude and gradient direction angle of each neighboring pixel in the neighborhood window; the global illumination mean is extracted based on the grayscale operation of all pixels in the lens image to be inspected. Local contrast is adjusted based on the global illumination mean to construct a local relative albedo volatility, wherein the local relative albedo volatility is... ,in, Indicates the standard deviation of a local area; This represents the mean of a local region. The global illumination mean is represented; a nonlinear physical damping term is constructed based on the local regional mean and the global illumination mean; the local relative albedo volatility is fused with the nonlinear physical damping term to construct a reflection suppression and enhancement factor; A wavefront divergence penalty operator is constructed based on the cosine relationship between the gradient direction angle of a pixel and the local dominant gradient direction angle. The wavefront divergence penalty operator, the gradient magnitude of the pixel, and the reflection suppression enhancement factor are fused to construct a defect candidate response value. Calculate the mean and standard deviation of the response values of the candidate response values for all pixels corresponding to the defects, and construct an adaptive cutoff limit by combining it with a preset environmental tolerance coefficient. The candidate defect response values in the lens image to be inspected are compared with the adaptive truncation limit to extract candidate region pixels, and a candidate defect region image is generated and output.
2. The image detection method for enhancing defect candidate regions according to claim 1, characterized in that, The local dominant gradient direction angle is extracted based on the weighted average of the gradient magnitude and gradient direction angle of each neighboring pixel within the neighborhood window, including: Centered on each pixel, the gradient direction angle of each neighboring pixel in its neighborhood window is mapped to a physical direction vector, and the normalized result of the gradient magnitude is used as the magnitude weight of the physical direction vector, wherein the normalized result is the ratio of the gradient magnitude to the sum of the gradient magnitudes of all neighboring pixels in the neighborhood window. The physical direction vector with the magnitude weight is projected and decomposed into horizontal gradient components and vertical gradient components. The horizontal gradient components and vertical gradient components of all adjacent pixels are independently linearly accumulated and aggregated to obtain horizontal composite vector and vertical composite vector. Based on the vertical composite vector and the horizontal composite vector, the composite angle is reconstructed using a bivariate arctangent function, and the composite angle is used as the local dominant gradient direction angle.
3. The image detection method for enhancing defect candidate regions according to claim 1, characterized in that, The reflection suppression enhancement factor satisfies the expression: ; In the formula, Indicates a reflectivity suppression and enhancement factor; Represents an exponential function with the natural constant as its base; This represents the nonlinear physical damping term.
4. The image detection method for enhancing defect candidate regions according to claim 1, characterized in that, The defect candidate response value satisfies the expression: ; In the formula, Indicates the candidate response value for the defect; This represents the gradient magnitude of a pixel. Indicates a reflectivity suppression and enhancement factor; Indicates the gradient direction angle of a pixel; This represents the local dominant gradient direction angle of a pixel; Represents the cosine function; This represents the wavefront divergence penalty operator.
5. The image detection method for enhancing defect candidate regions according to claim 1, characterized in that, The adaptive cutoff limit satisfies the expression: ; In the formula, Indicates an adaptive cutoff limit. This represents the mean of the response value across the entire graph. This represents the environmental tolerance coefficient. This represents the standard deviation of the response values across the entire graph.
6. The image detection method for enhancing defect candidate regions according to claim 1, characterized in that, The process of comparing the candidate defect response values in the lens image under inspection with the adaptive truncation limit to extract candidate region pixels, generating and outputting a candidate defect region image, includes: Each pixel in the lens image to be inspected is traversed one by one; Compare and retain the pixels in the lens image to be inspected whose defect candidate response values are greater than the adaptive cutoff limit, and mark the position and grayscale of the retained pixels as candidate region pixels; The defect candidate region image is generated and output based on the labeled candidate region pixels.
7. The image detection method for enhancing defect candidate regions according to claim 1, characterized in that, Acquire the image of the lens to be inspected, including: Control the product tray to move along the conveyor track and fix it in position at the vision inspection station; Based on the sensor's detection that the product tray has been positioned and fixed, the programmable logic controller is triggered to synchronously output a hard trigger signal. Based on a down-shooting vision component equipped with a ring light source and a telecentric lens, an industrial camera acquires the two-dimensional electrical signal of the cap lens after receiving the hard trigger signal, and converts the two-dimensional electrical signal into the image of the lens to be inspected.
8. The image detection method for enhancing defect candidate regions according to claim 5, characterized in that, The method for calibrating the empirical value of the environmental tolerance coefficient is as follows: Establish a standardized physical test set that includes good products with high gloss overflow and defective products with minor scratches; Using the boundary values of the three sigma confidence interval for shot noise as the test center, parameter traversal is performed, and the steady-state values that make the false negative rate and false positive rate of the current batch test lower than the acceptance standard are output as empirical values of the environmental tolerance coefficient.
9. An image detection system for enhancing defect candidate regions, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement an image detection method for enhancing defect candidate regions according to any one of claims 1-8.
Citation Information
Patent Citations
Fabric defect detection method based on deep convolution neural network and visual saliency
CN107833220A
A highlight object surface defect detection system and method based on reflected light
CN109584239A