Image recognition-based aluminum plate surface feature extraction system
Patent Information
- Application Number
- CN202611178124.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-10-23
AI Technical Summary
[0004]本发明的目的在于提供基于图像识别的铝板表面特征提取系统,解决以下技术问题:现有铝板表面检测技术在面对工况波动导致的特征提取不稳定,以及高光纹理误判与细浅缺陷响应不足方面存在明显不足,亟待提出一种能够更精准处理反光纹理干扰、稳定增强并融合缺陷特征的提取系统
[0018]本系统通过工况归一化模块补偿工况波动,利用反光分离与频域滤波模块生成反光抑制系数并滤除轧制纹理,再结合模糊强度参数构建方向卷积核进行缺陷增强与轮廓融合。该方案有效降低了高光边界和纹理变化引起的误判,增强了浅层及细长缺陷的边缘连续响应,提升了铝板在线检测的准确性与稳定性。
Smart Images

Figure CN122966972A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial surface inspection and machine vision technology, specifically to an aluminum plate surface feature extraction system based on image recognition. Background Technology
[0002] Surface defect detection of aluminum plates is an important part of quality control in continuous production. It usually requires the acquisition and analysis of images of aluminum plate surfaces during the transportation process to identify scratches, cracks, indentations and other abnormal surface features. With the development of industrial vision inspection technology, image processing-based surface inspection methods are gradually being applied to high-speed production lines. These methods can perform online inspection of aluminum plate surfaces in continuous production and output defect locations and related feature information.
[0003] However, in the actual continuous conveying and inspection of aluminum plates, surface reflection, rolling texture, motion blur, and changes in working conditions often jointly affect image quality, making existing image detection methods prone to misjudging highlight boundaries or texture changes as defects, or resulting in insufficient response to shallow and slender defects, affecting detection accuracy and stability. In particular, under different production line speeds, exposure times, light source brightness, and camera gain conditions, traditional processing methods are still easily limited by fluctuations in working conditions, resulting in unstable defect feature extraction results. Summary of the Invention
[0004] The purpose of this invention is to provide an image recognition-based aluminum plate surface feature extraction system to solve the following technical problems: Existing aluminum plate surface detection technologies suffer from significant shortcomings in feature extraction due to fluctuations in operating conditions, as well as in the misjudgment of highlight textures and insufficient response to shallow defects. There is an urgent need for an extraction system that can more accurately handle reflective texture interference and stably enhance and fuse defect features. To achieve the above objective, this invention adopts the following technical solution:
[0005] The aluminum plate surface feature extraction system based on image recognition includes an image acquisition module, a working condition normalization module, a reflection separation module, a frequency domain filtering module, a defect enhancement module, a contour fusion module, and a feature output module connected in sequence. The image acquisition module is used to acquire the original image of the aluminum plate surface and simultaneously acquire working condition parameters. The working condition normalization module is used to perform grayscale normalization compensation on the original image based on a preset working condition compensation rule, and determine the blur intensity parameter according to the working condition parameters to generate a working condition normalized image.
[0006] The reflection separation module is used to construct a local pixel parameter set based on the gradient of the normalized image under the working condition and the local brightness in the preset neighborhood, determine the gradient direction and edge change based on the local pixel parameter set, and generate a reflection suppression coefficient and a defect retention coefficient by combining the local brightness, the gradient direction and the edge change to obtain the defect image to be inspected.
[0007] The frequency domain filtering module is used to perform frequency domain transformation and spectral direction analysis on the defect image to be inspected to generate a filtered image; the defect enhancement module is used to construct a directional convolution kernel based on the local gradient direction, the blur intensity parameter and the intermediate parameters output by the reflection separation module to enhance the filtered image and generate an enhanced image and a defect retention image.
[0008] The contour fusion module is used to fuse the filtered image and the enhanced image according to the edge continuity to generate a final defect feature map; the feature output module is used to determine the defect response value and adaptive discrimination threshold based on the final defect feature map, generate a defect candidate mask, and output the defect candidate mask and feature data including at least one of the final defect feature map, the defect retention map, the defect retention coefficient and the edge continuity.
[0009] Preferably, the processing procedure of the working condition normalization module for the original image of the aluminum plate surface includes: receiving the production line speed, exposure time, light source brightness, and camera gain acquired by the image acquisition module as the working condition parameters; performing grayscale normalization compensation on the original image of the aluminum plate surface based on the light source brightness and the camera gain to generate the working condition normalized image; and determining the blur intensity parameter based on the production line speed and the exposure time.
[0010] Preferably, the processing procedure of the reflection separation module for the normalized image of the working condition includes: acquiring the horizontal first-order gradient and the vertical first-order gradient of the normalized image of the working condition, and constructing a local pixel parameter set composed of the horizontal first-order gradient, the vertical first-order gradient, and the local brightness in a preset neighborhood of the normalized image of the working condition; calculating the gradient homing degree and the edge change degree based on the local pixel parameter set; generating the reflection suppression coefficient and the defect retention coefficient according to a preset mapping rule, combining the local brightness, the gradient homing degree, and the edge change degree; and performing weighted fusion on the normalized image of the working condition based on the defect retention coefficient to obtain the defect image to be inspected.
[0011] Preferably, the frequency domain filtering module processes the image of the defect to be inspected as follows: performing a two-dimensional frequency domain transformation on the image of the defect to be inspected to generate a two-dimensional spectrum; calculating the spectral direction angle of the two-dimensional spectrum and determining the main direction of the texture based on the energy distribution of the spectral direction angle; determining the center frequency based on the two-dimensional spectrum; constructing directional filtering coefficients by combining the main direction of the texture and the center frequency; applying the directional filtering coefficients to the two-dimensional spectrum and generating the filtered image through inverse transformation.
[0012] Preferably, the defect enhancement module's processing of the filtered image includes: calculating the local gradient direction and local gradient intensity on the filtered image; determining the major axis scale of the convolution kernel based on the blur intensity parameter and the degree of gradient symmetry, and determining the minor axis scale of the convolution kernel based on the local gradient intensity; determining the convolution kernel orientation angle by combining a preset blur correction angle and the local gradient direction; generating a defect retention map based on the local gradient intensity, the degree of edge change, and the reflection suppression coefficient; and performing convolution processing on the filtered image using the constructed directional convolution kernel to generate the enhancement map.
[0013] Preferably, the feature fusion process of the contour fusion module includes: calculating the neighborhood average reflection suppression coefficient based on the reflection suppression coefficient; determining the edge gradient threshold based on the local gradient intensity, the preset basic gradient threshold, the neighborhood average reflection suppression coefficient, and the blur intensity parameter; extracting effective edge points based on the local gradient intensity and the edge gradient threshold; and calculating the average local gradient direction of the effective edge points as the average principal gradient direction.
[0014] The edge continuity is determined based on the edge gradient threshold and the mean of the principal gradient direction; the filter image fusion coefficient and the enhancement image fusion coefficient are determined based on the edge continuity; the filter image and the enhancement image are weighted and summed using the filter image fusion coefficient and the enhancement image fusion coefficient to generate the final defect feature map.
[0015] Preferably, the process of the feature output module outputting the feature data includes: receiving the final defect feature map, the defect retention map, the defect retention coefficient, and the edge continuity; combining the final defect feature map, the defect retention map, the defect retention coefficient, and the edge continuity to form the feature data, and outputting it for external classification processing to call.
[0016] Preferably, the process of the feature output module generating the defect candidate mask includes: determining a defect response value based on the final defect feature map, the defect retention map, and the edge continuity; determining an adaptive discrimination threshold based on the defect response value; marking pixels with defect response values greater than or equal to the adaptive discrimination threshold as defect candidate pixels, and marking pixels with defect response values less than the adaptive discrimination threshold as non-candidate pixels, so as to generate the defect candidate mask.
[0017] The advantages of this invention are:
[0018] This system compensates for fluctuations in operating conditions through a normalization module, generates a reflection suppression coefficient and filters out rolling textures using a reflection separation and frequency domain filtering module, and then constructs a directional convolution kernel based on fuzzy intensity parameters to enhance defects and fuse contours. This approach effectively reduces misjudgments caused by specular boundaries and texture variations, enhances the edge continuity response of shallow and slender defects, and improves the accuracy and stability of online aluminum plate inspection. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the functional modules of the image recognition-based aluminum plate surface feature extraction system of this application. Detailed implementation method.
[0021] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0022] like Figure 1 As shown, the aluminum plate surface feature extraction system based on image recognition includes an image acquisition module, a working condition normalization module, a reflection separation module, a frequency domain filtering module, a defect enhancement module, a contour fusion module, and a feature output module connected in sequence.
[0023] The image acquisition module acquires the original image of the aluminum plate surface and simultaneously collects operating parameters;
[0024] The working condition normalization module performs grayscale normalization compensation on the original image based on preset working condition compensation rules, determines the blur intensity parameter according to the working condition parameters, and generates a working condition normalized image.
[0025] The reflection separation module constructs a local pixel parameter set based on the gradient of the normalized image under working conditions and the local brightness of the preset neighborhood, determines the gradient direction and edge change, and generates a reflection suppression coefficient and a defect retention coefficient by combining the local brightness of the preset neighborhood, the gradient direction and edge change, thus obtaining the defect image to be inspected.
[0026] The frequency domain filtering module performs frequency domain transformation and spectral direction analysis on the defect image to be inspected, and generates a filtered image.
[0027] The defect enhancement module constructs an oriented convolution kernel based on the local gradient direction, blur intensity parameters, and the reflection suppression coefficient and defect retention coefficient output by the reflection separation module. This kernel enhances the filtered image and generates an enhanced image and a defect retention image.
[0028] The contour fusion module fuses the filtered image and the enhanced image based on the degree of edge continuity to generate the final defect feature map;
[0029] The feature output module determines the defect response value and adaptive discrimination threshold based on the final defect feature map, generates and outputs a defect candidate mask, and outputs feature data containing at least one of the final defect feature map, defect retention map, defect retention coefficient and edge continuity.
[0030] The processing steps of the operating condition normalization module for the original image include:
[0031] The image acquisition module collects production line speed, exposure time, light source brightness, and camera gain as operating parameters.
[0032] The original image is compensated for grayscale normalization based on the light source brightness and camera gain to generate a normalized image of the working condition.
[0033] The blur intensity parameters are determined based on the production line speed and exposure time.
[0034] The processing steps of the reflection separation module for the normalized image of the working condition include:
[0035] Obtain the first-order gradient of the horizontal and vertical axes of the normalized image under working conditions, and construct a local pixel parameter set consisting of the first-order gradient of the horizontal axis, the first-order gradient of the vertical axis, and the local brightness in the preset neighborhood of the normalized image under working conditions.
[0036] The gradient directionality and edge variation are calculated based on the local pixel parameter set.
[0037] Based on the preset mapping rules, the reflection suppression coefficient and defect retention coefficient are generated by combining local brightness, gradient unidirectionality and edge change.
[0038] The defect image to be inspected is obtained by weighted fusion of the normalized image based on the defect retention coefficient.
[0039] In this embodiment, the system is applied to the continuous conveying and detection of aluminum plates; the image acquisition module can use a line scan camera or an area scan camera, in conjunction with an industrial light source to acquire the original grayscale image of the aluminum plate surface; the acquisition control unit in the image acquisition module outputs the original image while simultaneously reading the production line speed, exposure time, light source brightness and camera gain, and sends the original image and the corresponding working condition parameters to the working condition normalization module.
[0040] There is a physical lag in the data bus transmission between the production line programmable logic controller and the light source controller. The synchronous reading process is as follows: the acquisition control unit assigns a unique timestamp based on the same hardware trigger pulse issued by the encoder, stores the production line speed, light source brightness and camera gain latched at the trigger moment into the corresponding timestamp buffer, and matches and packages the image data according to the timestamp when it is output, so as to ensure that the working condition parameters transmitted to the front-end module accurately represent the actual physical state of the current frame.
[0041] The aforementioned operating parameters refer to objective physical quantities that directly affect image brightness and motion blur. Production line speed corresponds to the movement state of the aluminum plate relative to the camera, exposure time corresponds to the single image integration time, and light source brightness and camera gain correspond to the input light intensity and magnification of the imaging system.
[0042] The operating condition normalization module is executed by the preprocessing program in the industrial computer. This module is triggered upon receiving the complete original image and corresponding operating condition parameters. During execution, the preprocessing program first reads the light source brightness and camera gain, and then calls the pre-calibrated brightness and gain calibration coefficients to perform grayscale normalization compensation pixel-by-pixel on the original image. The grayscale values of the operating condition normalized image are then calculated. It can be obtained from the original grayscale value The calculation shows that, Spatial coordinates of image pixels:
[0043]
[0044] Among them, the brightness of the introduced light source With camera gain The calibration coefficients obtained during the equipment installation and commissioning phases are used in conjunction with these calibration coefficients. and And superimpose a value set to Stability constant within the range To avoid the denominator being zero; through the above normalization compensation, the overall grayscale fluctuations caused by different lighting and gain conditions are compressed to a stable range, so that subsequent modules can directly compare the structural differences of different pixel regions.
[0045] After completing the grayscale normalization compensation, the working condition normalization module continues to determine the blur intensity parameters based on the production line speed and exposure time. Since the continuous movement of the aluminum plate will form a trail in the imaging direction, the module first determines the calculation rule for the equivalent blur length as follows: multiply the pixel displacement coefficient obtained by converting the field of view size and camera resolution, the production line speed, and the exposure time.
[0046] The specific rule for compressing the equivalent blur length to a normalized range and obtaining the blur intensity parameter is as follows: divide the equivalent blur length by the sum of the equivalent blur length and the blur saturation control constant, where the preferred range of the blur saturation control constant can correspond to the empirical value of the allowable edge expansion width, for example, it can be 5 to 15 pixels; when the equivalent blur length is less than the set blur length threshold, it indicates that the degree of motion trailing is lower than the set trailing threshold, and the blur intensity parameter is configured to the first preset parameter range.
[0047] When the equivalent blur length is greater than or equal to the set blur length threshold, the blur intensity parameter increases by a preset ratio to adjust the convolution kernel scale during subsequent directional enhancement; the working condition normalization module outputs a working condition normalized image and blur intensity parameters corresponding to the current production line speed and exposure conditions to provide a basis for subsequent enhancement steps.
[0048] The reflection separation module continues execution by the image processing program, and its input is the normalized image of the working condition. The local pixel parameter set here refers to a set of pixel descriptions obtained by jointly recording the horizontal first-order gradient, the vertical first-order gradient, and the local brightness around the current pixel in a preset neighborhood. This module performs first-order difference on the normalized image of the working condition to obtain the horizontal first-order gradient and the vertical first-order gradient. At the same time, it calculates the local brightness mean in the preset neighborhood centered on the current pixel. This neighborhood can be a square area with a side length of several pixels, preferably five to nine pixels, to stably estimate the brightness of the current area without over-smoothing small defects.
[0049] After obtaining the horizontal gradient, vertical gradient, and local brightness, the reflection separation module constructs a local pixel parameter set and further calculates the gradient directionality and edge variation. The gradient directionality is used to characterize the edge direction consistency in the neighborhood. When the consistency parameter is greater than the set consistency threshold, it is determined to be a specular highlight or a stable texture boundary. The edge variation is used to reflect the discrete characteristics of the gradient magnitude in the neighborhood. When the dispersion is greater than the set dispersion threshold, it is determined to be an irregular defect boundary.
[0050] In actual processing, the horizontal and vertical first-order gradients of each pixel in the local neighborhood are used to construct... The gradient covariance matrix of dimension, where the main diagonal elements are the sum of squares of the horizontal and vertical gradients, and the side diagonal elements are the sum of the products of the horizontal and vertical gradients.
[0051] Find the principal and secondary eigenvalues of the matrix. The principal eigenvalues represent the energy concentration along the principal gradient direction. Divide the difference between the principal and secondary eigenvalues by the sum of the principal and secondary eigenvalues, and then add a very small positive real constant to prevent the denominator from being zero. This is used as a quantitative indicator of directional consistency, that is, the degree of gradient alignment. The closer this value is to 1, the more consistent the directions are.
[0052] To determine the degree of edge variation, the mean value of the gradient magnitude within the local neighborhood is first calculated. Then, the sum of the absolute values of the differences between the gradient magnitude of each pixel and the mean value is obtained and divided by the mean value and the total number of neighboring pixels to represent the degree of edge variation. The reflection separation module uses brightness, direction consistency and edge dispersion to distinguish between reflections and defects.
[0053] The reflection suppression coefficient and the defect retention coefficient are generated by a preset mapping rule. The preset mapping rule can adopt an S-shaped nonlinear mapping, so that the region where the brightness and direction consistency parameters are both greater than the corresponding first set threshold and the edge change parameter is less than the second set threshold is configured with the first reflection suppression coefficient; and the region where the edge change parameter is greater than the second set threshold and the direction consistency parameter is less than the first set threshold is configured with the first defect retention coefficient.
[0054] The reflection suppression coefficient is calculated by applying a nonlinear S-shaped mapping to the weighted combination of brightness, gradient direction, and edge variation of the normalized image under working conditions. Brightness and gradient direction have positive weighting coefficients, while edge variation has negative weighting coefficients. All of the above weighting coefficients are positive values and can be determined by minimizing the joint result of false highlight detection and false defect detection on the labeled sample set. The preferred initial value can be set to a set of similar positive numbers so that brightness, direction, and dispersion factors participate in the judgment together.
[0055] Specifically, the process of applying the S-shaped nonlinear mapping is as follows: first, construct the determination variables. Its value is the positive weighted sum of the brightness and gradient direction of the normalized image under working conditions, minus the negative weighted term of the edge change degree, using a coefficient that controls the mapping steepness. With the judgment center offset constant Calculate the reflection suppression coefficient:
[0056]
[0057] in, For the natural constant An exponential function with base 0.5, the same applies below; For the current pixel The independent variable for determination; the defect retention coefficient is calculated as the difference between the constant 1 and the reflection suppression coefficient;
[0058] After the coefficients are generated, the reflective separation module multiplies the defect retention coefficients with the corresponding coordinates of the normalized image in the spatial domain one by one to obtain the defect image to be inspected; the gray value of the highlight area is reduced to the preset gray range in response to the defect retention coefficients that are less than the first preset threshold.
[0059] Local irregular edges respond to a defect retention coefficient greater than the second preset threshold, and their gray values are retained according to a preset weight coefficient. As a result, the image entering the subsequent frequency domain filtering module is no longer the unseparated original image, but the image of the defect to be inspected after working condition compensation and reflection suppression. This image has a low response to mirror boundaries and a high response to random defect structures, which helps to reduce subsequent false detections.
[0060] When both bright stripe reflections and shallow scratches exist on the surface of an aluminum plate, directly applying a uniform threshold to the original image will cause the bright stripe edges to generate a higher response than the scratches. This implementation first normalizes the light source brightness and camera gain, and then constructs a defect retention coefficient using the gradient directionality and edge change degree. This significantly reduces the response weight of the bright stripe reflection area, while keeping the scratch edges visible, thus providing input with higher feature saliency for subsequent texture suppression and orientation enhancement. The result is reflected in a reduction of the false detection area of highlights, and the shallow defect boundaries remain distinguishable after processing.
[0061] In this embodiment, the processing procedure of the frequency domain filtering module for the defect image to be inspected includes:
[0062] A two-dimensional frequency domain transformation is performed on the defect image to be inspected to generate a two-dimensional spectrum;
[0063] Calculate the spectral direction angle of the two-dimensional spectrum, and determine the main direction of the texture based on the energy distribution of the spectral direction angle;
[0064] Determine the center frequency based on the two-dimensional spectrum;
[0065] Construct directional filter coefficients by combining the main direction of the ripple and the center frequency;
[0066] The directional filtering coefficients are applied to the two-dimensional spectrum and then inversely transformed to generate the filtered image.
[0067] The defect enhancement module's processing of the filtered image includes:
[0068] Calculate the local gradient direction and local gradient intensity on the filtered image;
[0069] The major axis scale of the convolution kernel is determined based on the fuzziness intensity parameter and the degree of gradient alignment, and the minor axis scale of the convolution kernel is determined based on the local gradient intensity.
[0070] The kernel orientation angle is determined by combining the preset fuzz correction angle and the local gradient direction;
[0071] Defect retention maps are generated based on local gradient intensity, edge variation degree, and reflection suppression coefficient;
[0072] The filtered image is convolved using the constructed directional convolution kernel to generate an enhanced image.
[0073] The feature fusion process of the contour fusion module includes:
[0074] The neighborhood average reflection suppression coefficient is calculated based on the reflection suppression coefficient, and the edge gradient threshold is determined based on the local gradient intensity, the preset basic gradient threshold, the neighborhood average reflection suppression coefficient, and the blur intensity parameter.
[0075] Effective edge points are extracted based on local gradient intensity and edge gradient threshold, and the average local gradient direction of the effective edge points is calculated as the average principal gradient direction. The degree of edge continuity is determined based on the edge gradient threshold and the average principal gradient direction.
[0076] The filtering graph fusion coefficient and the enhancement graph fusion coefficient are determined based on the degree of edge continuity.
[0077] The filtered image and the enhanced image are weighted and summed using the fusion coefficients of the filtered image and the fusion coefficients of the enhanced image, respectively, to generate the final defect feature map.
[0078] In this embodiment, the frequency domain filtering module, the defect enhancement module, and the contour fusion module are executed sequentially by the frequency domain processing program, the enhancement processing program, and the fusion processing program in the industrial computer. Their inputs are the defect image to be inspected output by the previous module, the blur intensity parameters, and the intermediate parameters obtained during reflection separation. The aforementioned intermediate parameters include the gradient unidirectionality, the edge change degree, and the reflection suppression coefficient, all of which correspond to the local structural state of the aluminum plate surface. The calculation objects of the subsequent modules correspond to the actual surface texture, reflection, and trailing conditions.
[0079] The prerequisite for the frequency domain filtering module is that the image of the defect to be inspected has been obtained. The two-dimensional frequency domain transformation here refers to converting the gray-level changes in the spatial domain into the energy distribution in the frequency domain, which is used to identify the directional concentration phenomenon of stable rolling texture in the spectrum. During execution, the frequency domain processing program performs a fast Fourier transform on the image of the defect to be inspected to obtain a two-dimensional spectrum. For each frequency point in the spectrum, the arctangent function of the ratio of the vertical and horizontal frequency coordinates is calculated to obtain the spectral direction angle, and the energy is accumulated in different directions to form a directional energy distribution.
[0080] Directional energy can be obtained by summing the squares of the spectral amplitudes in the corresponding direction. Since rolling textures usually form a strong energy band along a certain stable direction, the direction with the largest directional energy can be taken as the main direction of the texture. If the system records the rolling direction parameters synchronously, the frequency domain module can further verify whether the current main direction falls within the allowable deviation range of the direction to eliminate the interference of occasional defects on the judgment of the main direction.
[0081] After determining the main direction of the texture, the frequency domain filtering module continues to determine the center frequency from the two-dimensional spectrum; the aforementioned center frequency refers to the frequency radius where the energy band distribution is most concentrated along the main direction; the processing program can extract the spectrum energy profile along the main direction and find the frequency radius corresponding to the peak as the center frequency;
[0082] A directional filtering coefficient is constructed by combining the main direction of the rolling texture and the center frequency. The function of the directional filtering coefficient is to suppress the frequency region corresponding to the rolling texture, while preserving as much as possible the random frequency components related to defect edges. The calculation is performed using a dual constraint of direction and frequency:
[0083]
[0084] Calculate the current frequency point Corresponding frequency radius
[0085]
[0086] in, and These are the horizontal and vertical frequency coordinate variables in the two-dimensional frequency domain, respectively;
[0087] This incorporates the inhibition strength. The frequency radius corresponding to the current frequency point With center frequency Differences, spectral direction angle at current frequency point With the main direction of the texture The actual angle difference between them and directional bandwidth and frequency bandwidth ;
[0088] The calculation logic is as follows: extract the absolute difference between the current spectral direction angle and the main direction of the texture, and then take the minimum value of the difference between this absolute difference and π radians; suppress intensity Based on fuzzy intensity parameters The exponential decay rule is adjusted accordingly, specifically calculated as follows:
[0089]
[0090] in, The baseline inhibition coefficient under calibration conditions. This is the fuzzy attenuation control constant; the stronger the fuzziness, the lower the suppression intensity, so as to avoid weakening cracks that are close to the texture direction.
[0091] After the directional filtering coefficients are applied to the two-dimensional spectrum, the corrected spectrum is obtained by multiplying the directional filtering coefficients with the corresponding points of the two-dimensional spectrum, and then the filtered image is obtained by inverse transformation. As a result, the directional interference of the inherent rolling texture of the aluminum plate is suppressed, and the random edges and fine structures in the defects to be inspected are highlighted. The frequency domain filtering module provides an image basis for subsequent spatial domain enhancement by filtering out stable texture background.
[0092] The input to the defect enhancement module is the filtered image, the blur intensity parameter, and the gradient directionality, edge change degree, and reflection suppression coefficient provided by the reflection separation module. The directional convolution kernel here refers to a convolution template whose major axis, minor axis, and orientation angle can all change with the pixel position, and is configured to enhance the pixel response along the direction that satisfies the real edge features.
[0093] The enhancement process first calculates the local gradient direction and local gradient intensity on the filtered image; in the specific structured calculation, the local gradient direction is calculated as the arctangent of the ratio of the vertical gradient to the horizontal gradient of the filtered image; the local gradient intensity is calculated as the square root of the sum of the squares of the horizontal gradient and the vertical gradient.
[0094] After obtaining the local gradient direction and intensity, the defect enhancement module determines the major axis scale of the convolution kernel based on the fuzz intensity parameter and the degree of gradient homology. The greater the fuzz intensity, the more obvious the edge tailing, and the major axis scale should be appropriately increased to compensate for continuity along the tailing direction. The higher the degree of gradient homology, the more continuous the local edge is, and the major axis can also be appropriately extended.
[0095] The major axis scale of the convolution kernel is obtained by multiplying the base scale by a gain factor, which is calculated as a weighted sum of a constant 1 and the blur intensity parameter and the degree of gradient homing. Meanwhile, the minor axis scale is determined based on the local gradient intensity. The stronger the local gradient, the smaller the minor axis scale, in order to avoid introducing irrelevant regions across the specular boundary or wide texture band.
[0096] The processing module sets a safety upper limit for the minor axis dimension. and basic lower limit value And through local gradient intensity The specific mapping formula for dynamically determining the value using an exponential inverse proportional mapping is as follows:
[0097]
[0098] in, The minor axis scale of the convolution kernel. The preset gradient response shrinkage coefficient; taking a strong reflective scratch as an example, when the local gradient is greater than the set high gradient threshold, the short axis scale is adjusted to the preset lower limit value, so that the directional convolution kernel forms the first aspect ratio shape, so as to avoid non-target textures or noise with a distance less than the set distance threshold being synchronously fused.
[0099] For indentation edges with contrast below a set threshold, when the local gradient is less than the set gradient threshold, the minor axis scale is increased by a set ratio to fuse the energy of neighboring pixels within a preset vertical range; thus, the directional convolution kernel takes on a first aspect ratio form when the blur intensity parameter is greater than the first threshold, and a second aspect ratio form when the local contrast is greater than the second threshold.
[0100] The convolution kernel orientation angle is determined by the preset fuzzy correction angle and the local gradient direction. The preset fuzzy correction angle reflects the compensation relationship between the production line movement direction and the local gradient normal direction, while the local gradient direction reflects the actual orientation of the current edge. The two are superimposed to form the convolution kernel orientation angle, which is the sum of the local gradient direction and the preset fuzzy correction angle. The oriented convolution kernel compensates for known movement directions when there is motion tail.
[0101] The defect preservation map is generated jointly by the local gradient intensity, the degree of edge variation, and the reflection suppression coefficient; the aforementioned defect preservation map is used to reflect the degree to which the current pixel is more likely to belong to a real defect rather than a specular boundary; its generation can be achieved using a sigmoid mapping function. , local gradient intensity Degree of edge change and reflectivity suppression coefficient Set weight coefficients respectively , , Then, the images are combined to calculate the pixel values in the defect-preserving image. ;
[0102] Since the reflection suppression coefficient is used as a negative weighting parameter in the above calculation relationship, when the local gradient of a highly reflective region is greater than the set threshold, its response value in the defect retention map is still configured to be lower than the target response threshold; while locations with obvious local gradients and large edge changes will obtain higher responses.
[0103] The enhancement processing program calls directional convolution kernels to perform pixel-by-pixel convolution processing on the filtered image, generating an enhanced image. The internal weight distribution of the aforementioned directional convolution kernels is generated by an anisotropic Gaussian model. The specific steps are as follows: within a preset window around the current pixel, a local coordinate system is established with the center of the window as the reference point. Based on the direction angle of the convolution kernel Perform rotation to obtain the corresponding coordinates aligned along the major and minor axes. ,Right now , ;
[0104] Based on the corresponding coordinates , kernel major axis scale and the short axis scale of the convolution kernel Calculate the weighting coefficients:
[0105]
[0106] and all within the local window The specific convolutional template matrix is obtained by performing sum normalization. The major axis scale, minor axis scale, and orientation angle of the convolutional kernel are all controlled by the aforementioned results, so the convolutional template used at different positions is not the same. For narrow defects such as fine cracks, the convolutional kernel will generate continuous enhancement along its edge direction. For specular boundaries, the enhancement amplitude is limited due to the constraints of the defect preservation map and the reflection suppression coefficient. After the enhancement map is output, it not only preserves the background after the stable texture has been removed in the filtered image, but also further enhances the narrow defect edges affected by blur.
[0107] The contour fusion module starts working after receiving the filtered image, the enhanced image, the local gradient intensity, the reflection suppression coefficient, and the blur intensity parameters. The edge continuity here refers to the proportion of pixels in a local neighborhood that meet the effective gradient conditions and have small changes in the main gradient direction. The contour fusion module first determines the edge gradient threshold. This threshold is not a fixed constant, but is given by the local gradient intensity, the preset basic gradient threshold, the reflection suppression coefficient, and the blur intensity parameters.
[0108] The specific calculation logic of the edge gradient threshold is as follows: multiply the basic gradient threshold by a dynamic adjustment factor, which is equal to a weighted value plus the neighborhood average reflection suppression coefficient and minus the weighted value of the blur intensity parameter; when the neighborhood average reflection suppression coefficient is greater than the first set threshold, the edge gradient threshold is increased to avoid the highlight boundary being identified as a stable contour; when the blur intensity parameter is greater than the second set threshold, the edge gradient threshold is decreased to prevent defects from being filtered out due to tailing.
[0109] After obtaining the edge gradient threshold, the contour fusion module counts whether the gradient intensity in the neighborhood exceeds the threshold, and calculates the edge continuity by combining the mean of the main gradient direction. In the specific implementation, the contour fusion module counts the pixels with local gradient intensity greater than or equal to the edge gradient threshold in the local window centered on the current pixel as effective edge points, and calculates the proportion of effective edge points.
[0110] Meanwhile, the average local gradient direction of these effective edge points is taken as the average principal gradient direction, and the average directional deviation between the gradient direction of all effective edge points and the average principal gradient direction is calculated. The degree of edge continuity is derived from the constraint relationship between the proportion of effective edge points and the average directional deviation: in specific numerical calculations, it is equivalent to dividing the proportion of effective edge points by the sum of the ratio of the average directional deviation and the maximum allowable deviation angle after normalization and the preset small anti-zero constant, thereby forming a positively correlated continuity measure.
[0111] The higher the proportion of effective edge points and the smaller the deviation of the direction of each point from the average direction of the principal gradient, the higher the metric value, indicating that the local edge extends coherently along a single direction, which is judged as a high degree of continuity. For example, if the effective edge points in a local neighborhood are arranged in a straight line and have the same direction, the edge continuity is close to the highest value. If the effective edge points are sparse or the directions are scattered, the continuity will decrease accordingly. When the edge continuity is greater than the set continuity threshold, it indicates that the edge after frequency domain filtering meets the preset integrity condition. When the edge continuity is less than the set continuity threshold, it indicates that the edge has broken or trailing features.
[0112] Therefore, the contour fusion module determines the filtering map fusion coefficient and the enhancement map fusion coefficient based on the edge continuity. The filtering map fusion coefficient is determined by: taking the currently calculated edge continuity... As input, a biased sigmoid function is used for transformation, with the specific mapping formula as follows:
[0113]
[0114] in, These are the fusion coefficients of the filtered graph. To incorporate the steepness coefficient, To distinguish between high and low continuity, a center threshold is used to non-linearly amplify the distinction between high and low continuity regions; while the enhancement image fusion coefficient is calculated as the difference between a constant 1 and the filter image fusion coefficient.
[0115] The contour fusion module performs a weighted summation of the filtered image and the enhanced image to generate the final defect feature map. The specific calculation method is as follows: using the fusion coefficients of the filtered image and the fusion coefficients of the enhanced image as weights, multiply them by the corresponding pixels of the filtered image and the enhanced image respectively, and then sum them.
[0116] The generated final defect feature map integrates two types of information: one is the texture decoupling result with low interference after frequency domain filtering, and the other is the more continuous edge result after spatial domain enhancement. For areas where the edges are already relatively clear, the final feature map retains more frequency domain results. For areas with heavy tailing or local breakage, the final feature map incorporates more enhancement results to reduce the interruption of slender defects.
[0117] When a surface simultaneously contains a texture band along the rolling direction and fine cracks parallel to it, using only directional filtering will cause the cracks to decay synchronously. In this implementation, the energy of the main texture is first reduced by frequency domain filtering, and then directional convolution kernels are constructed based on the fuzzing intensity and local gradient direction to recover the edges of the fine cracks. The edges are then adaptively fused according to their continuity. In the final defect feature map after processing, the stable texture is reduced, while the continuous response of the cracks is preserved, thus providing more reliable basic features for the subsequent output module.
[0118] In this embodiment, the process of the feature output module outputting feature data includes:
[0119] Receive the final defect feature map, defect retention map, defect retention coefficient, and edge continuity.
[0120] The final defect feature map, defect retention map, defect retention coefficient, and edge continuity are combined to form feature data, which is then output for external classification processing.
[0121] The process of generating defect candidate masks by the feature output module includes:
[0122] The defect response value is determined based on the final defect feature map, defect retention map, and edge continuity.
[0123] Determine the adaptive discrimination threshold based on the defect response value;
[0124] Pixels with defect response values greater than or equal to the adaptive discrimination threshold are marked as defect candidate pixels, and pixels with defect response values less than the adaptive discrimination threshold are marked as non-candidate pixels, in order to generate a defect candidate mask.
[0125] In this embodiment, the feature output module runs in an industrial computer or edge processing unit, and its input comes from the contour fusion module and the pre-enhancement module. This module undertakes two tasks: first, to organize feature data that can be called by external classification processing; second, to generate defect candidate masks for subsequent segmentation, alarm or manual review. Here, the external classification processing can be a subsequent rule-based decision program, segmentation program or defect category recognition program, but in this embodiment, the feature output module itself is only responsible for outputting the current extraction results in a unified format and does not undertake additional classification logic.
[0126] The feature output module receives data including the final defect feature map, defect retention map, defect retention coefficient, and edge continuity. The final defect feature map reflects the main defect response after frequency domain filtering and spatial domain enhancement. The defect retention map reflects the relative degree to which local locations belong to real defects. The defect retention coefficient reflects the retention weight of defect information after reflection separation.
[0127] Edge continuity reflects whether local edges are continuous; the above four types of data correspond to different information sources on the aluminum plate surface in terms of grayscale structure, reflection suppression, and edge connectivity. Therefore, when used as multi-channel feature output, they can provide a more complete basis for subsequent external processing than a single grayscale image.
[0128] In the specific output, the feature output module combines the final defect feature map, defect retention map, defect retention coefficient, and edge continuity degree into feature data according to the pixel position; this feature data can be organized into a multi-channel feature tensor containing the final defect feature map, defect retention map, defect retention coefficient, and edge continuity degree.
[0129] The output module stores the combined result of the multi-channel feature tensor into a shared buffer or result data area for external classification processing; external modules can directly call the feature data for processing, reducing redundant calculations.
[0130] In addition to outputting feature data, the feature output module also generates a defect candidate mask. The defect candidate mask is a binary result that marks the locations where defects may exist in the current image, which is used for subsequent defect region extraction. Before generation, the output module determines the defect response value based on the final defect feature map, the defect preservation map, and the edge continuity.
[0131] An optional method for calculating the defect response value is as follows: multiply the pixel value of the final defect feature map by the pixel value of the defect retention map, and multiply by a topology gain factor. The topology gain factor is equal to the product of the topology enhancement coefficient and the edge continuity. The topology enhancement coefficient is a preset structural constant used to characterize the influence of the aspect ratio of the surface texture on the visual response. The topology enhancement coefficient is a positive number, preferably ranging from 0.5 to 2.0, and is used to adjust the gain amplitude of the elongated feature response value.
[0132] When using this combinational logic, the final defect feature map provides the main response intensity, the defect retention map is used to suppress highlights and false edges, and the edge continuity is used to improve the response value of long strip-shaped defects such as continuous fine cracks and fine scratches. If a pixel has a high gray level, but the defect retention map value is low or the edge continuity is poor, its final response will not be abnormally high, thereby reducing mislabeling.
[0133] After obtaining the defect response values of the entire image, the feature output module determines the adaptive discrimination threshold based on the defect response values. This threshold is not fixed in advance, but is calculated based on the response statistical characteristics of the current image. The adaptive discrimination threshold is specifically calculated as: the mean of all defect response values in the current image plus the product of the threshold control coefficient and the standard deviation of the defect response value.
[0134] This threshold control coefficient is a hyperparameter for controlling the stringency. Its value can be determined on the validation samples based on the balance between the false negative rate and the false positive rate. The preferred value range is 2.0 to 4.0, which means that only responses that deviate from the mean by more than 2 to 4 standard deviations are considered as high-confidence candidate defects. When the overall image noise is high, the standard deviation increases and the threshold increases accordingly. When the overall image is relatively stable and the defect contrast is obvious, the standard deviation is small and the threshold decreases accordingly. The adaptive discrimination threshold is automatically adjusted according to the working conditions and image quality changes to improve stability under different brightness and texture backgrounds.
[0135] After the threshold calculation is completed, the feature output module compares the defect response value with the adaptive discrimination threshold pixel by pixel; thus forming a defect candidate mask: when the defect response value of a pixel is greater than or equal to the adaptive discrimination threshold, the mask takes a value of one at that pixel, otherwise it takes a value of zero; after the mask is output, it can be directly called by the connected component extraction program, alarm display program or subsequent classification program;
[0136] Since the mask's discrimination is based on a combination of the final defect feature map, the defect preservation map, and the degree of edge continuity, rather than a single brightness value, candidate regions are more likely to remain continuous for shallow defects, fine scratches, and minor cracks; while candidate regions are more likely to be excluded for specular boundaries and abrupt changes in rolling texture.
[0137] When there are shallow indentations and irregular reflections on the aluminum plate surface, the feature output module receives the final defect feature map and auxiliary features, and calculates the defect response value. If a certain area is a shallow indentation, its final defect feature map response may not be the highest, but the defect retention map value is high and the edge continuity is relatively stable. Therefore, the overall response can still exceed the adaptive discrimination threshold and be included in the candidate mask. If a certain area is only a highlight boundary, its defect retention map value is low. Even if the final defect feature map is locally bright, it is difficult to pass the discrimination threshold.
[0138] The output retains the candidate defect regions for external programs to classify or filter by area. The overall output process is based on the grayscale information of the aluminum plate surface, fuzzy intensity parameters and structural features to mark the candidate surface defect regions.
[0139] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. An aluminum plate surface feature extraction system based on image recognition, characterized in that, It includes an image acquisition module, a working condition normalization module, a reflection separation module, a frequency domain filtering module, a defect enhancement module, a contour fusion module, and a feature output module connected in sequence; The image acquisition module acquires the original image of the aluminum plate surface and simultaneously collects operating parameters; The working condition normalization module performs grayscale normalization compensation on the original image based on the preset working condition compensation rules, determines the blur intensity parameter according to the working condition parameters, and generates a working condition normalized image. The reflection separation module constructs a local pixel parameter set based on the gradient of the normalized image under the working condition and the local brightness of the preset neighborhood, determines the gradient direction and edge change, and generates a reflection suppression coefficient and a defect retention coefficient by combining the local brightness of the preset neighborhood, the gradient direction and the edge change, thereby obtaining the defect image to be inspected. The frequency domain filtering module performs frequency domain transformation and spectral direction analysis on the defect image to be inspected, and generates a filtered image. The defect enhancement module constructs an oriented convolution kernel based on the local gradient direction, blur intensity parameters, and the reflection suppression coefficient and defect retention coefficient output by the reflection separation module to enhance the filtered image and generate an enhanced image and a defect retention image. The contour fusion module fuses the filtered image and the enhanced image based on the degree of edge continuity to generate the final defect feature map; The feature output module determines the defect response value and adaptive discrimination threshold based on the final defect feature map, generates and outputs a defect candidate mask, and outputs feature data containing at least one of the final defect feature map, defect retention map, defect retention coefficient and edge continuity.
2. The aluminum plate surface feature extraction system based on image recognition according to claim 1, characterized in that, The processing steps of the operating condition normalization module for the original image include: The production line speed, exposure time, light source brightness, and camera gain acquired by the image acquisition module are used as the operating condition parameters. The original image is compensated for grayscale normalization based on the light source brightness and the camera gain to generate the working condition normalized image; The blur intensity parameter is determined based on the production line speed and the exposure time.
3. The aluminum plate surface feature extraction system based on image recognition according to claim 1, characterized in that, The processing procedure of the reflection separation module for the normalized image of the working condition includes: Obtain the horizontal first-order gradient and the vertical first-order gradient of the normalized image of the working condition, and construct a local pixel parameter set composed of the horizontal first-order gradient, the vertical first-order gradient and the local brightness in a preset neighborhood by combining the local brightness of the normalized image of the working condition. The gradient homogeneity and edge variation are calculated based on the local pixel parameter set. Based on a preset mapping rule, the reflection suppression coefficient and the defect retention coefficient are generated by combining the local brightness, the gradient unidirectionality, and the edge change degree. The defect image to be inspected is obtained by weighted fusion of the normalized image of the working condition based on the defect retention coefficient.
4. The aluminum plate surface feature extraction system based on image recognition according to claim 1, characterized in that, The frequency domain filtering module processes the image of the defect to be detected as follows: The image of the defect to be inspected is subjected to a two-dimensional frequency domain transformation to generate a two-dimensional spectrum; Calculate the spectral direction angle of the two-dimensional spectrum, and determine the main direction of the texture based on the energy distribution of the spectral direction angle; The center frequency is determined based on the two-dimensional spectrum. Construct directional filter coefficients by combining the main direction of the texture and the center frequency; The directional filtering coefficients are applied to the two-dimensional spectrum and then inversely transformed to generate the filtered image.
5. The aluminum plate surface feature extraction system based on image recognition according to claim 1 or 3, characterized in that, The defect enhancement module's processing of the filtered image includes: Calculate the local gradient direction and local gradient intensity on the filtered image; The major axis scale of the convolution kernel is determined based on the fuzziness intensity parameter and the gradient homing degree, and the minor axis scale of the convolution kernel is determined based on the local gradient intensity. The convolution kernel orientation angle is determined by combining the preset fuzz correction angle and the local gradient direction; A defect retention map is generated based on the local gradient intensity, the degree of edge change, and the reflection suppression coefficient. The filtered image is convolved using the constructed directional convolution kernel to generate the enhanced image.
6. The aluminum plate surface feature extraction system based on image recognition according to claim 5, characterized in that, The feature fusion process of the contour fusion module includes: The neighborhood average reflection suppression coefficient is calculated based on the reflection suppression coefficient, and the edge gradient threshold is determined based on the local gradient intensity, the preset basic gradient threshold, the neighborhood average reflection suppression coefficient, and the blur intensity parameter. Effective edge points are extracted based on the local gradient intensity and the edge gradient threshold, and the average local gradient direction of the effective edge points is calculated as the average principal gradient direction; the degree of edge continuity is determined based on the edge gradient threshold and the average principal gradient direction. The filter map fusion coefficient and the enhancement map fusion coefficient are determined based on the degree of edge continuity, respectively. The filtered image and the enhanced image are weighted and summed using the fusion coefficients of the filtered image and the enhanced image, respectively, to generate the final defect feature map.
7. The aluminum plate surface feature extraction system based on image recognition according to any one of claims 1 to 6, characterized in that, The process by which the feature output module outputs the feature data includes: Receive the final defect feature map, the defect retention map, the defect retention coefficient, and the edge continuity. The final defect feature map, the defect retention map, the defect retention coefficient, and the edge continuity are combined to form the feature data, which is then output for external classification processing.
8. The aluminum plate surface feature extraction system based on image recognition according to any one of claims 1 to 7, characterized in that, The process by which the feature output module generates the defect candidate mask includes: The defect response value is determined based on the final defect feature map, the defect retention map, and the edge continuity. An adaptive discrimination threshold is determined based on the defect response value; Pixels whose defect response values are greater than or equal to the adaptive discrimination threshold are marked as defect candidate pixels, and pixels whose defect response values are less than the adaptive discrimination threshold are marked as non-candidate pixels, so as to generate the defect candidate mask.