A method and system for imaging surface defects of a precision metal part in a complex light field interference environment
By acquiring multispectral image sequences under complex light field environments, dynamically adjusting exposure parameters and adaptive kernel functions to separate the background, and combining nonlinear stretching of the normal distribution model with multi-scale feature fusion, the problems of light field interference and loss of defect edge information in traditional optical detection methods are solved, achieving efficient defect detection.
Patent Information
- Application Number
- CN202510770968.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-06-10
AI Technical Summary
In complex light field environments, traditional optical detection methods struggle to suppress stray light interference, leading to the generation of false defect signals. Furthermore, they cannot effectively utilize the spatial correlation between spectral information and defect geometric features in multispectral imaging technology, resulting in the loss of defect edge information and overexposure or under-enhancement due to differences in grayscale distribution.
By acquiring multispectral image sequences of the metal surface, dynamically adjusting the exposure parameters of each spectral channel, using an adaptive kernel function to separate low-frequency background from high-frequency defect features, performing nonlinear stretching based on a normal distribution model, and fusing multi-scale features, a defect-enhanced image set is generated.
It effectively suppresses light field interference, highlights real defect features, and improves the visual salience and recognizability of small defects. It solves the problems of false defects and loss of defect edge information caused by light field interference in traditional methods, and achieves defect detection with high sensitivity and low false detection rate.
Smart Images

Figure CN120707450B_ABST
Abstract
Description
Technical Field
[0001] This 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 under complex light field interference environments. Background Technology
[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 limit the application of traditional optical detection 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 stray ambient light, especially under multi-angle reflection conditions where false defect signals are easily generated. Furthermore, the high degree of overlap between metal surface textures and minute defects in the spatial frequency domain causes conventional frequency domain filtering algorithms to lose defect edge information when suppressing background textures.
[0003] Current mainstream contrast enhancement methods, such as linear stretching or histogram equalization, suffer from two key drawbacks in metal surface inspection: first, the difference in grayscale distribution between high-reflectance and low-illuminance areas leads to overexposure or underexposure in the global enhancement algorithm; second, they cannot adaptively adjust to the statistical characteristics of defect features and non-uniform reflection noise. Furthermore, while multispectral imaging techniques can capture differences in the reflectivity of surface materials, they lack an effective cross-modal feature fusion mechanism, resulting in the underutilization of the spatial correlation between spectral information and defect geometric features. Summary of the Invention
[0004] This application provides a method and system for imaging surface defects of precision metal parts under complex light field interference environments, in order to solve the problem that the difference in gray-scale distribution between high-reflection areas and low-illuminance areas in the prior art causes overexposure or under-enhancement of the global enhancement algorithm; and the inability to adaptively adjust for the statistical characteristics of defect features and non-uniform reflection noise.
[0005] In a first aspect, this application provides a method for imaging surface defects of precision metal parts under complex light field interference environments, including:
[0006] Obtain the original multispectral image sequence of the metal part surface;
[0007] 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;
[0008] Background separation is performed on single-frame images in the standardized image set using an adaptive kernel function, and the low-frequency components of the images are extracted as guided smoothing images.
[0009] The guided smoothing image is subjected to pixel-level difference operation with a single frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information.
[0010] Based on the normal distribution model, the gray-level distribution of the feature map is mapped by 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.
[0011] The defect feature distribution map is fused with the original multispectral image at multiple scales to construct a defect-enhanced image set.
[0012] Optionally, based on a normal distribution model, a probability density function is applied to the grayscale distribution of the feature map. By adjusting the standard deviation parameter, a nonlinear stretching of the local contrast is performed to generate a defect feature distribution map with enhanced gradient features, including:
[0013] The gray-level histogram of the high-frequency defect feature map is used as input to establish the initial normal distribution model parameters;
[0014] Based on the parameters of the normal distribution model, the probability density function value corresponding to each gray level is calculated, and a mapping relationship matrix between gray level and probability density is generated.
[0015] The mapping matrix is used as the input to the nonlinear stretching function. The slope of the probability density function curve is modulated by adjusting the standard deviation parameter to obtain the adjusted probability density function.
[0016] The original feature map is remapped pixel by pixel using the modulated probability density function to generate a defect feature distribution map with enhanced gradient features.
[0017] Optionally, the mapping matrix is used as input to the nonlinear stretching function, and the slope of the probability density function curve is modulated by adjusting the standard deviation parameter to obtain the adjusted probability density function, including:
[0018] A nonlinear stretching weighting factor is established based on the mapping relationship matrix, and a dynamic partial derivative function of the probability density function is generated according to the adjustment range of the standard deviation parameter.
[0019] The parameters of the dynamic partial derivative function are optimized so that the slope of the probability density function curve in the target gray range satisfies the preset dynamic optimization objective function.
[0020] The probability density function curve is matched and calibrated step by step with the gray-level distribution of the original feature map to generate an adaptive contrast-enhanced modulation function.
[0021] Optionally, the raw multispectral image sequence of the metal part surface is acquired, including:
[0022] Based on the surface reflectivity of metal parts, the exposure time of CCD in each spectral channel is dynamically triggered to generate a multispectral synchronously sampled image containing visible and near-infrared bands.
[0023] The multispectral synchronously sampled images are subjected to time-series alignment processing to generate an original multispectral image sequence with sub-pixel level registration accuracy.
[0024] Optionally, based on the original multispectral image sequence, the exposure parameters of each spectral channel are adjusted through dynamic intensity equalization to generate a standardized image set, including:
[0025] Calculate the statistical parameters of the luminance components of each spectral channel image in the CIE-Lab color space, and establish the inter-channel light intensity compensation coefficient matrix;
[0026] Based on the compensation coefficient matrix, gamma correction is performed on the oversaturated channel, and histogram equalization is applied to the low-illuminance channel.
[0027] Through iterative optimization, the contrast standard deviation of each channel image is converged to a preset threshold range, generating a standardized image set with consistent spectral response.
[0028] Optionally, background separation is performed on a single frame image in the normalized image set using an adaptive kernel function, and the low-frequency components of the image are extracted as a guided smoothing image, including:
[0029] 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;
[0030] Based on the kernel function configuration parameters, a weight matrix is calculated, and multi-scale spatial filtering is performed on the standardized image to output the filtered intermediate image data.
[0031] The intermediate image data is transformed into frequency domain data by Fourier transform to generate frequency domain spectrum data;
[0032] The frequency domain spectral data is processed by zero-frequency centering before the spectral components are selected.
[0033] An inverse Fourier transform is performed on the selected frequency domain data to extract its real part as a low-frequency component. The low-frequency component is then weighted and fused with the original intermediate image data to generate a guided smoothing image.
[0034] Optionally, the defect feature distribution map is fused with the original multispectral image at multiple scales to construct a defect-enhanced image set, including:
[0035] The defect feature distribution map is decomposed into Gaussian pyramids to generate a multi-scale feature map containing different spatial frequencies;
[0036] The multi-scale feature map is matched with the corresponding scale layer of the original multispectral image by convolution kernel matching, and a feature mapping relationship is established by normalized cross-correlation algorithm;
[0037] Based on the mapping relationship, adaptive weight allocation is performed on each channel of the multispectral image to generate a fusion feature layer with spectral preservation properties;
[0038] The fused feature layer is inversely synthesized using the Laplacian pyramid reconstruction algorithm to output a defect-enhanced image set containing defect enhancement information.
[0039] Secondly, embodiments of this application provide a precision metal part surface defect imaging system under complex light field interference environment, characterized in that it includes:
[0040] The acquisition module is used to acquire the original multispectral image sequence of the metal part surface;
[0041] The adjustment module is used to adjust the exposure parameters of each spectral channel based on the original multispectral image sequence through dynamic light intensity equalization to generate a standardized image set;
[0042] The separation module is used to perform background separation on single-frame images in a standardized image set using an adaptive kernel function, and extract the low-frequency components of the image as a guide for smoothing.
[0043] The difference module is used to perform pixel-level difference operations on the guided smoothing image and the single-frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information.
[0044] The mapping module is used to map the gray-level distribution of the feature map using a probability density function based on a normal distribution model. By adjusting the standard deviation parameter, it performs nonlinear stretching of the local contrast to generate a defect feature distribution map with enhanced gradient features.
[0045] A construction module is used to fuse the defect feature distribution map with the original multispectral image at multiple scales to construct a defect-enhanced image set.
[0046] Thirdly, embodiments of this application provide a computing device, including a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are invoked and executed by the processing component to realize a method for imaging surface defects of precision metal parts under complex light field interference environment as described in the first aspect above.
[0047] Fourthly, embodiments of this application provide a computer storage medium storing a computer program, which, when executed by a computer, implements a method for imaging surface defects of precision metal parts under complex light field interference environment as described in the first aspect.
[0048] This application embodiment acquires a sequence of original multispectral images of a metal surface; 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 single-frame images in the standardized image set using an adaptive kernel function, and the low-frequency components of the images are extracted as guiding smoothing images; pixel-level difference operations are performed between the guiding smoothing images and the corresponding single-frame images in the standardized image set to generate a high-frequency defect feature map containing defect edge information; based on a normal distribution model, a probability density function is applied to the gray-level distribution of the feature map, and 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 images at multiple scales to construct a defect-enhanced image set. The technical solution provided by this application overcomes the limitations of single-spectral imaging, captures the reflection characteristics of metal surfaces in different bands through multispectral data, and provides a redundant information basis for defect detection under complex light field interference. It solves the problem of exposure imbalance in each channel caused by ambient light fluctuations or the reflective properties of metals, eliminates the suppression of defect signals by non-uniform illumination, and improves the comparability of cross-spectral data. Overcoming the oversmoothing or undersmoothing issues of traditional fixed kernel functions on complex textured backgrounds, this method adaptively strips away structural noise from metal surfaces while preserving the physical continuity of low-frequency backgrounds. Through background separation and difference operations, it suppresses low-frequency background interference, highlighting the high-frequency abrupt changes at defect edges, thus overcoming the bottleneck of traditional threshold segmentation in detecting weak edge defects. Addressing the issue of concentrated gray-level distribution in feature maps for weak-contrast defects, it adaptively stretches local contrast through probability density mapping, enhancing the gradient difference between minute defects and the background. By fusing original multispectral material information with enhanced defect gradient features, it solves the problem of insufficient signal-to-noise ratio in a single feature map, improving the visual saliency and recognizability of defects. Specifically, an initial normal distribution model is established based on the gray-level histogram of the high-frequency defect feature map; a gray-level-probability density relationship matrix is generated through probability density function mapping; the standard deviation parameter is dynamically adjusted to modulate the slope of the probability density function curve; and a remapping function is used to perform a nonlinear transformation on the gray-level values of the feature map, achieving adaptive stretching of local contrast and generating a defect distribution map with enhanced gradient features. By accurately locating the clustering range of defect grayscale in the feature map through probability density mapping, the background noise amplification caused by global stretching is avoided; the dynamic adjustment of the standard deviation parameter gives the model the ability to adapt to defect scale / contrast: high slope stretching is applied to small defects to sharpen the edges, while moderate stretching is maintained for large defects to prevent feature distortion; it breaks through the generalization barrier of fixed parameter enhancement methods on complex metal surfaces, improves the imaging signal-to-noise ratio of weakly visible defects such as micron-level scratches and pits, and solves the problem of excessive submersion of weak defects by traditional linear contrast stretching.
[0049] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 The flowchart of a method for imaging surface defects of precision metal parts under complex light field interference environment provided in this application is shown;
[0052] Figure 2 This invention provides a schematic diagram of the structure of a precision metal part surface defect imaging system under complex light field interference environment.
[0053] Figure 3 A schematic diagram of the structure of a computing device provided in this application is shown. Detailed Implementation
[0054] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0055] In some of the processes described in the specification, claims, and accompanying drawings of this application, multiple operations appearing in a specific order are included. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not themselves represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.
[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] In the field of precision metal surface defect detection, this application proposes a dynamic light intensity equalization and adaptive feature enhancement imaging method to address the challenges of suppressing dynamic interference from 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 limitations of existing technologies such as fixed-angle light sources and single-spectral imaging in overcoming multi-angle reflection interference and loss of defect edge information caused by conventional frequency domain filtering algorithms. By acquiring the original multispectral image sequence and dynamically adjusting the exposure parameters of each channel, the overexposure or underexposure problem of the global enhancement algorithm caused by the difference in grayscale distribution in high / low illumination areas is solved. 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 achieve adaptive enhancement of defect edge gradient features, overcoming the limitations of linear stretching and histogram equalization in being sensitive to non-uniform reflection noise. Finally, a multi-scale feature fusion mechanism is used to incorporate the spatial correlation between spectral reflectivity and geometric features into the defect enhancement process, compensating for the shortcomings of existing cross-modal feature fusion methods. Ultimately, an enhanced image set that effectively suppresses light field interference and highlights true defect features is constructed.
[0058] Figure 1 A flowchart of a method is provided for an embodiment of this application, such as Figure 1 As shown, the method includes:
[0059] Step 101: Obtain the original multispectral image sequence of the metal part surface.
[0060] In this step, the original multispectral image sequence refers to the set of surface reflection images of the metal part acquired by a multi-band optical sensor, containing spectral channel data such as ultraviolet, visible, and infrared, reflecting the differences in the material's reflection characteristics under different bands.
[0061] In this embodiment of the application, a multispectral industrial camera is used to collect reflected light signals from the surface of a metal part in a complex light field environment, and simultaneously acquires a sequence of original multispectral images containing ultraviolet, visible and near-infrared bands.
[0062] Step 102: Based on the original multispectral image sequence, adjust the exposure parameters of each spectral channel through dynamic light intensity equalization to generate a standardized image set.
[0063] In this step, the exposure parameters for each spectral channel refer to the adjustable combination of parameters that control the amount of light received by the camera sensor, used to independently adjust the imaging brightness of each spectral channel. The normalized image set refers to the set of images generated after dynamic light intensity equalization processing, where each channel image has a consistent brightness distribution benchmark, eliminating channel differences caused by ambient light interference.
[0064] In this embodiment, based on the original multispectral image sequence, the grayscale mean and variance of each spectral channel image are calculated respectively. 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 difference between channels caused by ambient light fluctuations, and output a standardized image set with balanced exposure.
[0065] Step 103: Perform background separation on single-frame images in the standardized image set using an adaptive kernel function, and extract the low-frequency components of the images as a guide smoothing image.
[0066] In this step, the adaptive kernel function refers to a Gaussian convolution kernel whose size is dynamically adjusted according to the local texture complexity of the image, used to balance noise suppression and detail preservation in background separation. A single frame image refers to any independent spectral channel image from the normalized image set. Low-frequency components refer to the slowly varying signal components retained after spatial domain filtering, reflecting the uniform background and macroscopic structure of the metal surface. The guided smoothing image refers to the low-frequency background image extracted by the adaptive kernel function, used as the reference template for the difference operation.
[0067] In this embodiment, for a single frame image of a standardized image set, the Gaussian kernel function size is dynamically selected based on its local texture complexity: a large-scale kernel function is used to suppress noise in sparse texture regions, and a small-scale kernel function is used to preserve details in dense texture regions; the spatial frequency components of the image are separated by convolution operation, and the low-frequency background component is extracted as a guide for smoothing the image.
[0068] Step 104: Perform pixel-level difference operation on the guided smoothing image and the single-frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information.
[0069] In this step, defect edge information refers to the spatial high-frequency abrupt signal characteristics caused by defects such as surface scratches and pits. The high-frequency defect feature map refers to an image generated through pixel-level difference analysis, where background signals are suppressed and high-frequency components at the defect edges are highlighted.
[0070] In this embodiment, the guided smooth image is subtracted pixel by pixel from the normalized image in the same frame. In the difference result, the uniform background of the metal surface is canceled out, 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.
[0071] Step 105: Based on the normal distribution model, the gray-level distribution of the feature map is mapped by 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.
[0072] In this step, the normal distribution model refers to the probabilistic model used to describe the gray-level statistical characteristics of the feature map, and its bell curve represents the pixel value clustering pattern. The standard deviation parameter is an adjustment variable that controls the broadening of the normal distribution curve; increasing this value can improve the gray-level mapping slope in low-probability areas. Local contrast refers to the intensity of the gray-level difference between small regions (such as defect edges) and the adjacent background in the image. The defect feature distribution map with enhanced gradient features refers to the image generated after nonlinear stretching, in which the gray-level gradient changes at the defect edges are enhanced, and weak defect signals are improved.
[0073] In this embodiment, the gray-level histogram of the high-frequency defect feature map is statistically analyzed, and an initial normal distribution model is fitted. A gray-level remapping curve is established with the probability density function value as the weight. By increasing the standard deviation parameter, the slope of the curve rises sharply in the low probability density region, thereby achieving nonlinear stretching of local contrast and outputting a defect feature distribution map with enhanced gradient features.
[0074] Step 106: Perform multi-scale feature fusion between the defect feature distribution map and the original multispectral image to construct a defect-enhanced image set.
[0075] In this step, the defect enhancement image set refers to the output image set after fusing multispectral material information and enhancing defect features, thereby optimizing defect visibility and detectability.
[0076] In this embodiment, the Laplacian pyramid decomposition algorithm is used: the original multispectral image is decomposed into a low-frequency basal layer and a high-frequency detail layer, the noise-dominant subband in the high-frequency detail layer is replaced with a defect feature distribution map, and then the material reflection properties and enhanced defect features are fused through pyramid reconstruction to generate a defect-enhanced image set.
[0077] The embodiments of this application eliminate the influence of complex light fields through dynamic exposure equalization, retain the real defect edges through adaptive background separation, enhance the micron-level defect gradient through probability-driven nonlinear stretching, and 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.
[0078] For example, in the surface inspection of aero-engine blades, a multispectral camera (containing 450nm / 650nm / 850nm channels) is first used to acquire the original multispectral image sequence. To address the overexposure phenomenon of the 650nm channel caused by 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 areas and σ=5px in dense areas) is used to extract low-frequency guided smoothing images from a single frame of the 650nm image. High-frequency features of micro-scratches at the blade tenon groove are separated by pixel difference. Based on the feature map grayscale histogram fitting a normal distribution with μ=42 and σ=8, σ is adjusted to 12 to perform local contrast stretching on the scratch area. Finally, the stretched defect features are fused with the original 850nm channel (the oxide layer sensitive band) using a pyramid fusion method to output an enhanced image set with clearly visible micro-scratches and oxide spots.
[0079] This application provides a specific embodiment. Step 105 involves mapping the grayscale distribution of the feature map using a probability density function based on a normal distribution model, and nonlinearly stretching the local contrast by adjusting the standard deviation parameter to generate a defect feature distribution map with enhanced gradient features. This specifically includes the following steps:
[0080] Step 201: Use the grayscale histogram of the high-frequency defect feature map as input to establish the initial normal distribution model parameters.
[0081] In this step, the grayscale histogram refers to a distribution chart of the frequency of each gray level in the statistical image. The horizontal axis represents the gray levels from 0 to 255, and the vertical axis represents the number of pixels, reflecting the grayscale concentration range and dispersion of the defect feature map. The initial normal distribution model parameters refer to the statistical variables describing the distribution shape of the grayscale histogram, including the mean (center of distribution) and standard deviation (dispersion of distribution), used to construct the initial probability model.
[0082] In this embodiment, the grayscale value distribution of all pixels in the high-frequency defect feature map is statistically analyzed to generate a grayscale histogram with grayscale level on the horizontal axis and pixel frequency on the vertical axis. The mean parameter of the normal distribution is determined based on the peak position of the histogram, and the initial value of the standard deviation parameter is calculated based on the distribution width to establish the initial normal distribution model parameters characterizing the grayscale statistical characteristics of the feature map.
[0083] Step 202: Calculate the probability density function value corresponding to each gray level based on the parameters of the normal distribution model, and generate a mapping relationship matrix between gray level and probability density.
[0084] In this step, the probability density function value refers to the single-point probability intensity calculated according to the normal distribution formula, representing the relative probability of a specific gray level appearing in the statistical distribution. The mapping relationship matrix between gray level and probability density refers to the set of probability density function values arranged in order of gray level, forming a conversion table from gray level value to probability intensity.
[0085] In this embodiment, the gray levels are substituted into the normal distribution probability density function formula, and the probability density function value corresponding to each gray level is calculated using the mean parameter and the standard deviation parameter; the function values are arranged in ascending order of gray levels to construct a two-dimensional mapping relationship matrix with gray levels as rows and probability densities as columns.
[0086] Step 203: Using the mapping matrix as input to the nonlinear stretching function, the slope of the probability density function curve is modulated by adjusting the standard deviation parameter to obtain the adjusted probability density function.
[0087] In this step, the nonlinear stretching function refers to a grayscale transformation function designed with probability density as the weight, which enhances local contrast by increasing the mapping slope in the low-probability region. The probability density function curve is a continuous curve that visualizes the mapping matrix, with the horizontal axis representing grayscale levels and the vertical axis representing probability density values, characterizing the grayscale distribution pattern. The adjusted probability density function refers to the probability density curve modulated by the standard deviation parameter, where the slope in the low-probability region is increased to achieve nonlinear stretching of the defect-sensitive area.
[0088] In this embodiment, an initial probability density function curve is generated based on the mapping relationship matrix; the standard deviation parameter is increased according to the contrast requirements of the target defect, so that the slope of the probability density function curve rises sharply in the low probability density region and the slope slows down in the high probability density region, and the modulated probability density function curve is output.
[0089] Step 204: Use the modulated probability density function to remap the original feature map pixel by pixel grayscale values to generate a defect feature distribution map with enhanced gradient features.
[0090] 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 that is masked by background noise.
[0091] In this embodiment, 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 mapped to a new grayscale value through the lookup table, thereby expanding the grayscale dynamic range of the low probability density region; this transformation is performed pixel by pixel on the high-frequency defect feature map to generate a gradient feature-enhanced defect feature distribution map.
[0092] This application embodiment accurately locates the gray-level clustering range of defect signals by modeling with a normal distribution, and dynamically modulates the slope of the probability density curve using the standard deviation parameter. Under the premise of avoiding background noise amplification, it specifically stretches the dynamic range of defect edges, improves the edge gradient of weakly visible defects such as micron-level scratches and pitting, and overcomes the contradiction of overexposure or underenhancement caused by traditional linear stretching.
[0093] This application provides a specific embodiment. Step 203 involves using the mapping relationship matrix as input to the nonlinear stretching function, and modulating the slope of the probability density function curve by adjusting the standard deviation parameter to obtain the adjusted probability density function. This specifically includes the following steps:
[0094] Step 211: Establish a nonlinear stretching weight factor based on the mapping relationship matrix, and generate the dynamic partial derivative function of the probability density function according to the adjustment range of the standard deviation parameter.
[0095] In this step, the nonlinear stretching weighting factor refers to a normalized coefficient calculated based on the probability density value. It is used to quantify the enhancement priority of different gray levels in contrast stretching; the lower the probability density, the larger the weighting factor. The adjustment magnitude of the standard deviation parameter refers to the proportion of standard deviation increased to improve the contrast of the defect area. This magnitude determines the deformation intensity of the probability density function curve. The dynamic partial derivative function of the probability density function refers to the derivative function describing the slope of the probability density function curve as a function of gray level, reflecting the dynamic response characteristics of the curve steepness after adjusting the standard deviation.
[0096] In this embodiment, the mapping relationship matrix between gray level and probability density is used as input. The probability density values corresponding to each gray level are normalized to generate a nonlinear stretching weight factor that reflects the importance of gray level. Based on the increase ratio of the standard deviation parameter, the slope change rate of the probability density function curve at each gray point is calculated to generate a dynamic partial derivative function that characterizes the steepness of the curve.
[0097] Step 212: Optimize the parameters of the dynamic partial derivative function so that the slope of the probability density function curve in the target gray range satisfies the preset dynamic optimization objective function.
[0098] In this step, the target grayscale range refers to the grayscale range of the defect signal concentration in the high-frequency defect feature map, where the probability density value corresponding to this range is lower than the overall distribution mean. The preset dynamic optimization objective function refers to the mathematical constraint condition set for the slope of the defect area, requiring that the minimum slope of the target range must be many times greater than the baseline slope of the background area.
[0099] In this embodiment, the dynamic optimization objective function is set to require the slope of the target grayscale interval (the area where the defect signal is concentrated) to be increased to more than a multiple of the slope of the background area; the standard deviation parameter is iteratively adjusted by 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 of the probability density function curve in the defect area to meet the preset dynamic optimization objective function.
[0100] Step 213: Perform step-by-step matching and calibration between the probability density function curve and the gray-level distribution of the original feature map to generate an adaptive contrast-enhanced modulation function.
[0101] 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 real defects to the background. The adaptive contrast enhancement modulation function refers to the grayscale remapping function generated after parameter optimization and distribution calibration, whose output grayscale value is non-linearly positively correlated with the input probability density.
[0102] In this embodiment, the modulated probability density function curve is discretized by gray level and matched and calibrated step by step with the gray level histogram of the original feature map; if the actual pixel frequency of a certain gray 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 that adaptively matches the statistical distribution of defect features is generated.
[0103] This application embodiment quantifies the slope change of the probability curve through a dynamic partial derivative function, accurately locks the enhancement intensity of the defect area by combining it with an optimized objective function, eliminates modeling errors by using grayscale distribution calibration, and generates a modulation function that strictly matches the physical properties of the defect. This completely solves the problem of over-enhancement and under-enhancement caused by fixed parameters on complex metal surfaces in traditional methods.
[0104] This application provides a specific embodiment, step 101, acquiring the original multispectral image sequence of the metal part surface, specifically including the following steps:
[0105] 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 multispectral synchronous sampling image containing visible light and near-infrared bands.
[0106] In this step, the surface reflectivity of the metal part refers to the reflectivity distribution of the metal material under different wavelengths of light. For example, aluminum alloy has a reflectivity as high as 80% in the 550nm visible light band, while it drops to 40% in the 850nm near-infrared band due to absorption by the oxide layer. The CCD exposure time for each spectral channel refers to the duration of light exposure for the CCD sensor in a specific spectral band (such as the 650nm red band and the 850nm infrared band), dynamically adjusted based on reflectivity to avoid overexposure or undersampling. The multispectral synchronously sampled image, including visible and near-infrared bands, refers to the image set captured synchronously by a beam splitter and a multi-CCD array.
[0107] In this embodiment, the reflectivity curve of the metal surface is monitored in real time by a fiber optic spectrometer. When a high reflectivity band (such as a specular reflection area) is detected, the CCD exposure time of the corresponding spectral channel is automatically shortened to prevent overexposure. For low reflectivity bands (such as oxide layer absorption areas), 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 synchronously sampled image with complete spectral information.
[0108] Step 112: Perform time-series alignment processing on the multispectral synchronously sampled images to generate an original multispectral image sequence with sub-pixel level registration accuracy.
[0109] In this step, subpixel-level registration accuracy refers to the fact that after the multispectral images are aligned, the positional deviation of corresponding points in space is very small, and a matching accuracy of 0.1-0.5 pixels is usually achieved through interpolation algorithms.
[0110] In this embodiment, the near-infrared channel image is used as a reference to perform time-series alignment processing on the multispectral synchronously sampled image, and the rigid transformation matrix of the visible light channel image is calculated; the visible light image is compensated for subpixel-level translation and rotation by a bicubic interpolation algorithm, and when the feature point position error between multispectral images is very small, the original multispectral image sequence with subpixel-level registration accuracy is output.
[0111] This application's embodiments solve the brightness imbalance between channels caused by high metallic reflectivity by using dynamic exposure control driven by reflectivity characteristics. It eliminates spatial misalignment of multispectral images by using sub-pixel level registration, providing high-quality input with complete spectral information and spatial alignment for subsequent processing, thus breaking through the bottleneck of spectral distortion caused by exposure mismatch and image shift in traditional multispectral detection.
[0112] This application provides a specific embodiment. Step 102 involves adjusting the exposure parameters of each spectral channel based on the original multispectral image sequence through dynamic light intensity equalization to generate a standardized image set. This specifically includes the following steps:
[0113] Step 201: Calculate the statistical parameters of the luminance components of each spectral channel image in the CIE-Lab color space, and establish the inter-channel light intensity compensation coefficient matrix.
[0114] In this step, the CIE-Lab color space refers to the perceptually uniform color model developed by the International Commission on Illumination (ICI), which includes luminance and chromaticity components. The luminance component independently characterizes the brightness and darkness of an image, making it suitable for separating the effects of illumination. The luminance component statistical parameters refer to the mathematical features extracted from the luminance components of the CIE-Lab space, including the mean and standard deviation of the overall image luminance. The inter-channel luminance compensation coefficient matrix is a proportional matrix describing the difference in luminance between each spectral channel and the reference channel; its element value is the mean luminance of the target channel divided by the mean luminance of the reference channel.
[0115] In this embodiment, the original image of each spectral channel is converted from the color space to the CIE-Lab color space, and the luminance component is extracted; the mean and standard deviation of the luminance of all luminance channel images are calculated as statistical parameters; and the ratio of the mean luminance of other channels to the benchmark is calculated using the near-infrared channel as a reference to generate a light intensity compensation coefficient matrix.
[0116] Step 202: Perform gamma correction on the oversaturated channel based on the compensation coefficient matrix, and perform histogram equalization on the low-illuminance channel.
[0117] In this step, the oversaturated channel refers to an image channel where the grayscale value of pixels in the highlight area reaches 255 due to overexposure, and its histogram shows a truncated peak at the high end. The low-light channel refers to an image channel where the overall grayscale value is concentrated in the 0-100 range due to underexposure, and its histogram is skewed to the left and has a narrow dynamic range.
[0118] In this embodiment, based on the compensation coefficient matrix, the gamma correction formula (the gamma correction formula is: output brightness equals input brightness divided by gamma coefficient) is used to compress the highlight area of the oversaturated channel; histogram equalization is performed on the low-light channel, and the pixel gray values are redistributed through histogram equalization to stretch the contrast.
[0119] Step 203: Through iterative optimization, the contrast standard deviation of each channel image is converged to a preset threshold range to generate a standardized image set with consistent spectral response.
[0120] In this step, the contrast standard deviation is a quantitative indicator of the dispersion of image grayscale values. It is calculated by dividing the sum of squared deviations of all pixel grayscale values from their mean by the total number of pixels and then taking the square root. The preset threshold is an engineering parameter that controls the termination of the iteration, setting the maximum allowable difference in the contrast standard deviation of each channel. The standardized image set with consistent spectral response refers to a set of images with similar brightness and contrast in the same material region after equalization processing, eliminating imaging differences between bands.
[0121] In this embodiment, the standard deviation of the brightness components of each channel after processing is calculated. If the difference between the maximum and minimum values exceeds a preset threshold, the compensation coefficient is adjusted and step 2 is executed again. The iteration terminates when the difference in the standard deviation of all channels is less than the preset threshold, and a standardized image set with consistent spectral response is output.
[0122] This application embodiment accurately separates the luminance component in CIE-Lab space, quantifies the differences between channels using a compensation coefficient matrix, classifies and enhances oversaturated or low-illuminance channels, and achieves cross-spectral response consistency through iterative optimization, breaking through the technical barrier of local overexposure or insufficient enhancement caused by fixed enhancement parameters in traditional methods.
[0123] This application provides a specific embodiment. Step 103 involves performing background separation on a single frame image in a standardized image set using an adaptive kernel function, and extracting the low-frequency components of the image as a guided smoothing image. This specifically includes the following steps:
[0124] 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.
[0125] In this step, bilateral filtering refers to a nonlinear filtering algorithm that simultaneously considers spatial distance and pixel value similarity. Spatial domain weights decrease with increasing distance, while value domain weights decrease with increasing grayscale difference. The spatially variable kernel function model refers to a kernel function system that dynamically adjusts parameters based on local image characteristics. Its scale parameter changes inversely with texture complexity, used to balance smoothing intensity and detail preservation. Kernel function configuration parameters refer to the set of variables that control the behavior of the kernel function, including the spatial domain weight distribution function, the value domain weight function, and the scale adjustment coefficient.
[0126] In this embodiment, for each pixel in a single frame of a standardized image set, a texture complexity index is calculated based on the gray-level variance of its neighborhood; large-scale spatial domain weights are assigned to sparse texture regions, and small-scale weights are assigned to dense texture regions; a spatially variable kernel function model based on bilateral filtering is obtained; at the same time, the value domain weights are calculated based on the gray-level difference between pixels, and kernel function configuration parameters that fuse spatial distance and gray-level similarity are output.
[0127] Step 302: Calculate the weight matrix based on the kernel function configuration parameters, perform multi-scale spatial filtering on the standardized image, and output the filtered intermediate image data.
[0128] In this step, the weight matrix refers to a two-dimensional matrix generated by the kernel function, where each element represents the filtering weight of other pixels in the neighborhood of each pixel relative to the central pixel. The intermediate image data refers to the output image after multi-scale spatial filtering, where the background is smoothed while defect edges are preserved.
[0129] In this embodiment, 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 sparse texture areas, and small-scale edge-preserving filtering is performed in dense texture areas, and intermediate image data after noise suppression is output.
[0130] Step 303: Perform frequency domain transformation on the intermediate image data using Fourier transform to generate frequency domain spectrum data.
[0131] In this embodiment, 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 composed of real and imaginary parts. The amplitude spectrum reflects the intensity of the frequency components, and the phase spectrum reflects the spatial structure information.
[0132] Step 304: Select spectral components after zero-frequency centering of the frequency domain spectral data.
[0133] In this step, frequency domain spectral data refers to the representation of a spatial image converted to the frequency domain through Fourier transform, including 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 gradually changing background of the image, while high-frequency components correspond to edges and noise.
[0134] In this embodiment, the frequency domain spectrum data is zero-frequency centered, 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.
[0135] Step 305: Perform an inverse Fourier transform on the selected frequency domain data, extract its real part as the low-frequency component, and then perform weighted fusion of the low-frequency component with the original intermediate image data to generate a guided smoothing image.
[0136] In this step, the real component refers to the real-valued image component generated after performing an inverse Fourier transform on the complex-form frequency domain data, reflecting the reconstructed spatial domain information.
[0137] In this embodiment, 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 weighted and fused according to the weight ratio (e.g., the low-frequency component is multiplied by 0.7 and the intermediate image is multiplied by 0.3) to generate a guided smooth image that preserves the continuity of the background.
[0138] This application embodiment achieves adaptive background smoothing through a spatially variable kernel function, accurately extracts low-frequency components by combining frequency domain filtering, and preserves the physical continuity of the background by weighted fusion, thus completely solving the problem of blurred defect edges or texture residue caused by traditional fixed kernel filtering on metal surfaces.
[0139] This application provides a specific embodiment. Step 106 involves fusing the defect feature distribution map with the original multispectral image at multiple scales to construct a defect-enhanced image set, specifically including the following steps:
[0140] Step 601: Perform Gaussian pyramid decomposition on the defect feature distribution map to generate a multi-scale feature map containing different spatial frequencies.
[0141] In this step, the multi-scale feature map refers to the 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.
[0142] In this embodiment of the invention, a Gaussian pyramid decomposition algorithm is used to process the defect feature distribution map. By repeatedly performing Gaussian smoothing and downsampling operations, an image sequence with progressively decreasing resolution is generated. The image size is reduced, with low-frequency components concentrated in the top layer and high-frequency components distributed in the bottom layer, generating a multi-scale feature map set containing different spatial frequencies from macroscopic defect contours to microscopic edges.
[0143] Step 602: Perform convolution kernel matching between 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.
[0144] In this step, the feature mapping relationship refers to the pixel correspondence matrix established by the normalized cross-correlation algorithm, which reflects the spatial location matching degree between the defect feature map and the multispectral image at the same scale.
[0145] In this embodiment of the invention, each layer of the multi-scale feature map is matched with the same-scale layer of the original multispectral image through convolution kernel matching. The image is traversed using a sliding window of the same size, and the normalized cross-correlation value of the two images within 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 at the cross-correlation peak position.
[0146] Step 603: Based on the mapping relationship, adaptive weight allocation is performed on each channel of the multispectral image to generate a fusion feature layer with spectral preservation properties.
[0147] In this step, the fusion feature layer that preserves spectral characteristics refers to the feature layer that retains the original reflectance distribution of the multispectral channels during the fusion process.
[0148] In this embodiment of the invention, the weight of each channel is calculated according to the feature mapping relationship. For pixels in the overlapping mapping region, the channel with high defect feature significance is assigned a high weight. The original spectral information is preserved in the non-overlapping region to generate a fusion feature layer with spectral preservation characteristics.
[0149] Step 604: The fused feature layer is reverse synthesized using the Laplacian pyramid reconstruction algorithm to output a defect-enhanced image set containing defect enhancement information.
[0150] In this step, the Laplacian pyramid reconstruction algorithm refers to an image reconstruction method that uses Gaussian pyramid differences to progressively upsample and stack images. Mathematically, it is the reverse synthesis of full-resolution images from the Laplacian filtering results at different scales.
[0151] In this embodiment of the invention, the fused feature layer is upsampled layer by layer from the top layer and details are superimposed. This process is repeated until the original resolution is reached. The defect-enhanced image set with sharpened defect edges and no spectral distortion is output by reconstructing the inverse Gaussian pyramid.
[0152] This application's embodiments accurately separate the spatial frequencies of defects using Gaussian pyramids, establish cross-modal positional associations using cross-correlation mapping, and achieve both defect enhancement and spectral fidelity through adaptive weight allocation. Laplacian reconstruction enables edge sharpening and lossless resolution restoration, thus completely solving the problems of spectral distortion or edge blurring caused by traditional fusion methods.
[0153] Figure 2 This application provides a schematic diagram of the structure of a system, such as... Figure 2 As shown, the system includes:
[0154] The acquisition module 21 is used to acquire the original multispectral image sequence of the metal part surface;
[0155] The adjustment module 22 is used to adjust the exposure parameters of each spectral channel based on the original multispectral image sequence through dynamic light intensity equalization to generate a standardized image set;
[0156] The separation module 23 is used to perform background separation on a single frame image in a standardized image set using an adaptive kernel function, and extract the low-frequency components of the image as a guide smoothing image;
[0157] The difference module 24 is used to perform pixel-level difference operations on the guided smoothing image and the single-frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information.
[0158] The mapping module 25 is used to perform probability density function mapping on the gray-level distribution of the feature map based on the normal distribution model, and to perform nonlinear stretching of the local contrast by adjusting the standard deviation parameter to generate a defect feature distribution map with enhanced gradient features.
[0159] The construction module 26 is used to perform multi-scale feature fusion between the defect feature distribution map and the original multispectral image to construct a defect-enhanced image set.
[0160] Figure 2 The system described above can execute Figure 1 The implementation principle and technical effects of the method described in the illustrated embodiment will not be repeated here. The specific methods by which each module and unit performs operations in the system described above have been described in detail in the embodiments related to this method, and will not be elaborated upon here.
[0161] In one possible design, Figure 2 One embodiment of the system shown can 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;
[0162] The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are invoked and executed by the processing component 32.
[0163] The processing component 32 is used for the above Figure 1 One method of the embodiment described.
[0164] 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-described method. Alternatively, the processing component may 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-described method.
[0165] 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 storage 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 storage, flash memory, magnetic disk, or optical disk.
[0166] Of course, computing devices may also include other components, such as input / output interfaces, display components, communication components, etc.
[0167] Input / output interfaces provide interfaces between processing components and peripheral interface modules, which can be output devices, input devices, etc.
[0168] The communication components are configured to facilitate wired or wireless communication between computing devices and other devices.
[0169] The computing device can be a physical device or an elastic computing host provided by a cloud computing platform. In this case, the computing device can refer to a cloud server, and the aforementioned processing components, storage components, etc., can be basic server resources rented or purchased from the cloud computing platform.
[0170] This application also provides a computer storage medium storing a computer program, which, when executed by a computer, can perform the above-described functions. Figure 1 The embodiment shown is a method for imaging surface defects of precision metal parts under complex light field interference environment.
[0171] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0172] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0173] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part 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, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for imaging surface defects of precision metal parts under complex light field interference environments, characterized in that, include: Obtain the original multispectral image sequence of the metal part surface; 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; Background separation is performed on single-frame images in the standardized image set using an adaptive kernel function, and the low-frequency components of the images are extracted as guided smoothing images. The guided smoothing image is subjected to pixel-level difference operation with 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 gray-level distribution of the feature map is mapped by 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. The defect feature distribution map is fused with the original multispectral image at multiple scales to construct a defect-enhanced image set. The defect feature distribution map is fused with the original multispectral image at multiple scales to construct a defect-enhanced image set, including: The defect feature distribution map is decomposed into Gaussian pyramids to generate a multi-scale feature map containing different spatial frequencies; The multi-scale feature map is matched with the corresponding scale layer of the original multispectral image by convolution kernel matching, and a feature mapping relationship is established by 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 spectral preservation properties; The fused feature layer is inversely synthesized using the Laplacian pyramid reconstruction algorithm to output a defect-enhanced image set containing defect enhancement information.
2. The method according to claim 1, characterized in that, Based on the normal distribution model, a probability density function is applied to the gray-level distribution of the feature map. By adjusting the standard deviation parameter, a nonlinear stretching of the local contrast is performed to generate a defect feature distribution map with enhanced gradient features, including: The gray-level histogram of the high-frequency defect feature map is used as input to establish the initial normal distribution model parameters; Based on the parameters of the normal distribution model, the probability density function value corresponding to each gray level is calculated, and a mapping relationship matrix between gray level and probability density is generated. The mapping matrix is used as the input to the nonlinear stretching function. The slope of the probability density function curve is modulated by adjusting the standard deviation parameter to obtain the adjusted probability density function. The original feature map is remapped pixel by pixel using the modulated probability density function to generate a defect feature distribution map with enhanced gradient features.
3. The method according to claim 2, characterized in that, Using the mapping matrix as input to the nonlinear stretching function, the slope of the probability density function curve is modulated by adjusting the standard deviation parameter to obtain the adjusted probability density function, including: A nonlinear stretching weighting factor is established based on the mapping relationship matrix, and a dynamic partial derivative function of the probability density function is generated according to the adjustment range of the standard deviation parameter. The parameters of the dynamic partial derivative function are optimized so that the slope of the probability density function curve in the target gray range satisfies the preset dynamic optimization objective function. The probability density function curve is matched and calibrated step by step with the gray-level distribution of the original feature map to generate an adaptive contrast-enhanced modulation function.
4. The method according to claim 1, characterized in that, Obtain the raw multispectral image sequence of the metal part surface, including: Based on the surface reflectivity of metal parts, the exposure time of CCD in each spectral channel is dynamically triggered to generate a multispectral synchronously sampled image containing visible and near-infrared bands. The multispectral synchronously sampled images are subjected to time-series alignment processing to generate an original multispectral image sequence with sub-pixel level registration accuracy.
5. The method according to claim 4, characterized in that, Based on the original multispectral image sequence, the exposure parameters of each spectral channel are adjusted through dynamic intensity equalization to generate a standardized image set, including: Calculate the statistical parameters of the luminance components of each spectral channel image in the CIE-Lab color space, and establish the inter-channel light intensity compensation coefficient matrix; Based on the compensation coefficient matrix, gamma correction is performed on the oversaturated channel, and histogram equalization is applied to the low-illuminance channel. Through iterative optimization, the contrast standard deviation of each channel image is converged to a preset threshold range, generating a standardized image set with consistent spectral response.
6. The method according to claim 1, characterized in that, Background separation is performed on single frames of images in a normalized image set using an adaptive kernel function. The low-frequency components of the images are then extracted as a guide for smoothing, 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; Based on the kernel function configuration parameters, a weight matrix is calculated, and multi-scale spatial filtering is performed on the standardized image to output the filtered intermediate image data. The intermediate image data is transformed into frequency domain data by Fourier transform to generate frequency domain spectrum data; The frequency domain spectral data is processed by zero-frequency centering before the spectral components are selected. An inverse Fourier transform is performed on the selected frequency domain data to extract its real part as a low-frequency component. The low-frequency component is then weighted and fused with the original intermediate image data to generate a guided smoothing image.
7. A precision metal part surface defect imaging system under complex light field interference environment, characterized in that, include: The acquisition module is used to acquire the original multispectral image sequence of the metal part surface; The adjustment module is used to adjust the exposure parameters of each spectral channel based on the original multispectral image sequence through dynamic light intensity equalization to generate a standardized image set; The separation module is used to perform background separation on single-frame images in a standardized image set using an adaptive kernel function, and extract the low-frequency components of the image as a guide for smoothing. The difference module is used to perform pixel-level difference operations on the guided smoothing image and the single-frame image of the corresponding standardized image set to generate a high-frequency defect feature map containing defect edge information. The mapping module is used to map the gray-level distribution of the feature map using a probability density function based on a normal distribution model. By adjusting the standard deviation parameter, it performs nonlinear stretching of the local contrast to generate a defect feature distribution map with enhanced gradient features. The construction module is used to perform multi-scale feature fusion between the defect feature distribution map and the original multispectral image to construct a defect-enhanced image set; The defect feature distribution map is fused with the original multispectral image at multiple scales to construct a defect-enhanced image set, including: The defect feature distribution map is decomposed into Gaussian pyramids to generate a multi-scale feature map containing different spatial frequencies; The multi-scale feature map is matched with the corresponding scale layer of the original multispectral image by convolution kernel matching, and a feature mapping relationship is established by 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 spectral preservation properties; The fused feature layer is inversely synthesized using the Laplacian pyramid reconstruction algorithm to output a defect-enhanced image set containing defect enhancement information.
8. 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 invoked and executed by the processing component to implement the method for imaging surface defects of precision metal parts under complex light field interference environment as described in any one of claims 1 to 6.
9. A computer storage medium, characterized in that, The device contains a computer program that, when executed by a computer, implements a method for imaging surface defects of precision metal parts under complex light field interference environment as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Workpiece defect detection method and device based on event camera
CN116363065A
Smart infrared image scene enhancement method
WO2019144581A1