Energy-absorbing box defect detection method based on image processing
The pits and pore defects of the energy-absorbing box welds are detected through image processing technology, and the degree of weld defects is calculated using the grayscale value and shape parameters of the edge lines, which solves the problem of difficulty in detecting the weld defects in the prior art, and realizes an effective evaluation of the structural strength of the energy-absorbing box.
Patent Information
- Application Number
- CN202411648204.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The prior art is difficult to effectively detect defects in the welds of the energy-absorbing box, especially pits and pore defects, which affect the structural strength and collision energy absorption capacity of the energy-absorbing box.
By obtaining the surface grayscale image of the weld, determining the edge pixel points and edge lines, calculating the grayscale value standard deviation and shape parameters of the pixel points in the minimum external rectangle of the edge lines, combining the parameter values of the reference edge lines, determining the degree of weld defects, and outputting defect prompt information.
Effectively characterize the impact of weld defects on the structural strength of the energy-absorbing box, realize accurate defect detection of the energy-absorbing box welds, avoid installing defective energy-absorbing boxes, and ensure the collision energy absorption effect.
Smart Images

Figure CN119151935B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of image data processing, and particularly relates to a method for detecting energy absorption box defects based on image processing. Background Art
[0002] The energy absorption box is an important energy absorption device in the vehicle bumper system. The energy absorption box can be installed inside the front bumper of the vehicle, at the front end of the front longitudinal beam, and at the vehicle floor structure. The energy absorption box is mainly used to absorb and disperse the energy of the collision when the vehicle collides, thereby protecting the body structure, reducing the harm to passengers caused by the collision, and the existence of the energy absorption box improves the passive safety of the vehicle and can reduce the maintenance cost caused by the impact of the vehicle.
[0003] The energy absorption box can be welded by an energy absorption tube and a mounting plate. By detecting the defects in the weld of the energy absorption box, the possible abnormalities in the weld of the energy absorption box can be detected in time to ensure the energy absorption capacity of the energy absorption box for the collision energy.
[0004] When detecting the defects in the weld, the Chinese patent application document with the publication number CN117630014A provides a weld detection method, including: receiving the image information of the part to be detected; the image information includes several pictures; receiving the discrimination information of the part, and the discrimination information contains the information characterizing the defect type and defect characteristics of the part; extracting the image contour characteristics and regional characteristics of the pictures; determining the quality judgment result of the part according to the discrimination information, the image contour characteristics and the regional characteristics.
[0005] In the related art, the defects in the weld are mainly detected through the defect type and defect characteristic information. However, the characteristics of the defects existing in the weld are relatively diverse, and it is difficult to detect the defects in the weld through the limited defect characteristic information. Therefore, it is difficult to effectively detect the defects of the energy absorption box. Summary of the Invention
[0006] To overcome the problem in the related art that it is difficult to effectively detect the defects of the energy absorption box, the present application provides an energy absorption box defect detection method based on image processing, including: obtaining a surface grayscale image of the weld of the energy absorption box to be detected, and determining the edge pixel points in the surface grayscale image to obtain an edge line formed by connecting adjacent edge pixel points; for a target edge line among multiple edge lines, determining the minimum circumscribed rectangle of the target edge line, and determining the standard deviation of the grayscale values of the pixel points within the minimum circumscribed rectangle; according to the standard deviation of the grayscale values of the pixel points within the minimum circumscribed rectangle of the target edge line, determining a first parameter value of the target edge line, where the first parameter value is positively correlated with the standard deviation; according to the first parameter value of the target edge line, the area of the minimum circumscribed rectangle, and the first parameter value of a reference edge line, determining a second parameter value of the target edge line; the reference edge line is another edge line with the largest first parameter value within the neighborhood range of the target edge line; taking the sum value of the second parameter values of all target edge lines in the grayscale image as the defect degree value of the welded part of the energy absorption box to be detected, and outputting a prompt message when the defect degree value is greater than a preset threshold; the prompt message is used to prompt that there is an abnormality in the welding of the energy absorption box to be detected.
[0007] In this way, according to the first parameter value of the target edge line, the area of the minimum circumscribed rectangle, and the first parameter value of the reference edge line, the second parameter value of the target edge line is determined; the reference edge line is another edge line with the largest first parameter value within the neighborhood range of the target edge line, and the first parameter value is determined according to the standard deviation of the grayscale values of the pixel points within the minimum circumscribed rectangle of the target edge line. The first parameter value can represent the probability that the edge line is located in the pit of the weld. When there are other edge lines with a relatively high probability of being located in the pit within the neighborhood range of the edge line with a relatively high probability of being located in the pit, it indicates that there is a relatively high probability of dense pits in the weld of the energy absorption box, which has a greater impact on the structural strength of the energy absorption box. Therefore, the defect degree value of the welded part of the energy absorption box to be detected can effectively represent the impact degree of the defects in the weld on the structural strength of the energy absorption box, and can effectively realize the defect detection of the energy absorption box.
[0008] Optionally, determining the first parameter value of the target edge line according to the standard deviation of the grayscale values of the pixel points within the minimum circumscribed rectangle of the target edge line includes: , where p is the first parameter value of the target edge line, exp is the exponential function with the natural constant as the base, r is the shape parameter of the minimum circumscribed rectangle of the target edge line, norm is the normalization processing function, v is the standard deviation of the grayscale values of the pixel points within the minimum circumscribed rectangle of the target edge line; f is the third parameter value of the target edge line, and the third parameter value is used to represent the probability that the target edge line is located in the weld.
[0009] In this way, by combining the shape parameters of the minimum circumscribed rectangle of the target edge line according to the shape parameters of the minimum circumscribed rectangle of the target edge line and the variance of the gray values of the pixel points within the minimum circumscribed rectangle, the first parameter value of the target edge line is obtained, which helps to determine the influence degree of the concave hole defect existing in the surface gray image on the energy absorption box through the first parameter value.
[0010] Optionally, the third parameter value of the target edge line is determined in the following way: , where f is the third parameter value of the target edge line, is to take the minimum value, is the number of pixel points in the surface gray image that are at the same horizontal position as the center of the minimum circumscribed rectangle of the target edge line, W is the width of the surface gray image, is the number of pixel points in the surface gray image that are at the same vertical position as the center of the minimum circumscribed rectangle of the target edge line, H is the height of the surface gray image, is the number of edge lines in the clustering cluster where the target edge line is located after clustering the edge lines in the surface gray image, is the number of all edge lines in the surface gray image.
[0011] In this way, since there are more edge lines in the weld area of the surface gray image and the edge lines in the weld area are more concentrated, through the determined third parameter value of the target edge line, the probability that the target edge line is located in the weld of the surface gray image can be effectively characterized.
[0012] Optionally, the third parameter value of the target edge line is determined in the following way: perform a closedness detection on the target edge line to determine whether the target edge line is closed; in the case where the target edge line is closed, take the first preset positive number as the third parameter value of the target edge line; in the case where the target edge line is not closed, take the second preset positive number as the third parameter value of the target edge line, and the second preset positive number is less than the first preset positive number.
[0013] Optionally, the shape parameter of the minimum circumscribed rectangle of the target edge line is determined in the following way: determine the aspect ratio and the height-width ratio of the minimum circumscribed rectangle of the target edge line; take the maximum of the aspect ratio and the height-width ratio as the shape parameter.
[0014] In this way, by determining the aspect ratio and the height-width ratio of the minimum circumscribed rectangle of the target edge line and taking the maximum of the aspect ratio and the height-width ratio as the shape parameter, the shape of the minimum circumscribed rectangle of the target edge line can be better characterized by the shape parameter, thereby characterizing the shape of the target edge line.
[0015] Optionally, determining a second parameter value of the target edge line according to a first parameter value of the target edge line, the area of the minimum circumscribed rectangle, and a first parameter value of the reference edge line includes: , where M is the second parameter value of the target edge line, p is the first parameter value of the target edge line, norm is a normalization function, m is the area of the minimum circumscribed rectangle of the target edge line, and t is the first parameter value of the reference edge line of the target edge line.
[0016] Optionally, the surface grayscale image of the weld of the energy-absorbing box to be detected is obtained by the following method: obtaining an initial grayscale image of the welded part of the energy-absorbing box to be detected; inputting the initial grayscale image into a pre-trained image segmentation model to obtain the surface grayscale image of the weld output by the image segmentation model; the image segmentation model is used to set the pixel values of other pixel points except the image area where the weld is located in the initial grayscale image to 0.
[0017] Optionally, the energy-absorbing box to be detected is fixed on a fixing mechanism, and the method further includes: when the defect degree value is less than or equal to a preset threshold, controlling the moving mechanism to remove the energy-absorbing box to be detected from the fixing mechanism, and controlling the moving mechanism to place the next energy-absorbing box to be detected on the fixing mechanism to perform defect detection on the next energy-absorbing box to be detected.
[0018] In this way, when the defect degree value is less than or equal to the preset threshold, it indicates that the influence degree on the structural strength of the energy-absorbing box to be detected is relatively small, and the energy-absorbing box to be detected can reach the expected structural strength. By controlling the moving mechanism to remove the energy-absorbing box to be detected from the fixing mechanism and controlling the moving mechanism to place the next energy-absorbing box to be detected on the fixing mechanism to perform defect detection on the next energy-absorbing box to be detected, continuous detection of multiple energy-absorbing boxes to be detected can be achieved.
[0019] The technical solution provided by the embodiments of the present application may include the following beneficial effects: determining a second parameter value of the target edge line according to a first parameter value of the target edge line, the area of the minimum circumscribed rectangle, and a first parameter value of the reference edge line; the reference edge line is another edge line with the largest first parameter value within the neighborhood range of the target edge line, and the first parameter value is determined according to the standard deviation of the grayscale values of the pixel points within the minimum circumscribed rectangle of the target edge line. The first parameter value can characterize the probability that the edge line is located in the pit of the weld. When there are other edge lines with a relatively high probability of being located in the pit within the neighborhood range of the edge line with a relatively high probability of being located in the pit, it indicates that the probability of the existence of dense pits in the weld of the energy-absorbing box is relatively high, resulting in a relatively large influence degree on the structural strength of the energy-absorbing box. Therefore, the defect degree value of the welded part of the energy-absorbing box to be detected can effectively characterize the influence degree of the defect in the weld on the structural strength of the energy-absorbing box, and can effectively achieve defect detection of the energy-absorbing box.
[0020] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit this application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings herein are incorporated into the specification and form a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application.
[0022] Figure 1 is a flowchart of a method for detecting defects of an energy absorption box based on image processing shown according to an exemplary embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.
[0024] First, a brief introduction to the application scenario of the embodiments of this application is given. In the application scenario of this application, it is possible to detect defects of a product formed by welding by detecting defects of the weld seam. The energy absorption box can be formed by welding an energy absorption tube and a mounting plate.
[0025] When the related art detects defects of the weld seam, it mainly detects defects such as scratches that may exist on the surface of the weld seam. The energy absorption box is mainly used to absorb collision energy when the vehicle is collided to reduce the impact degree of the collision on the vehicle body. Therefore, when detecting the weld seam of the energy absorption box, the influence degree of the surface scratch of the weld seam on the energy absorption box is small, and it is difficult for the related art to effectively detect the defects of the energy absorption box.
[0026] To solve the above technical problems, the embodiments of this application provide a method for detecting defects of an energy absorption box based on image processing. Figure 1 is a flowchart of a method for detecting defects of an energy absorption box based on image processing shown according to an exemplary embodiment, as Figure 1 shown, the method includes the following steps.
[0027] In step S101, obtain the surface grayscale image of the weld seam of the energy absorption box to be detected, and determine the edge pixel points in the surface grayscale image to obtain an edge line formed by connecting adjacent edge pixel points.
[0028] The surface image of the weld seam of the energy absorption box to be detected can be collected by an image acquisition device, and the surface grayscale image of the weld seam can be obtained by performing grayscale processing on the surface image of the weld seam.
[0029] In one embodiment, the surface grayscale image of the weld of the energy-absorbing box to be detected is obtained in the following manner: obtain the initial grayscale image of the welding part of the energy-absorbing box to be detected; input the initial grayscale image into a pre-trained image segmentation model to obtain the surface grayscale image of the weld output by the image segmentation model; the image segmentation model is used to set the pixel values of other pixel points in the initial grayscale image except for the image area where the weld is located to 0.
[0030] For example, the pixel values of other pixel points in the initial grayscale image of the welding part of the energy-absorbing box except for the image area where the weld is located can be marked as 0 to obtain the weld mask image corresponding to the initial grayscale image; the initial grayscale image of the welding part of the energy-absorbing box is used as the input of a pre-constructed network model, and the weld mask image corresponding to the initial grayscale image is used as the output of the network model, so as to realize the training of the network model, and the trained network model is used as the image segmentation model.
[0031] In this way, by inputting the initial grayscale image into the pre-trained image segmentation model, the influence of other areas outside the weld of the welding part of the energy-absorbing box on the defect detection of the energy-absorbing box can be minimized, so as to obtain a more accurate defect detection result for the energy-absorbing box.
[0032] Compared with defects such as scratches on the surface of the weld, the pits on the surface of the weld will directly affect the energy absorption ability of the energy-absorbing box when it is collided. The pits usually have a certain grayscale difference from other surrounding areas in the surface grayscale image, so that the pits have certain edge features in the surface image. Therefore, by determining the edge pixel points in the surface grayscale image, it is helpful to determine the pits existing in the surface grayscale image, so as to determine the influence degree of the pits existing in the weld on the structural strength of the energy-absorbing box, and thus better realize the defect detection of the energy-absorbing box.
[0033] Edge detection can be performed on the surface grayscale image to obtain the edge pixel points in the surface grayscale image. The image operator for edge detection can be operators such as Sobel operator, Prewitt operator, Canny operator, and Laplacian operator. The embodiments of the present application do not limit the operator used for edge detection; the gradient value of the pixel points in the grayscale image can be obtained through the edge detection operator, and the pixel points with the gradient value greater than the preset gradient threshold are used as the edge pixel points.
[0034] If the gradient value of a pixel point is greater than the preset gradient threshold, it indicates that the difference in grayscale values between the pixel point and other adjacent pixel points is relatively large. Since the surface of a weld seam usually consists of relatively continuous pixel points, the edge pixel points in the surface grayscale image can be effectively determined based on the gradient value of the pixel point. The preset gradient threshold can be set in advance according to actual requirements. For example, the preset gradient threshold can be between 10 and 20.
[0035] Adjacent edge pixel points can form an edge line. In the weld seam of an energy-absorbing box, such as the weld seam between the energy-absorbing tube and the mounting plate of the energy-absorbing box, there is a certain degree of difference in grayscale values between the area with a pit defect and other surrounding areas, making the edge line of the pit area of the weld seam of the energy-absorbing box correspond to the edge line in the surface grayscale image.
[0036] In step S102, for the target edge line among multiple edge lines, determine the minimum circumscribed rectangle of the target edge line and determine the standard deviation of the grayscale values of the pixel points within the minimum circumscribed rectangle.
[0037] After welding the energy-absorbing tube and the mounting plate to obtain the energy-absorbing box, the solubility of gases (such as hydrogen and nitrogen) in the molten pool metal at high temperature in the welded part of the energy-absorbing box will increase. As the molten pool cools, the solubility of these gases decreases. If the gases cannot escape from the molten pool in time, pores will form on the surface of the weld seam, affecting the energy-absorbing ability of the energy-absorbing box for collision energy.
[0038] The pores existing on the surface of the weld seam usually appear as circles or ellipses. Therefore, by determining the minimum circumscribed rectangle of the target edge line, it helps to determine the shape characteristics of the actual position corresponding to the target edge line in the energy-absorbing box, thereby determining whether the target edge line is a pit or a pore on the surface of the energy-absorbing box.
[0039] For example, when the minimum circumscribed rectangle appears as a long and narrow rectangle, the probability that the defect corresponding to the target edge line in the energy-absorbing box is a pit or a pore is relatively low; when the minimum circumscribed rectangle appears as a square, the target edge line has a higher probability of being a pore defect on the weld seam surface of the energy-absorbing box.
[0040] Due to the existence of pores or pits on the surface of the weld seam, the light reflection ability changes at the pores or pits, causing the pixel values at the pores or pits to change in the surface grayscale image. If the target edge line is located at a pore or a pit, in the minimum circumscribed rectangle of the target edge line, since there are both pore defects and other areas other than the pore defects, or both pit defects and other areas other than the pit defects, the variety of pixel values of the pixel points within the minimum circumscribed rectangle of the edge line is more abundant, and the difference degree of the pixel values of the pixel points within the minimum circumscribed rectangle of the edge line increases.
[0041] For the pixel points within the minimum circumscribed rectangle of the target edge line, the greater the standard deviation of the gray values of the pixel points within the minimum circumscribed rectangle, the greater the probability that the area within the target edge line is located in a pit defect or a pore.
[0042] Or, as the depth of the pit defect or the pore defect increases, the change amount of the pixel values of the pixel points in the area within the target edge line increases, while the gray values of the pixel points outside the target edge line and within the minimum circumscribed rectangle are close to the overall gray value of the weld area, so that the deeper the area within the target edge line is located in the pit defect or the pore, the greater the standard deviation of the gray values of the pixel points within the minimum circumscribed rectangle. Therefore, the greater the standard deviation of the gray values of the pixel points within the minimum circumscribed rectangle, the deeper the area within the target edge line is located in the pit defect or the pore.
[0043] In step S103, according to the standard deviation of the gray values of the pixel points within the minimum circumscribed rectangle of the target edge line, determine the first parameter value of the target edge line.
[0044] The first parameter value is positively correlated with the standard deviation, that is, the greater the standard deviation of the gray values of the pixel points within the minimum circumscribed rectangle of the target edge line, the greater the first parameter value of the target edge line; or, the smaller the standard deviation of the gray values of the pixel points within the minimum circumscribed rectangle of the target edge line, the smaller the first parameter value of the target edge line.
[0045] In one embodiment, determining the first parameter value of the target edge line according to the standard deviation of the gray values of the pixel points within the minimum circumscribed rectangle of the target edge line includes: , where p is the first parameter value of the target edge line, exp is the exponential function with the natural constant as the base, r is the shape parameter of the minimum circumscribed rectangle of the target edge line, norm is the normalization processing function, v is the standard deviation of the gray values of the pixel points within the minimum circumscribed rectangle of the target edge line; f is the third parameter value of the target edge line, and the third parameter value is used to characterize the probability that the target edge line is located in the weld.
[0046] r is the shape parameter of the minimum circumscribed rectangle of the target edge line. By comparing the shape parameter of the minimum circumscribed rectangle of the target edge line with 1, since the pores or pits existing in the weld are usually circular or elliptical, the closer the shape parameter of the minimum circumscribed rectangle of the target edge line is to 1, compared with the scratches or protrusions existing in the weld, the higher the probability that the target edge line is the pit or pore existing in the weld.
[0047] The surface grayscale image may include the edges of the weld seam, or may include other areas outside the weld seam, such as areas on the mounting plate or the energy-absorbing tube. To facilitate the determination of the defects existing in the weld seam, a third parameter value of the target edge line can be determined. The third parameter value is used to characterize the probability that the target edge line is located in the weld seam. There are differences in shape or color between the weld seam and other areas other than the weld seam. Therefore, the third parameter value of the target edge line can be determined according to the color characteristics or shape characteristics of the target edge line.
[0048] Since the light reflection ability of the pores or cavities existing in the weld seam is different from that of the normal area in the weld seam, when the target edge line is a pit or pore defect in the weld seam, the contrast of the grayscale values of the pixel points within the minimum circumscribed rectangle of the target edge line becomes larger, and the shape of the target edge line is close to a circle or an ellipse.
[0049] In this way, by combining the shape parameter of the minimum circumscribed rectangle of the target edge line according to the shape parameter of the minimum circumscribed rectangle of the target edge line and the variance of the grayscale values of the pixel points within the minimum circumscribed rectangle, to obtain the first parameter value of the target edge line, it helps to determine the influence degree of the pit defects existing in the surface grayscale image on the energy-absorbing box through the first parameter value.
[0050] In one embodiment, the shape parameter of the minimum circumscribed rectangle of the target edge line is determined in the following manner: determine the aspect ratio and the height-width ratio of the minimum circumscribed rectangle of the target edge line; take the larger of the aspect ratio and the height-width ratio as the shape parameter.
[0051] If the target edge line is the weld edge, scratch or protrusion in the weld seam, the minimum circumscribed rectangle of the target edge line appears as a long and narrow rectangle, and the larger of the aspect ratio and the height-width ratio of the minimum circumscribed rectangle is relatively large, for example, the larger of the aspect ratio and the height-width ratio is greater than 3; if the target edge line is a pit or pore in the weld seam, due to the shape of the pit or pore being close to a circle or an ellipse, the minimum circumscribed rectangle of the target edge line appears as a square or other rectangle close to a square, making the larger of the aspect ratio and the height-width ratio of the minimum circumscribed rectangle relatively small, for example, the larger of the aspect ratio and the height-width ratio is between 1 and 1.5.
[0052] The aspect ratio of the minimum circumscribed rectangle is the ratio of the width to the height of the minimum circumscribed rectangle; the height-width ratio of the minimum circumscribed rectangle is the ratio of the height to the width of the minimum circumscribed rectangle.
[0053] In this way, by determining the aspect ratio and the height-width ratio of the minimum circumscribed rectangle of the target edge line and taking the larger of the aspect ratio and the height-width ratio as the shape parameter, the shape of the minimum circumscribed rectangle of the target edge line can be better characterized by the shape parameter, thereby characterizing the shape of the target edge line.
[0054] In one embodiment, the third parameter value of the target edge line is determined as follows: , where f is the third parameter value of the target edge line, is to take the minimum value, is the number of pixel points in the surface grayscale image that are at the same horizontal position as the center of the minimum circumscribed rectangle of the target edge line, W is the width of the surface grayscale image, is the number of pixel points in the surface grayscale image that are at the same vertical position as the center of the minimum circumscribed rectangle of the target edge line, H is the height of the surface grayscale image, is the number of edge lines in the cluster where the target edge line is located after clustering the edge lines in the surface grayscale image, is the number of all edge lines in the surface grayscale image.
[0055] The edge lines in the surface grayscale image can be clustered. Compared with the boundaries of the welds and other regions except the welds in the surface grayscale image, since the texture in the weld region is richer, the number of edge lines existing in the weld region of the surface grayscale image is larger. Therefore, the clusters obtained after clustering are mainly located in the weld region of the surface grayscale image. Therefore, the larger the ratio of the number of edge lines in the cluster where the target edge line is located after clustering to the number of all edge lines in the surface grayscale image, the more likely the target edge line is located at the weld of the energy absorption box.
[0056] Compared with the edge lines located at the welds in the surface grayscale image, the edge lines in other regions except the welds in the surface grayscale image are more isolated, and the number of pixel points in the surface grayscale image that are at the same horizontal position as the center of the minimum circumscribed rectangle of the target edge line is smaller, or the number of pixel points in the surface grayscale image that are at the same vertical position as the center of the minimum circumscribed rectangle of the target edge line is smaller. Therefore, by the number of pixel points in the surface grayscale image that are at the same vertical position as the center of the minimum circumscribed rectangle of the target edge line and the number of pixel points in the surface grayscale image that are at the same horizontal position as the center of the minimum circumscribed rectangle of the target edge line, the edge lines located at the welds in the surface grayscale image can be effectively screened.
[0057] In this way, since the number of edge lines existing in the weld region of the surface grayscale image is larger and the edge lines existing in the weld region are more concentrated, the third parameter value of the determined target edge line can effectively represent the probability that the target edge line is located at the weld of the surface grayscale image.
[0058] In another embodiment, the third parameter value of the target edge line can also be determined in the following manner: perform a closure detection on the target edge line to determine whether the target edge line is closed; when the target edge line is closed, use a first preset positive number as the third parameter value of the target edge line; when the target edge line is not closed, use a second preset positive number as the third parameter value of the target edge line, and the second preset positive number is less than the first preset positive number.
[0059] Since scratches or protrusions in the weld of the energy absorption box are manifested as non-closed edge lines, while pores or pits in the weld are manifested as circular or elliptical regions, making the edge lines of the pores or pits appear as closed edge lines. Therefore, the probability that the closed target edge line is a pit or pore defect in the weld of the energy absorption box is greater.
[0060] Moreover, for other regions outside the weld in the surface grayscale image, the edge lines also mainly appear as non-closed, such as vertical or horizontal edge lines. Therefore, by determining whether the target edge line is closed, it is possible to distinguish pits and other parts other than pits in the surface grayscale image, and the third parameter value of the target edge line can effectively characterize the probability that the target edge line is located in the weld of the surface grayscale image.
[0061] Among them, the first preset positive number can be 1, and the second preset positive numbers can be positive numbers less than 1 such as 0.01, 0.02, and 0.03, so as to assign a higher value to the third parameter value of the target edge line when the target edge line is closed, and assign a lower value to the third parameter value of the target edge line when the target edge line is not closed.
[0062] In step S104, determine the second parameter value of the target edge line according to the first parameter value of the target edge line, the area of the minimum circumscribed rectangle, and the first parameter value of the reference edge line.
[0063] The reference edge line is the other edge line with the largest first parameter value within the neighborhood range of the target edge line. Since the edge line with a larger first parameter value has a greater probability of belonging to a pit in the weld, and the influence of possible pit or pore defects in the energy absorption box on the structural strength of the energy absorption box is relatively large. If there is another edge line with a larger first parameter value within the neighborhood range of the target edge line, it indicates that the degree of influence on the structural strength of the energy absorption box near the target edge line is relatively large.
[0064] Therefore, determine the second parameter value of the target edge line according to the first parameter value of the target edge line, the area of the minimum circumscribed rectangle, and the first parameter value of the reference edge line. The second parameter value of the target edge line can characterize the degree of influence on the structural strength of the energy absorption box at the target edge.
[0065] In one embodiment, determining the second parameter value of the target edge line according to the first parameter value of the target edge line, the area of the minimum circumscribed rectangle, and the first parameter value of the reference edge line includes: , where M is the second parameter value of the target edge line, p is the first parameter value of the target edge line, exp is the exponential function with the natural constant as the base, norm is the normalization function, m is the area of the minimum circumscribed rectangle of the target edge line, and t is the first parameter value of the reference edge line of the target edge line.
[0066] For the pits with the same depth in the weld, the larger the area of the pit, the greater the impact on the structural strength of the energy absorption box; for the pits with the same area, the greater the depth of the pit, the greater the impact on the structural strength of the energy absorption box, and the first parameter value of the target edge line can characterize the probability that the target edge line is located in the pit; or, when the target edge line is located in the pit, the first parameter value of the target edge line can characterize the depth of the pit where the target edge line is located.
[0067] At the same time, the distance between the pit defects in the weld will also affect the degree of influence on the structural strength of the energy absorption box. Compared with the presence of other pits around the pit, the degree of influence on the structural strength of the energy absorption box is greater when there are no other pits around the pit.
[0068] In this way, the second parameter value of the target edge line is determined according to the first parameter value of the target edge line, the area of the minimum circumscribed rectangle, and the first parameter value of the reference edge line, and the second parameter value can characterize the degree of influence of the position where the target edge line is located on the structural strength of the energy absorption box.
[0069] In step S105, the sum value of the second parameter values of all the target edge lines in the grayscale image is used as the defect degree value of the welded part of the energy absorption box to be detected, and a prompt message is output when the defect degree value is greater than the preset threshold.
[0070] The prompt message is used to prompt that there is an abnormality in the welding of the energy absorption box to be detected. When the defect degree value is greater than the preset threshold, it means that the structural strength of the energy absorption box is affected to a greater extent, and it will be difficult to achieve an ideal collision energy absorption effect after the energy absorption box is installed on the vehicle. By prompting that there is an abnormality in the welding of the energy absorption box to be detected, defective energy absorption boxes can be prevented from being installed on the vehicle.
[0071] Through the energy absorption box defect detection method based on image processing provided by the embodiments of the present application, the second parameter value of the target edge line is determined according to the first parameter value of the target edge line, the area of the minimum circumscribed rectangle, and the first parameter value of the reference edge line; the reference edge line is other edge lines with the largest first parameter value within the neighborhood range of the target edge line, and the first parameter value is determined according to the standard deviation of the gray values of the pixel points within the minimum circumscribed rectangle of the target edge line. The first parameter value can characterize the probability that the edge line is located in the pit of the weld. When there are other edge lines with a relatively high probability of being located in the pit within the neighborhood range of the edge line with a relatively high probability of being located in the pit, it indicates that the probability of the presence of dense pits in the weld of the energy absorption box is relatively high, and the degree of influence on the structural strength of the energy absorption box is relatively large. Therefore, the defect degree value of the welded part of the energy absorption box to be detected can effectively characterize the degree of influence of the defects in the weld on the structural strength of the energy absorption box, and can effectively achieve the defect detection of the energy absorption box.
[0072] In one embodiment, the energy absorption box to be detected is fixed on a fixing mechanism. Also, when the defect degree value is less than or equal to a preset threshold, the moving mechanism is controlled to remove the energy absorption box to be detected from the fixing mechanism, and the moving mechanism is controlled to place the next energy absorption box to be detected on the fixing mechanism for defect detection of the next energy absorption box to be detected.
[0073] In this way, when the defect degree value is less than or equal to the preset threshold, it indicates that the degree of influence on the structural strength of the energy absorption box to be detected is relatively small, and the energy absorption box to be detected can reach the expected structural strength. By controlling the moving mechanism to remove the energy absorption box to be detected from the fixing mechanism and controlling the moving mechanism to place the next energy absorption box to be detected on the fixing mechanism for defect detection of the next energy absorption box to be detected, continuous detection of multiple energy absorption boxes to be detected can be achieved.
[0074] For example, the fixing mechanism can be a device provided with clamping jaws, and the energy absorption box to be detected is clamped by the provided clamping jaws so that the image acquisition device can acquire the surface image of the welded part of the energy absorption box to be detected. The fixing mechanism, the moving mechanism, and the device for detecting the energy absorption box can be communicatively connected so that control instructions can be transmitted between different devices.
[0075] The moving mechanism can be a movable robot with a robotic arm. For example, it can be a movable robot that has been pre-calibrated for hand-eye calibration to achieve the movement of the energy absorption box to be detected in space.
[0076] Hand-eye calibration refers to the calibration of the correspondence between the image coordinate system and the spatial coordinate system, so that the robot can determine the actual position of the target object in the spatial coordinate system through the acquired image, thereby facilitating the robot to move to the position of the target object in the spatial coordinate system to move the target object.
[0077] It should be understood that, unless otherwise specifically stated, the features of some embodiments of the present application described herein can be combined with each other.
[0078] Although terms such as "first", "second", and "third" may be used herein to describe various components, parts, regions, layers, or sections, these components, parts, regions, layers, or sections are not limited to these terms. On the contrary, these terms are only used to distinguish one component, part, region, layer, or section from another. Thus, the first component, part, region, layer, or section mentioned in the examples described herein may also be referred to as the second component, part, region, layer, or section without departing from the teachings of the examples.
[0079] In addition, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In the description herein, "a plurality of" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0080] Furthermore, the word "exemplary" is used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as "exemplary" is not necessarily to be understood as being advantageous compared to other aspects or designs. On the contrary, the use of the word exemplary is intended to present concepts in a concrete manner. As used herein, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or".
[0081] Similarly, although the present application has been shown and described with respect to one or more implementations, after reading and understanding the specification and drawings, those skilled in the art will envision equivalent variations and modifications. Particularly with respect to the various functions performed by the components (e.g., elements, resources, etc.) described above, unless otherwise indicated, the terms used to describe such components are intended to correspond to any component (functionally equivalent) that performs the specific function of the described component, even if not structurally equivalent to the disclosed structure.
[0082] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include known common knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and examples are only to be considered exemplary.
[0083] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A method for detecting defects in energy absorption boxes based on image processing, characterized in that: include: Acquire a surface grayscale image of the weld of the energy absorption box to be inspected, and determine edge pixel points in the surface grayscale image to obtain an edge line formed by connecting adjacent edge pixel points; For a target edge line among the multiple edge lines, determining a minimum circumscribed rectangle of the target edge line, and determining a standard deviation of grayscale values of pixels within the minimum circumscribed rectangle; Determining the first parameter value of the target edge line according to the standard deviation of the grayscale values of the pixels within the minimum circumscribed rectangle of the target edge line includes: , where p is the first parameter value of the target edge line, exp is an exponential function with a natural constant as the base, r is the shape parameter of the minimum circumscribed rectangle of the target edge line, norm is a normalization function, and v is the standard deviation of the grayscale values of the pixels within the minimum circumscribed rectangle of the target edge line; f is the third parameter value of the target edge line, and the third parameter value is used to characterize the probability that the target edge line is located at the weld, and the first parameter value is positively correlated with the standard deviation; The shape parameters of the minimum circumscribed rectangle of the target edge line are determined in the following way: Determine the aspect ratio and height-to-width ratio of the minimum circumscribed rectangle of the target edge line; The maximum of the aspect ratio and the height-to-width ratio is used as the shape parameter Determining the second parameter value of the target edge line according to the first parameter value of the target edge line, the area of the minimum circumscribed rectangle, and the first parameter value of the reference edge line includes: , M is the second parameter value of the target edge line, m is the area of the minimum circumscribed rectangle of the target edge line, and t is the first parameter value of the reference edge line of the target edge line; the reference edge line is another edge line with the largest first parameter value within the neighborhood of the target edge line; The sum of the second parameter values of all target edge lines in the grayscale image is used as the defect degree value of the welding point of the energy absorption box to be detected, so as to output a prompt message when the defect degree value is greater than a preset threshold; the prompt message is used to indicate that there is an abnormality in the welding of the energy absorption box to be detected.
2. The method for detecting defects of energy absorption boxes based on image processing according to claim 1 is characterized in that: The third parameter value of the target edge line is determined by: , where f is the third parameter value of the target edge line, To obtain the minimum value, is the number of pixels in the surface grayscale image that are located at the same horizontal position as the center of the minimum circumscribed rectangle of the target edge line, W is the width of the surface grayscale image, is the number of pixels in the surface grayscale image that are located at the same vertical position as the center of the minimum circumscribed rectangle of the target edge line, H is the height of the surface grayscale image, is the number of edge lines in the cluster where the target edge line is located after clustering the edge lines in the surface grayscale image. is the number of all edge lines in the surface grayscale image.
3. The method for detecting defects of energy absorption boxes based on image processing according to claim 1 is characterized in that: The third parameter value of the target edge line is determined by: Performing a closure check on the target edge line to determine whether the target edge line is closed; When the target edge line is closed, the first preset positive number is used as the third parameter value of the target edge line; When the target edge line is not closed, a second preset positive number is used as the third parameter value of the target edge line, and the second preset positive number is smaller than the first preset positive number.
4. The method for detecting defects of energy absorption boxes based on image processing according to claim 1 is characterized in that: The surface grayscale image of the weld of the energy absorption box to be inspected is obtained by: Acquire an initial grayscale image of the welding portion of the energy absorption box to be inspected; The initial grayscale image is input into a pre-trained image segmentation model to obtain a surface grayscale image of the weld output by the image segmentation model; the image segmentation model is used to set the pixel values of other pixel points in the initial grayscale image except the image area where the weld is located to 0.
5. The method for detecting defects in energy absorption boxes based on image processing according to any one of claims 1 to 4, characterized in that: The energy absorption box to be detected is fixed on a fixing mechanism, and the method further includes: When the defect degree value is less than or equal to the preset threshold, the mobile mechanism is controlled to remove the energy absorption box to be detected from the fixed mechanism, and the mobile mechanism is controlled to place the next energy absorption box to be detected on the fixed mechanism to perform defect detection on the next energy absorption box to be detected.
Citation Information
Patent Citations
Tower foot welding seam detection device, welding seam detection method and storage medium
CN117630014A
Visual inspection method for surface defects of injection mold
CN118071753A
Weld seam internal defect intelligent detection device and method, and medium
WO2022053001A1