A profile detection method and system for aluminum bar quality inspection based on image recognition technology

By combining multi-angle optical scanning and pseudo-defect morphology prediction maps, a multi-scale curvature amplitude spectrum is generated, which solves the problem of distinguishing between real and pseudo defects in aluminum rod inspection and achieves efficient and accurate aluminum rod quality inspection.

CN121114073BActive Publication Date: 2026-02-17TONGCHUAN YIXINFENG ALUMINUM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511648460.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-02-17
Estimated Expiration
2045-11-12

AI Technical Summary

Technical Problem

Existing aluminum rod inspection technologies struggle to effectively distinguish between real and false defects, resulting in a high false positive rate. Furthermore, single imaging modes cannot simultaneously capture texture details and depth information, while hybrid imaging technologies are costly and difficult to promote in industrial settings.

Method used

A depth parameter matrix is ​​obtained by multi-angle optical scanning. A pseudo-defect morphology prediction map is generated by combining the cooling rate of the aluminum rod, surface temperature and ambient humidity. A multi-scale curvature amplitude spectrum is generated by local neighborhood nonlinear filtering and directional projection transformation. Cross-angle dynamic comparison and adaptive adjustment are performed to achieve high-resolution curvature amplitude sampling.

Benefits of technology

It improved the accuracy and efficiency of aluminum rod quality inspection, reduced the false judgment rate, ensured the reliability and comprehensiveness of quality inspection results, reduced resource waste, and simplified the quality inspection decision-making process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121114073B_ABST
    Figure CN121114073B_ABST
Patent Text Reader

Abstract

This invention discloses a contour detection method and system for aluminum rod quality inspection based on image recognition technology, belonging to the field of computer vision inspection technology. This method utilizes a high-speed optical scanner to scan the surface of the aluminum rod at multiple incident angles, acquiring reflection change curves under different incident angles, and converting the two-dimensional grayscale image into a depth parameter matrix. Simultaneously, during the scanning process, the beam incident angle position, scanning speed, and scanning time sequence are recorded. The obtained depth parameter matrix is ​​subjected to a gradient second-order differential transformation along the contour direction to generate a curvature amplitude spectrum. By scanning the aluminum rod surface at multiple incident angles with a high-speed optical scanner, simultaneously acquiring the reflection change curves and depth parameter matrix, and recording key parameters such as beam incident angle and scanning speed, this method solves the problem of incomplete contour information in traditional single-angle scanning, enabling a more comprehensive characterization of the three-dimensional morphology of the aluminum rod surface and reducing initial feature extraction deviations caused by missing information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision inspection technology, and more specifically, to a contour detection method and system for aluminum rod quality inspection based on image recognition technology. Background Technology

[0002] In the aluminum rod manufacturing process, surface defect detection is a key step in ensuring product quality and subsequent processing accuracy. In particular, aluminum rods after hot rolling and cold rolling processes may have real defects such as scratches, cracks, and dents on their surfaces. Accurate detection is required to achieve quality grading and screening of non-conforming products. With the improvement of industrial automation, manual visual inspection has been gradually replaced by computer vision-based automatic optical inspection technology. This type of technology acquires images of the aluminum rod surface through an optical imaging system, and combines image processing algorithms to analyze contour features to achieve automatic identification and location of defects, thereby improving inspection efficiency and consistency.

[0003] Current mainstream aluminum rod contour detection methods are mainly based on 2D imaging, 3D imaging, or spectral analysis techniques. 2D imaging technology can acquire high-resolution texture details and has good sensitivity to defects such as minor scratches and inclusions. However, due to the limitations of planar projection, it cannot effectively capture depth and normal direction information, making it difficult to distinguish the contour differences between false defects such as oil stains and watermarks and real defects. Although 3D imaging technology can provide surface texture and depth data, it suffers from high computational cost and limited spatial resolution, resulting in insufficient accuracy in identifying subtle false defects such as oxide scale and debris. Spectral analysis methods separate defect features through transform domain processing, which has certain advantages in scenarios with fluctuating illumination. However, it has not been optimized for specific interference sources in aluminum rod production scenarios, and it is still difficult to avoid the risk of misjudgment caused by false defects.

[0004] In industrial production environments, after hot-rolled aluminum bars undergo laminar flow cooling, water stains and irregular outlines formed by water mist are easily left on the surface. The grayscale changes they exhibit in images are highly similar to scratch features, often leading to misjudgment as genuine defects. During cold rolling, oil stains formed by residual rolling oil, debris from oxide scale shedding, and imaging distortion caused by equipment vibration further exacerbate the difficulty of defect identification. At the same time, the high reflectivity of the aluminum bar surface easily creates uneven light and shadow areas, resulting in abnormal grayscale differences between false defects and the background, increasing the probability of false edge detection and making it difficult for traditional algorithms to establish stable defect discrimination criteria.

[0005] While existing detection technologies attempt to suppress interference through image enhancement and threshold segmentation, a systematic solution for pseudo-defects in aluminum rods has not yet been developed. Single imaging modes cannot simultaneously address the complementary needs of texture details and depth information, while hybrid imaging technologies are difficult to promote in industrial settings due to excessively high equipment costs. Defect identification largely relies on fixed parameter models and fails to dynamically adjust detection strategies based on process and environmental parameters such as aluminum rod cooling rate, surface roughness, and ambient humidity, resulting in insufficient feature differentiation between pseudo-defects and real defects. These limitations directly lead to a persistently high false alarm rate in detection systems, increasing not only the workload and production costs of manual re-inspection but also the possibility of missed detections due to real defects being masked by pseudo-defect signals, posing quality risks to subsequent processing and end-use applications. Summary of the Invention

[0006] To address the problems existing in the prior art, the present invention aims to provide a contour detection method and system for aluminum rod quality inspection based on image recognition technology. This method can solve the problem of incomplete contour information in traditional single-angle scanning, and can more comprehensively characterize the three-dimensional morphology of the aluminum rod surface, reducing the deviation in preliminary feature extraction caused by missing information.

[0007] To solve the above problems, the present invention adopts the following technical solution.

[0008] Firstly, a contour detection method for quality inspection of aluminum bars based on image recognition technology includes the following steps:

[0009] Step 1: The surface of the aluminum rod is scanned at multiple incident angles using an optical scanner to obtain the reflection change curves under different incident angles, and the two-dimensional grayscale image is converted into a depth parameter matrix. At the same time, the incident angle position of the beam, the scanning speed and the scanning time sequence are recorded synchronously during the scanning process.

[0010] Step 2: Perform gradient second-order differential transformation on the depth parameter matrix obtained in Step 1 along the contour direction to generate the curvature amplitude spectrum, and apply local neighborhood nonlinear filtering and directional projection transformation to the curvature amplitude spectrum.

[0011] Step 3: Generate a pseudo-defect morphology prediction map based on the cooling rate, surface temperature and thermal expansion coefficient of the aluminum rod, and perform compensation processing on the prediction area during the curvature amplitude spectrum calculation generated in Step 2. At the same time, incorporate the micro-surface roughness parameters of the material and environmental humidity information into the compensation weight calculation in the compensation processing.

[0012] Step 4: Perform cross-angle dynamic comparison and curvature amplitude continuity judgment on the potential defects detected in the curvature amplitude spectrum processed in Step 3, combine the contour differential features to perform correlation matching in multi-scale space, generate defect confidence score, and record the spatial distribution information of each defect.

[0013] Step 5: The defect confidence score generated in Step 4 is used as the dynamic adjustment signal for the next round of scanning. By adjusting the incident angle, scanning speed and beam intensity of the optical scanner, high-resolution curvature amplitude sampling is performed on the predicted area in Step 3. At the same time, an adaptive step size adjustment and angle micro-offset mechanism are introduced into the scanning control to establish a feedback adjustment mechanism between scanning parameters and contour features.

[0014] Furthermore, step 2 also includes:

[0015] Step 21: Perform gradient second-order differential mapping on the obtained depth parameter matrix along the contour direction to generate the curvature amplitude matrix;

[0016] Step 22: Establish a fixed neighborhood around each contour point of the generated curvature amplitude matrix, and perform nonlinear weighted reconstruction on the amplitude values ​​within the fixed neighborhood to form a neighborhood enhancement matrix;

[0017] Step 23: Physically rearrange the points of the generated neighborhood enhancement matrix along the contour direction according to multiple specified projection directions to form a directional curvature projection matrix.

[0018] Step 24: Perform multi-scale spatial resampling on the generated directional curvature projection matrix at different contour length scales to generate a multi-scale curvature amplitude spectrum set;

[0019] Step 25: Adaptive mapping encoding is performed on the generated multi-scale curvature amplitude spectrum set to map amplitude values ​​at different scales to independent encoding spaces while maintaining the correspondence between contour space positions.

[0020] Furthermore, methods for performing nonlinear weighted reconstruction include:

[0021] Step 221: Using the neighborhood amplitude matrix as input, classify the amplitude values ​​in the neighborhood of each contour point according to their relative position at the neighborhood center point and the local curvature gradient to form several response levels.

[0022] Step 222: Map the amplitude value corresponding to each level in the generated response hierarchy to a weighting coefficient. The mapping rule is based on the nonlinear physical mapping relationship constructed by the contour micro-cutting tendency and the neighborhood spatial position.

[0023] Step 223: The generated weighting coefficients are weighted and accumulated point by point in the original amplitude values ​​in the neighborhood to form a neighborhood enhancement matrix, while maintaining the topological relationship of the neighborhood space;

[0024] Step 224: Physically interact and adjust the boundary amplitude values ​​of adjacent neighborhoods in the generated neighborhood enhancement matrix to form the final neighborhood enhancement matrix, and output it.

[0025] Furthermore, step 3 also includes:

[0026] Step 31: Using the cooling rate of the aluminum rod, surface temperature, and thermal expansion rate of the material as inputs, a preliminary pseudo-defect morphology prediction map is generated in the contour space.

[0027] Step 32: Map the corresponding regions in the generated preliminary pseudo-defect morphology prediction map to the material micro-surface roughness parameters to form a roughness annotation prediction map;

[0028] Step 33: Map the corresponding area in the generated roughness annotation prediction map to the environmental humidity parameter to form a corrected pseudo-defect morphology prediction map;

[0029] Step 34: Using the generated curvature amplitude spectrum and the corrected pseudo-defect morphology prediction map as input, the curvature amplitude value is adjusted point by point within the prediction area to form the compensated curvature amplitude spectrum matrix.

[0030] Furthermore, the point-by-point compensation method for curvature amplitude spectrum includes:

[0031] Step 341: Using the corrected pseudo-defect morphology prediction map as input, the marked prediction regions are spatially located in the curvature amplitude spectrum matrix to form a region mapping matrix;

[0032] Step 342: Generate local amplitude compensation weights based on the neighborhood micro-curvature characteristics and material physical parameters of each mapping point in the region mapping matrix.

[0033] Step 343: Using the local amplitude compensation weights generated in step 342 as input, perform point-by-point weighted adjustment on each mapping point in the curvature amplitude spectrum matrix to form a preliminary compensation curvature amplitude spectrum matrix.

[0034] Step 344: Physical continuity adjustment is performed on adjacent mapping points and their neighborhood amplitudes in the generated preliminary compensated curvature amplitude spectrum matrix to form the final compensated curvature amplitude spectrum matrix.

[0035] Furthermore, methods for defect identification and spatial annotation of curvature amplitude spectra include:

[0036] Step 41: Using the set of potential defect points detected in the curvature amplitude spectrum matrix output in Step 3 as input, based on the amplitude response of a single observation angle, a local multi-angle response subdomain for each defect point is constructed, and the curvature response trajectory under a continuous angle sequence is generated by controlling the angular perturbation amplitude of the virtual incident angle.

[0037] Step 42: Using the generated curvature response trajectory as input, perform time-series analysis on the amplitude changes of each defect point along the angle sequence direction, and form an angle evolution chain based on the amplitude offset difference between adjacent angle responses.

[0038] Step 43: Using the formed angular evolution chain as input, extract the contour differential features in the local neighborhood of each defect point, and calculate the contour differential morphology change rate based on the change of amplitude gradient sign.

[0039] Furthermore, the method for defect identification and spatial annotation of curvature amplitude spectrum also includes:

[0040] Step 44: Using the extracted contour differential features as input, generate feature mapping layers at different spatial scales while maintaining consistency of directional parameters, and form a scale correlation matrix of defect morphology through inter-layer structural association.

[0041] Step 45: Using the generated scale correlation matrix as input, perform weighted calculations on the morphological stability of each defect point in multi-scale space to generate a defect credibility score set containing angle sequence integrals.

[0042] Step 46: Using the defect confidence score set as input, spatially relocate each defect according to the spatial coordinate system of the curvature amplitude spectrum, and embed the score results as additional scalar parameters into the coordinate index of the curvature amplitude spectrum to generate a defect spatial distribution map.

[0043] Furthermore, the dynamic adjustment closed-loop method for curvature amplitude scanning control includes:

[0044] Step 51: Obtain the generated defect confidence score set, analyze the spatial distribution of the score values, and generate a modulation parameter set based on the local rate of change of the score gradient. The modulation parameter set includes the incident angle adjustment command, the scanning speed weight, and the beam energy distribution ratio.

[0045] Step 52: Using the modulation parameter set as input, establish the response matrix of the optical scanner. The response matrix is ​​used to physically map the incident angle change, beam intensity and mirror drive electrical signal, and form a control vector corresponding to the modulation parameter space index.

[0046] Step 53: Using the response matrix as input, calculate the step size shrinkage ratio and angle micro-offset based on the intensity change rate of the control vector during the scanning execution phase, and realize the nonlinear scaling of the scanning path and the correction of the incident direction through the step size adjustment module and the angle micro-offset module respectively.

[0047] Furthermore, the dynamic adjustment closed-loop method for curvature amplitude scanning control also includes:

[0048] Step 54: Using the scanning control parameters generated after adjustment in step 53 as input, perform high-resolution curvature amplitude sampling within the predicted area. Based on the dynamic changes of step size and incident angle, generate multi-angle amplitude response records at the same spatial position and form a high-resolution amplitude spectrum layer of continuous time series.

[0049] Step 55: Using the high-resolution amplitude spectrum as input, compare it with the original curvature amplitude spectrum, calculate the scanning parameter deviation vector based on the difference signal, and feed the deviation vector back to the modulation parameter set generation process in step 51 to achieve dynamic correction.

[0050] Secondly, a contour detection system for aluminum rod quality inspection based on image recognition technology includes:

[0051] The multi-angle scanning module scans the surface of the aluminum rod at multiple incident angles using an optical scanner, obtains the reflection change curves under different incident angles, and converts the two-dimensional grayscale image into a depth parameter matrix. At the same time, it records the beam incident angle position, scanning speed, and scanning time sequence during the scanning process.

[0052] The curvature transformation module is used to perform gradient second-order differential transformation on the obtained depth parameter matrix along the contour direction to generate the curvature amplitude spectrum, and apply local neighborhood nonlinear filtering and directional projection transformation to the curvature amplitude spectrum.

[0053] The pseudo-defect compensation module generates a pseudo-defect morphology prediction map based on the cooling rate, surface temperature and thermal expansion coefficient of the aluminum rod. In the curvature amplitude spectrum calculation process generated in the curvature transformation module, the prediction area is compensated. At the same time, the micro-surface roughness parameters of the material and the environmental humidity information are included in the compensation weight calculation in the compensation process.

[0054] The defect assessment module performs cross-angle dynamic comparison and curvature amplitude continuity judgment on potential defects detected in the curvature amplitude spectrum processed by the pseudo-defect compensation module. It combines contour differential features to perform correlation matching in multi-scale space, generates defect credibility score, and records the spatial distribution information of each defect.

[0055] The dynamic optimization module uses the defect confidence score generated by the defect assessment module as the dynamic adjustment signal for the next round of scanning. By adjusting the incident angle, scanning speed and beam intensity of the optical scanner, it performs high-resolution curvature amplitude sampling on the predicted area in the false defect compensation module. At the same time, it introduces an adaptive step size adjustment and angle micro-offset mechanism in the scanning control to establish a feedback adjustment mechanism between scanning parameters and contour features.

[0056] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0057] (1) This scheme uses a high-speed optical scanner to scan the surface of an aluminum rod at multiple incident angles, simultaneously acquiring the reflection change curve and depth parameter matrix, and recording key parameters such as beam incident angle and scanning speed. This solves the problem of incomplete contour information in traditional single-angle scanning, and can more comprehensively characterize the three-dimensional morphology of the aluminum rod surface, providing a high-precision, multi-dimensional data foundation for subsequent curvature analysis, and reducing the deviation in preliminary feature extraction caused by missing information.

[0058] (2) This scheme combines the cooling rate of aluminum rod, surface temperature, micro-roughness and environmental humidity to generate a false defect morphology prediction map, and performs compensation processing on the curvature amplitude spectrum to effectively eliminate false defect signals caused by thermal deformation, humidity interference, etc., avoid misjudging non-real defects as qualified, improve the accuracy of real defect identification, reduce the misjudgment rate in the quality inspection process, and ensure the reliability of aluminum rod quality inspection results.

[0059] (3) This scheme performs multi-scale spatial resampling of the directional curvature projection matrix, generates a multi-scale curvature amplitude spectrum set and performs correlation matching, which can cover different size defects from micro scratches to macro depressions, solve the problem of missing different size defects in single-scale analysis, ensure that all kinds of size defects can be accurately captured, improve the comprehensiveness of defect detection, and reduce the risk of missed detection.

[0060] (4) This scheme uses the defect confidence score as a dynamic adjustment signal to adjust the incident angle, speed and beam intensity of the scanner, and introduces an adaptive step size and angle micro offset mechanism to achieve high-resolution sampling of high confidence defect areas and efficient scanning of low confidence areas. While ensuring detection accuracy, it avoids resource waste, balances quality inspection accuracy and efficiency, and improves the overall process efficiency of aluminum rod quality inspection.

[0061] (5) This scheme performs local neighborhood nonlinear weighted reconstruction and directional projection transformation on the curvature amplitude matrix. By neighborhood weighting, the edge features of defects are enhanced and noise interference is suppressed. Combined with directional projection, the feature differences of defects in different directions are highlighted, making the defect features clearer and more identifiable. This provides better feature data for subsequent defect identification and credibility scoring, and further improves the accuracy of defect judgment.

[0062] (6) This solution combines the defect credibility score with spatial coordinates to generate a defect spatial distribution map with the score, which intuitively presents the location, quantity and authenticity level of the defect, making it convenient for quality inspectors to quickly distinguish between high credibility defects and medium credibility defects, simplifying the quality inspection decision process, improving the operability and convenience of quality inspection operations, and helping to efficiently complete the quality inspection and quality grading of aluminum rods. Attached Figure Description

[0063] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0064] Figure 1 This is a flowchart of a contour detection method for aluminum rod quality inspection based on image recognition technology according to the present invention;

[0065] Figure 2 This is a flowchart of a contour detection system for aluminum rod quality inspection based on image recognition technology according to the present invention. Detailed Implementation

[0066] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0067] Please see Figure 1 A contour detection method for aluminum rod quality inspection based on image recognition technology, comprising:

[0068] Step 1: Scan the surface of the aluminum rod from multiple angles using a high-speed optical scanner to obtain the reflection change curve, convert the two-dimensional grayscale image into a depth parameter matrix, and simultaneously record the incident angle position, scanning speed, and time series.

[0069] First, a high-speed optical scanner is used to scan the surface of an aluminum rod at multiple incident angles to obtain reflection curves under different incident angles. The two-dimensional grayscale image is then converted into a depth parameter matrix. Simultaneously, the beam incident angle position, scanning speed, and scanning time sequence are recorded during the scanning process. The working principle of aluminum rod surface contour detection based on the high-speed optical scanner begins with the optical scanning process under multiple incident angles. The high-speed optical scanner dynamically adjusts the angle between the emitted beam and the normal to the aluminum rod surface to achieve continuous scanning operations at multiple different incident angles. Due to subtle contour variations on the aluminum rod surface, such as protrusions, depressions, or minor scratches, the beam reflects light at different incident angles. The reflection path and energy distribution on the surface will differ, so the reflected light intensity change data corresponding to different incident angles can be captured and recorded in real time during the scanning process, forming a reflection change curve that reflects the surface contour characteristics. At the same time, the scanner synchronously acquires a two-dimensional grayscale image of the aluminum rod surface. The grayscale value of each pixel in the two-dimensional grayscale image directly corresponds to the reflected light intensity signal detected by the detector during the scanning process. The reflected light intensity and the vertical distance from the scanner to a certain point on the aluminum rod surface, i.e., the depth, have a definite physical relationship. This relationship can be quantified by mathematical relationships based on Lambert's law of reflection and the light intensity attenuation law, thereby realizing the conversion from two-dimensional grayscale information to three-dimensional depth information.

[0070] According to Lambert's law of reflection, the intensity of reflected light from an ideal diffuse surface is proportional to the cosine of the angle of incidence. Furthermore, the light intensity decreases with the square of the propagation distance. Since the grayscale value of a two-dimensional grayscale image is linearly positively correlated with the reflected light intensity, a conversion formula between grayscale value and depth can be abstracted from this. First, let the intensity of the reflected light be I. According to Lambert's law of reflection, the intensity of the reflected light is proportional to the cosine of the angle of incidence, i.e. Furthermore, considering the spherical attenuation law of light, the intensity of the reflected light is inversely proportional to the square of the distance from the scanner to the surface of the aluminum rod, i.e. By combining these two relations, we can obtain ,in This is a constant related to the surface reflectance of the aluminum rod; since the gray value G of a pixel in a two-dimensional grayscale image is determined by the intensity of reflected light received by the detector, and the two are linearly proportional after system calibration, that is... ,in The grayscale conversion coefficient is given by substituting I into the linear relationship in the previous formula and rearranging the equation to obtain the relationship between depth d, grayscale value G, and incident angle. The formula relating them is as follows: This is a comprehensive constant that integrates the reflection coefficient and the grayscale conversion coefficient. The specific meanings of the symbols in the formula are as follows: d represents the depth of a point on the surface of the aluminum rod relative to the scanning reference plane, and its unit is usually micrometers; k is a comprehensive coefficient, which is determined by the light source power of the scanning system, the detector sensitivity, and the reflection characteristics of the aluminum rod surface material, and is a dimensionless constant. is the incident angle of the light beam, which is the angle between the scanning beam and the normal to the surface of the aluminum rod, in radians; G is the gray value of the corresponding pixel in the two-dimensional grayscale image, which is usually an integer from 0 to 255, and directly represents the intensity level of reflected light detected by the detector. The higher the gray value, the stronger the reflected light intensity.

[0071] By substituting the grayscale value of each pixel in the two-dimensional grayscale image into the aforementioned depth conversion formula, the specific depth value of each pixel corresponding to a point on the aluminum rod surface can be calculated. These depth values ​​are then arranged in an orderly manner according to the pixel spatial distribution pattern of the two-dimensional grayscale image, forming a depth parameter matrix that can completely describe the three-dimensional contour of the aluminum rod surface. Throughout the scanning process, the system also records three key operating parameters in real time: the beam incident angle position, the scanning speed, and the scanning time sequence. The beam incident angle position is used to clarify the incident angle conditions corresponding to each depth value calculation, ensuring accurate correlation of depth data under different incident angles. The combination of the scanning speed and the scanning time sequence determines the actual spatial coordinates of each depth sampling point on the aluminum rod surface through kinematic relationships, avoiding spatial position offset of the sampling points.

[0072] Step 2: Perform a second-order gradient differential transformation on the depth parameter matrix to generate the curvature amplitude spectrum, and apply local neighborhood nonlinear filtering and directional projection transformation:

[0073] The depth parameter matrix is ​​essentially a discrete distribution of the surface depth values ​​of the aluminum rod in two-dimensional space. Each element represents the surface depth at a specific spatial coordinate. The depth variation along the contour direction directly reflects the slope and curvature of the contour. To quantify this curvature, the depth parameter matrix needs to be mapped using gradient second-order differential mapping. Since the depth parameter matrix is ​​discrete two-dimensional data, let its depth value be Z(x, y), where x is the directional coordinate along the aluminum rod contour and y is the lateral coordinate perpendicular to the contour, both in micrometers. Its second-order partial derivative in two-dimensional space needs to be approximated using the discrete difference method. According to the basic principle in calculus that the derivative reflects the rate of change and the second derivative reflects the change in the rate of change, the second-order partial derivative in the contour direction (x direction) is... It reflects the increase or decrease in the rate of change of depth along the contour direction, i.e., the curvature trend of the contour; the second partial derivative in the lateral direction (y-direction). This reflects the increase or decrease in the rate of change of depth along the lateral direction. The combination of these two factors can comprehensively characterize the curvature characteristics of that point. From this, the formula for calculating the curvature amplitude can be abstracted as follows:

[0074] ;

[0075] First, in the discrete depth matrix, the first-order partial derivatives Approximating the depth difference between adjacent points is... , Let x be the sampling step size in the x-direction. Similarly, we can obtain... Secondly, the second-order partial derivatives The difference between the first-order partial derivatives, i.e. After substituting the expression for the first-order partial derivative, the discretization calculation can be completed. Finally, since curvature is a comprehensive feature in a two-dimensional plane, the second-order partial derivatives in the two directions need to be integrated into a single curvature amplitude value by squaring and taking the square root to quantify the degree of curvature at that point. The meanings of the symbols in the formula are as follows: A(x, y) is the curvature amplitude at coordinate (x, y), and the dimension of curvature. The second partial derivative of the depth along the contour direction (x direction); Z is the second-order partial derivative of the depth along the lateral (y-direction); Z(x, y) is the surface depth of the aluminum rod at coordinate (x, y); by substituting each coordinate point in the depth parameter matrix into this formula, a complete curvature amplitude matrix can be generated. The regions with larger values ​​in this matrix correspond to locations where the curvature of the aluminum rod surface is significant, which may be defect or contour abrupt change regions.

[0076] After generating the curvature amplitude matrix, local neighborhood nonlinear weighted reconstruction is required. The purpose is to suppress the interference of scanning noise on the curvature amplitude and enhance the signal strength of the true contour features, especially defect edges. This process first establishes a fixed-size neighborhood for each contour point based on the curvature amplitude matrix, such as... or The spatial range and neighborhood selection need to balance noise suppression effect and feature resolution. If the neighborhood is too small, noise suppression will be insufficient, and if the neighborhood is too large, the features of small defects may be blurred. Subsequently, each amplitude value in the neighborhood is classified according to two dimensions: relative position and local curvature gradient. In the relative position dimension, the amplitude value closer to the center point of the neighborhood contributes more to the features of the center point and has a higher classification priority. In the local curvature gradient dimension, the position where the amplitude value changes more drastically is more likely to be the edge of the defect and has a higher classification priority. Through this classification, several response levels are formed, and each level corresponds to a set of amplitude values ​​with similar contribution.

[0077] Based on the response hierarchy, the amplitude value of each level needs to be mapped to a corresponding weighting coefficient. The mapping rule needs to construct a nonlinear relationship by combining the processing characteristics and contour physical features of the aluminum rod. For example, during the rolling or extrusion process, aluminum rods are prone to forming micro-cutting marks along specific directions. The curvature characteristics of these marks are directional. Therefore, the mapping rule needs to assign higher weights to neighborhood positions consistent with the micro-cutting direction to highlight these potential processing-related features. At the same time, higher weights are assigned to levels with large local curvature gradients to strengthen the signal at defect edges. After completing the weighting coefficient mapping, the enhanced amplitude value of the neighborhood center point is calculated by weighted accumulation. The calculation formula is as follows: The derivation logic of its formula is as follows: the true curvature feature of the neighborhood center point is a comprehensive reflection of the features of all points in the neighborhood, but the contribution of different points varies. Therefore, a weighted summation is needed to achieve the effect of strengthening useful features and weakening useless noise. Since the difference in contribution is non-linear, such as the contribution increasing exponentially with distance from the center, a weighting coefficient obtained by non-linear mapping is used. Instead of equal weighting; in the formula, is the enhanced amplitude value at the neighborhood center point, with the same unit as the original amplitude; n is the total number of amplitude values ​​contained in the neighborhood, such as... The neighborhood has n=9; Let be the weighting coefficient of the i-th neighborhood point, dimensionless and satisfying all The sum of these is 1, and its value is determined by the relative position of the point and the local curvature gradient. Let be the original amplitude value of the i-th neighboring point. By performing this calculation on each neighborhood center point, a neighborhood enhancement matrix can be formed. At the same time, the boundary amplitude values ​​of adjacent neighborhoods need to be physically interactively adjusted. Since the boundary point belongs to two adjacent neighborhoods at the same time, its amplitude value may differ in the calculation of the two neighborhoods. By introducing a boundary smoothing factor, which is determined based on the average amplitude of the adjacent neighborhoods, the amplitude of the boundary point is finely adjusted to ensure the spatial continuity of the entire matrix and finally output a stable neighborhood enhancement matrix.

[0078] After the neighborhood enhancement matrix is ​​generated, a directional projection transformation is required to highlight the differences in contour features in different directions. Defects on the surface of aluminum rods, such as scratches and dents, often have obvious directions, such as scratches along the axial direction and dents along the circumferential direction. The distribution characteristics of amplitude values ​​in the neighborhood enhancement matrix in different directions can directly reflect these directional defects. The transformation process first determines several specified projection directions, such as 0°, 45°, 90°, and 135°, which correspond to the key directions of the aluminum rod, such as the axial, oblique, and radial directions, respectively. Then, each point of the neighborhood enhancement matrix along the contour direction is physically rearranged according to each projection direction. That is, along a certain projection direction, the amplitude values ​​of all contour points in that direction are arranged in spatial coordinate order to form a one-dimensional amplitude sequence in that direction. After repeating this operation for all projection directions, the two-dimensional neighborhood enhancement matrix can be transformed into multiple one-dimensional directional curvature projection matrices. This rearrangement makes the amplitude variation pattern in a specific direction easier to identify. For example, in the matrix projected along the axial direction, a sequence of continuous high amplitude values ​​can directly indicate axially extending scratches.

[0079] To cover defect features of different sizes, multi-scale spatial resampling of the directional curvature projection matrix is ​​required. The defect sizes on the surface of aluminum rods vary greatly; the length of a tiny scratch may be only tens of micrometers, while the length of a macroscopic depression may be hundreds of micrometers. Curvature features at a single scale cannot fully represent these differences. Multi-scale resampling adjusts the spatial sampling interval of each directional curvature projection matrix by setting different contour length scales, such as 20 micrometers, 50 micrometers, and 100 micrometers. Small scales correspond to small sampling intervals, which can capture the details of tiny defects; large scales correspond to large sampling intervals, which can reflect the changing trend of macroscopic contours. By resampling the projection matrix at each scale and calculating the corresponding curvature amplitude, a multi-scale curvature amplitude spectrum set containing information at different scales can be generated. This set can completely cover various contour features from microscopic to macroscopic.

[0080] Finally, adaptive mapping encoding is performed on the multi-scale curvature amplitude spectrum set to eliminate feature interference between different scales and retain spatial position correlation. The curvature amplitude value ranges differ at different scales, with larger scale amplitude values ​​typically being larger. Direct superposition analysis can easily lead to the masking of small-scale features. At the same time, the features at each scale must correspond one-to-one with the actual spatial position on the aluminum rod surface to ensure the accuracy of subsequent defect localization. Adaptive mapping encoding separates features at different scales by setting an independent encoding space for each scale, that is, the amplitude value of each scale is mapped to a dedicated numerical range, such as 0-100 for small scales and 101-200 for large scales. During the mapping process, the correspondence between each amplitude value and the original spatial coordinates (x, y) is strictly maintained, that is, the amplitude values ​​of the same spatial coordinates in different scale encoding spaces can be associated through coordinate index. Through this encoding, a multi-scale curvature amplitude spectrum set with clear structure, no interference, and well-defined spatial position can be formed.

[0081] Step 3: Generate a pseudo-defect morphology prediction map based on the cooling rate of the aluminum rod, and compensate for the predicted region in the curvature amplitude spectrum calculation, incorporating microscopic surface roughness and environmental humidity information to calculate the compensation weight.

[0082] In aluminum rod quality inspection, false defects, which are non-real defect signals caused by thermal deformation, surface roughness, or environmental humidity, can interfere with the curvature amplitude spectrum's identification of real defects. Therefore, it is necessary to correct these interference signals through a coherent process of false defect morphology prediction and curvature amplitude compensation to ensure detection accuracy. Using the thermal characteristics of the aluminum rod, the material's microscopic properties, and environmental parameters as inputs, a prediction map covering the potential area of ​​false defects is first constructed. Then, based on the prediction results, the curvature amplitude spectrum is compensated in a targeted manner, and finally, amplitude data that eliminates the interference of false defects is output.

[0083] Regarding the generation of the pseudo-defect morphology prediction map, firstly, the cooling rate of the aluminum rod, surface temperature, and material thermal expansion rate are used as inputs to generate a preliminary pseudo-defect morphology prediction map. When the aluminum rod is cooled, the difference in cooling rate in different areas will lead to uneven thermal contraction, resulting in local micro-deformation, such as micro-protrusions or depressions. These deformations are easily misjudged as real defects in the curvature amplitude spectrum. According to the thermal deformation theory, the amount of thermal deformation is positively correlated with the cooling rate, surface temperature difference, and thermal expansion rate. The faster the cooling rate, the greater the temperature difference, and the higher the thermal expansion rate, the more significant the local deformation and the higher the probability of pseudo-defects. By substituting the real-time collected cooling rate, surface temperature distribution, and material thermal expansion rate into the thermal deformation simulation model, the thermal deformation risk coefficient of each area on the surface of the aluminum rod can be calculated. Areas with risk coefficients higher than the threshold are marked as potential pseudo-defect areas. Arranging them according to spatial coordinates forms a preliminary prediction map. This map can locate the distribution of pseudo-defects caused by thermal deformation. For the thermal deformation simulation model, you can refer to the "Simulation Thermal Deformation Modeling Method for Industrial Composite Material Parts" and "Finite Element Simulation and Performance Prediction of Microstructure Evolution during Metal Thermal Deformation" published on Baidu Wenku.

[0084] Secondly, the preliminary prediction map is mapped to the material's microscopic surface roughness parameters to form a roughness-annotated prediction map. Microscopic roughness of the aluminum rod surface, such as minute irregularities left during the rolling process, alters local reflection characteristics, leading to high-amplitude signals without actual defects in the curvature amplitude spectrum. The higher the roughness, the more drastic the fluctuation in reflected light intensity, and the more easily the corresponding curvature amplitude value deviates from the normal range. Microscopic roughness parameters of the aluminum rod surface are obtained using atomic force microscopy or laser profilometry, and the profile arithmetic mean deviation is used. The roughness is expressed in micrometers and mapped one-to-one with the spatial coordinates of the preliminary prediction map. Areas exceeding the set threshold, such as Add roughness-related pseudo-defect annotations to the prediction map so that the prediction map can simultaneously cover the potential areas of both thermal deformation and micro-roughness pseudo-defects.

[0085] Finally, an environmental humidity parameter is introduced to correct the roughness annotation prediction map, generating the final corrected pseudo-defect morphology prediction map. Environmental humidity affects the reflectivity of the aluminum rod surface. When the humidity is high, water vapor will adhere to the tiny pits on the surface, changing the local reflection path and further amplifying the amplitude deviation caused by roughness, exacerbating the interference of pseudo-defect signals. The relative humidity of the environment is collected and detected by a humidity sensor, and a correlation model between humidity and amplitude deviation is established: for every 10% RH increase in humidity, the amplitude deviation caused by roughness increases by about 5%-8%, with the specific ratio determined experimentally. Based on this model, the pseudo-defect annotation range of the high humidity-affected area in the roughness annotation prediction map is expanded, usually to the surface area corresponding to humidity above 60% RH, while improving the confidence of pseudo-defects in these areas to ensure that the prediction map can reflect the superimposed influence of environmental factors on pseudo-defect signals.

[0086] Regarding the point-by-point compensation of the curvature amplitude spectrum, the first step is to locate the spatial correspondence of the predicted area. The corrected prediction map of the pseudo-defect morphology has marked the spatial coordinates of all potential pseudo-defect areas, which correspond one-to-one with the actual positions on the aluminum rod surface. These coordinates need to be matched with the coordinate system of the curvature amplitude spectrum matrix. Each element of the curvature amplitude spectrum matrix corresponds to the amplitude value of a specific spatial coordinate on the aluminum rod surface. Through the coordinate mapping algorithm, the specific position of each pseudo-defect area in the prediction map in the amplitude spectrum matrix can be determined, forming a region mapping matrix. This matrix clearly marks the target area that needs to be compensated in the amplitude spectrum, providing a spatial index for subsequent targeted compensation.

[0087] The second step is to generate local amplitude compensation weights. The degree of amplitude deviation in the pseudo-defect region is determined by the micro-curvature characteristics of the neighborhood, material physical parameters such as thermal expansion coefficient, roughness, and environmental humidity. The combined influence of these factors needs to be quantified through weighting to ensure that the compensation strength matches the degree of deviation. According to the multi-factor influence model, the local amplitude compensation weights can be expressed as:

[0088] ;

[0089] First, neighborhood micro-curvature features It directly reflects the degree of amplitude anomaly caused by pseudo-defects. The greater the micro-curvature, the more significant the amplitude deviation. Therefore, a basic weighting coefficient is assigned. Secondly, the thermal expansion coefficient of the material. Micro-roughness The ambient humidity H and the ambient humidity H are the contributing factors to the formation of pseudo-defects, and different coefficients need to be assigned to them according to their contribution to the amplitude deviation. , , The coefficient values ​​were calibrated through extensive experiments to ensure the total weight ranged between 0 and 1. Finally, the four factors were integrated into a single weight value through linear combination to quantify the compensation requirement for each mapping point. In the formula, coordinates The local amplitude compensation weight at the location is dimensionless and ranges from 0 to 1. The larger the value, the more significant the amplitude deviation and the stronger the compensation force required. coordinates The neighborhood micro-curvature at a given point is obtained by calculating the neighborhood average curvature using the curvature amplitude matrix; is the coefficient of thermal expansion of the aluminum rod material, and is an inherent property of the material. is the arithmetic mean deviation of the surface profile at coordinates (x, y); H is the relative humidity of the detection environment, normalized to a value between 0 and 1. , , , These are weighting coefficients, dimensionless, summing to 1, determined experimentally, such as... , , , These correspond to the contributions of neighborhood micro-curvature, thermal expansion coefficient, roughness, and humidity, respectively.

[0090] The third step is a point-by-point weighted adjustment of the curvature amplitude. Based on the local amplitude compensation weight, the amplitude values ​​of the mapped points in the curvature amplitude spectrum matrix are corrected. Amplitude deviations caused by pseudo-defects are divided into positive deviations (amplitude values ​​higher than the normal range) and negative deviations (amplitude values ​​lower than the normal range). Compensation needs to be adjusted in reverse according to the type of deviation. If the amplitude value of a certain mapped point is too high due to pseudo-defects, which is a positive deviation, then the original amplitude value is multiplied by 1 - Reduce its amplitude; if the amplitude value is too low due to the false defect and is a negative deviation, then multiply the original amplitude value by 1 + This increases the amplitude. By performing this calculation on each mapping point, the amplitude shift caused by pseudo-defects can be eliminated, forming a preliminary compensated curvature amplitude spectrum matrix.

[0091] Finally, the physical continuity of the preliminary compensation matrix is ​​adjusted. Since the compensation weights of adjacent mapping points may differ, the amplitude values ​​of adjacent points may change abruptly after the preliminary compensation. This abrupt change will interfere with subsequent defect identification and may be misjudged as defect edges. During the adjustment process, the amplitude difference between adjacent mapping points needs to be calculated. If the difference exceeds the set threshold, it is calibrated by the normal contour fluctuation range of the aluminum rod material. Then, the average amplitude of the two points is used as the benchmark to smooth the amplitude values ​​of the two points and the surrounding neighborhood. The amplitude difference is reduced by linear interpolation to ensure that the amplitude change of the entire matrix conforms to the physical continuity of the aluminum rod surface contour. Finally, a compensation curvature amplitude spectrum matrix that eliminates false defect interference and has smooth contour features is output. This matrix can accurately retain the high amplitude signal of the real defect.

[0092] Step 4: Dynamically compare and determine the continuity of potential defects across angles in the curvature amplitude spectrum; combine multi-scale correlation matching of contour differential features to generate a defect credibility score and record its spatial distribution.

[0093] First, a local multi-angle response subdomain is constructed for each defect point. Centered on the potential defect point under a single observation angle, such as a reference incident angle of 30°, a subdomain with a fixed spatial range is defined, such as a 5×5 pixel area centered on the defect point, corresponding to an actual surface size of approximately 0.5mm×0.5mm on the aluminum rod. This subdomain covers the defect point and its surrounding contour environment, ensuring complete capture of the overall morphological response of the defect. Then, the virtual incident angle is controlled to perform angular perturbation. The perturbation range is set based on the actual angle accuracy of the optical scanner, such as ±8°, and the perturbation step size is taken as the minimum angle increment of the scanning system, such as 1°, generating a continuous angle sequence, such as 22°, 23°..., 30°..., 37°, 38°. For each angle, the curvature amplitude values ​​of all points within the subdomain are collected to form the subdomain amplitude distribution at that angle. The subdomain amplitude distributions of all angles are arranged in angular order to obtain the curvature response trajectory of the defect point. The trajectory of a real defect will show a smooth amplitude change due to its fixed shape, while the trajectory of a pseudo defect will fluctuate violently due to the lack of a fixed shape.

[0094] Based on the curvature response trajectory, a time-series analysis of the amplitude changes at each defect point is performed along the angle sequence direction. The amplitude offset difference between two adjacent angles is calculated, which is the absolute value of the amplitude value of the later angle minus the amplitude value of the earlier angle. This offset difference reflects the stability of the amplitude response when the angle changes. The amplitude offset differences of all adjacent angles are concatenated in sequence according to the angle sequence to form an angle evolution chain: the physical morphology of real defects, such as axial scratches, does not change fundamentally under different angles, and the amplitude offset difference between adjacent angles is small and fluctuates gently, such as all offset differences being less than 0.2× / micrometer; while pseudo-defects, such as the amplitude response of random noise points, lack physical support, and the offset difference will increase and become irregular, such as an offset difference of 0.1× / micrometer to 1.0× Random fluctuations within micrometers and angular evolution chains have initially enabled the screening of defect authenticity.

[0095] Regarding contour differential feature extraction and morphological change rate calculation:

[0096] First, the amplitude gradient of each point in the neighborhood is calculated using the first-order partial derivative. The magnitude of the gradient reflects the steepness of the contour edge. For example, the gradient value of the scratch edge is higher than that of the surrounding flat area, and the direction of the gradient points in the direction of increasing amplitude. For example, the gradient direction of the concave edge points to the center of the concave. Then, the second-order partial derivative of the amplitude is calculated. The sign of the second-order partial derivative reflects the curvature direction of the contour. For example, the second-order partial derivative of the convex area is positive, and that of the concave area is negative. Its absolute value reflects the degree of curvature. These differential features directly correspond to the physical morphological properties of the defect.

[0097] Based on the sign change of the amplitude gradient, the differential shape change rate of the profile is calculated. In the local neighborhood of the defect point, along the two key directions of the aluminum rod, the number of changes in the sign of the amplitude gradient is counted: the gradient sign change of a real defect will be concentrated in the direction perpendicular to the scratch extension, such as the circumferential direction, and the number of changes is small and the direction is continuous, such as only one change from positive to negative, corresponding to the edge of one side of the scratch to the edge of the other. The gradient sign change of a pseudo defect is irregular in both directions, with many changes and chaotic directions, such as the gradient sign around the noise point frequently alternating between positive and negative in both the axial and circumferential directions. The shape change rate is calculated by dividing the number of sign changes by the total number of neighborhood points. The smaller the value and the more concentrated the change direction, the more regular the spatial shape of the defect and the higher the probability of it being real.

[0098] Regarding multi-scale feature mapping and scale correlation matrix construction:

[0099] The physical structure of real defects exhibits inherent correlation across different spatial scales. For instance, scratch details observed at a small scale can still correspond to continuous linear contours at a large scale. In contrast, spurious defects may disappear or exhibit unrelated morphologies as the scale changes. Therefore, multi-scale feature correlation is necessary to further verify the authenticity of defects. Using extracted contour differential features as input, multiple sets of different contour length scales are set, covering the sizes of common defects in aluminum rods, such as 20 μm for small scales, 50 μm for medium scales, and 100 μm for large scales. Each scale corresponds to a specific spatial sampling interval, such as the small scale... The sampling interval is 1 μm / pixel, and the large-scale sampling interval is 5 μm / pixel. For each scale, the contour differential features of the local neighborhood of the defect point are resampled according to its sampling interval. Features related to the defect morphology at that scale are retained. For example, edge points with drastic gradient changes are retained at small scales, and the bending trend of the overall contour is retained at large scales. A feature mapping layer for that scale is generated. When generating the mapping layer, the directional parameters of each scale must be kept consistent. For example, if the main extension direction of a defect is the axis of the aluminum rod, then the feature mapping layers of all scales must be based on this direction to ensure that the features between layers have comparable spatial directions.

[0100] A scale correlation matrix is ​​constructed by linking layers. For any two scales, such as small-scale and medium-scale, or medium-scale and large-scale feature mapping layers, the matching degree of their key features is calculated. This includes the overlap ratio of edge points in the small-scale mapping layer with contour lines in the large-scale mapping layer, or the consistency ratio of their gradient directions. The matching degree value ranges from 0 to 1, with values ​​closer to 1 indicating a stronger correlation between the features of the two scales. The matching degree of all scale pairs is then categorized by behavioral scale. Listed as a standard The elements are arranged in order to form a scale correlation matrix: the matrix elements of real defects are mostly close to 1, such as 0.9 for small to medium scale and 0.85 for medium to large scale, indicating that their morphological features are highly correlated at different scales; the matrix elements of pseudo defects are mostly below 0.5, such as 0.3 for small to medium scale and 0.2 for medium to large scale, indicating that their features have no intrinsic correlation and are only interference at local scales.

[0101] Regarding the calculation of defect credibility score:

[0102] The defect credibility score is a comprehensive quantification of the consistency of the angular dimension and the correlation of the spatial dimension. It is achieved by weighted integration of the verification results of the two dimensions and outputting a score value in the range of 0-1. The closer the value is to 1, the higher the probability that the defect is real.

[0103] The formula for calculating the credibility score is as follows:

[0104] ;

[0105] First, angle sequence integration Used to quantify the consistency of the angle evolution chain, the smaller the amplitude offset difference between adjacent angles, the more stable the angle response. The calculation is done by summing the squares of the offset differences and taking the reciprocal. The smaller the sum of squares of the offset differences, the better. The larger the value, the better it reflects the verification results of the angular dimension; secondly, the scale stability coefficient S is used to quantify the correlation of the scale correlation matrix. The closer the average value of the matrix elements is to 1, the stronger the correlation of multi-scale features. S is taken as the arithmetic mean of all elements in the matrix, directly reflecting the verification results of the spatial dimension; finally, through weighting coefficients... , , Integrating both, the weights are based on experimental calibration. For example, angular consistency contributes more to distinguishing between real and fake defects, so it is chosen accordingly. , , The weighting coefficients of the integral of the angle sequence are dimensionless and 0 < <1, as determined by experiments, reflects the importance of angle and dimension verification; The weighting coefficient for scale stability is dimensionless, 0 < <1, and Complementarity reflects the importance of spatial dimension verification; in the formula, C is the defect credibility score, which is dimensionless and 0≤C≤1; The integral of the angle sequence is dimensionless, and the calculation formula is: , This represents the total number of angles in the angle sequence. Let be the amplitude offset difference between the i-th and (i+1)-th angles, in units of 1 / micrometer; S is the scale stability coefficient, dimensionless, taken as the arithmetic mean of all elements in the scale correlation matrix, 0≤S≤1; after calculating the confidence score of each potential defect point using this formula, a scoring threshold can be set, such as C≥0.8 for high confidence true defects, 0.5≤C<0.8 for medium confidence defects requiring re-inspection, and C<0.5 for low confidence pseudo defects, thus completing the quantitative judgment of the authenticity of the defects.

[0106] Regarding defect spatial location and distribution map generation:

[0107] First, defect spatial relocation is performed. Each element of the curvature amplitude spectrum matrix corresponds to a specific physical coordinate on the surface of the aluminum rod. The row index of the matrix corresponds to the axial coordinate of the aluminum rod, the x-axis, in millimeters. For example, row number 1 corresponds to x=0mm, and each increase of 1 in the row number corresponds to an increase of 0.1mm in x. The column index corresponds to the circumferential coordinate of the aluminum rod, the y-axis, in millimeters. For example, column number 1 corresponds to y=0mm, and each increase of 1 in the column number corresponds to an increase of 0.1mm in y. Based on the row and column indices of the potential defect points in the amplitude spectrum matrix, their actual physical coordinates (x, y) on the surface of the aluminum rod can be calculated, realizing the mapping from matrix index to physical space and ensuring that the location of each defect point can be traced back to a specific area of ​​the aluminum rod.

[0108] Subsequently, the credibility score is embedded into the coordinate index. The credibility score C of each defect point is used as an additional scalar parameter and bound to the corresponding physical coordinates (x, y). For example, coordinates (x=5.2mm, y=3.8mm) are associated with a score C=0.92, forming a one-to-one correspondence between coordinates and scores, avoiding the disconnect between scores and locations. Finally, a defect spatial distribution map is generated, using the axial and circumferential physical coordinates of the aluminum rod as coordinate axes. The coordinate positions of all high and medium credibility defects are marked on the map, and different colors or symbols are used to distinguish the credibility levels. For example, red dots represent high credibility defects with C≥0.8, and yellow triangles represent medium credibility defects with 0.5≤C<0.8. At the same time, the specific score value is marked next to each mark. This distribution map intuitively presents the number, location, and authenticity level of defects on the surface of the aluminum rod. Quality inspectors can directly determine whether the aluminum rod is qualified based on the information in the map, or conduct further manual re-inspection of medium credibility defects, realizing the quantification, location, and decision-making closed loop of defect identification.

[0109] Step 5: Using the defect confidence score as a dynamic adjustment signal, the scanning parameters are adjusted to perform high-resolution sampling of the predicted area. An adaptive step size and angle micro-offset mechanism are introduced to form a collaborative optimization closed loop.

[0110] The dynamic adjustment closed loop of curvature amplitude scanning control achieves accurate and efficient scanning of key areas on the surface of aluminum rods through real-time linkage between defect confidence scores and scanning parameters. Essentially, it is an adaptive control process that guides defect features to dynamic parameter optimization and finally to feedback correction iteration. This closed loop uses the defect confidence score set as the initial driving signal and, through the coherent operation of modulation parameter generation, device response mapping, scanning path optimization, high-resolution sampling, and feedback correction, dynamically matches scanning parameters such as incident angle, velocity, beam intensity, and aluminum rod contour features, especially the defect area, ultimately improving the accuracy and efficiency of defect detection.

[0111] Regarding the generation of modulation parameter sets:

[0112] The defect confidence score set contains quantitative information on the authenticity of each potential defect on the aluminum rod surface, such as a 0-1 score and spatial coordinates. Its spatial distribution characteristics directly reflect the differences in scanning requirements. In high-confidence defect areas, the score is close to 1, requiring more detailed scanning to confirm details. In medium-confidence areas, the score is 0.5-0.8, requiring supplementary scanning to improve the judgment basis. In low-confidence areas, the score is below 0.5, and the scanning resource investment can be reduced. Therefore, the spatial distribution of the score values ​​must first be analyzed to calculate the local rate of change of the score gradient: in the two-dimensional coordinate system on the aluminum rod surface, the score difference between adjacent points is calculated along the axial and circumferential directions respectively. The larger the difference, the more drastic the score change, and the more complex the defect characteristics of the corresponding area may be, requiring a higher resolution scan.

[0113] Based on the local rate of change of the scoring gradient, a modulation parameter set is generated, which includes incident angle adjustment commands, scanning speed weights, and beam energy allocation ratios. The incident angle adjustment commands target high-confidence defect areas, increasing the sampling density of the incident angle, such as increasing it from the original 1° interval to 0.5° intervals, to capture the three-dimensional morphological details of the defect through multi-angle reflection responses. The scanning speed weight is positively correlated with the score; the higher the score, the greater the weight and the slower the scanning speed. For example, the speed in high-scoring areas is reduced to 50% of the original speed to increase the number of sampling points per unit area. The beam energy allocation ratio is dynamically adjusted according to the surface roughness of the defect area. The surface roughness of the defect area can be obtained from the prediction map. Areas with high roughness are allocated higher energy, such as increasing it by 20%-30%, to ensure that the reflected signal intensity is sufficient to distinguish between real defects and noise. The modulation parameter set composed of these three parameters realizes the tilted allocation of scanning resources to key areas.

[0114] Regarding the response matrix and control vector of the optical scanner:

[0115] The modulation parameter set needs to be converted into physical action commands for the optical scanner. This conversion is achieved through the response matrix. The execution components of the optical scanner include a mirror drive mechanism that controls the incident angle, such as a piezoelectric ceramic driven mirror, and a light source adjustment module that controls the beam intensity, such as a tunable power laser. Its action is directly driven by electrical signals. Therefore, the response matrix is ​​essentially a physical mapping relationship between the modulation parameters and the driving electrical signals.

[0116] For incident angle adjustment, the response matrix needs to establish a mapping between the change in incident angle and the mirror driving voltage. The mirror deflection angle has a linear relationship with the driving voltage. Within a small angle range, let the change in incident angle be... The unit is radians, and the driving voltage is... If the unit is volts, then the mapping relationship is: ,in The unit is radians per volt, representing the voltage-to-angle conversion factor of the mirror, determined by hardware calibration; for beam intensity, the response matrix needs to establish the beam energy distribution ratio. Dimensionless, 0 < η ≤ 1, and related to the light source driving current. The mapping is such that the power of the light source and the current are approximately linear within the rated range, therefore... ,in This is the maximum power of the light source. The unit is watts per ampere, which is the current-to-power conversion coefficient of the light source. Arranging these mapping relationships according to spatial coordinate indices forms a response matrix. Each row of the matrix corresponds to a spatial position on the surface of the aluminum rod, and each column corresponds to a driving signal: incident angle driving voltage, scanning speed control signal, and beam intensity driving current. The matrix elements are the signal values ​​of the modulation parameters at that position. Based on the response matrix, a control vector corresponding one-to-one with the spatial index of the modulation parameters can be generated. Each element of the vector represents the specific action command of the scanner at a specific position, ensuring that the modulation parameters can be accurately executed by the scanner.

[0117] Regarding adaptive step size adjustment and angle micro-offset:

[0118] During the scanning execution phase, the scanning path needs to be optimized based on the control vector. This is achieved through adaptive step size adjustment and angle micro-offset mechanisms to balance scanning accuracy and efficiency. The step size contraction ratio is used to adjust the spatial interval of the scanning path. Its calculation is based on the intensity change rate of the control vector. The larger the weight of the scanning speed in the control vector, the higher the intensity change rate in the high-scoring region, and the larger the step size contraction ratio, i.e., the smaller the actual step size. For example, let the baseline step size be... The unit is micrometers, the rate of change of the control vector intensity is r, which is dimensionless and reflects the intensity of the scoring gradient. The actual step size is... In the formula, the larger the intensity change rate r, the more complex the regional defect characteristics, and the step size needs to be reduced to 1 / (1+r) of the baseline value to increase the sampling density; when r=0, there is no feature change, and the step size remains at the baseline value to ensure efficient scanning; where s is the actual scanning step size in micrometers. The preset reference step size is r, which is the rate of change of the intensity of the control vector, calculated from the difference in scanning speed weights between adjacent positions.

[0119] Angle micro-offset is used to correct the incident direction. Based on the incident angle specified by the control vector, a small angle perturbation, such as ±0.1°, is superimposed to form a continuous angle fine-tuning sequence. This mechanism can cover the subtle angles not included in the original incident angle and capture the reflection characteristics of defects at critical angles, such as the amplitude change of the scratch edge when shifted by a specific tiny angle, further enriching the angle response information. The actual step size is converted into the feed amount of the scanning motor through the step size adjustment module, and the fine-tuning angle is converted into the additional voltage of the mirror drive through the angle micro-offset module. Finally, nonlinear scaling of the scanning path is achieved, such as dense high-scoring areas and sparse low-scoring areas, as well as fine correction of the incident direction.

[0120] Regarding high-resolution sampling and closed-loop feedback correction:

[0121] The optimized scanning parameters drive the optical scanner to perform high-resolution curvature amplitude sampling in the pre-judged area. At the same spatial position, the scanner repeatedly samples according to the dynamically adjusted step size and multi-angle sequence, recording the amplitude response values ​​at different times to form a high-resolution amplitude spectrum layer of continuous time series. Compared with the original curvature amplitude spectrum, this spectrum layer has higher spatial resolution, denser sampling points, and higher angular resolution with smaller angular intervals, which can more clearly present the detailed features of defects, such as the edge curvature of tiny depressions and the depth variation of scratches.

[0122] To ensure continuous optimization of scanning parameters, the high-resolution amplitude spectrum layer needs to be compared with the original curvature amplitude spectrum to calculate the difference signal. The difference signal reflects the amplitude value deviation at the same position in the two scans. The larger the deviation, the worse the adaptability of the original scanning parameters to the region. For example, if the original step size is too large, details may be lost, or if the incident angle is insufficient, features may not be fully revealed. Based on the difference signal, a scanning parameter deviation vector can be calculated. Each component of the vector corresponds to a scanning parameter, such as the adjustment amount of incident angle, step size, and beam intensity. For example, if the difference signal in a certain region is due to insufficient incident angle, the incident angle component in the deviation vector will be positive, and the incident angle sampling needs to be increased; if it is due to excessive step size, the step size component will be negative, and the step size needs to be reduced.

[0123] Feeding the deviation vector back to the modulation parameter generation process can dynamically correct the incident angle adjustment command, scanning speed weight, and beam energy distribution ratio in the next round, making the scanning parameters more closely match the actual contour features. For example, if the deviation vector indicates that a certain area needs a smaller step size, the scanning speed weight of that area in the next round of modulation parameters will be increased, and the step size will be further reduced. Through this cycle of sampling, comparison, correction, and resampling, a collaborative optimization closed loop between scanning parameters and contour features is formed, continuously improving scanning accuracy and efficiency, and ensuring that surface defects of the aluminum rod are accurately identified and quantified.

[0124] Example 2:

[0125] Please see Figure 2 Based on Example 1, this embodiment provides a contour detection system for aluminum rod quality inspection based on image recognition technology, including:

[0126] The multi-angle scanning module scans the surface of the aluminum rod at multiple incident angles using an optical scanner, obtains the reflection change curves under different incident angles, and converts the two-dimensional grayscale image into a depth parameter matrix. At the same time, it records the beam incident angle position, scanning speed, and scanning time sequence during the scanning process.

[0127] The curvature transformation module is used to perform gradient second-order differential transformation on the obtained depth parameter matrix along the contour direction to generate the curvature amplitude spectrum, and apply local neighborhood nonlinear filtering and directional projection transformation to the curvature amplitude spectrum.

[0128] The pseudo-defect compensation module generates a pseudo-defect morphology prediction map based on the cooling rate, surface temperature and thermal expansion coefficient of the aluminum rod. In the curvature amplitude spectrum calculation process generated in the curvature transformation module, the prediction area is compensated. At the same time, the micro-surface roughness parameters of the material and the environmental humidity information are included in the compensation weight calculation in the compensation process.

[0129] The defect assessment module performs cross-angle dynamic comparison and curvature amplitude continuity judgment on potential defects detected in the curvature amplitude spectrum processed by the pseudo-defect compensation module. It combines contour differential features to perform correlation matching in multi-scale space, generates defect credibility score, and records the spatial distribution information of each defect.

[0130] The dynamic optimization module uses the defect confidence score generated by the defect assessment module as the dynamic adjustment signal for the next round of scanning. By adjusting the incident angle, scanning speed and beam intensity of the optical scanner, it performs high-resolution curvature amplitude sampling on the predicted area in the false defect compensation module. At the same time, it introduces an adaptive step size adjustment and angle micro-offset mechanism in the scanning control to establish a feedback adjustment mechanism between scanning parameters and contour features.

[0131] The above are merely preferred embodiments of the present invention; however, the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and its improved concept, should be covered within the scope of protection of the present invention.

Claims

1. A contour detection method for aluminum rod quality inspection based on image recognition technology, characterized in that, Includes the following steps: Step 1: The surface of the aluminum rod is scanned at multiple incident angles using an optical scanner to obtain the reflection change curves under different incident angles, and the two-dimensional grayscale image is converted into a depth parameter matrix. At the same time, the incident angle position of the beam, the scanning speed and the scanning time sequence are recorded synchronously during the scanning process. Step 2: Perform gradient second-order differential transformation on the depth parameter matrix obtained in Step 1 along the contour direction to generate the curvature amplitude spectrum, and apply local neighborhood nonlinear filtering and directional projection transformation to the curvature amplitude spectrum. Step 3: Generate a pseudo-defect morphology prediction map based on the cooling rate, surface temperature and thermal expansion coefficient of the aluminum rod. In the process of calculating the curvature amplitude spectrum generated in Step 2, the prediction area is compensated. At the same time, the micro-surface roughness parameters of the material and the environmental humidity information are included in the compensation weight calculation in the compensation process. Step 4 involves performing cross-angle dynamic comparison and curvature amplitude continuity judgment on the potential defects detected in the curvature amplitude spectrum processed in Step 3, combining contour differential features for multi-scale spatial correlation matching, generating defect confidence scores, and recording the spatial distribution information of each defect, specifically including: Step 41: Using the set of potential defect points detected in the curvature amplitude spectrum matrix output in Step 3 as input, based on the amplitude response of a single observation angle, a local multi-angle response subdomain for each defect point is constructed, and the curvature response trajectory under a continuous angle sequence is generated by controlling the angular perturbation amplitude of the virtual incident angle. Step 42: Using the generated curvature response trajectory as input, perform time-series analysis on the amplitude changes of each defect point along the angle sequence direction, and form an angle evolution chain based on the amplitude offset difference between adjacent angle responses. Step 43: Using the formed angular evolution chain as input, extract the contour differential features in the local neighborhood of each defect point, and calculate the contour differential morphology change rate based on the change of amplitude gradient sign. Step 44: Using the extracted contour differential features as input, generate feature mapping layers at different spatial scales while maintaining consistency of directional parameters, and form a scale correlation matrix of defect morphology through inter-layer structural association. Step 45: Using the generated scale correlation matrix as input, perform weighted calculations on the morphological stability of each defect point in multi-scale space to generate a defect credibility score set containing angle sequence integrals. Step 46: Using the defect confidence score set as input, spatially relocate each defect according to the spatial coordinate system of the curvature amplitude spectrum, and embed the score results as additional scalar parameters into the coordinate index of the curvature amplitude spectrum to generate a defect spatial distribution map. Step 5: The defect confidence score generated in Step 4 is used as the dynamic adjustment signal for the next round of scanning. By adjusting the incident angle, scanning speed, and beam intensity of the optical scanner, high-resolution curvature amplitude sampling is performed on the predicted area in Step 3. Simultaneously, an adaptive step size adjustment and angle micro-offset mechanism are introduced into the scanning control to establish a feedback adjustment mechanism between scanning parameters and contour features. Specifically, this includes: Step 51: Obtain the generated defect confidence score set, analyze the spatial distribution of the score values, and generate a modulation parameter set based on the local rate of change of the score gradient. The modulation parameter set includes the incident angle adjustment command, the scanning speed weight, and the beam energy distribution ratio. Step 52: Using the modulation parameter set as input, establish the response matrix of the optical scanner. The response matrix is ​​used to physically map the incident angle change, beam intensity and mirror drive electrical signal, and form a control vector corresponding to the modulation parameter space index. Step 53: Using the response matrix as input, calculate the step size shrinkage ratio and angle micro-offset based on the intensity change rate of the control vector during the scanning execution phase, and realize the nonlinear scaling of the scanning path and the correction of the incident direction through the step size adjustment module and the angle micro-offset module respectively. Step 54: Based on the scanning control parameters generated after adjustment in step 53, high-resolution curvature amplitude sampling is performed within the predicted area. According to the dynamic changes of step size and incident angle, multi-angle amplitude response records are generated at the same spatial position, forming a high-resolution amplitude spectrum of continuous time series. Step 55: Using the high-resolution amplitude spectrum as input, compare it with the original curvature amplitude spectrum, calculate the scanning parameter deviation vector based on the difference signal, and feed the deviation vector back to the modulation parameter set generation process in step 51 to achieve dynamic correction.

2. The contour detection method for aluminum rod quality inspection based on image recognition technology according to claim 1, characterized in that, Step 2 also includes: Step 21: Perform gradient second-order differential mapping on the obtained depth parameter matrix along the contour direction to generate the curvature amplitude matrix; Step 22: Establish a fixed neighborhood around each contour point of the generated curvature amplitude matrix, and perform nonlinear weighted reconstruction on the amplitude values ​​within the fixed neighborhood to form a neighborhood enhancement matrix; Step 23: Physically rearrange the points of the generated neighborhood enhancement matrix along the contour direction according to multiple specified projection directions to form a directional curvature projection matrix. Step 24: Perform multi-scale spatial resampling on the generated directional curvature projection matrix at different contour length scales to generate a multi-scale curvature amplitude spectrum set; Step 25: Adaptive mapping encoding is performed on the generated multi-scale curvature amplitude spectrum set to map amplitude values ​​at different scales to independent encoding spaces while maintaining the correspondence between contour space positions.

3. A contour detection method for aluminum rod quality inspection based on image recognition technology according to claim 2, characterized in that, Methods for performing nonlinear weighted reconstruction include: Step 221: Using the neighborhood enhancement matrix as input, classify the amplitude values ​​in the neighborhood of each contour point according to their relative position at the neighborhood center point and the local curvature gradient to form several response levels. Step 222: Map the amplitude value corresponding to each level in the generated response hierarchy to a weighting coefficient. The mapping rule is based on the nonlinear physical mapping relationship constructed by the contour micro-cutting tendency and the neighborhood spatial position. Step 223: The generated weighting coefficients are weighted and accumulated point by point in the original amplitude values ​​in the neighborhood to form a neighborhood enhancement matrix, while maintaining the topological relationship of the neighborhood space; Step 224: Physically interact and adjust the boundary amplitude values ​​of adjacent neighborhoods in the generated neighborhood enhancement matrix to form the final neighborhood enhancement matrix, and output it.

4. A contour detection method for aluminum rod quality inspection based on image recognition technology according to claim 1, characterized in that, Step 3 also includes: Step 31: Using the cooling rate of the aluminum rod, surface temperature, and thermal expansion rate of the material as inputs, a preliminary pseudo-defect morphology prediction map is generated in the contour space. Step 32: Map the corresponding regions in the generated preliminary pseudo-defect morphology prediction map to the material micro-surface roughness parameters to form a roughness annotation prediction map; Step 33: Map the corresponding area in the generated roughness annotation prediction map to the environmental humidity parameter to form a corrected pseudo-defect morphology prediction map; Step 34: Using the generated curvature amplitude spectrum and the corrected pseudo-defect morphology prediction map as input, the curvature amplitude value is adjusted point by point within the prediction area to form the compensated curvature amplitude spectrum matrix.

5. A contour detection method for aluminum rod quality inspection based on image recognition technology according to claim 4, characterized in that, Point-by-point compensation methods for curvature amplitude spectrum include: Step 341: Using the corrected pseudo-defect morphology prediction map as input, the marked prediction regions are spatially located in the curvature amplitude spectrum matrix to form a region mapping matrix; Step 342: Generate local amplitude compensation weights based on the neighborhood micro-curvature characteristics and material physical parameters of each mapping point in the region mapping matrix. Step 343: Using the local amplitude compensation weights generated in step 342 as input, perform point-by-point weighted adjustment on each mapping point in the curvature amplitude spectrum matrix to form a preliminary compensation curvature amplitude spectrum matrix. Step 344: Physical continuity adjustment is performed on adjacent mapping points and their neighborhood amplitudes in the generated preliminary compensated curvature amplitude spectrum matrix to form the final compensated curvature amplitude spectrum matrix.

6. A contour detection system for aluminum rod quality inspection based on image recognition technology, applied to the contour detection method for aluminum rod quality inspection based on image recognition technology according to any one of claims 1-5, characterized in that, include: The multi-angle scanning module scans the surface of the aluminum rod at multiple incident angles using an optical scanner, obtains the reflection change curves under different incident angles, and converts the two-dimensional grayscale image into a depth parameter matrix. At the same time, it records the beam incident angle position, scanning speed, and scanning time sequence during the scanning process. The curvature transformation module is used to perform gradient second-order differential transformation on the obtained depth parameter matrix along the contour direction to generate the curvature amplitude spectrum, and apply local neighborhood nonlinear filtering and directional projection transformation to the curvature amplitude spectrum. The pseudo-defect compensation module generates a pseudo-defect morphology prediction map based on the cooling rate, surface temperature and thermal expansion coefficient of the aluminum rod. In the curvature amplitude spectrum calculation process generated in the curvature transformation module, the prediction area is compensated. At the same time, the micro-surface roughness parameters of the material and the environmental humidity information are included in the compensation weight calculation in the compensation process. The defect assessment module performs cross-angle dynamic comparison and curvature amplitude continuity judgment on potential defects detected in the curvature amplitude spectrum processed by the pseudo-defect compensation module. It combines contour differential features to perform correlation matching in multi-scale space, generates defect credibility score, and records the spatial distribution information of each defect. The dynamic optimization module uses the defect confidence score generated by the defect assessment module as the dynamic adjustment signal for the next round of scanning. By adjusting the incident angle, scanning speed and beam intensity of the optical scanner, it performs high-resolution curvature amplitude sampling on the predicted area in the false defect compensation module. At the same time, it introduces an adaptive step size adjustment and angle micro-offset mechanism in the scanning control to establish a feedback adjustment mechanism between scanning parameters and contour features.

Citation Information

Patent Citations

  • Surface defect inspecting method and device

    JP2002082060A

  • Method and apparatus for characterizing surface flaws utilizing ultrasonic surface waves

    US4307614A