A method for classifying defects in pressure forming of aluminum alloy tubes
By performing shift matching and DTW distance analysis on the outer contour feature sequence of aluminum alloy shells, the problem of automated detection and classification of surface defects of aluminum alloy shells was solved, improving the accuracy and efficiency of detection.
Patent Information
- Application Number
- CN202511319122.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-09-16
AI Technical Summary
During the extrusion molding process of aluminum alloy tubes, shape defects such as pits or protrusions may exist on the surface of the aluminum alloy shell, affecting the appearance quality and structural strength of the shell. Existing technologies are difficult to effectively classify and detect these defects.
By acquiring the front surface image of the aluminum alloy shell, the centroid of the outer contour and the central moments of different outer contour segments are determined, a feature sequence is constructed, and a shift matching is performed with the feature sequence of the standard aluminum alloy shell. The contour defect value is determined by using the DTW distance, thereby realizing the automated detection and classification of shape defects.
It enables accurate and automated detection and classification of shape defects in aluminum alloy shells, avoiding the influence of camera shooting angle and equipment vibration, and improving the accuracy and efficiency of detection results.
Smart Images

Figure CN120807532B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method for classifying defects in the compression molding of aluminum alloy tubes. Background Technology
[0002] GIS (Gas Insulated Switch Gear) is a type of electrical equipment that integrates various high-voltage electrical devices into a closed metal housing and uses insulating gas as the insulating medium. Three-way or four-way valves in GIS can regulate the flow direction, flow rate, and pressure distribution of insulating gas.
[0003] The body of a three-way or four-way valve is the external protective structure of the valve. It must withstand the high pressure of the internal insulating gas to ensure the mechanical strength and sealing performance of the valve in a fully enclosed GIS environment and prevent leakage of the insulating gas.
[0004] The housing of a three-way or four-way valve can be obtained by extruding an aluminum alloy tube; for example, pressure is applied to the end of the aluminum alloy tube using a press, and the displacement and deformation direction of the aluminum alloy tube are restricted by a die during the pressing process; the aluminum alloy tube can undergo plastic deformation under the pressure of the press and the restriction of the die, thereby obtaining the required shape of the three-way or four-way valve; through further processing of the aluminum alloy housing obtained after extrusion, a GIS three-way or four-way valve can be made.
[0005] During the extrusion process of aluminum alloy tubes to obtain a shell, the surface of the obtained aluminum alloy shell may have shape defects such as pits or protrusions. The defects on the surface of the aluminum alloy shell will affect the appearance quality, structural strength and airtightness of the subsequently manufactured three-way or four-way valves. Therefore, it is necessary to classify the defects that may exist in the aluminum alloy tube after being compressed. Summary of the Invention
[0006] To classify potential defects in aluminum alloy shells obtained after aluminum alloy tubes are subjected to pressure, this application provides a method for classifying defects in compression molding of aluminum alloy tubes. The method includes: acquiring a front surface image of the aluminum alloy shell to be inspected obtained by extruding the aluminum alloy tube; obtaining a first outer contour of the aluminum alloy shell to be inspected based on the front surface image; determining the centroid of the outer contour pixels of the first outer contour; determining the central moments of different outer contour segments of the first outer contour relative to the centroid of the first outer contour; constructing a first feature sequence using the central moments of the different outer contour segments of the first outer contour as elements; and obtaining a second feature sequence pre-constructed for a standard aluminum alloy shell; the second feature sequence is determined based on the second outer contour of the standard aluminum alloy shell; performing shift matching on the first feature sequence and the second feature sequence; determining the contour defect value based on the DTW distance of the shift matching result; using the contour defect value to determine whether shape defects exist on both sides of the front surface of the aluminum alloy shell to be inspected; and classifying shape defects if they exist.
[0007] This allows for more accurate automated detection and classification of shape defects that may exist in aluminum alloy tubes under pressure.
[0008] Optionally, the central moments of different outer contour segments of the first outer contour are determined in the following way: a polar coordinate system is constructed with the centroid of the first outer contour as the origin, and the first outer contour is divided into a predetermined number of outer contour segments according to the angles corresponding to them in the polar coordinate system; for the target outer contour segment among the multiple outer contour segments of the first outer contour, the average distance and average angle of the pixel point of the target outer contour segment to the centroid in the polar coordinate system are determined; the normalized central moments of the target outer contour segment are determined based on the difference between the distance from the pixel point to the centroid and the average distance, the difference between the angle to the centroid and the average angle, and the gradient value of the pixel point in the frontal surface image.
[0009] Optionally, shift matching is performed on the first feature sequence and the second feature sequence, including: performing a shift operation on the first feature sequence and determining the similarity between the sequence obtained after the shift operation and the second feature sequence; the shift operation includes shifting the element at the end position of the sequence to the beginning position of the sequence; performing the shift operation again on the sequence obtained after the shift operation, and performing the step of determining the similarity between the sequence obtained after the shift operation and the second feature sequence again; when the number of shift operations reaches the number of elements in the first feature sequence, the sequence with the smallest similarity corresponding to all shift operations is taken as the target feature sequence after shift matching.
[0010] In this way, by performing multiple shift operations on the first feature sequence, a sequence that best matches the second feature sequence can be obtained, avoiding the influence of the camera's shooting direction or vibrations on the equipment on the detection results.
[0011] Optionally, determining the profile defect value based on the DTW distance of the shift matching result includes: using the DTW distance of the shift matching result as the profile defect value.
[0012] In this way, the contour defect value corresponding to the front of the aluminum alloy shell to be inspected can be determined simply and effectively, so as to determine whether there are defects on both sides of the front of the aluminum alloy shell to be inspected.
[0013] Optionally, the shift matching result includes a first matching sequence and a second matching sequence; the contour defect value is determined in the following way: based on the difference in local shape features between the outer contour segments corresponding to the first matching sequence and the outer contour segments corresponding to the second matching sequence, the weight value between the matching element pairs in the first matching sequence and the second matching sequence is determined; using the weight value between the matching element pairs in the first matching sequence and the second matching sequence, the distance between the matching element pairs is weighted and summed to obtain the contour defect value.
[0014] In this way, the weight values of matching element pairs can be adaptively determined, the distances between matching element pairs can be weighted and summed to obtain the contour defect value, and the contribution of the element pairs to the contour defect value can be determined according to the actual situation of the element pairs, thus obtaining a more accurate contour defect value.
[0015] Optionally, the weight values between matching element pairs in the first matching sequence and the second matching sequence are determined in the following way: ,in, Let be the weight value between the i-th matching element pair in the first matching sequence and the second matching sequence, and exp be an exponential function with base constant . Let be the average angle value of the outer contour segment corresponding to the element from the first matching sequence in the i-th element pair. Let be the average angle value of the outer contour segment corresponding to the element from the second matching sequence in the i-th element pair. The standard deviation of the differences between matched element pairs at their corresponding mean angle values. It is a preset positive number.
[0016] Optionally, if it is determined that there are no shape defects on either side of the front surface of the aluminum alloy shell to be inspected, the method further includes: determining the LBP value of the target pixel based on the grayscale values of pixels in the neighborhood of the target pixel in the grayscale image of the front surface; determining the information entropy of the LBP values of pixels in the neighborhood of the target pixel, wherein the information entropy is used to characterize the complexity of the LBP values of pixels in the neighborhood; and determining that there is a crack defect at the target pixel if the information entropy of the target pixel is greater than a preset information entropy threshold.
[0017] In this way, if it is determined that there are no shape defects on both sides of the front of the aluminum alloy shell to be tested, it is possible to further detect the crack defects that may exist on the front of the aluminum alloy shell to be tested.
[0018] Optionally, if it is determined that there are no shape defects on both sides of the front of the aluminum alloy housing to be inspected, the method further includes: acquiring a side surface image of the aluminum alloy housing to be inspected, and determining the contour defect degree value of the side surface image, so as to determine whether there are shape defects on both sides of the side of the aluminum alloy housing to be inspected.
[0019] Optionally, the shift matching result includes a first matching sequence and a second matching sequence that match. If it is determined that there are shape defects on both sides of the front of the aluminum alloy shell to be tested, the method further includes: according to the distance between the matching elements in the first matching sequence and the second matching sequence, taking the outer contour segment corresponding to the largest distance among the different matching element pairs as the outer contour segment where the shape defect exists in the aluminum alloy shell to be tested.
[0020] Optionally, when shape defects exist on both sides of the front, shape defects are classified, including: determining the classification result of the shape defects based on the contour defect value; wherein, contour defect values of different ranges correspond to different classification results of shape defects.
[0021] The technical solution provided by the embodiments of this application may include the following beneficial effects: by determining the first outer contour of the aluminum alloy shell to be inspected and determining the centroid of the first outer contour, the central moments of different outer contour segments of the first outer contour relative to the centroid of the first outer contour can better reflect the shape features of different outer contour segments of the aluminum alloy shell to be inspected. A first feature sequence is determined based on the different outer contour segments of the first outer contour, and a second feature sequence is determined in advance based on a standard aluminum alloy shell. The first feature sequence and the second feature sequence are shifted and matched, which can avoid the influence of possible rotation of the first outer contour on the detection results. The contour defect value determined based on the DTW distance of the shift matching result can obtain a more accurate classification result of the shape defects of the aluminum alloy shell to be inspected.
[0022] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0023] Figure 1 This is a schematic diagram illustrating the extrusion molding process of an aluminum alloy tube according to an exemplary embodiment.
[0024] Figure 2 This is a schematic diagram of an extruded aluminum alloy shell according to an exemplary embodiment.
[0025] Figure 3 This is a flowchart illustrating a method for classifying defects in the compression molding of aluminum alloy tubes according to an exemplary embodiment.
[0026] Figure 4 This is a schematic diagram of an unpressurized aluminum alloy tube placed in a limiting mold.
[0027] Figure 5 This is a schematic diagram of an aluminum alloy tube placed in a limiting mold after being pressurized.
[0028] Figure 6 This is a schematic diagram showing the comparison results between the first matching sequence and the second matching sequence. Detailed Implementation
[0029] First, a brief introduction to the application scenarios of the embodiments of this application will be given. In the application scenarios of this application... Figure 1 This is a schematic diagram illustrating the extrusion molding process of an aluminum alloy tube according to an exemplary embodiment, such as... Figure 1 As shown, an aluminum alloy tube can be extruded using a press, causing the aluminum alloy tube to undergo plastic deformation under pressure. By using a limiting die to restrict the aluminum alloy tube during the pressing process, the shape obtained after the aluminum alloy tube is compressed can be limited.
[0030] The limiting mold is placed on the base of the press, and the limiting mold has a cavity for placing the aluminum alloy tube. The aluminum alloy tube is placed in the cavity of the limiting mold, and under the vertical downward pressure applied by the top of the press, the aluminum alloy tube can be pressed to gradually form an aluminum alloy shell of the target shape.
[0031] Figure 2 This is a schematic diagram of an extruded aluminum alloy shell according to an exemplary embodiment, as shown below. Figure 2 As shown, the shape of the bottom of the aluminum alloy tube, which is restricted by the limiting mold, does not change, while the shape of the upper part of the aluminum alloy tube deforms under pressure.
[0032] Compared to injecting molten liquid aluminum into a mold that matches the target shape, where the liquid aluminum cools in the mold to form an aluminum alloy shell, the aluminum alloy shell shown in the embodiments of this application is obtained by plastically deforming an aluminum alloy tube under the constraint of a limiting mold and the pressure applied by a press. This can shorten the time required to produce the aluminum alloy shell at the production end.
[0033] In this embodiment, the aluminum alloy tube is extruded, causing it to undergo plastic deformation under the applied pressure. Compared to the aluminum alloy shell obtained through the casting process, the aluminum alloy shell obtained through the production process in this embodiment has a more compact structure, which can effectively improve the tensile strength, yield strength, hardness, and other mechanical properties of the obtained aluminum alloy shell.
[0034] In the aluminum alloy shells obtained by extruding aluminum alloy tubes, there may be shape defects such as protrusions or dents. These defects will affect the appearance quality and structural strength of the aluminum alloy shells. Therefore, it is necessary to perform defect detection on the obtained aluminum alloy shells and classify the defects of the aluminum alloy shells that are found to have defects, so as to carry out targeted treatment of the shape defects in a timely manner.
[0035] To address the aforementioned technical problems, this application provides a method for classifying defects in the compression molding of aluminum alloy tubes. Figure 3 This is a flowchart illustrating a method for classifying defects in the compression molding of aluminum alloy tubes according to an exemplary embodiment, such as... Figure 3 As shown, the method includes the following steps.
[0036] In step S101, a front surface image of the aluminum alloy shell to be tested, obtained by extruding the aluminum alloy tube, is acquired, and the first outer contour of the aluminum alloy shell to be tested is obtained based on the front surface image.
[0037] In this embodiment, the extruded aluminum alloy tube is a circular cross-section aluminum alloy tube. By applying pressure to the top of the formed aluminum alloy tube and using the set limiting mold to restrict the bottom of the aluminum alloy tube during the pressure process, the aluminum alloy tube can undergo plastic deformation during the pressure process, so that the shape of the obtained aluminum alloy shell after extrusion is consistent with the shape of the required standard aluminum alloy shell.
[0038] An image acquisition device can be installed on the front of the aluminum alloy shell obtained after extrusion to acquire an image of the front surface of the aluminum alloy shell; other components besides the aluminum alloy shell can be removed beforehand from the field of view of the image acquisition device.
[0039] Alternatively, the initial image acquired by the image acquisition device can be segmented so that only the aluminum alloy shell to be detected is retained in the obtained front surface image, avoiding interference from other background information besides the aluminum alloy shell. The specific process can be referred to in the prior art, and will not be repeated here in the embodiments of this application.
[0040] The first outer contour corresponds to the outer contour of the aluminum alloy shell to be detected in the front surface image. The first outer contour includes the pixel points corresponding to different positions of the outer contour of the aluminum alloy shell to be detected in the front surface image.
[0041] The outer contour of the aluminum alloy shell obtained after extrusion has significant differences from the features of other pixels in the front surface image. Grayscale processing can be performed on the front surface image to obtain a grayscale image, and edge detection can be performed on the grayscale image using operators such as Sobel, Prewitt, Canny, and Laplacian to obtain an edge image.
[0042] By performing edge detection on the grayscale image, pixels with gradient values greater than a preset gradient threshold in the front surface image can be retained in the edge image; the outermost and closed edge in the edge image is taken as the first outer contour corresponding to the aluminum alloy shell to be detected.
[0043] In step S102, the centroid of the outer contour pixel points of the first outer contour is determined, and the central moments of different outer contour segments of the first outer contour relative to the centroid of the first outer contour are determined respectively.
[0044] The aluminum alloy tube used in this embodiment is a circular cross-section aluminum alloy tube; since the cross-section of the aluminum alloy tube is circular, after applying pressure to the top of the aluminum alloy tube using the pressure plane of the press, the cross-section of the aluminum alloy shell obtained under normal circumstances is also circular. When there are no defects on the surface of the aluminum alloy shell, the outline of the aluminum alloy shell is the same from the side or front view.
[0045] When there are defects such as pits or protrusions on the surface of the aluminum alloy shell, the outer contour line of the pits or protrusions will appear to differ from the contour line from other perspectives; or, the outer contour line of the pits or protrusions will differ from the outer contour line of the standard aluminum alloy shell.
[0046] For example, at a point H1 on the surface of an aluminum alloy shell, when viewed from the side with the edge line where point H1 is located as the outer contour line, there is a pit at point H1, and the outer contour line at point H1 is closer to the inner side of the aluminum alloy shell than other outer contour lines.
[0047] For example, if there is a protrusion H2 on the surface of the aluminum alloy shell, from the side view with the edge line where the protrusion H2 is located as the outer contour line, there is a protrusion at the protrusion H2, and the outer contour line at the protrusion H2 is farther away from the inner side of the aluminum alloy shell than other outer contour lines.
[0048] Determining the centroid of the outer contour pixels of the first outer contour facilitates the description of the shape of the first outer contour, so as to determine whether there are pit defects or protrusion defects on both sides of the front. The centroid of the outer contour pixels of the first outer contour can refer to the centroid of the closed region enclosed by the first outer contour as the boundary.
[0049] In one embodiment, the central moments of different outer contour segments of the first outer contour are determined as follows: a polar coordinate system is constructed with the centroid of the first outer contour as the origin, and the first outer contour is divided into a predetermined number of outer contour segments according to the angles corresponding to them in the polar coordinate system; for the target outer contour segment among the multiple outer contour segments of the first outer contour, the average distance from the pixel of the target outer contour segment to the centroid and the average angle of the target outer contour segment in the polar coordinate system are determined; the normalized central moments of the target outer contour segment are determined based on the difference between the distance from the pixel of the target outer contour segment to the centroid and the average distance, the difference between the angle to the centroid and the average angle, and the gradient value of the pixel in the frontal surface image.
[0050] A polar coordinate system is constructed using the centroid of the first outer contour as the origin. The first outer contour is then divided into a predetermined number of outer contour segments according to the angles corresponding to them in the polar coordinate system. The total angle of all outer contour segments is 360 degrees.
[0051] The preset number can be selected according to actual needs. A larger preset number corresponds to more accurate division precision, while a smaller preset number corresponds to a longer outer contour segment after division. The preset number can be, for example, between 36 and 50.
[0052] Determine the average distance and average angle from the pixel points of the target outer contour segment to the centroid in the polar coordinate system. The difference between the distance from the pixel points of the target outer contour segment to the centroid and the average distance can reflect the characteristics of the target outer contour segment in terms of distance to the centroid.
[0053] The difference between the angle from the pixel to the centroid and the average angle of the outer contour segment of the target can reflect the curvature characteristics of the outer contour segment. The gray value of the pixel at the pit or protrusion is higher than that of the surrounding pixels, resulting in a higher gradient value of the pixel at the pit or protrusion. Therefore, the gradient value of the pixel in the frontal surface image can reflect the probability of defects in the pixels of the outer contour segment of the target.
[0054] The normalized central moment of the target outer contour segment is determined based on the distance of the target outer contour segment relative to the centroid, the curvature characteristics of the target outer contour segment, and the gradient characteristics. As the aluminum alloy shell to be detected rotates or the camera viewing angle rotates, the angle of the target outer contour segment in the polar coordinate system and the angle of the centroid will change in a consistent manner, so that the relative angle between the angle of the target outer contour segment and the centroid remains unchanged. This makes the normalized central moment rotation invariant. Therefore, the obtained central moment can adapt to the possible rotation of the camera angle of the image acquisition device.
[0055] The following example uses a calculation formula to illustrate the process of obtaining the centroid in this application embodiment: ;in, Let be the normalized central moment of the target's outer contour segment, and n be the number of pixels in the target's outer contour segment. Let be the distance from the i-th pixel in the outer contour segment of the target to the centroid. This is the average distance from all pixels in the target's outer contour segment to the centroid. Let be the angle of the i-th pixel in the outer contour segment of the target in the polar coordinate system. Let be the average angle of all pixels in the outer contour segment of the target in the polar coordinate system, where p is the first order and q is the second order. Let be the grayscale gradient value of the i-th pixel in the frontal surface image of the target outer contour segment.
[0056] When different outer contour segments have different shape features, the difference between the angle of the pixels in the outer contour segment and the average angle will change, which will change the normalized central moment of the outer contour segment. When different outer contour segments have different distance features from the centroid, the distance from the pixels in the outer contour segment to the centroid will change, which will change the normalized central moment of the outer contour segment.
[0057] When the edge features of pixels in different outer contour segments are different, the gray-level gradient values of the pixels in the outer contour segments will change, which will cause the normalized central moments of the outer contour segments to change. Therefore, the normalized central moments of the target outer contour segments can obtain values that match the features of the outer contour segments when the target outer contour segments have different features. The normalized central moments of the outer contour segments can realize the description of the features of the outer contour segments.
[0058] In step S103, the center moments of different outer contour segments of the first outer contour are used as elements to construct a first feature sequence, and a second feature sequence pre-constructed for the standard aluminum alloy shell is obtained.
[0059] Referring to the steps for obtaining the first outer contour corresponding to the aluminum alloy shell to be inspected, the second outer contour corresponding to the standard aluminum alloy shell can be obtained in advance; the standard aluminum alloy shell can be an aluminum alloy shell that has passed inspection; the standard aluminum alloy shell has the desired shape after the aluminum alloy tube is extruded, and the second outer contour of the standard aluminum alloy shell can provide a better reference for the defects existing in the aluminum alloy shell to be inspected.
[0060] The second feature sequence is determined based on the second outer contour of the standard aluminum alloy shell; referring to the steps of obtaining the first feature sequence corresponding to the first outer contour of the aluminum alloy shell to be detected, the second feature sequence corresponding to the second outer contour of the standard aluminum alloy shell can be obtained in advance.
[0061] For example, by referring to the process of obtaining the center moments of different outer contour segments of the first outer contour of the aluminum alloy shell to be detected, the center moments of different outer contour segments of the second outer contour of the standard aluminum alloy shell can be obtained in advance; by referring to the steps of obtaining the first feature sequence corresponding to the first outer contour of the aluminum alloy shell to be detected, the second feature sequence corresponding to the second outer contour of the standard aluminum alloy shell can be obtained in advance based on the center moments of different outer contour segments of the second outer contour of the standard aluminum alloy shell.
[0062] Based on the first feature sequence determined by different outer contour segments of the first outer contour of the aluminum alloy shell to be tested, it is possible to describe the features of different outer contour segments of the aluminum alloy shell to be tested; based on the second feature sequence determined by different outer contour segments of the second outer contour of the standard aluminum alloy shell, it is possible to describe the features of different outer contour segments of the standard aluminum alloy shell.
[0063] Obtaining the first feature sequence and the second feature sequence helps to determine the difference in the outer contour between the aluminum alloy shell to be tested and the standard aluminum alloy shell. Since the presence of defects on the contour line of the aluminum alloy shell to be tested indicates that there are protrusions or depressions on both sides of the contour line, it helps to determine whether there are defects such as protrusions or depressions on both sides of the outer contour of the aluminum alloy shell to be tested.
[0064] In step S104, the first feature sequence and the second feature sequence are shift-matched, and the contour defect value is determined based on the DTW distance of the shift-matching result.
[0065] The outer contour of the aluminum alloy shell to be tested is a closed contour. When directly comparing the outer contour of the aluminum alloy shell to be tested with the outer contour of the standard aluminum alloy shell, misjudgment of the consistency of the two outer contours may occur due to possible misalignment, and the aluminum alloy shell to be tested, which does not actually have defects, may be mistakenly judged as having defects.
[0066] For example, for an aluminum alloy shell to be tested and a standard aluminum alloy shell with the same outer contour, taking the bottom position of the aluminum alloy shell to be tested as the starting position, the center moments of different outer contour segments of the aluminum alloy shell to be tested along clockwise from the starting position are L1, L2, L3, L4, L5 and L6 respectively; taking the bottom position of the standard aluminum alloy shell as the starting position, the center moments of different outer contour segments of the standard aluminum alloy shell along clockwise from the starting position are L1, L2, L3, L4, L5 and L6 respectively.
[0067] If the camera's shooting angle changes or the device is vibrated, in the first outer contour determined based on the obtained front surface image, when the aluminum alloy shell to be tested is in the starting position from the bottom, the different outer contour segments of the aluminum alloy shell to be tested along the clockwise center distance are L3, L4, L5, L6, L1 and L2.
[0068] If the first feature sequence and the second feature sequence are directly matched, then the two sequences (L3, L4, L5, L6, L1, L2) and (L1, L2, L3, L4, L5, L6) will be matched. The values of the elements at the same position in these two sequences are different. The matching result will misjudge the aluminum alloy shell to be tested, which does not actually have any abnormality, as having an abnormality. Therefore, the first feature sequence and the second feature sequence can be shifted for matching to obtain a matching result that is more consistent with the actual situation.
[0069] The outer contour of the aluminum alloy shell to be inspected is a continuous contour. If the position points of the first feature sequence can be shifted and matched with the second feature sequence in the same order, it means that the contour of the aluminum alloy shell to be inspected on the front is consistent with that of the standard aluminum alloy shell, and there is no abnormality in the aluminum alloy shell to be inspected. Therefore, shifting and matching the first feature sequence and the second feature sequence can better realize the detection of defects on the surface of the aluminum alloy shell to be inspected.
[0070] In one embodiment, shift matching of a first feature sequence and a second feature sequence includes: performing a shift operation on the first feature sequence and determining the similarity between the sequence obtained after the shift operation and the second feature sequence; the shift operation includes shifting an element at the end position of the sequence to the beginning position of the sequence; performing the shift operation again on the sequence obtained after the shift operation and performing the step of determining the similarity between the sequence obtained after the shift operation and the second feature sequence again; when the number of shift operations reaches the number of elements in the first feature sequence, taking the sequence with the smallest similarity among all shift operations as the target feature sequence after shift matching.
[0071] The similarity between the sequence obtained after the shift operation and the second feature sequence can be determined by the absolute value of the difference between the elements at the same position in the sequence obtained after the shift operation and the second feature sequence. The larger the absolute value of the difference between the elements at the same position, the smaller the similarity value, and the lower the degree of matching between the sequence obtained after the shift operation and the second feature sequence.
[0072] For example, when the first feature sequence is (L3, L4, L5, L6, L1, L2) and the second feature sequence is (L1, L2, L3, L4, L5, L6), a shift operation can be performed on either the first feature sequence or the second feature sequence. This application embodiment uses the first feature sequence as an example to illustrate the shift matching process.
[0073] When performing a shift operation on the first feature sequence (L3, L4, L5, L6, L1, L2), the element L2, which is located at the end position, can be placed at the beginning position of the sequence to obtain the sequence (L2, L3, L4, L5, L6, L1).
[0074] Among the multiple shifted sequences obtained after multiple shifting operations, at least one sequence corresponds to the actual outer contour of the aluminum alloy shell. Furthermore, in the aluminum alloy shell obtained after applying pressure to the top of the aluminum alloy tube using a press, the pits or protrusions are usually smaller than the area of the normal region, making most of the aluminum alloy shell to be tested (e.g., 90% of the surface area) a normal region. Therefore, by performing multiple shifting operations on the first feature sequence of the aluminum alloy shell to be tested, a first matching sequence that matches the second feature sequence can be obtained. The elements corresponding to the normal outer contour segment in the first matching sequence are located in the same or similar positions as the elements corresponding to the normal outer contour segment in the second feature sequence.
[0075] The first feature sequence can reflect the characteristics of different outer contour segments of the aluminum alloy shell to be detected, and the second feature sequence can reflect the characteristics of different outer contour segments of the standard aluminum alloy shell. The shift matching process of the first feature sequence and the second feature sequence avoids the influence of possible changes in the shooting angle of the camera or possible vibrations of the equipment. Therefore, after shift matching of the first feature sequence and the second feature sequence, the second feature sequence is used as the second matching sequence to obtain the first matching sequence that best matches the second matching sequence. This allows the feature matching process between the aluminum alloy shell to be detected and the standard aluminum alloy shell to also avoid the influence of possible changes in the shooting angle of the camera or possible vibrations of the equipment.
[0076] Among the multiple feature sequences obtained after performing multiple shift operations on the first feature sequence of the aluminum alloy tube to be inspected, the first matching sequence and the second matching sequence have the highest degree of matching and can better reflect the actual outer contour features of the aluminum alloy tube to be inspected. Therefore, the contour defect value of the aluminum alloy tube to be inspected can be determined based on the DTW (Dynamic Time Warping) distance between the first matching sequence and the second matching sequence.
[0077] In one embodiment, determining the contour defect value based on the DTW distance of the shift matching result includes: using the DTW distance of the shift matching result as the contour defect value.
[0078] The DTW distance of the shift matching result is the DTW distance between the first matching sequence and the second matching sequence obtained after shift matching. After multiple shift operations on the first feature sequence, the first matching sequence obtained is the sequence that best matches the second feature sequence. The DTW distance of the shift matching result can characterize the difference between the outer contour features of the aluminum alloy shell to be detected and the outer contour features of the standard aluminum alloy shell.
[0079] The obtained first feature sequence can reflect the features of the outer contour segment of the aluminum alloy shell to be detected. By shifting and matching the first feature sequence and the second feature sequence, the influence of the shooting angle of the camera or the vibration it is subjected to on the order of elements in the first feature sequence can be avoided. Therefore, the DTW distance of the shift matching result can at least avoid the influence of the change of the shooting angle of the camera or the vibration it is subjected to on the detection result.
[0080] Using the DTW distance of the displacement matching result as the contour defect value, the contour defect value of the aluminum alloy tube to be inspected can be determined simply and effectively. The contour defect value characterizes the degree or probability of shape defects on both sides of the front of the aluminum alloy tube to be inspected.
[0081] In one embodiment, the shift matching result includes a first matching sequence and a second matching sequence; the contour defect value is determined by: determining the weight value between the matching element pairs in the first matching sequence and the second matching sequence based on the difference in local shape features between the outer contour segments corresponding to the first matching sequence and the outer contour segments corresponding to the second matching sequence; and using the weight values between the matching element pairs in the first matching sequence and the second matching sequence, weighted summing of the distances between the matching element pairs is performed to obtain the contour defect value.
[0082] The first matching sequence is the sequence that best matches the second feature sequence among multiple sequences obtained after performing multiple shift operations on the first feature sequence; the second matching sequence is the same as the second feature sequence.
[0083] After shifting and matching the first feature sequence and the second feature sequence, the elements at the same position in the first matching sequence and the second matching sequence correspond to two outer contour segments of the aluminum alloy shell to be detected and the standard aluminum alloy shell, respectively. Based on the differences in local shape features between the outer contour segments corresponding to the first matching sequence and the outer contour segments corresponding to the second matching sequence, the weight values between the matching element pairs in the first matching sequence and the second matching sequence are determined. This allows the outer contour segments with greater differences in local shape features to contribute more to the overall detection result, thereby more sensitively identifying subtle shape defects in the aluminum alloy shell to be detected.
[0084] In one embodiment, the weight values between matching element pairs in the first matching sequence and the second matching sequence are determined in the following manner: ,in, Let be the weight value between the i-th matching element pair in the first matching sequence and the second matching sequence, and exp be an exponential function with base constant . Let be the average angle value of the outer contour segment corresponding to the element from the first matching sequence in the i-th element pair. Let be the average angle value of the outer contour segment corresponding to the element from the second matching sequence in the i-th element pair. The standard deviation of the differences between matched element pairs at their corresponding mean angle values. It is a preset positive number.
[0085] The standard deviation of the differences between matched pairs of elements at their corresponding mean angle values, for example, For all element pairs The standard deviation; can be used to determine the difference of all element pairs on the mean angle value, and to determine the standard deviation of the difference corresponding to different element pairs, and the standard deviation of the difference of matched element pairs on the corresponding mean angle value. This enables the normalization of angle values. Preset positive numbers. To avoid the denominator being 0, the default positive number can be, for example, 0.01 or 0.02.
[0086] The outer contour segment is obtained by dividing the outer contour in the polar coordinate system according to angles. Different outer contour segments correspond to the same angle size. However, due to the different features of different outer contour segments, the number of pixels in different outer contour segments may be different. Therefore, the average angle value of pixels in outer contour segments with different features is different.
[0087] For example, if the complete 360° is divided into 10° segments, 36 outer contour segments can be obtained. Among the 36 outer contour segments, outer contour segment A and outer contour segment B are obtained. Outer contour segment A includes 250 pixels because of its larger curvature, while outer contour segment B may include 200 pixels because it is flatter. Therefore, the average angle value of outer contour segment A is equal to 10 / 250 = 0.04, and the average angle value of outer contour segment B is equal to 10 / 200 = 0.05.
[0088] For two matching outer contour segments, the greater the difference in average angle value, the greater the difference in local morphology between the two outer contour segments, making it more likely that the aluminum alloy tube to be tested has a shape at the corresponding position.
[0089] The greater the difference in average angle value between two matching outer contour segments, the larger the weight value can be determined, thereby increasing the contribution of the outer contour segment with a higher probability of shape defects to the calculation results.
[0090] In step S105, the contour defect value is used to determine whether there are shape defects on both sides of the front of the aluminum alloy shell to be inspected, and the shape defects are classified if they exist.
[0091] The larger the contour defect value determined by the front surface image of the aluminum alloy shell to be tested, the greater the difference between the overall contour of the aluminum alloy shell to be tested on the front and the overall contour of the standard aluminum alloy shell. The more serious the shape defects on both sides of the front of the aluminum alloy shell to be tested are. Therefore, the contour defect value can be used to determine whether there are shape defects on both sides of the front of the aluminum alloy shell to be tested.
[0092] For example, if the contour defect value determined based on the front surface image of the aluminum alloy housing to be inspected is greater than a preset threshold, it can be determined that at least one of the two sides of the front surface of the aluminum alloy housing to be inspected has a shape defect.
[0093] If the contour defect value determined based on the front surface image of the aluminum alloy shell to be inspected is less than or equal to a preset threshold, it can be determined that there are no shape defects on both sides of the front surface of the aluminum alloy shell to be inspected.
[0094] In the presence of shape defects, the shape defects can be classified according to the local contour of the defects in the aluminum alloy shell to be inspected. Different types of defects can correspond to different degrees of defects. For example, the greater the value of the depth, length and width of the shape defect, the greater the degree of the shape defect.
[0095] In one embodiment, if it is determined that there are no shape defects on either side of the front of the aluminum alloy shell to be inspected, the LBP value of the target pixel can be determined based on the grayscale values of the pixels in the neighborhood of the target pixel in the grayscale image of the front surface; the information entropy of the LBP values of the pixels in the neighborhood of the target pixel can be determined, and the information entropy is used to characterize the complexity of the LBP values of the pixels in the neighborhood; if the information entropy of the target pixel is greater than a preset information entropy threshold, it is determined that there is a crack defect in the aluminum alloy shell to be inspected at the target pixel.
[0096] If it is determined that there are shape defects on both sides of the front of the aluminum alloy shell to be inspected, the aluminum alloy shell to be inspected can be identified as an abnormal aluminum alloy shell; for aluminum alloy shells that have been identified as abnormal, they can be heated to molten aluminum and the aluminum alloy product can be remade, and it is no longer necessary to determine whether there are crack defects on its surface.
[0097] If it is determined that there are no shape defects on both sides of the front of the aluminum alloy shell to be tested, it means that there are no shape defects such as pits or protrusions on both sides of the front of the aluminum alloy shell to be tested, and crack defects are difficult to be reflected in the outline of the aluminum alloy shell. In order to further determine whether the aluminum alloy shell to be tested is a qualified product, it can be determined whether there are cracks on the front of the aluminum alloy shell to be tested.
[0098] For aluminum alloy tubes that are not subjected to pressure at the top, the normal texture present in the aluminum alloy tube is usually along the longitudinal direction of the aluminum alloy tube; for aluminum alloy tubes after pressure is applied at the top, in the embodiments of this application, the same cross section of the aluminum alloy tube is subjected to the same pressure applied by the press, so that the local texture of the aluminum alloy tube after pressure is consistent with the longitudinal direction of the local plane.
[0099] The cracks that appear after being subjected to pressure may be caused by defects in the aluminum alloy tube, resulting in stress in different directions. This makes the direction of the cracks in the aluminum alloy shell after applying pressure to the top of the aluminum alloy tube more random and more different from the surrounding texture.
[0100] By determining the LBP (Local Binary Pattern) value of a target pixel within a local range of pixels, a description of the local texture of the target pixel can be achieved. The process of obtaining the LBP value can be referred to the calculation process in the prior art, and will not be described in detail here.
[0101] The information entropy of the LBP values of pixels within the neighborhood of the target pixel is determined. The information entropy can be determined based on the frequency ratio of different LBP values appearing within the neighborhood of the target pixel. The higher the complexity of the LBP values of pixels within the neighborhood of the target pixel, the higher the information entropy of the LBP values of pixels within the neighborhood of the target pixel.
[0102] When there are crack defects in the neighborhood of a target pixel that differ significantly from the normal texture direction, the LBP values in the neighborhood of the target pixel will become more diverse, thus increasing the information entropy of the LBP values in the neighborhood of the target pixel. The process of obtaining the information entropy of the LBP values can be referred to in the prior art for the calculation process of information entropy, and will not be repeated in this embodiment.
[0103] In one embodiment, if it is determined that there are no shape defects on both sides of the front of the aluminum alloy housing to be inspected, a side surface image of the aluminum alloy housing to be inspected can also be acquired, and the contour defect degree value of the side surface image can be determined to determine whether there are shape defects on both sides of the side of the aluminum alloy housing to be inspected.
[0104] If it is determined that there are no shape defects on the two sides of the front of the aluminum alloy shell to be inspected, in order to further achieve a more comprehensive inspection of the aluminum alloy shell to be inspected, the sides of the aluminum alloy shell to be inspected can be inspected to determine whether there are shape defects at the two sides of the outline of the side of the aluminum alloy shell to be inspected.
[0105] In one embodiment, the shift matching result includes a first matching sequence and a second matching sequence that match. If it is determined that there are shape defects on both sides of the front of the aluminum alloy shell to be detected, the outer contour segment corresponding to the largest distance among the distances between the matching elements in the first matching sequence and the second matching sequence can also be used as the outer contour segment where the shape defect exists in the aluminum alloy shell to be detected.
[0106] If shape defects are found on both sides of the front of the aluminum alloy shell to be inspected, it indicates that the overall outer contour of the front of the aluminum alloy shell to be inspected is abnormal. For the first matching sequence and the second matching sequence, the abnormality of the outer contour is more affected by the matching element pairs with greater differences. Therefore, taking the outer contour segment corresponding to the largest distance among the different matching element pairs as the outer contour segment where the shape defect exists in the aluminum alloy shell to be inspected can not only achieve the judgment of the overall defect, but also further achieve the localization of the local defect.
[0107] In one embodiment, classifying shape defects when they exist on both sides of the front surface includes: determining the classification result of the shape defects based on the contour defect value; wherein, contour defect values of different ranges correspond to different classification results of the shape defects.
[0108] The larger the value of the contour defect, the higher the degree of abnormality on both sides of the front. Therefore, different evaluation levels can be preset, such as minor defects, moderate defects, and severe defects. The value range corresponding to minor defects is the smallest, and the value range corresponding to severe defects is the largest. The value range corresponding to minor defects is between minor defects and severe defects.
[0109] For minor or moderate defects in the aluminum alloy casing, operators can address the defects through localized repairs; for severe defects, operators may need to recycle the entire aluminum alloy casing for reuse.
[0110] Figure 4 This is a schematic diagram of an unpressurized aluminum alloy tube placed in a limiting mold in an embodiment of this application. Figure 5 This is a schematic diagram of the aluminum alloy tube placed in the limiting mold and pressurized according to an embodiment of this application. A press is used to press the aluminum alloy tube... Figure 4 When pressure is applied to the top of the aluminum alloy tube, and the tube is confined by a limiting mold at the bottom, it can undergo plastic deformation. Figure 5 The shape shown.
[0111] Can Figure 5 The aluminum alloy tube shown serves as a standard aluminum alloy casing. Figure 4 The aluminum alloy casing shown is used as the aluminum alloy casing to be inspected to illustrate the defect classification process in the embodiments of this application.
[0112] By utilizing the steps for obtaining the first feature sequence and the second feature sequence in the embodiments of this application, and the shift matching between the first feature sequence and the second feature sequence, it is possible to obtain, as follows: Figure 6 The comparison results of the first matching sequence and the second matching sequence are shown below; Figure 6 The points with circular shapes are elements in the first matching sequence. Figure 6 The points with a square shape are elements in the second matching sequence. Figure 6 The points with a triangular shape are the points where the first matching sequence and the second matching sequence coincide.
[0113] from Figure 6The two matching sequences show that the first and second matching sequences overlap in some subsequences and differ in others. This corresponds to a portion of the outline of the aluminum alloy shell to be detected being consistent with the outline of the standard aluminum alloy shell, while another portion of the outline of the aluminum alloy shell to be detected is different from that of the standard aluminum alloy shell.
[0114] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only.
[0115] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A method of classifying pressure forming defects in an aluminum alloy tube, the method comprising: The method comprises the following steps: obtaining a front surface image of an aluminum alloy shell to be detected obtained by extruding an aluminum alloy pipe, and obtaining a first outer contour of the aluminum alloy shell to be detected according to the front surface image; determining the center of mass of the outer contour pixel points of the first outer contour, and determining the central moments of different outer contour segments of the first outer contour relative to the center of mass of the first outer contour, respectively; constructing a first feature sequence by taking the central moments of the different outer contour segments of the first outer contour as elements, and obtaining a second feature sequence constructed in advance for a standard aluminum alloy shell; The second feature sequence is determined according to the second outer contour of the standard aluminum alloy shell. Shift matching is performed on the first feature sequence and the second feature sequence, which comprises: performing a shift operation on the first feature sequence, and determining the similarity between the sequence obtained after the shift operation and the second feature sequence; the shift operation comprises shifting the element at the end position of the sequence to the starting position of the sequence; the sequence obtained after the shift operation is subjected to the shift operation again, and the step of determining the similarity between the sequence obtained after the shift operation and the second feature sequence is performed again; in the case where the number of shift operations reaches the number of elements in the first feature sequence, the sequence corresponding to the minimum similarity in all shift operations is taken as the target feature sequence after shift matching; determining the contour defect value according to the DTW distance of the shift matching result; determining whether there is a shape defect on the front surface of the aluminum alloy shell to be detected by using the contour defect value, and classifying the shape defect in the case where there is a shape defect. The central moments of the different outer contour segments of the first outer contour are determined by the following method:
2. The method of classifying pressure forming defects in an aluminum alloy tube of claim 1 wherein, constructing a polar coordinate system by taking the center of mass of the first outer contour as the coordinate origin, and dividing the first outer contour into a plurality of outer contour segments according to the corresponding angles in the polar coordinate system; for a target outer contour segment in the plurality of outer contour segments of the first outer contour, determining the average distance of the pixel points of the target outer contour segment to the center of mass in the polar coordinate system and the average angle; determining the normalized central moment of the target outer contour segment according to the difference between the distance of the pixel points of the target outer contour segment to the center of mass and the average distance, the difference between the angle of the pixel points to the center of mass and the average angle, and the gradient value of the pixel points in the front surface image. The contour defect value is determined according to the DTW distance of the shift matching result.
3. The method of classifying pressure forming defects in an aluminum alloy tube of claim 1 wherein, The shift matching result comprises a first matching sequence and a second matching sequence; the contour defect value is determined by the following method:
4. The method of classifying pressure forming defects in an aluminum alloy tube of claim 1 wherein, determining the weight value between the matching element pairs in the first matching sequence and the second matching sequence according to the difference in local shape features between the outer contour segments corresponding to the first matching sequence and the second matching sequence; obtaining the contour defect value by weighted sum of the distance between the matching element pairs by using the weight value between the matching element pairs in the first matching sequence and the second matching sequence. The weight value between the matching element pairs in the first matching sequence and the second matching sequence is determined by the following method:
5. The method of classifying pressure forming defects in an aluminum alloy tube of claim 4, wherein, wherein, is a weight value between the i-th pair of matched elements in the first and second matching sequences, exp is an exponential function with the natural constant as the base number, is an average angle value of the outer contour segment corresponding to the element from the first matching sequence in the i-th pair of elements, is an average angle value of the outer contour segment corresponding to the element from the second matching sequence in the i-th pair of elements, is a standard deviation of the difference between the corresponding average angle values of the matched element pairs, is a preset positive number.
6. The method of classifying pressure forming defects in an aluminum alloy tube of claim 1 wherein, In a case where it is determined that the two sides of the front face of the aluminum alloy shell to be detected do not have shape defects, the method further comprises: For a target pixel point in the front face surface gray image, an LBP value of the target pixel point is determined according to gray values of pixel points in a neighborhood range of the target pixel point; An information entropy of the LBP values of the pixel points in the neighborhood range of the target pixel point is determined, and the information entropy is used to represent a complexity of the LBP values of the pixel points in the neighborhood range; In a case where the information entropy of the target pixel point is greater than a preset information entropy threshold, it is determined that the aluminum alloy shell to be detected has a crack defect at the target pixel point.
7. The method of classifying pressure forming defects in an aluminum alloy tube of claim 1 wherein, In a case where it is determined that the two sides of the front face of the aluminum alloy shell to be detected do not have shape defects, the method further comprises: A side surface image of the aluminum alloy shell to be detected is acquired, and a contour defect degree value of the side surface image is determined to determine whether the two sides of the side face of the aluminum alloy shell to be detected have shape defects.
8. The method of classifying pressure forming defects in an aluminum alloy tube of claim 1 wherein, The shift matching result comprises the matched first matching sequence and the second matching sequence; In a case where it is determined that the two sides of the front face of the aluminum alloy shell to be detected have shape defects, the method further comprises: According to distances between matched elements in the first matching sequence and the second matching sequence, an outer contour segment corresponding to at least one maximum distance between different element pairs is taken as an outer contour segment where a position of the shape defect in the aluminum alloy shell to be detected is located.
9. The method of classifying pressure forming defects in an aluminum alloy tube of claim 1 wherein, In a case where the two sides of the front face have shape defects, classification of the shape defects comprises: A classification result of the shape defects is determined according to the contour defect value; and different contour defect values in different value ranges correspond to different classification results of the shape defects.
Citation Information
Patent Citations
Touch panel cover glass
JP2018018378A
Method for quantitatively identifying the defects of large-size composite material based on infrared image sequence
US20210383563A1