Precise metal part surface defect imaging method and system in complex light field interference environment
By acquiring multispectral image sequences in complex light field environments, dynamically adjusting exposure parameters and performing adaptive background separation and nonlinear stretching, combined with multi-scale feature fusion, the problems of light field interference and defect edge information loss in traditional optical detection methods are solved, and high-sensitivity defect imaging is achieved.
Patent Information
- Application Number
- CN202510770968.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-10
AI Technical Summary
In complex light field environments, traditional optical detection methods have difficulty suppressing interference from ambient stray light, resulting in false defect signals, and are unable to effectively utilize the spatial correlation between spectral information and defect geometric features in multispectral imaging technology, resulting in loss of defect edge information and overexposure or under-enhancement caused by differences in grayscale distribution.
By acquiring a multispectral image sequence of the metal surface, dynamically adjusting the exposure parameters of each spectral channel, using an adaptive kernel function to separate low-frequency background and high-frequency defect features, and performing nonlinear stretching based on the normal distribution model, combined with multi-scale feature fusion, a defect enhanced image set is generated.
It effectively suppresses light field interference, highlights real defect features, improves the visual significance and recognizability of tiny defects, and solves the problems of exposure imbalance and defect edge information loss caused by ambient light fluctuations and metal reflective properties in traditional methods.
Smart Images

Figure CN120707450A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and system for imaging surface defects of precision metal parts in a complex light field interference environment. Background Art
[0002] In the field of surface defect detection for precision metal parts, imaging interference in complex light field environments and the high reflectivity of metal surfaces lead to limitations in traditional optical inspection methods. Existing surface defect detection systems based on visible light imaging typically employ fixed-angle light sources and single-spectrum imaging, making it difficult to suppress dynamic interference from ambient stray light and, in particular, prone to generating false defect signals under multi-angle reflection conditions. The high overlap between metal surface texture and tiny defects in the spatial frequency domain causes conventional frequency-domain filtering algorithms to lose defect edge information when suppressing background texture.
[0003] Current mainstream contrast enhancement methods, such as linear stretching or histogram equalization, suffer from two key flaws in metal surface inspection: First, the difference in grayscale distribution between highly reflective and low-illuminated areas causes the global enhancement algorithm to overexposure or underenhancement; second, it is unable to adaptively adjust to the statistical characteristics of defect features and non-uniform reflection noise. Furthermore, while multispectral imaging technology can capture differences in the reflective properties of surface materials, it lacks an effective cross-modal feature fusion mechanism, resulting in the underutilization of the spatial correlation between spectral information and defect geometric characteristics. Summary of the Invention
[0004] The present application provides a method and system for imaging surface defects of precision metal parts in a complex light field interference environment, which is used to solve the problem in the prior art that the difference in grayscale distribution between high-reflection areas and low-illumination areas causes the global enhancement algorithm to produce overexposure or under-enhancement; and it is impossible to adaptively adjust the defect characteristics and the statistical characteristics of non-uniform reflection noise.
[0005] In a first aspect, the present application provides a method for imaging surface defects of precision metal parts in a complex light field interference environment, comprising: Obtaining original multispectral image sequences of the metal surface; Adjusting exposure parameters of each spectral channel by dynamic light intensity equalization based on the original multispectral image sequence to generate a standardized image set; The background of a single frame image in the standardized image set is separated by an adaptive kernel function, and the low-frequency component of the image is extracted as a guided smoothing image. Performing pixel-level difference operation on the guided smoothed image and a single-frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information; Based on the normal distribution model, the grayscale distribution of the feature map is mapped to a probability density function. The local contrast is nonlinearly stretched by adjusting the standard deviation parameter to generate a defect feature distribution map with enhanced gradient features. The defect feature distribution map is fused with the original multispectral image to form a defect enhanced image set.
[0006] Optionally, a probability density function mapping is performed on the grayscale distribution of the feature map based on a normal distribution model, and the local contrast is nonlinearly stretched by adjusting the standard deviation parameter to generate a defect feature distribution map with enhanced gradient features, including: Taking the grayscale histogram of the high-frequency defect feature map as input, establishing initial normal distribution model parameters; Calculating the probability density function value corresponding to each gray level based on the normal distribution model parameters, and generating a mapping relationship matrix between gray level and probability density; Using the mapping relationship matrix as the input of a nonlinear stretching function, and modulating the slope of a probability density function curve by adjusting a standard deviation parameter to obtain an adjusted probability density function; The modulated probability density function is used to remap the grayscale value of the original feature map pixel by pixel to generate a defect feature distribution map with enhanced gradient features.
[0007] Optionally, the mapping relationship matrix is used as the input of a nonlinear stretching function, and the slope of the probability density function curve is modulated by adjusting a standard deviation parameter to obtain an adjusted probability density function, including: A nonlinear stretching weight factor is established based on the mapping relationship matrix, and a dynamic partial derivative function of a probability density function is generated according to the adjustment range of the standard deviation parameter; Optimizing the parameters of the dynamic partial derivative function so that the slope of the probability density function curve in the target grayscale range satisfies a preset dynamic optimization objective function; The probability density function curve is matched and calibrated with the grayscale distribution of the original feature map step by step to generate a modulation function for adaptive contrast enhancement.
[0008] Optionally, obtaining a sequence of original multispectral images of the metal surface includes: Based on the surface reflection characteristics of metal parts, the CCD exposure time of each spectral channel is dynamically triggered to generate a multi-spectral synchronous sampling image covering visible light and near-infrared bands; Time series alignment processing is performed on the multispectral synchronous sampling images to generate an original multispectral image sequence with sub-pixel registration accuracy.
[0009] Optionally, adjusting exposure parameters of each spectral channel by dynamic light intensity equalization based on the original multispectral image sequence to generate a standardized image set includes: Calculate the statistical parameters of the brightness component of each spectral channel image in the CIE-Lab color space and establish the inter-channel light intensity compensation coefficient matrix; Performing gamma correction on the oversaturated channel based on the compensation coefficient matrix and performing histogram equalization on the low illumination channel; Through iterative optimization, the contrast standard deviation of each channel image converges to the preset threshold range, generating a set of standardized images with consistent spectral response.
[0010] Optionally, background separation is performed on a single frame image in the standardized image set using an adaptive kernel function, and a low-frequency component of the image is extracted as a guided smoothing image, including: Construct a spatially variable kernel function model based on bilateral filtering, and output kernel function configuration parameters including spatial domain weight distribution and scale parameters; Calculating a weight matrix based on the kernel function configuration parameters, performing multi-scale spatial filtering on the standardized image, and outputting filtered intermediate image data; Performing frequency domain conversion on the intermediate image data by Fourier transform to generate frequency domain spectrum data; Selecting spectral components after performing zero-frequency centering processing on the frequency domain spectrum data; An inverse Fourier transform is performed on the selected frequency domain data to extract its actual component as a low-frequency component, and the low-frequency component is weightedly fused with the original intermediate image data to generate a guided smoothed image.
[0011] Optionally, multi-scale feature fusion is performed on the defect feature distribution map and the original multispectral image to construct a defect enhanced image set, including: Performing Gaussian pyramid decomposition on the defect feature distribution map to generate a multi-scale feature map containing different spatial frequencies; Perform convolution kernel matching on the multi-scale feature map and the corresponding scale layer of the original multispectral image, and establish a feature mapping relationship through a normalized cross-correlation algorithm; Based on the mapping relationship, adaptive weight allocation is performed on each channel of the multispectral image to generate a fusion feature layer with spectrum preservation characteristics; The fused feature layer is inversely synthesized using a Laplacian pyramid reconstruction algorithm to output a defect enhancement image set containing defect enhancement information.
[0012] In a second aspect, an embodiment of the present application provides a system for imaging surface defects of precision metal parts in a complex light field interference environment, characterized by comprising: An acquisition module is used to acquire an original multispectral image sequence of the metal surface; An adjustment module, configured to adjust exposure parameters of each spectral channel by dynamic light intensity equalization based on the original multispectral image sequence to generate a standardized image set; A separation module is used to perform background separation on a single frame image in the standardized image set using an adaptive kernel function, and extract the low-frequency component of the image as a guided smoothing image; A difference module is used to perform pixel-level difference operation between the guided smoothed image and a single-frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information; A mapping module is used to perform probability density function mapping on the grayscale distribution of the feature map based on the normal distribution model, and to perform nonlinear stretching on the local contrast by adjusting the standard deviation parameter to generate a defect feature distribution map with enhanced gradient features; A construction module is used to perform multi-scale feature fusion on the defect feature distribution map and the original multispectral image to construct a defect enhanced image set.
[0013] In a third aspect, an embodiment of the present application provides a computing device comprising a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement a method for imaging surface defects of precision metal parts in a complex light field interference environment as described in the first aspect above.
[0014] In a fourth aspect, an embodiment of the present application provides a computer storage medium storing a computer program. When the computer program is executed by a computer, it implements a method for imaging surface defects of precision metal parts in a complex light field interference environment as described in the first aspect.
[0015] In an embodiment of the present application, a sequence of original multispectral images of a metal surface is obtained; based on the original multispectral image sequence, the exposure parameters of each spectral channel are adjusted through dynamic light intensity equalization to generate a standardized image set; background separation is performed on a single frame image in the standardized image set using an adaptive kernel function, and the low-frequency component of the image is extracted as a guided smoothed image; pixel-level difference operations are performed between the guided smoothed image and the corresponding single frame image in the standardized image set to generate a high-frequency defect feature map containing defect edge information; probability density function mapping is performed on the grayscale distribution of the feature map based on a normal distribution model, and local contrast is nonlinearly stretched by adjusting the standard deviation parameter to generate a defect feature distribution map with enhanced gradient characteristics; multi-scale feature fusion is performed on the defect feature distribution map with the original multispectral image to construct a defect enhanced image set. The technical solution provided by this application breaks through the limitations of single-spectral imaging. By capturing the reflectance characteristics of the metal surface in different bands through multispectral data, it provides a redundant information basis for defect detection under complex light field interference. It solves the problem of exposure imbalance between each channel caused by ambient light fluctuations or metal reflective properties, eliminates the suppression of defect signals by non-uniform illumination, and improves the comparability of cross-spectral data. This method overcomes the over-smoothing or under-smoothing issues of traditional fixed kernel functions for complex textured backgrounds, adaptively stripping away structural noise from metal surfaces while preserving the physical continuity of low-frequency backgrounds. Through background separation and differential operations, it suppresses low-frequency background interference, highlighting the high-frequency mutation characteristics of defect edges, and overcoming the bottleneck of traditional threshold segmentation in underdetecting weak-edge defects. To address the problem of concentrated grayscale distribution of weak-contrast defects in feature maps, probability density mapping is used to adaptively stretch local contrast, enhancing the gradient difference between tiny defects and the background. By fusing the original multispectral material information with the enhanced defect gradient features, the method addresses the insufficient signal-to-noise ratio of a single feature map and improves the visual salience and recognizability of defects. An initial normal distribution model is established based on the grayscale histogram of the high-frequency defect feature map, and a grayscale-probability density relationship matrix is generated through probability density function mapping. The slope of the probability density function curve is modulated by dynamically adjusting the standard deviation parameter. A remapping function is used to perform a nonlinear transformation of the feature map grayscale values, achieving adaptive stretching of local contrast and generating a defect distribution map with enhanced gradient features. Through probability density mapping, the clustering interval of defect grayscale in the feature map is accurately located to avoid the amplification of background noise caused by global stretching; the dynamic adjustment of the standard deviation parameter gives the model the ability to adapt to the defect scale / contrast: high-slope stretching is applied to small defects to sharpen the edges, and moderate stretching is maintained for large defects to prevent feature distortion; breaking through the generalization barrier of fixed parameterized enhancement methods on complex metal surfaces, improving the imaging signal-to-noise ratio of weak visible defects such as micron-level scratches and pits, and solving the problem of excessive submergence of weak defects by traditional linear contrast stretching.
[0016] These and other aspects of the present application will become more readily apparent from the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 A flow chart of a method for imaging surface defects of precision metal parts in a complex light field interference environment provided by the present application is shown; Figure 2 A schematic diagram of the structure of a precision metal part surface defect imaging system in a complex light field interference environment provided by the present application is shown; Figure 3 A schematic structural diagram of a computing device provided by the present application is shown. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0020] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to being different types.
[0021] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0022] In the field of surface defect detection for precision metal parts, the difficulty in suppressing dynamic interference from ambient stray light in complex light field environments, the presence of false defect signals in traditional optical detection methods due to the high reflectivity of metals, and the inability of existing fixed-angle light sources and single-spectrum imaging to overcome multi-angle reflection interference and the loss of defect edge information caused by conventional frequency-domain filtering algorithms are addressed. This application proposes an imaging method using dynamic light intensity equalization and adaptive feature enhancement. By acquiring the original multispectral image sequence and dynamically adjusting the exposure parameters of each channel, the overexposure or underenhancement problem of the global enhancement algorithm caused by grayscale distribution differences in high / low illumination areas is resolved. An adaptive kernel function is used to separate low-frequency background and high-frequency defect features, overcoming feature confusion caused by the overlap of metal surface texture and defects in the spatial frequency domain. Nonlinear contrast stretching based on a normal distribution model is used to adaptively enhance the gradient features of defect edges, overcoming the limitations of linear stretching and histogram equalization, which are sensitive to non-uniform reflection noise. Finally, a multi-scale feature fusion mechanism is used to incorporate the spatial correlation between spectral reflectance characteristics and geometric features into the defect enhancement process, compensating for the shortcomings of existing cross-modal feature fusion. Ultimately, an enhanced image set is constructed that effectively suppresses light field interference and highlights true defect features.
[0023] Figure 1 A flowchart of a method is provided for an embodiment of the present application, such as Figure 1 As shown, the method includes: Step 101: Acquire an original multispectral image sequence of the metal surface.
[0024] In this step, the original multispectral image sequence refers to a collection of metal surface reflection images collected by a multi-band optical sensor, including ultraviolet, visible, infrared and other spectral channel data, reflecting the differences in material reflection characteristics in different bands.
[0025] In an embodiment of the present application, a multispectral industrial camera is used to collect light signals reflected from the surface of a metal part in a complex light field environment, and a sequence of original multispectral images including ultraviolet, visible and near-infrared bands is simultaneously acquired.
[0026] Step 102: Based on the original multispectral image sequence, the exposure parameters of each spectral channel are adjusted by dynamic light intensity equalization to generate a standardized image set.
[0027] In this step, the exposure parameters for each spectral channel refer to a combination of adjustable parameters that control the amount of light received by the camera sensor, independently adjusting the image brightness of each spectral channel. The standardized image set is a collection of images generated after dynamic light intensity equalization. This ensures that each channel image has a consistent brightness distribution baseline, eliminating inter-channel variations caused by ambient light interference.
[0028] In an embodiment of the present application, based on the original multispectral image sequence, the grayscale mean and variance of each spectral channel image are calculated respectively, and the camera exposure time and gain parameters are dynamically adjusted through a feedback control algorithm to make the overall brightness and contrast of each channel image tend to be consistent, eliminate the brightness differences between channels caused by ambient light fluctuations, and output a standardized image set with balanced exposure.
[0029] Step 103: Perform background separation on a single frame image in the standardized image set using an adaptive kernel function, and extract the low-frequency component of the image as a guided smoothing image.
[0030] In this step, the adaptive kernel function refers to a Gaussian convolution kernel whose size is dynamically adjusted based on the local texture complexity of the image. This kernel is used to balance noise suppression and detail preservation during background separation. A single-frame image refers to any independent spectral channel image in the standardized image set. The low-frequency component refers to the slowly varying signal component retained after spatial filtering of the image, reflecting the uniform background and macrostructure of the metal surface. The guided smoothed image refers to the low-frequency background image extracted using the adaptive kernel function and serves as the reference template for the difference operation.
[0031] In an embodiment of the present application, for a single-frame image of a standardized image set, the size of the Gaussian kernel function is dynamically selected based on its local texture complexity: a large-scale kernel function is used to suppress noise in sparse texture areas, and a small-scale kernel function is used to preserve details in dense texture areas; the spatial frequency components of the image are separated by convolution operations, and the low-frequency background components are extracted as a guide for the smoothed image.
[0032] Step 104: performing pixel-level difference operation on the guided smoothed image and a single-frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information.
[0033] In this step, defect edge information refers to the spatial high-frequency mutation signal characteristics caused by surface defects such as scratches and pits. The high-frequency defect feature map is an image generated by pixel-level differentiation, in which the background signal is suppressed and the high-frequency components of the defect edge are highlighted.
[0034] In an embodiment of the present application, the guided smoothed image is subtracted pixel by pixel from the standardized image of the same frame. In the differential result, the uniform background of the metal surface is offset, while the defect area forms a high-intensity edge response due to the spatial frequency difference, generating a high-frequency defect feature map that highlights the defect contour.
[0035] Step 105: Perform probability density function mapping on the grayscale distribution of the feature map based on the normal distribution model, perform nonlinear stretching on the local contrast by adjusting the standard deviation parameter, and generate a defect feature distribution map with enhanced gradient features.
[0036] In this step, the normal distribution model refers to a probabilistic model used to describe the grayscale statistical characteristics of the feature map. Its bell-shaped curve represents the clustering pattern of pixel values. The standard deviation parameter is a regulatory variable that controls the widening of the normal distribution curve. Increasing this value increases the slope of the grayscale mapping in low-probability areas. Local contrast refers to the intensity of the grayscale difference between a small area in the image (such as the defect edge) and the adjacent background. The defect feature distribution map with enhanced gradient features refers to an image generated after nonlinear stretching. The grayscale gradient changes at the defect edge are enhanced, thereby enhancing weak defect signals.
[0037] In an embodiment of the present application, a grayscale histogram of a high-frequency defect feature map is statistically analyzed to fit an initial normal distribution model; a grayscale remapping curve is established with a probability density function value as a weight, and the slope of the curve is steeply increased in the low probability density area by increasing the standard deviation parameter, thereby achieving nonlinear stretching of the local contrast and outputting a defect feature distribution map with enhanced gradient features.
[0038] Step 106: Perform multi-scale feature fusion on the defect feature distribution map and the original multispectral image to construct a defect enhanced image set.
[0039] In this step, the defect enhanced image set refers to the output image set after fusing multispectral material information and enhancing defect features, and the defect visibility and detectability are optimized.
[0040] In an embodiment of the present application, a Laplace pyramid decomposition algorithm is used: the original multispectral image is decomposed into a low-frequency base layer and a high-frequency detail layer, the noise-dominated subband in the high-frequency detail layer is replaced by a defect feature distribution map, and then the material reflection characteristics and enhanced defect features are fused through pyramid reconstruction to generate a defect-enhanced image set.
[0041] The embodiments of the present application eliminate the influence of complex light fields through dynamic exposure balancing, retain the real defect edges through adaptive background separation, enhance the micron-level defect gradient through probability-driven nonlinear stretching, and collaboratively utilize spectral and spatial information through multi-scale fusion, ultimately achieving high-sensitivity and low false detection rate defect visualization under strong reflection and multiple interference conditions.
[0042] For example, in the surface inspection of aircraft engine blades, a multispectral camera (including 450nm / 650nm / 850nm channels) is first used to capture a sequence of original multispectral images. To address the overexposure of the 650nm channel due to ambient stray light, its exposure time is dynamically reduced to 70% of that of other channels to generate a standardized image set. An adaptive Gaussian kernel (σ=15px in sparse texture areas and σ=5px in dense texture areas) is used to extract a low-frequency guided smoothed image from a single-frame 650nm image. The high-frequency features of micro-scratches at the blade mortise and tenon are separated by pixel difference. Based on the grayscale histogram of the feature map, a normal distribution with μ=42 and σ=8 is fitted, and σ is adjusted to 12 to perform local contrast stretching on the scratched area. Finally, the stretched defect features are pyramid-fused with the original 850nm channel (the oxide layer-sensitive band) to output an enhanced image set that clearly displays micro-scratches and oxidation spots.
[0043] This application provides a specific embodiment, step 105, performing probability density function mapping on the grayscale distribution of the feature map based on the normal distribution model, performing nonlinear stretching on the local contrast by adjusting the standard deviation parameter, and generating a defect feature distribution map with enhanced gradient features, specifically comprising the following steps: Step 201: Taking the grayscale histogram of the high-frequency defect feature map as input, initial normal distribution model parameters are established.
[0044] In this step, the grayscale histogram is a distribution chart that counts the frequency of each grayscale level in the image. The horizontal axis represents grayscale levels from 0 to 255, and the vertical axis represents the number of pixels. This chart reflects the grayscale concentration range and dispersion of the defect feature map. The initial normal distribution model parameters are statistical variables that describe the distribution of the grayscale histogram, including the mean (the center of the distribution) and the standard deviation (the degree of dispersion). These parameters are used to construct the initial probability model.
[0045] In an embodiment of the present application, the grayscale value distribution of all pixels in the high-frequency defect feature map is statistically analyzed to generate a grayscale histogram with the horizontal axis being the grayscale level and the vertical axis being the pixel frequency; the normal distribution mean parameter is determined based on the histogram peak position, and the initial value of the standard deviation parameter is calculated based on the distribution width to establish the initial normal distribution model parameters that characterize the grayscale statistical characteristics of the feature map.
[0046] Step 202: Calculate the probability density function value corresponding to each gray level based on the normal distribution model parameters, and generate a mapping relationship matrix between gray levels and probability densities.
[0047] In this step, the probability density function value refers to the single-point probability intensity calculated according to the normal distribution formula, indicating the relative likelihood of a specific grayscale level occurring in the statistical distribution. The grayscale-to-probability density mapping matrix is a set of probability density function values arranged in grayscale order, forming a conversion table from grayscale value to probability intensity.
[0048] In an embodiment of the present application, the grayscale level is substituted into the normal distribution probability density function formula, and the probability density function value corresponding to each grayscale level is calculated using the mean parameter and the standard deviation parameter; the function values are arranged in ascending order according to the grayscale level, and a two-dimensional mapping relationship matrix is constructed with the grayscale level as the row and the probability density as the column.
[0049] Step 203: using the mapping relationship matrix as the input of a nonlinear stretching function, and performing slope modulation on the probability density function curve by adjusting a standard deviation parameter to obtain an adjusted probability density function.
[0050] In this step, the nonlinear stretching function refers to a grayscale transformation function designed with probability density as the weight. This function enhances local contrast by increasing the mapping slope in low-probability intervals. The probability density function curve is a continuous curve that visualizes the mapping relationship matrix, with grayscale levels on the horizontal axis and probability density values on the vertical axis, representing the grayscale distribution pattern. The adjusted probability density function is a probability density curve modulated by the standard deviation parameter, with the slope of the low-probability region increased to achieve nonlinear stretching of defect-sensitive areas.
[0051] In an embodiment of the present application, an initial probability density function curve is generated based on the mapping relationship matrix; the standard deviation parameter is increased according to the contrast requirement of the target defect, so that the slope of the probability density function curve rises sharply in the low probability density area and slows down in the high probability density area, and the modulated probability density function curve is output.
[0052] Step 204: remapping the original feature map pixel by pixel using the modulated probability density function to generate a defect feature distribution map with enhanced gradient features.
[0053] In this step, the original feature map refers to the high-frequency defect feature map input to this step, which contains weak defect edge information masked by background noise.
[0054] In an embodiment of the present application, a grayscale remapping lookup table is established based on the modulated probability density function curve: the grayscale value of each pixel in the original feature map is used as input, and is mapped to a new grayscale value through the lookup table to expand the grayscale dynamic range of the low probability density area; this transformation is performed pixel by pixel on the high-frequency defect feature map to generate a defect feature distribution map with gradient feature enhancement.
[0055] The embodiment of the present application accurately locates the grayscale aggregation interval of the defect signal through normal distribution modeling, and uses the standard deviation parameter to dynamically modulate the slope of the probability density curve. Under the premise of avoiding background noise amplification, it specifically stretches the dynamic range of the defect edge, improves the edge gradient of weak visible defects such as micron-level scratches and pitting, and overcomes the contradiction of overexposure or under-enhancement caused by traditional linear stretching.
[0056] This application provides a specific embodiment, step 203, using the mapping relationship matrix as the input of the nonlinear stretching function, and modulating the slope of the probability density function curve by adjusting the standard deviation parameter to obtain an adjusted probability density function, specifically including the following steps: Step 211: establishing a nonlinear stretching weight factor based on the mapping relationship matrix, and generating a dynamic partial derivative function of the probability density function according to the adjustment range of the standard deviation parameter.
[0057] In this step, the nonlinear stretching weight factor refers to a normalization coefficient calculated based on the probability density value. It is used to quantify the enhancement priority of different grayscale levels during contrast stretching. The lower the probability density, the larger the weight factor. The adjustment amplitude of the standard deviation parameter refers to the proportion of the standard deviation increased to improve the contrast of the defect area. This amplitude determines the deformation strength of the probability density function curve. The dynamic partial derivative of the probability density function refers to the derivative function that describes the change in the slope of the probability density function curve with grayscale level. It reflects the dynamic response characteristics of the curve steepness after adjusting the standard deviation.
[0058] In an embodiment of the present application, the mapping relationship matrix between grayscale and probability density is used as input, the probability density values corresponding to each grayscale level are normalized, and a nonlinear stretching weight factor reflecting the importance of the grayscale level is generated; according to the increase ratio of the standard deviation parameter, the slope change rate of the probability density function curve at each grayscale point is calculated to generate a dynamic partial derivative function that characterizes the steepness of the curve.
[0059] Step 212: Optimizing the parameters of the dynamic partial derivative function so that the slope of the probability density function curve in the target grayscale range satisfies a preset dynamic optimization objective function.
[0060] In this step, the target grayscale interval refers to the grayscale range within the high-frequency defect signature image where the defect signal is concentrated. The corresponding probability density value for this interval is lower than the overall distribution mean. The preset dynamic optimization objective function is a mathematical constraint set for the slope of the defect area, requiring the minimum slope of the target interval to be at least multiple times the baseline slope of the background area.
[0061] In an embodiment of the present application, the dynamic optimization objective function is set to require that the slope of the target grayscale interval (defect signal concentration area) be increased to more than multiple times the slope of the background area; the standard deviation parameter is iteratively adjusted through the gradient descent algorithm so that the output value of the dynamic partial derivative function in the target interval reaches a preset threshold, thereby achieving a selective steep rise in the probability density function curve in the defect area to meet the preset dynamic optimization objective function.
[0062] Step 213: performing step-by-step matching and calibration on the probability density function curve and the grayscale distribution of the original feature map to generate a modulation function for adaptive contrast enhancement.
[0063] In this step, the grayscale distribution of the original feature map refers to the actual pixel grayscale statistical histogram of the high-frequency defect feature map, reflecting the distribution ratio of the actual defect to the background. The modulation function for adaptive contrast enhancement refers to the grayscale remapping function generated after parameter optimization and distribution calibration. Its output grayscale value is nonlinearly positively correlated with the input probability density.
[0064] In an embodiment of the present application, the modulated probability density function curve is discretized according to the grayscale level and calibrated step by step with the grayscale histogram of the original feature map; if the actual pixel frequency of a certain grayscale level deviates from the theoretical probability density by more than the tolerance threshold, the slope of the curve is locally fine-tuned, and finally a contrast enhancement modulation function is generated that adaptively matches the statistical distribution of the defect features.
[0065] The embodiment of the present application quantifies the change in the slope of the probability curve through a dynamic partial derivative function, combines it with the optimization objective function to accurately lock the enhancement intensity of the defect area, uses grayscale distribution calibration to eliminate modeling errors, and generates a modulation function that strictly matches the physical characteristics of the defect, completely solving the problem of coexistence of over-enhancement and under-enhancement caused by fixed parameters on complex metal surfaces in traditional methods.
[0066] This application provides a specific embodiment, step 101, obtaining an original multispectral image sequence of the metal surface, specifically including the following steps: Step 111: Dynamically trigger the CCD exposure time of each spectral channel based on the surface reflection characteristics of the metal part to generate a multi-spectral synchronous sampling image including visible light and near-infrared bands.
[0067] In this step, the surface reflectivity of a metal part refers to the reflectivity distribution of the metal material under illumination with light of different wavelengths. For example, aluminum alloy has a reflectivity of up to 80% in the 550nm visible light band, but this drops to 40% in the 850nm near-infrared band due to absorption by the oxide layer. The CCD exposure time for each spectral channel controls the duration of light exposure within the CCD sensor in a specific spectral band (e.g., the 650nm red band and the 850nm infrared band). This is dynamically adjusted based on reflectivity to avoid overexposure or undersampling. Multispectral synchronously sampled images encompassing both visible and near-infrared bands refer to a set of images captured synchronously with a beam splitter and a multi-CCD array.
[0068] In an embodiment of the present application, a fiber optic spectrometer is used to monitor the reflectivity curve of the metal surface in real time. When a high-reflection band (such as a mirror reflection area) is detected, the CCD exposure time of the corresponding spectral channel is automatically shortened to prevent overexposure; for a low-reflection band (such as an oxide layer absorption area), the exposure time is extended to improve the signal-to-noise ratio; all spectral channels are exposed simultaneously under the control of a synchronous trigger signal to generate a synchronous sampling image with complete spectral information.
[0069] Step 112: performing time series alignment processing on the multispectral synchronous sampling images to generate an original multispectral image sequence with sub-pixel registration accuracy.
[0070] In this step, sub-pixel registration accuracy refers to the very small position deviation of corresponding points in space after the multispectral images are aligned, and a matching accuracy of 0.1-0.5 pixels is usually achieved through interpolation algorithms.
[0071] In an embodiment of the present application, time series alignment processing is performed on the multispectral synchronous sampling images based on the near-infrared channel image, and the rigid body transformation matrix of the visible light channel image is calculated; sub-pixel translation and rotation compensation is performed on the visible light image through the bicubic interpolation algorithm, and when the position error of the feature points between the multispectral images is very small, the original multispectral image sequence with sub-pixel alignment accuracy is output.
[0072] The embodiments of the present application solve the brightness imbalance between channels caused by high metal reflectivity through dynamic exposure control driven by reflective characteristics, and use sub-pixel level alignment to eliminate the spatial misalignment of multispectral images, providing high-quality input with complete spectral information and spatial alignment for subsequent processing, breaking through the spectral distortion bottleneck caused by exposure mismatch and image offset in traditional multispectral detection.
[0073] This application provides a specific embodiment, step 102, adjusting the exposure parameters of each spectral channel by dynamic light intensity equalization based on the original multispectral image sequence to generate a standardized image set, specifically including the following steps: Step 201: Calculate the statistical parameters of the brightness component of each spectral channel image in the CIE-Lab color space and establish an inter-channel light intensity compensation coefficient matrix.
[0074] In this step, the CIE-Lab color space refers to the perceptually uniform color model developed by the International Commission on Illumination, which consists of luminance and chromaticity components. The luminance component independently represents the intensity of light and dark in an image and is suitable for isolating the effects of lighting. Luminance component statistical parameters refer to mathematical features extracted from the CIE-Lab luminance component, including the mean luminance value and standard deviation of the entire image. The inter-channel light intensity compensation coefficient matrix refers to a proportional matrix that describes the brightness difference between each spectral channel and the reference channel. The element value is the mean luminance value of the target channel divided by the mean luminance value of the reference channel.
[0075] In an embodiment of the present application, the original image of each spectral channel is converted from the color space to the CIE-Lab color space, and the brightness component is extracted; the brightness mean and standard deviation of all brightness channel images are calculated as statistical parameters; and with the near-infrared channel as the benchmark, the ratio of the brightness mean of other channels to the benchmark is calculated to generate a light intensity compensation coefficient matrix.
[0076] Step 202: performing gamma correction on the oversaturated channel based on the compensation coefficient matrix, and performing histogram equalization processing on the low illumination channel.
[0077] In this step, an oversaturated channel refers to a channel image whose grayscale value in the highlight area reaches 255 due to overexposure, and its histogram shows a truncated peak at the high end. A low-light channel refers to a channel image whose overall grayscale is concentrated in the range of 0-100 due to underexposure, and its histogram is left-skewed and has a narrow dynamic range.
[0078] In an embodiment of the present application, based on the compensation coefficient matrix, a gamma correction formula (the gamma correction formula is: the output brightness is equal to the input brightness divided by the gamma coefficient) is used to compress the highlight area of the oversaturated channel; histogram equalization is performed on the low-illumination channel, and the pixel grayscale values are redistributed through histogram equalization to stretch the contrast.
[0079] Step 203: Through iterative optimization, the contrast standard deviation of each channel image is converged to a preset threshold range, thereby generating a standardized image set with consistent spectral response.
[0080] In this step, the contrast standard deviation is a quantitative indicator of the dispersion of the image's grayscale values. It is calculated as the square root of the sum of the squared deviations of all pixel grayscale values from their mean, divided by the total number of pixels. The preset threshold is an engineering parameter that controls the termination of iterations and sets the upper limit for the maximum permissible difference in the contrast standard deviation of each channel. A standardized image set with consistent spectral response refers to a set of images with similar brightness and contrast across channels in the same material area after equalization, eliminating imaging differences between bands.
[0081] In an embodiment of the present application, the standard deviation of the brightness component of each channel after calculation is calculated. If the difference between the maximum and minimum values exceeds a preset threshold, the compensation coefficient is adjusted and step 2 is re-executed; the iteration is terminated when the difference between the standard deviations of all channels is less than the preset threshold, and a standardized image set with consistent spectral response is output.
[0082] The embodiments of the present application accurately separate the brightness components through CIE-Lab space, quantify the differences between channels using a compensation coefficient matrix, perform classification enhancement on oversaturated or low-illumination channels, and achieve cross-spectral response consistency through iterative optimization, thus breaking through the technical barriers of local overexposure or insufficient enhancement caused by fixed enhancement parameters in traditional methods.
[0083] This application provides a specific embodiment, step 103, using an adaptive kernel function to perform background separation on a single frame image in the standardized image set, extracting the low-frequency component of the image as a guided smoothing image, specifically including the following steps: Step 301: Construct a spatially variable kernel function model based on bilateral filtering, and output kernel function configuration parameters including spatial domain weight distribution and scale parameters.
[0084] In this step, bilateral filtering refers to a nonlinear filtering algorithm that simultaneously considers spatial distance and pixel value similarity. Spatial domain weights decay with increasing distance, and range weights decay with increasing grayscale differences. The spatially variable kernel function model refers to a kernel function system that dynamically adjusts parameters based on the local characteristics of the image. Its scale parameter varies inversely with texture complexity, balancing smoothing intensity and detail preservation. Kernel function configuration parameters refer to the set of variables that control the kernel function's behavior, including the spatial domain weight distribution function, the range weight function, and the scale adjustment coefficient.
[0085] In an embodiment of the present application, for each pixel point of a single frame image in a standardized image set, a texture complexity index is calculated based on the grayscale variance of its neighborhood; a large-scale spatial domain weight is assigned to a sparse texture area, and a small-scale weight is assigned to a dense texture area; a spatially variable kernel function model based on bilateral filtering is obtained; and at the same time, the value domain weight is calculated based on the grayscale difference between pixels, and the kernel function configuration parameters that fuse spatial distance and grayscale similarity are output.
[0086] Step 302: Calculate a weight matrix based on the kernel function configuration parameters, perform multi-scale spatial filtering on the normalized image, and output filtered intermediate image data.
[0087] In this step, the weight matrix refers to a two-dimensional matrix generated by the kernel function, where the element values represent the filtering weights of the other pixels in each pixel's neighborhood on the central pixel. The intermediate image data refers to the output image after multi-scale spatial filtering, where the background area is smoothed and the defect edges are preserved.
[0088] In an embodiment of the present application, a dynamic weight matrix is generated based on the kernel function configuration parameters (the weight value calculation formula is: spatial domain weight multiplied by value domain weight); the weight matrix and the standardized image are subjected to multi-scale spatial filtering processing, large-scale smoothing is performed in the texture sparse area, and small-scale edge-preserving filtering is performed in the texture dense area, and the intermediate image data after noise suppression is output.
[0089] Step 303: Perform frequency domain conversion on the intermediate image data through Fourier transform to generate frequency domain spectrum data.
[0090] In an embodiment of the present application, a two-dimensional fast Fourier transform is performed on the intermediate image data to convert the spatial domain image frequency domain into complex frequency domain spectrum data consisting of real and imaginary parts, whose amplitude spectrum reflects the intensity of the frequency component and the phase spectrum reflects the spatial structure information.
[0091] Step 304: performing zero-frequency centering processing on the frequency domain spectrum data and then selecting spectrum components.
[0092] In this step, frequency domain spectral data refers to the representation of the spatial image converted to the frequency domain via Fourier transform, consisting of the amplitude spectrum (frequency energy distribution) and the phase spectrum (structural information). Spectral components refer to the independent frequency units in the frequency domain spectral data. Low-frequency components correspond to the slowly varying background of the image, while high-frequency components correspond to edges and noise.
[0093] In an embodiment of the present application, the frequency domain spectrum data is processed for zero-frequency centering, and the zero-frequency component is moved to the center of the spectrum; an ideal low-pass filter is designed to retain the low-frequency spectrum components within the radius with the center as the origin, and filter out the high-frequency components outside the radius.
[0094] Step 305: Perform inverse Fourier transform on the selected frequency domain data, extract its actual component as low-frequency component, and perform weighted fusion on the low-frequency component and the original intermediate image data to generate a guided smoothed image.
[0095] In this step, the real component refers to the real-valued image component generated after performing inverse Fourier transform on the complex frequency domain data, reflecting the reconstructed spatial domain information.
[0096] In an embodiment of the present application, an inverse Fourier transform is performed on the filtered frequency domain data, and the real part of the output result is taken as the low-frequency component of the image; the low-frequency component and the intermediate image data are weightedly fused according to a weight ratio (such as the low-frequency component multiplied by 0.7 plus the intermediate image multiplied by 0.3) to generate a guided smooth image that retains background continuity.
[0097] The embodiment of the present application realizes background adaptive smoothing through spatially variable kernel functions, combines frequency domain filtering to accurately extract low-frequency components, and weighted fusion to retain the physical continuity of the background, thereby completely solving the problem of blurred defect edges or texture residue on metal surfaces caused by traditional fixed kernel filtering.
[0098] This application provides a specific embodiment, step 106, performing multi-scale feature fusion on the defect feature distribution map and the original multispectral image to construct a defect enhanced image set, specifically comprising the following steps: Step 601: performing Gaussian pyramid decomposition on the defect feature distribution map to generate a multi-scale feature map containing different spatial frequencies.
[0099] In this step, the multi-scale feature map refers to a sequence of images with decreasing resolution generated by Gaussian pyramid decomposition. Each layer of the image contains defect features in a specific spatial frequency range. The top layer represents the macroscopic defect morphology, and the bottom layer represents the microscopic edge details.
[0100] In this embodiment of the present invention, a Gaussian pyramid decomposition algorithm is used to process the defect feature distribution map. By repeatedly performing Gaussian smoothing and downsampling operations, a sequence of images with decreasing resolution is generated. The image size is reduced, with low-frequency components concentrated at the top layer and high-frequency components distributed at the bottom layer. This generates a multi-scale feature map with different spatial frequencies, ranging from macroscopic defect outlines to microscopic edges.
[0101] Step 602: performing convolution kernel matching on the multi-scale feature map and the corresponding scale layer of the original multispectral image, and establishing a feature mapping relationship through a normalized cross-correlation algorithm.
[0102] In this step, the feature mapping relationship refers to the pixel correspondence matrix established by the normalized cross-correlation algorithm, which reflects the spatial position matching degree between the defect feature map and the multispectral image at the same scale.
[0103] In an embodiment of the present invention, convolution kernel matching is performed on each layer of the multi-scale feature map and the same-scale layer of the original multispectral image. A sliding window of the same size is used to traverse the image, and the normalized cross-correlation value of the two images in the window is calculated, where the numerator is the covariance of the two images and the denominator is the product of their respective standard deviations; a pixel-level mapping relationship is established for the cross-correlation peak position.
[0104] Step 603: Adaptively assign weights to the channels of the multispectral image based on the mapping relationship to generate a fusion feature layer with spectrum preservation characteristics.
[0105] In this step, the fusion feature layer of the spectrum preserving characteristic refers to the feature layer that retains the original reflectance distribution of the multi-spectral channels during the fusion process.
[0106] In an embodiment of the present invention, the weight of each channel is calculated based on the feature mapping relationship, and for pixels in the overlapping mapping area, channels with high defect feature significance are assigned high weights; the original spectral information is retained for the non-overlapping area to generate a fusion feature layer with spectral preservation characteristics.
[0107] Step 604: Use a Laplacian pyramid reconstruction algorithm to perform inverse synthesis on the fused feature layer, and output a defect enhancement image set containing defect enhancement information.
[0108] In this step, the Laplacian pyramid reconstruction algorithm refers to an image reconstruction method that uses Gaussian pyramid difference layered upsampling and superposition. The mathematical essence is to reversely synthesize the Laplacian filtering results of different scales into a full-resolution image.
[0109] In an embodiment of the present invention, the fused feature layer is upsampled layer by layer starting from the top layer and details are superimposed, and this process is repeated until the original resolution is reached. The defect enhanced image set with sharp defect edges and no spectral distortion is output through inverse Gaussian pyramid reconstruction.
[0110] The embodiment of the present application uses a Gaussian pyramid to accurately separate the spatial frequency of defects, uses cross-correlation mapping to establish cross-modal position associations, adaptively allocates weights to balance defect enhancement and spectral fidelity, and uses Laplace reconstruction to achieve edge sharpening and lossless resolution restoration, completely solving the spectral distortion or edge blurring problems caused by traditional fusion methods.
[0111] Figure 2 A schematic diagram of the structure of a system is provided for the embodiment of the present application, such as Figure 2 As shown, the system includes: An acquisition module 21 is used to acquire an original multispectral image sequence of the metal surface; An adjustment module 22 is configured to adjust the exposure parameters of each spectral channel by dynamic light intensity equalization based on the original multispectral image sequence to generate a standardized image set; A separation module 23 is used to perform background separation on a single frame image in the standardized image set using an adaptive kernel function, and extract a low-frequency component of the image as a guided smoothing image; A difference module 24 is configured to perform a pixel-level difference operation between the guided smoothed image and a single-frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information; A mapping module 25 is used to perform probability density function mapping on the grayscale distribution of the feature map based on a normal distribution model, and to perform nonlinear stretching on the local contrast by adjusting the standard deviation parameter to generate a defect feature distribution map with enhanced gradient features; The construction module 26 is used to perform multi-scale feature fusion on the defect feature distribution map and the original multispectral image to construct a defect enhanced image set.
[0112] Figure 2 The system can perform Figure 1 The implementation principle and technical effects of a method described in the embodiment are not described in detail. The specific manner in which each module and unit performs operations in a system in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.
[0113] In one possible design, Figure 2 A system of the illustrated embodiment may be implemented as a computing device, such as Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32; The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 32 .
[0114] The processing component 32 is used for the above Figure 1 A method of the embodiment described.
[0115] The processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above method.
[0116] The storage component 31 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0117] Of course, a computing device may also include other components, such as input / output interfaces, display components, communication components, etc.
[0118] The input / output interface provides an interface between the processing component and the peripheral interface module, which can be an output device, an input device, etc.
[0119] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.
[0120] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.
[0121] The present application also provides a computer storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 The illustrated embodiment provides a method for imaging surface defects of precision metal parts in a complex light field interference environment.
[0122] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0123] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0124] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for imaging surface defects of precision metal parts in a complex light field interference environment, characterized in that: include: Obtaining original multispectral image sequences of the metal surface; Adjusting exposure parameters of each spectral channel by dynamic light intensity equalization based on the original multispectral image sequence to generate a standardized image set; The background of a single frame image in the standardized image set is separated by an adaptive kernel function, and the low-frequency component of the image is extracted as a guided smoothing image. Performing pixel-level difference operation on the guided smoothed image and a single-frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information; Based on the normal distribution model, the grayscale distribution of the feature map is mapped to a probability density function. The local contrast is nonlinearly stretched by adjusting the standard deviation parameter to generate a defect feature distribution map with enhanced gradient features. The defect feature distribution map is fused with the original multispectral image to form a defect enhanced image set.
2. The method according to claim 1, characterized in that Based on the normal distribution model, the grayscale distribution of the feature map is mapped to a probability density function. By adjusting the standard deviation parameter, the local contrast is nonlinearly stretched to generate a defect feature distribution map with enhanced gradient features, including: Taking the grayscale histogram of the high-frequency defect feature map as input, establishing initial normal distribution model parameters; Calculating the probability density function value corresponding to each gray level based on the normal distribution model parameters, and generating a mapping relationship matrix between gray level and probability density; Using the mapping relationship matrix as the input of a nonlinear stretching function, and modulating the slope of a probability density function curve by adjusting a standard deviation parameter to obtain an adjusted probability density function; The modulated probability density function is used to remap the grayscale value of the original feature map pixel by pixel to generate a defect feature distribution map with enhanced gradient features.
3. The method according to claim 2, characterized in that The mapping relationship matrix is used as the input of the nonlinear stretching function, and the slope of the probability density function curve is modulated by adjusting the standard deviation parameter to obtain an adjusted probability density function, including: A nonlinear stretching weight factor is established based on the mapping relationship matrix, and a dynamic partial derivative function of a probability density function is generated according to the adjustment range of the standard deviation parameter; Optimizing the parameters of the dynamic partial derivative function so that the slope of the probability density function curve in the target grayscale range satisfies a preset dynamic optimization objective function; The probability density function curve is matched and calibrated with the grayscale distribution of the original feature map step by step to generate a modulation function for adaptive contrast enhancement.
4. The method according to claim 1, wherein Obtain the original multispectral image sequence of the metal surface, including: Based on the surface reflection characteristics of the metal parts, the CCD exposure time of each spectral channel is dynamically triggered to generate a multi-spectral synchronous sampling image covering visible light and near-infrared bands; Time series alignment processing is performed on the multispectral synchronous sampling images to generate an original multispectral image sequence with sub-pixel registration accuracy.
5. The method according to claim 4, characterized in that Based on the original multispectral image sequence, exposure parameters of each spectral channel are adjusted by dynamic light intensity equalization to generate a standardized image set, including: Calculate the statistical parameters of the brightness component of each spectral channel image in the CIE-Lab color space and establish the inter-channel light intensity compensation coefficient matrix; Performing gamma correction on the oversaturated channel based on the compensation coefficient matrix and performing histogram equalization on the low illumination channel; Through iterative optimization, the contrast standard deviation of each channel image converges to the preset threshold range, generating a set of standardized images with consistent spectral response.
6. The method according to claim 1, characterized in that The background of a single frame image in the standardized image set is separated by an adaptive kernel function, and the low-frequency component of the image is extracted as a guided smoothing image, including: Construct a spatially variable kernel function model based on bilateral filtering, and output kernel function configuration parameters including spatial domain weight distribution and scale parameters; Calculating a weight matrix based on the kernel function configuration parameters, performing multi-scale spatial filtering on the standardized image, and outputting filtered intermediate image data; Performing frequency domain conversion on the intermediate image data by Fourier transform to generate frequency domain spectrum data; Selecting spectral components after performing zero-frequency centering processing on the frequency domain spectrum data; An inverse Fourier transform is performed on the selected frequency domain data to extract its actual component as a low-frequency component, and the low-frequency component is weightedly fused with the original intermediate image data to generate a guided smoothed image.
7. The method according to claim 1, characterized in that The defect feature distribution map is subjected to multi-scale feature fusion with the original multispectral image to construct a defect enhanced image set, including: Performing Gaussian pyramid decomposition on the defect feature distribution map to generate a multi-scale feature map containing different spatial frequencies; Perform convolution kernel matching on the multi-scale feature map and the corresponding scale layer of the original multispectral image, and establish a feature mapping relationship through a normalized cross-correlation algorithm; Based on the mapping relationship, adaptive weight allocation is performed on each channel of the multispectral image to generate a fusion feature layer with spectrum preservation characteristics; The fused feature layer is inversely synthesized using a Laplacian pyramid reconstruction algorithm to output a defect enhancement image set containing defect enhancement information.
8. A precision metal surface defect imaging system in a complex light field interference environment, characterized by: include: An acquisition module is used to acquire an original multispectral image sequence of the metal surface; An adjustment module, configured to adjust exposure parameters of each spectral channel by dynamic light intensity equalization based on the original multispectral image sequence to generate a standardized image set; A separation module is used to perform background separation on a single frame image in the standardized image set using an adaptive kernel function, and extract the low-frequency component of the image as a guided smoothing image; A difference module is used to perform pixel-level difference operation between the guided smoothed image and a single-frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information; A mapping module is used to perform probability density function mapping on the grayscale distribution of the feature map based on the normal distribution model, and to perform nonlinear stretching on the local contrast by adjusting the standard deviation parameter to generate a defect feature distribution map with enhanced gradient features; A construction module is used to perform multi-scale feature fusion on the defect feature distribution map and the original multispectral image to construct a defect enhanced image set.
9. A computing device, characterized in that It includes a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement a method for imaging surface defects of precision metal parts in a complex light field interference environment as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that A computer program is stored, and when the computer program is executed by a computer, the method for imaging surface defects of precision metal parts in a complex light field interference environment as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Workpiece defect detection method and device based on event camera
CN116363065A
Stainless steel surface defect detection method based on machine vision
CN119810080A
Smart infrared image scene enhancement method
WO2019144581A1
Cited By
Aluminum alloy surface oxidation spot defect identification method and device based on machine vision
CN120894358A
Processing quality monitoring system and method for precision part with complex structure
CN120952634A
Image data enhancement processing method for industrial visual inspection
CN121120457A
High-speed camera for semiconductor graph-free dark field detection and detection method
CN121499514A
A high-speed camera and detection method for imageless dark-field detection of semiconductors
CN121499514B