Aluminum material surface oxide film defect detection method and system
By acquiring and analyzing the grayscale difference characteristics of aluminum surface images from multiple angles, the problem of sandblasting texture and gloss characteristics masking defects was solved, enabling accurate identification and quantitative assessment of oxide film defects on aluminum surfaces.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, the oxide film on the surface of aluminum materials can easily mask defects due to the sandblasting texture and gloss characteristics, leading to false detections and missed detections.
A rotating imaging device was used to acquire images of the aluminum surface from multiple angles. Pixel matching relationships were established through geometric coordinate transformation, grayscale difference feature vectors were constructed, reflection characteristics were analyzed, defect probability values were determined, and clustering and grade labeling were performed.
It effectively distinguishes between sandblasted textures and real defects, improving the accuracy and reliability of defect identification and providing a quantitative assessment of defect severity.
Smart Images

Figure CN120894350B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing technology, and specifically to a method and system for detecting defects in oxide films on aluminum surfaces. Background Technology
[0002] The oxide film on the surface of aluminum is the main anti-corrosion layer. However, during the production process, the oxide film on the surface of aluminum is prone to defects such as scratches and holes, which accelerate the corrosion of aluminum. Therefore, in order to ensure the stability of aluminum product quality, defect detection of the oxide film on the surface of aluminum is an essential process in aluminum production.
[0003] Currently, existing technologies mostly use images of aluminum surfaces taken from a single angle and analyze these images to identify defects. However, aluminum surfaces are usually sandblasted, and the oxide film itself has special gloss characteristics. During the analysis of images taken from a single angle, the sandblasting texture or reflection can easily mask the real defects, leading to false detections and missed detections. Summary of the Invention
[0004] To address the problem that images of aluminum surfaces taken from a single angle can obscure actual defects due to the sandblasting texture and the inherent gloss of the oxide film, this invention provides a method and system for detecting oxide film defects on aluminum surfaces. The specific technical solution adopted is as follows:
[0005] This invention proposes a method for detecting defects in the oxide film on the surface of aluminum materials, the method comprising:
[0006] The surface images of the aluminum material are captured from multiple angles by a preset rotating imaging device, and the pixel matching relationship of the same physical position in the surface images at each angle is established by geometric coordinate transformation.
[0007] For each surface image, a gray-level difference feature vector is constructed based on the spatial direction vector and gray-level difference features between each pixel and its neighboring pixels in the surface image.
[0008] For any physical location point, the matching pixels of the same physical location point at different angles are obtained using the pixel matching relationship; the reflection characteristic change vector is determined based on the grayscale difference feature vector difference characteristics between matching pixels at adjacent angles.
[0009] Based on the magnitude variation characteristics of the reflection characteristic variation vector, the defect probability value of the corresponding physical location point is determined;
[0010] Based on the pixel matching relationship, the defect probability value of the physical location point is mapped to the corresponding pixel of each surface image; pixels with a defect probability value not lower than the abnormal threshold are marked as abnormal pixels, abnormal pixels are clustered to obtain defect regions, and the defect regions are graded in the surface image.
[0011] Furthermore, the rotating shooting device includes a rotating platform for fixing the aluminum material and a shooting camera fixedly deployed directly above the rotating platform;
[0012] The process of acquiring surface images of the aluminum material at multiple angles using a preset rotating imaging device, and establishing pixel matching relationships at the same physical location in the surface images at various angles through geometric coordinate transformation, includes:
[0013] The control rotating platform carries the aluminum material and rotates it according to a preset rotation angle sequence. After pausing at each angle, the camera captures a frame of surface image.
[0014] Based on the calibration of the rotation axis of the rotating platform, a world coordinate system with the center of the rotating platform as the origin is established;
[0015] Based on the rotation angle sequence and camera calibration parameters, calculate the transformation matrix of the rotating platform relative to the world coordinate system during the acquisition of each frame of surface image;
[0016] For any physical location point in the world coordinate system, a transformation matrix is used to map it to the pixel coordinate system of each frame of surface image, thus establishing the pixel matching relationship between surface images of the same physical location point at different angles.
[0017] Furthermore, before constructing the grayscale difference feature vector for each pixel, a preprocessing step of the surface image is included:
[0018] The surface images from various angles are converted into grayscale images; an adaptive histogram equalization algorithm is used to enhance the grayscale images to obtain the enhanced surface images.
[0019] Furthermore, the process of constructing the grayscale difference feature vector includes:
[0020] For any pixel in the enhanced surface image, calculate the spatial direction vector from the pixel to each neighboring pixel.
[0021] Calculate the grayscale difference between a pixel and its neighboring pixels;
[0022] Multiply each grayscale difference value by its corresponding spatial direction vector to obtain a set of grayscale difference vectors;
[0023] The gray-level difference vectors of all pixels are summed to obtain the gray-level difference feature vector of each pixel.
[0024] Furthermore, the process of determining the reflection characteristic change vector includes:
[0025] The grayscale difference feature vectors of two matching pixels at the same physical location under adjacent angles are subtracted to obtain the reflection characteristic change vector between adjacent angles.
[0026] Furthermore, the process of determining the defect probability value includes:
[0027] Calculate the magnitude of the reflection characteristic change vector between all adjacent angles of the same physical location point to form a sequence of magnitudes for the same physical location point;
[0028] Calculate the arithmetic mean of the modulus length sequence as the modulus average; calculate the variance of the modulus length sequence.
[0029] The product of the average modulus length and the variance is normalized to obtain the defect probability value for the corresponding physical location point.
[0030] Furthermore, abnormal pixels are clustered to obtain defect regions, including:
[0031] Obtain the spatial coordinates of all abnormal pixels; calculate the Euclidean distance between each abnormal pixel as the spatial distance between them.
[0032] A density-based clustering algorithm is used to divide the set of abnormal pixels whose spatial distance is less than the preset neighborhood radius and whose number of abnormal pixels is greater than the minimum number of pixels into a cluster.
[0033] Morphological closing operations are performed on each cluster to fill the voids within the cluster and smooth the boundaries, so as to obtain connected and complete defect regions.
[0034] Furthermore, the defect areas in the surface image are graded, including:
[0035] Calculate the arithmetic mean of the defect probability values of all abnormal pixels in each defect region, and use it as the abnormality score of the corresponding defect region.
[0036] The grading threshold is adaptively determined based on the distribution characteristics of the anomaly scores of all defect areas.
[0037] The abnormality score of each defect area is compared with the grading threshold to determine the repair priority level of each defect area and then marked.
[0038] Furthermore, based on the distribution characteristics of the anomaly severity scores for all defective regions, a grading threshold is adaptively determined, including:
[0039] A preset adaptive threshold determination method was used to segment the abnormality scores of all defect areas and determine the optimal grading threshold for classifying different repair priority levels.
[0040] A system for detecting defects in an oxide film on the surface of aluminum is provided. The system includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of a method for detecting defects in an oxide film on the surface of aluminum.
[0041] The present invention has the following beneficial effects:
[0042] This invention acquires surface images from multiple angles and combines the grayscale differences between pixels to determine grayscale difference feature vectors. This allows for preliminary analysis of the brightness variations in surface texture while preserving directional information. Furthermore, considering the significant abrupt changes in grayscale difference feature vectors in defect areas compared to sandblasted textures, the influence of potential sandblasted textures is eliminated through vector-level differences, providing a stable and quantifiable feature basis for distinguishing normal and defective areas. Then, by analyzing the reflection characteristic change vector, the reflection changes of pixels at the same physical location at different angles are further analyzed. This effectively distinguishes between brightness changes caused by normal surface reflection and actual physical defects, improving the accuracy and reliability of defect identification. Finally, by calculating defect probability values, the severity of defects is quantified, providing intuitive and reliable data support for subsequent maintenance. Attached Figure Description
[0043] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a flowchart of a method for detecting defects in the oxide film on the surface of aluminum materials according to an embodiment of the present invention;
[0045] Figure 2 This is a working example diagram of a rotating imaging device provided in one embodiment of the present invention;
[0046] Figure 3 This is an example diagram illustrating the process of determining the defect probability value according to an embodiment of the present invention. Detailed Implementation
[0047] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a method and system for detecting defects in an aluminum surface oxide film according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0049] The following description, in conjunction with the accompanying drawings, details the specific scheme of the method and system for detecting defects in the oxide film on the surface of aluminum materials provided by the present invention.
[0050] Please see Figure 1 The diagram illustrates a flowchart of a method for detecting defects in the oxide film on the surface of aluminum materials according to an embodiment of the present invention. The method includes:
[0051] S101: Acquire surface images of aluminum material at multiple angles using a preset rotating imaging device, and establish pixel matching relationships at the same physical location in the surface images at various angles through geometric coordinate transformation.
[0052] It should be noted that the rotating shooting device includes a rotating platform for fixing the aluminum material and a shooting camera fixedly deployed directly above the rotating platform.
[0053] For example, an example diagram of the rotating shooting device in operation is shown below. Figure 2 As shown, the rotating platform is used to place the aluminum material to be inspected. It can rotate precisely around a central axis perpendicular to the surface of the aluminum material. During the acquisition process, it rotates 60° each time, and the aluminum material stops sequentially at preset rotation angles (e.g., 0°, 60°, 120°, 180°, 240°, 300°). The camera captures a surface image at each angle, for a total of 6 surface images. This indicates the position of the aluminum material before it begins to rotate; This indicates the position where the aluminum material stops after rotating 60°; This indicates the position where the aluminum material stops after rotating 120°; This indicates the position where the aluminum material stops after rotating 180°; This indicates the position where the aluminum material stops after rotating 240°; This indicates the position where the aluminum material stops after rotating 300°.
[0054] In this embodiment, a rotating platform carrying aluminum material is controlled to rotate according to a preset rotation angle sequence, and a frame of surface image is captured by a camera after each stop at each angle. Based on the calibration of the rotation axis of the rotating platform, a world coordinate system with the center of the rotating platform as the origin is established. According to the rotation angle sequence and camera calibration parameters, the transformation matrix of the rotating platform relative to the world coordinate system is calculated when each frame of surface image is captured. For any physical location point in the world coordinate system, the transformation matrix is used to map it to the pixel coordinate system of each frame of surface image, and the pixel matching relationship between surface images of the same physical location point at different angles is established.
[0055] It should be noted that the specific values of the preset rotation angle sequence are determined according to the actual situation, and this embodiment does not impose a specific limitation. For example, if the rotating platform is a circular rotating platform, in order to ensure that complete and appropriate images are captured, the circular surface of the rotating platform can be divided into sections with a central angle of 60 degrees. The six arcs are given, and the preset rotation angle sequence is (0°, 60°, 120°, 180°, 240°, 300°).
[0056] It should be noted that the calibration of the rotation axis of the rotating platform refers to the precise determination of the spatial position parameters of the rotation axis of the rotating platform in the rotating shooting device through common technical means, in order to establish a unified coordinate reference.
[0057] The rotation axis indicates the central axis around which the rotating platform rotates, and is usually a straight line perpendicular to the surface of the aluminum material.
[0058] It is important to understand that as the aluminum material rotates with the rotating platform, the coordinates of pixels at the same physical location in the image coordinate system will change in different angle images. Therefore, in order to ensure that all subsequent feature analyses are based on the "same physical location" and to avoid feature mismatch due to differences in viewing angle, a standardized geometric coordinate transformation is required.
[0059] The world coordinate system has the center of the rotating platform as the origin, the plane on which the aluminum material surface is located as the XY plane, and the direction perpendicular to the aluminum material surface as the Z axis.
[0060] The pixel coordinate system has the top left corner of each surface image as the origin, the horizontal axis to the right as the u-axis, and the vertical axis downward as the v-axis. The coordinates of the pixel are represented by (u, v).
[0061] It should be noted that the specific methods for calculating the transformation matrix and mapping any physical location point to the pixel coordinate system of each frame of surface image using the transformation matrix are well-known techniques to those skilled in the art, and will not be elaborated upon in this embodiment. For example, the intrinsic parameters (focal length, principal point coordinates) and extrinsic parameters (rotation matrix and translation vector of the camera relative to the world coordinate system at various angles) of the shooting camera are obtained through camera calibration (such as the Zhang Zhengyou calibration method), and a mapping relationship between pixel coordinates and world coordinates is established. For example, the coordinates (X, Y, Z) of a certain physical location point in the world coordinate system can be converted into coordinates in the shooting camera coordinate system through the camera extrinsic parameters. Then, the intrinsic parameters of the camera are used to convert the data into pixel coordinates (u, v) in the pixel coordinate system.
[0062] S102: For each surface image, construct the gray-level difference feature vector of each pixel based on the spatial direction vector and gray-level difference features between each pixel and its neighboring pixels in the surface image.
[0063] Neighboring pixels are selected from a specific range of pixels around each pixel as the center. For example, selecting 8 neighboring pixels means selecting pixels in the eight directions above, below, left, right, upper left, upper right, lower left, and lower right of each pixel.
[0064] To improve the quality of the surface image and eliminate irrelevant information, the surface image needs to be preprocessed before constructing the grayscale difference feature vector of each pixel. The specific process is as follows: convert the surface image at each angle into a grayscale image; and use an adaptive histogram equalization algorithm to enhance the grayscale image to obtain the enhanced surface image.
[0065] It should be noted that the specific methods for surface image grayscale conversion and the specific methods for enhancing the image using adaptive histogram equalization algorithms are well-known techniques to those skilled in the art, and will not be elaborated upon in this embodiment.
[0066] It is important to understand that if the surface oxide film has different defects, it will produce different reflection angles. As a result, light will be refracted to different positions on the aluminum surface, and the light will be reflected to different degrees. This will reflect differences in grayscale values on the image at different positions. Therefore, grayscale difference feature vectors can be constructed for each pixel based on the changes in grayscale values.
[0067] In this embodiment, for any pixel in the enhanced surface image, the spatial direction vector from the pixel to each neighboring pixel is calculated; the gray value difference between the pixel and each neighboring pixel is calculated; each gray value difference is multiplied by the corresponding spatial direction vector to obtain a set of gray value difference vectors; and all gray value difference vectors are summed to obtain the gray value difference feature vector of the pixel.
[0068] It should be noted that the spatial direction vector, or direction vector, abstracts the relative position of each pixel with each neighboring pixel into a unit vector (a vector with a magnitude of 1), which is used to represent the direction attribute.
[0069] For example, taking a pixel in the enhanced grayscale image as the origin, select the pixels in the 8-neighborhood of that pixel, namely the pixels in the eight directions of up, down, left, right, upper left, upper right, lower left, and lower right, such as the neighboring pixels directly above that pixel. Then the spatial direction vector from that pixel to the neighboring pixels directly above can be represented as (0, 1).
[0070] It's important to understand that if the difference in grayscale value between a pixel and its neighboring pixels is positive, it indicates that the pixel is brighter than its neighbors; if it is negative, it indicates that the pixel is darker than its neighbors. However, regardless of whether the value is positive or negative, the larger the absolute value of the grayscale difference, i.e., the magnitude of the grayscale difference feature vector, the more drastic the local grayscale change of the pixel. Therefore, the grayscale difference feature vector integrates the "local grayscale change" and "spatial orientation distribution" in a two-dimensional image into a structured vector, which more comprehensively characterizes the microscopic features of the aluminum surface compared to a single grayscale value or simple orientation information.
[0071] It should be noted that vector summation is a common technique, and will not be elaborated upon in this embodiment.
[0072] S103: For any physical location point, use pixel matching relationships to obtain matching pixels of the same physical location point at different angles; determine the reflection characteristic change vector based on the grayscale difference feature vector difference characteristics between matching pixels at adjacent angles.
[0073] It is important to understand that since the surface of aluminum is generally relatively flat, the reflection angle of normal areas tends to vary uniformly. However, defective areas often cause changes in the flatness of the aluminum surface, resulting in a certain degree of undulation. Moreover, the defect texture produced by real defective areas is more likely to cause abrupt changes in reflection compared to sandblasted textures. Therefore, the reflection angle of defective areas often changes abnormally under different shooting angles, which in turn causes abnormal changes in the value of the reflection vector. Thus, by analyzing the changes in the grayscale difference feature vector at the same physical location in the surface image under different angles, it can be determined whether the reflection at that physical location has changed abruptly. Furthermore, by comparing features across angles, abnormalities in the reflection characteristics of defects can be captured.
[0074] In this embodiment, the grayscale difference feature vectors of two matching pixels at the same physical location under adjacent angles are subtracted to obtain the reflection characteristic change vector between adjacent angles.
[0075] Matching pixels are the pixels that appear at different angles in the actual physical space of an aluminum surface (such as a specific oxide film area).
[0076] Pixel matching relationships are the rules for mapping pixel coordinates of the same physical location in surface images at different angles. For example, if a point at a certain physical location corresponds to pixel A in a 0° surface image, its corresponding pixel in a 60° surface image can be found through pixel matching relationships. Pixels corresponding to the 120° surface image wait.
[0077] It is important to understand that using pixel matching relationships to obtain matching pixels is to ensure that the subsequent analysis is of the feature changes of the "same physical location" at different angles, to eliminate feature errors caused by mismatched positions, and to establish a spatial consistency basis for cross-angle comparison.
[0078] It is understood that the surface images at adjacent angles can be determined based on the rotation sequence of the aluminum material carried by the rotating imaging device, and then the matching pixel points at adjacent angles can be determined.
[0079] It should be noted that the specific algorithm for vector subtraction is a publicly available technology, and will not be described in detail in this embodiment.
[0080] It is important to understand that the reflection characteristic change vector in defective areas usually has characteristics such as "abnormally large magnitude" and "irregular direction", while the reflection characteristic change vector in normal areas has a smaller magnitude and a stable directional distribution. Therefore, if the magnitude of the reflection characteristic change vector between a pair of adjacent angles is larger, it reflects a stronger change in reflection characteristics, which indicates that the surface feature difference of the corresponding physical location point is more significant when the viewing angle changes.
[0081] S104: Determine the defect probability value of the corresponding physical location point based on the magnitude change characteristics of the reflection characteristic change vector.
[0082] It is important to understand that defective areas behave differently at different angles. They may only exhibit large abrupt changes in reflection angle at certain angles. Furthermore, normal oxide film areas (such as uniform sandblasted textures) have small and gradual differences in feature vectors between adjacent angles due to their regular surface structure. In contrast, defective areas (such as scratches and holes) have irregular surface structures, and changes in viewing angle can cause abrupt changes in the distribution of reflected light. The magnitude of the reflection characteristic change vector will fluctuate abnormally. Therefore, it is possible to conduct in-depth analysis of the reflection angle changes at all angles, that is, the fluctuation of the reflection characteristics of the surface features at the same physical location when the viewing angle changes, in order to further determine the probability that different locations are real defects.
[0083] The process of determining the defect probability value is as follows: Figure 3 As shown, it includes:
[0084] S104-1: Calculate the magnitude of the reflection characteristic change vector between all adjacent angles of the same physical location point, forming a sequence of magnitudes for the same physical location point.
[0085] The modulus sequence records the intensity change of the reflection characteristic change vector at the same physical location point as the viewing angle changes continuously. The intensity change of reflection in normal areas is usually gradual (small modulus and small fluctuations), while defective areas may show drastic fluctuations (large modulus and instability).
[0086] For example, if four sets of surface images are captured at 0°, 60°, 120°, and 180° at a certain physical location, and the adjacent angle combinations are (0°-60°), (60°-120°), and (120°-180°), the corresponding magnitudes of the reflection characteristic change vectors are respectively... , , Then the modulus sequence is [ , , ].
[0087] S104-2: Calculate the arithmetic mean of the modulus length sequence as the modulus length mean; calculate the variance of the modulus length sequence.
[0088] The average modulus length represents the average difference in reflectivity of the corresponding physical location across all adjacent angles. Due to irregular surface structures, defective regions exhibit significantly greater reflectivity differences at most angles than normal regions, thus their average modulus length is typically larger. For example, assuming the modulus length sequence is [ , , The average modulus can be expressed by the following formula: ,in, This represents the average modulus.
[0089] The variance of the modulus sequence reflects the stability of the intensity difference in reflectance characteristics, i.e., the intensity fluctuation. Normal regions have a uniform surface structure, and the intensity of reflectance characteristics changes gradually between adjacent angles, resulting in a small variance. However, the reflectance characteristics of defective regions can change abruptly with small changes in viewing angle (e.g., a sudden increase in reflectance at the edge of a defect at a certain angle, while adjacent angles show no significant change), leading to a significant increase in variance. Therefore, assuming the modulus sequence is […]. , ,..., Let n be a positive integer, representing the total number of moduli in the moduli sequence. Then the variance of the moduli sequence can be expressed by the following formula:
[0090]
[0091] in, Represents the variance of the modulus-length sequence; This represents the i-th modulus in the modulus sequence; This represents the average modulus of the modulus sequence.
[0092] It should be noted that, in order to scientifically analyze the intensity of the reflection characteristic change vector when the viewing angle changes continuously at the same physical location point, surface images are taken at a suitable number of angles during the shooting process. This results in multiple pairs of adjacent angles, and thus multiple reflection characteristic change vectors. Therefore, the total number of moduli in the modulus sequence cannot be zero.
[0093] S104-3: Normalize the product of the average value and variance of the modulus to obtain the defect probability value of the corresponding physical location point.
[0094] It is important to understand that if the average magnitude of pixels at a certain physical location is larger and the variance is larger (with more dramatic fluctuations), then the defect probability value is significantly higher, reflecting that there is a greater likelihood of defects at that physical location.
[0095] S105: Based on the pixel matching relationship, the defect probability value of the physical location point is mapped to the corresponding pixel point of each surface image; the pixel point with a defect probability value not lower than the abnormal threshold is marked as an abnormal pixel point, the abnormal pixel points are clustered to obtain the defect area, and the defect area is graded in the surface image.
[0096] It should be noted that the defect probability value of a given physical location is unique. By using matching relationships, the corresponding pixel in the surface image at each angle can be determined, and the same probability value can be assigned to these pixels. For example, if the defect probability value of physical location A is 0.85, its corresponding pixel in the 0° image can be found through matching relationships. Pixels in a 60° image ,but and The defect probability values are all marked as 0.85.
[0097] It should be noted that the specific value of the abnormal threshold is determined according to the actual situation, and this embodiment does not impose a specific limitation. For example, if the abnormal threshold is 0.5, it can be clearly found that pixels with a defect probability value of not less than 0.5 are considered to have a higher probability of having defects.
[0098] In this embodiment, the spatial coordinates of all abnormal pixels are obtained; the Euclidean distance between each abnormal pixel is calculated as the spatial distance between each abnormal pixel; a density-based clustering algorithm is used to divide the set of abnormal pixels whose spatial distance is less than the preset neighborhood radius and whose number of abnormal pixels is greater than the minimum number of pixels into a cluster; morphological closing operation is performed on each cluster to fill the holes in the cluster and smooth the boundaries to obtain a connected and complete defect region.
[0099] It should be noted that density-based clustering algorithms are well-known techniques to those skilled in the art, and will not be elaborated upon in this embodiment. For example, the DBSCAN algorithm is used.
[0100] Spatial coordinates are the coordinates of an abnormal pixel in the pixel coordinate system of a surface image. For example, the spatial coordinates of an abnormal pixel are represented by (u, v).
[0101] Euclidean distance is a commonly used metric for measuring the straight-line distance between two points in two-dimensional space. For any two outlier pixels... ( , )and ( , ),but and The Euclidean distance between them can be expressed as .
[0102] The preset neighborhood radius defines the range of nearest neighbor pixels. If the preset neighborhood radius is 3 pixels, then if the Euclidean distance between two abnormal pixels is not greater than 3, then the two abnormal pixels are determined to be spatially adjacent.
[0103] Minimum pixel count threshold: Defines the minimum number of pixels (e.g., 5 pixels) required for a cluster. If the number of other abnormal pixels in the neighborhood of an abnormal pixel is not less than the minimum pixel count threshold, then the abnormal pixel is considered a "core pixel".
[0104] In this embodiment, the arithmetic mean of the defect probability values of all abnormal pixels in each defect region is calculated as the abnormality score of the corresponding defect region; the grading threshold is adaptively determined based on the distribution characteristics of the abnormality scores of all defect regions; the abnormality score of each defect region is compared with the grading threshold to determine the repair priority level of each defect region and then labeled.
[0105] It should be noted that a preset adaptive threshold determination method is used to segment the abnormality scores of all defect areas and determine the optimal grading threshold for classifying different repair priority levels.
[0106] It should be noted that the specific algorithm for determining the preset adaptive threshold can be a common algorithm, such as clustering segmentation based on data distribution (e.g., K-means clustering), or threshold segmentation based on maximum inter-class variance (e.g., Otsu's method, OTSU algorithm). This embodiment will not elaborate further. For example, firstly, the abnormality score data of all defect areas are statistically analyzed. Based on the score distribution, a histogram is constructed to observe the clustering of the data. Suppose that the scores are found to be concentrated in three intervals: 0.5-0.6, 0.6-0.8, and 0.8-1.0, indicating that they can be divided into three repair priority levels.
[0107] It should be noted that the anomaly score comprehensively reflects the average defect probability of the entire defect area. The higher the anomaly score of a defect area, the more the pixels in that area conform to the defect characteristics (the more drastic and unstable the changes in reflectivity), and the higher the severity of the defect. For example, a scratch area with a score of 0.85 is usually more likely to be a serious defect than an area with an anomaly score of 0.6.
[0108] For example, suppose the classification thresholds determined by the adaptive method are as follows: (e.g., 0.6) and (For example, 0.8), then if the anomaly score of a certain defect area is not less than If the defective area is classified as "high priority" (requires priority repair, indicating the most severe defect), then the defective area is classified as "high priority" (requiring priority repair, indicating the most severe defect); if the anomaly score of a certain defective area is less than... and not less than If the score is within the specified range, the defect area is classified as "medium priority" (second priority for repair); if the anomaly score of a defect area is less than the specified range, the defect area is classified as "medium priority" (second priority for repair). If the defective area is identified as "low priority" (it can be repaired later or does not need to be repaired), then the defective area is determined to be "low priority".
[0109] It should be noted that, in order to intuitively distinguish the degree of urgency of defect repair, the repair priority level can be visually marked. For example, in the surface image, different colors (such as red for high priority, yellow for medium priority, and green for low priority) can be used to mark each defect area, along with an anomaly score and level information.
[0110] A system for detecting defects in oxide films on aluminum surfaces includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of a method for detecting defects in oxide films on aluminum surfaces.
[0111] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0112] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A method for detecting defects in the oxide film on the surface of aluminum materials, characterized in that, The method includes: The surface images of the aluminum material are captured from multiple angles by a preset rotating imaging device, and the pixel matching relationship of the same physical position in the surface images at each angle is established by geometric coordinate transformation. For each surface image, a gray-level difference feature vector is constructed based on the spatial direction vector and gray-level difference features between each pixel and its neighboring pixels in the surface image. For any physical location point, the matching pixels of the same physical location point at different angles are obtained using the pixel matching relationship; the reflection characteristic change vector is determined based on the grayscale difference feature vector difference characteristics between matching pixels at adjacent angles. Based on the magnitude variation characteristics of the reflection characteristic variation vector, the defect probability value of the corresponding physical location point is determined; Based on the pixel matching relationship, the defect probability value of the physical location point is mapped to the corresponding pixel of each surface image; the pixel with a defect probability value not lower than the abnormal threshold is marked as an abnormal pixel, the abnormal pixels are clustered to obtain the defect region, and the defect region is graded in the surface image. Before constructing the grayscale difference feature vector for each pixel, a preprocessing step of the surface image is also included: The surface images from various angles are converted into grayscale images; an adaptive histogram equalization algorithm is used to enhance the grayscale images to obtain the enhanced surface images. The grayscale difference feature vector construction process includes: For any pixel in the enhanced surface image, calculate the spatial direction vector from the pixel to each neighboring pixel. Calculate the grayscale difference between a pixel and its neighboring pixels; Multiply each grayscale difference value by its corresponding spatial direction vector to obtain a set of grayscale difference vectors; The gray-level difference vectors of all gray-level difference vectors are summed to obtain the gray-level difference feature vector of each pixel. The process of determining the reflection characteristic change vector includes: Subtract the grayscale difference feature vectors of two matching pixels at the same physical location under adjacent angles to obtain the reflection characteristic change vector between adjacent angles; The process of determining the defect probability value includes: Calculate the magnitude of the reflection characteristic change vector between all adjacent angles of the same physical location point to form a sequence of magnitudes for the same physical location point; Calculate the arithmetic mean of the modulus length sequence as the modulus average; calculate the variance of the modulus length sequence. The product of the average modulus length and the variance is normalized to obtain the defect probability value for the corresponding physical location point.
2. The method for detecting defects in the oxide film on the surface of aluminum materials according to claim 1, characterized in that, The rotating shooting device includes a rotating platform for fixing aluminum materials and a shooting camera fixedly deployed directly above the rotating platform; The process of acquiring surface images of the aluminum material at multiple angles using a preset rotating imaging device, and establishing pixel matching relationships at the same physical location in the surface images at various angles through geometric coordinate transformation, includes: The control rotating platform carries the aluminum material and rotates it according to a preset rotation angle sequence. After pausing at each angle, the camera captures a frame of surface image. Based on the calibration of the rotation axis of the rotating platform, a world coordinate system with the center of the rotating platform as the origin is established; Based on the rotation angle sequence and camera calibration parameters, calculate the transformation matrix of the rotating platform relative to the world coordinate system during the acquisition of each frame of surface image; For any physical location point in the world coordinate system, a transformation matrix is used to map it to the pixel coordinate system of each frame of surface image, thus establishing the pixel matching relationship between surface images of the same physical location point at different angles.
3. The method for detecting defects in the oxide film on the surface of aluminum materials according to claim 1, characterized in that, The process of clustering abnormal pixels to obtain defect regions includes: Obtain the spatial coordinates of all abnormal pixels; calculate the Euclidean distance between each abnormal pixel as the spatial distance between them. A density-based clustering algorithm is used to divide the set of abnormal pixels whose spatial distance is less than the preset neighborhood radius and whose number of abnormal pixels is greater than the minimum number of pixels into a cluster. Morphological closing operations are performed on each cluster to fill the voids within the cluster and smooth the boundaries, so as to obtain connected and complete defect regions.
4. The method for detecting defects in the oxide film on the surface of aluminum materials according to claim 1, characterized in that, The step of classifying defect areas in the surface image includes: Calculate the arithmetic mean of the defect probability values of all abnormal pixels in each defect region, and use it as the abnormality score of the corresponding defect region. The grading threshold is adaptively determined based on the distribution characteristics of the anomaly scores of all defect areas. The abnormality score of each defect area is compared with the grading threshold to determine the repair priority level of each defect area and then marked.
5. The method for detecting defects in the oxide film on the surface of aluminum materials according to claim 4, characterized in that, The adaptive determination of the grading threshold based on the distribution characteristics of the anomaly severity scores of all defective regions includes: A preset adaptive threshold determination method was used to segment the abnormality scores of all defect areas and determine the optimal grading threshold for classifying different repair priority levels.
6. A system for detecting defects in the oxide film on the surface of aluminum materials, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Wafer surface defect regional detection method based on visual image
CN110286126A
Aluminum composite plate defect detection method and system based on artificial intelligence
CN117611583A