A punching defect detection method for automobile punching tubes
The image segmentation and clustering algorithm is used to correct the center of the circle, calculate the correction offset, and identify abnormal holes, which solves the problem of missed detection or wrong detection caused by environmental interference in the existing technology, and improves the accuracy of punching defect detection.
Patent Information
- Application Number
- CN202410956556.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-07-17
AI Technical Summary
In existing punching defect detection methods, under environmental interference, the deviation of contour points causes the center point group to be unconcentrated, leading to problems of missed detection or wrong detection.
Obtain the plate area through image segmentation, extract edge contour data, fit the center of the circle and perform clustering, correct the cluster center, calculate the correction offset, use projection curves and autocorrelation values to correct the clustering results, and identify abnormal holes.
It improves the accuracy of punching defect detection, reduces the occurrence of missed detections and wrong detections, and ensures the quality of punched pipes.
Smart Images

Figure CN118505686B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automobile parts production, and more specifically, to a punching defect detection method for automobile punching tubes. Background Art
[0002] The automobile perforated pipe is a key component used in the automobile manufacturing process, mainly used in the exhaust system. In the automobile exhaust system, the perforated pipe is usually used as a part of the muffler to reduce the exhaust noise. The automobile perforated pipe is an indispensable part of the automobile exhaust system, and its quality and performance directly affect the overall performance and driving experience of the car.
[0003] During the production and processing of automobile perforated tubes, due to the relatively thin tube wall, if welding is performed first and then punching, the perforated tube is prone to deformation. Therefore, the punched steel needs to be bent and welded to obtain the automobile perforated tube. However, if punching defects occur when punching the plate, the holes of the formed automobile perforated tube will also have defects. In order to ensure the production quality of the perforated tube, it is necessary to perform punching defect detection during punching.
[0004] Among them, in the detection of punching defects, the existing paper "Research and Application of Punching Nickel-plated Steel Strip Parameter Measurement Method Based on Machine Vision-Sun Xuan" explains that in the process of punching, blind holes, connected holes, uneven punching distribution and other defects may occur due to various reasons, which have a great impact on the performance and quality of the product. However, when performing punching defect detection, the holes need to be identified. The paper also points out that the existing circle parameter detection is commonly used in circle detection based on Hough transform and least squares fitting method. The paper also points out that the real-time performance of Hough transform detection is poor, and the accuracy of least squares algorithm detection is poor. The paper proposes a least squares method optimized by MeanShift (mean shift) algorithm, but when MeanShift is classified, it relies on the density distribution of the circle center point group to obtain the final circle center, and due to environmental interference, the contour points will deviate, resulting in the circle center point group is not concentrated enough, and because the punching arrangement is fixed, and defects will also cause deviations in the contour points, resulting in missed detection or wrong detection. Summary of the invention
[0005] In order to solve the problem that the contour points may deviate due to environmental interference, resulting in insufficient concentration of the center point group, and since the punching arrangement is fixed and defects may also cause deviations in the contour points, resulting in missed detection or wrong detection, the present invention provides solutions in the following aspects.
[0006] A punching defect detection method for automobile punching tubes includes: obtaining a plate image after historical punching to perform image segmentation to obtain a plate area, preprocessing the plate area to obtain two groups of straight lines and closed edge contour data of the plate length and width; fitting a circle center according to any pixel point in the edge contour data, clustering the circle centers in the edge contour data, correcting the clustering centers, and obtaining multiple cluster clusters; obtaining fitting straight lines of each corrected clustering center on the projection curves corresponding to the two groups of straight lines, calculating the vector sum of the shortest distance from each corrected clustering center to the fitting straight line as a regularized vector; calculating the offset of the corrected clustering center, , where Indicates the correction offset, It represents the cumulative vector of the density vector formed by the centers of each circle within the cluster radius and the modified cluster center. Indicates the modified weight corresponding to the cluster, Represents the regular vector corresponding to the corrected cluster center, obtains the change of the maximum value of the corrected offset of all the corrected cluster centers during the preset iterative clustering process, and in response to the change being less than the preset threshold, the clustering is completed, and in response to the maximum value of the corrected offset corresponding to the corrected cluster center after the clustering is completed being greater than the abnormal threshold, there is an abnormality in the hole corresponding to the corrected cluster center.
[0007] By segmenting the image, we can get a clear plate area, extract the length and width edge contour data of the plate, use the edge contour data to fit the center of the circle, and group the center of the circle through the clustering algorithm, which is helpful to identify the distribution pattern of the punching holes, correct the cluster center, improve the accuracy of the clustering results, and better reflect the actual punching distribution. Get the projection of the corrected cluster center, fit the straight line, calculate the corrected offset, and quantify the distribution deviation of the corrected cluster center. If the maximum value of the corrected offset is greater than the abnormal threshold, the abnormal holes can be quickly identified to improve the accuracy of defect detection.
[0008] In one embodiment, the obtaining of the plate image after historical punching and performing image segmentation to obtain the plate area includes:
[0009] The plate image is marked in history, pixels belonging to the plate are marked as 1, and pixels not belonging to the plate are marked as 0, to obtain training data;
[0010] The training data is input into the preset semantic segmentation network for training to complete the model training, and the collected plate image is input into the trained semantic segmentation network to obtain the plate area.
[0011] By using the semantic segmentation network, the plate area can be effectively segmented from the plate image after punching, providing accurate basic data for subsequent punching defect detection and other analysis tasks.
[0012] In one embodiment, the preprocessing of the plate area to obtain two sets of straight lines of the length and width of the plate includes:
[0013] The plate area is grayed to obtain a grayscale image of the plate area, and the grayscale image is denoised by mean filtering. The denoised grayscale image is edge detected to obtain a plate edge image. The plate edge image is straight line detected to obtain two sets of straight lines of the length and width of the plate.
[0014] In one embodiment, obtaining the closed edge contour data includes:
[0015] The plate edge image is filled as a filling image and subtracted from the plate edge image to obtain a filling information image, the filling information image is expanded, and an image AND operation is performed on the expanded image and the filling information image to obtain an edge filling image, the edge filling image is subtracted from the filling image to obtain a closed edge image, and a connected domain is extracted from the closed edge image to obtain a plurality of closed edge contour data.
[0016] Filling processing can help repair or close small cracks and gaps in the edge image and improve the integrity of the edge. Dilation processing can cover small noise points. Subsequent image and calculations can help remove noise, retain only larger edge structures, and further obtain accurate edge contour data.
[0017] In one embodiment, fitting a circle center according to any pixel point in the edge contour data includes:
[0018] Obtain a set of corresponding pixel points in each edge contour data, take any set as a target set, select any three non-coplanar pixel points in the target set to construct a pixel group, fit a circle to the pixel group, and obtain the center of the corresponding pixel group;
[0019] In response to the number of unselected pixel points being less than or equal to a preset number, the calculation is stopped to obtain multiple circle centers, wherein one edge contour data corresponds to multiple circle centers, and one circle center is a two-dimensional coordinate data.
[0020] Using multiple circle centers can help evaluate the integrity of the contour, identify possible missing or abnormal parts, effectively extract key geometric features from the plate edge contour data, and better detect hole anomalies.
[0021] In one embodiment, obtaining the center of the circle in the edge contour data for clustering includes:
[0022] The mean of the circle center coordinates corresponding to the edge contour data is calculated as the initial cluster center, and a preset number of cluster centers are additionally randomly set for clustering.
[0023] In one embodiment, the correcting the initial cluster center to obtain multiple clusters includes:
[0024] Obtain any initial cluster center as the target cluster center, calculate the cumulative vector of the density vectors of each circle center within a preset cluster radius of the target cluster center and the target cluster center according to the coordinate value of the target cluster center, and use the cumulative vector as the offset of the target cluster center;
[0025] Calculate the vertical distance from each cluster center to the two groups of straight lines, obtain the projection values of each cluster center on the two groups of straight lines, obtain the projection curves of the two groups of straight lines corresponding to the projection values, and obtain the maximum values of the autocorrelation values in the two groups of projection curves as correction weights;
[0026] According to the coordinate value of the target cluster center and the corresponding offset and correction weight, the initial cluster center of each cluster is corrected to obtain multiple clusters.
[0027] By calculating the offset, the cluster center can be more accurately located and corrected, the accuracy of the clustering results can be improved, and the anomalies or defects of the holes can be obtained.
[0028] In one embodiment, obtaining the fitting straight line includes:
[0029] The peak points and valley points of each corrected cluster center on the projection curves corresponding to the two groups of straight lines are obtained, and the area corresponding to the valley points adjacent to each peak point in each group of projection curves is obtained. The coordinates of all corrected cluster centers in the area are obtained for linear fitting to obtain a fitting straight line.
[0030] The present invention has the following effects:
[0031] 1. The present invention obtains the deviation between each hole by calculating the regularization vector, and uses it to correct the clustering process of the Mean Shift algorithm, thereby improving the accuracy of the clustering result in detecting the punching defects of automobile punching tubes, and helps to more accurately identify the abnormality of the hole.
[0032] 2. The present invention calculates the autocorrelation value of the projection curve corresponding to the projection values on two groups of straight lines of the length and width of the plate, selects the maximum value of the autocorrelation value as the correction weight of the offset, and better makes the center of the circle after clustering approach the linear feature, thereby conforming to the fixedness of the punching arrangement and facilitating better identification of punching defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0034] Figure 1 It is a method flow chart of steps S1 to S4 in a method for detecting perforation defects of automobile perforated tubes according to an embodiment of the present invention.
[0035] Figure 2 It is a method flow chart of steps S10 to S12 in a method for detecting perforation defects of automobile perforated tubes according to an embodiment of the present invention.
[0036] Figure 3 It is a method flow chart of steps S20 to S22 in a method for detecting perforation defects of automobile perforated tubes according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0038] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0039] The present invention is used in scenarios where the automobile perforated pipe is a metal automobile component and is often used in automobile exhaust pipes. The traditional automobile exhaust pipe processing technology first punches holes in the sheet, then curls the punched sheet into shape, and finally welds it.
[0040] Reference Figure 1 A method for detecting punching defects of automobile punching tubes includes steps S1 to S4, which are specifically as follows:
[0041] S1: Obtain the plate image after historical punching and perform image segmentation to obtain the plate area, pre-process the plate area, and obtain two sets of straight lines and closed edge contour data of the plate length and width.
[0042] To further explain, by placing a camera behind the punching machine, the image of the plate after punching is collected, where the collected image is a standard overhead image of the plate taken by the camera. The collection interval is determined by the punching speed of the punching machine. This solution is set to collect once every 4s, which can be adjusted by the implementer according to the specific implementation scenario.
[0043] Reference Figure 2 , including steps S10 to S12:
[0044] S10: Mark the historical plate images, mark the pixels belonging to the plate as 1, and mark the non-plate pixels as 0, to obtain training data, input the training data into a preset semantic segmentation network for training, complete model training, input the collected plate images into the trained semantic segmentation network, and obtain the plate area;
[0045] Further explanation, in this embodiment, since the plate image does not contain interfering background, a preset semantic segmentation network is used to identify the plate image to reduce the interference of the background on subsequent analysis, wherein the preset semantic segmentation network uses a U-net network, which is mainly composed of an encoder and a decoder. This technology is well known to the technician and will not be described in detail. The implementer can select and train other network models according to the specific implementation scenario. For example, image segmentation can also be performed through FCN (full convolution network) and SegNet network. It should be noted that when marking the image, the plate pixels and hole pixels are marked as 1, thereby obtaining training data, completing U-net network training, and obtaining the plate area.
[0046] S11: grayscale the plate area to obtain a grayscale image of the plate area, perform mean filtering and denoising on the grayscale image, perform edge detection on the denoised grayscale image to obtain a plate edge image, perform straight line detection on the plate edge image to obtain two sets of straight lines of the length and width of the plate;
[0047] To further illustrate, in this embodiment, the canny edge detection algorithm is used for the grayscale image to obtain the corresponding edge image, wherein the upper and lower thresholds of the canny edge detection algorithm are 0.6 and 0.2 respectively, which can be adjusted by the implementer according to the specific implementation scenario; by performing straight line detection on the edge detection result, the straight line detection adopts hough straight line detection to obtain the shape of the plate, and obtain two sets of straight lines for the length and width of the plate, wherein the length is set as the x straight line and the width is set as the y straight line.
[0048] S12: Fill the plate edge image as the filling image and make a difference with the plate edge image to obtain a filling information image, dilate the filling information image, perform an image AND operation on the dilated image and the filling information image to obtain an edge filling image, make a difference between the edge filling image and the filling image to obtain a closed edge image, extract a connected domain from the closed edge image, and obtain a plurality of closed edge contour data.
[0049] To further explain, the image AND operation refers to the binary "AND" operation of each pixel value of two images (either grayscale images or color images) to achieve image cropping; the filling information image is the information in the lost closed edge image, among which only the closed edge image has filling information, and the expanded image is the closed edge image lost in the filling information image, and the connected domains extracted from the closed edge image are all closed edge contour data.
[0050] S2: Fitting the center of a circle according to any pixel point in the edge contour data, clustering the center of the circle in the edge contour data, correcting the initial clustering center, and obtaining multiple clusters.
[0051] Reference Figure 3 , including steps S20 to S22:
[0052] S20: Obtain a set of corresponding pixel points in each edge contour data, take any set as a target set, select any three non-coplanar pixel points in the target set to construct a pixel group, fit a circle to the pixel group, and obtain the center of the corresponding pixel group;
[0053] Further explanation: multiple pixel groups can be arbitrarily combined in one edge contour data to obtain multiple fitting circles. edge contour, get the The set of pixels corresponding to the edge contour ,from By randomly extracting three non-coplanar pixels without duplication, we can get The center of a circle.
[0054] S21: In response to the number of unselected pixel points being less than or equal to a preset number, stop calculating to obtain multiple circle centers, wherein one edge contour data corresponds to multiple circle centers, and one circle center is one two-dimensional coordinate data;
[0055] Further explanation: the preset number is set to 2 and can be adjusted according to actual conditions.
[0056] It should be noted that, in this embodiment, the Mean Shift algorithm is used for clustering, but the Mean Shift algorithm relies on the density distribution of the circle center point group to obtain the final center of the circle, and due to environmental interference, the contour points will deviate, resulting in the circle center point group being not concentrated enough. Therefore, it is chosen to correct the clustering process of the Mean Shift algorithm to ensure that the center of each category is consistent with the co-linear property of the hole centers between the actual plate punching holes, so as to improve the accuracy of subsequent punching defect detection.
[0057] S22: The mean of the circle center coordinates corresponding to the calculated edge contour data is used as the initial cluster center, and a preset number of cluster centers are additionally randomly set for clustering.
[0058] It should be noted that, in the embodiment, the center of the circle corresponding to the set of pixel points corresponding to the same edge contour should be classified into the same category. If they are not classified into the same category, it means that the two holes are clustered into the same category. The clustering radius of the MeanShift algorithm is set to 0.05, which can be adjusted according to the specific situation. The two-dimensional coordinate data of the center of the circle is normalized before clustering, and the maximum and minimum normalization method is adopted; the preset number is set to 10, of which 10 is a hyperparameter and can be adjusted according to the actual situation.
[0059] The clustering process includes:
[0060] Get any initial cluster center as the target cluster center, calculate the cumulative vector of the density vectors of each circle center within the preset cluster radius and the target cluster center according to the coordinate value of the target cluster center, and use the cumulative vector as the offset of the target cluster center;
[0061] Calculate the vertical distance from each cluster center to the two groups of straight lines, obtain the projection values of each cluster center on the two groups of straight lines, obtain the projection curves corresponding to the projection values of the two groups of straight lines, and obtain the maximum value of the autocorrelation value in the two groups of projection curves as the correction weight;
[0062] Further explanation, the projection values are the coordinate values of each cluster center on two groups of straight lines. This technology is well known in the art and will not be described in detail. The autocorrelation value in the projection curve is calculated by the autocorrelation function, wherein the lag period in the autocorrelation is the interval period corresponding to the holes on the x-line and the y-line, respectively. The interval period is obtained by the interval between standard holes, and the interval is known to obtain the mapping period of the interval between standard holes in the image, and then the interval period corresponding to the holes on the x-line and the y-line is obtained according to the standard interval corresponding to the standard holes in the direction of the x-line and the y-line. The larger the autocorrelation value, the more obvious the periodicity of the current projection curve, the stronger the autocorrelation, and the correction weight. The closer the value is to 1.
[0063] According to the coordinate value of the target cluster center and the corresponding offset and correction weight, the initial cluster center of each cluster is corrected to obtain multiple clusters.
[0064] Specifically, the initial cluster center correction satisfies the following relationship:
[0065] ,
[0066] In the formula, represents the modified cluster center, Represents the coordinate value corresponding to the initial cluster center, Represents the cumulative vector of the density vector formed by the centers of each circle within the cluster radius and the initial cluster center. Indicates the corrected weight corresponding to the cluster.
[0067] Further explanation, by accumulating vector Get the offset of the initial cluster center. When the density is high, the accumulated vector is biased towards the high-density area, so that the initial cluster center moves to the high-density position. When the value is low, it means that the current clustering effect is not good and the initial cluster center is unstable. In this case, the offset in the initial cluster center update process focuses on the accumulated vector of the density vector. , which is used to obtain the initial cluster centers corresponding to the clusters with relatively high density.
[0068] In another embodiment, the shortest distance points from the initial cluster center to the x-line and the y-line are obtained, and the vector sum of the shortest distance points corresponding to the coordinates of the initial cluster center is obtained as a regular vector, thereby adjusting the offset of the initial cluster center.
[0069] Specifically, the initial cluster center correction satisfies the following relationship:
[0070] ,
[0071] In the formula, represents the modified cluster center, Represents the coordinate value corresponding to the initial cluster center, Represents the cumulative vector of the density vector formed by the centers of each circle within the cluster radius and the initial cluster center. Indicates the modified weight corresponding to the cluster, Represents the regularized vector corresponding to the initial cluster center.
[0072] Further explanation: when the weight is modified When the value is high, it means that the current clustering effect is relatively good and the initial cluster center is relatively stable. In this case, the offset in the initial cluster center update process focuses on the regularization vector. Initial cluster centers Updates are made to ensure that the deviation of the corrected cluster center is small.
[0073] S3: Obtain the fitting straight lines of each corrected cluster center on the projection curves corresponding to the two groups of straight lines, and calculate the vector sum of the shortest distance from each corrected cluster center to the fitting straight line as the regularized vector.
[0074] The peak points and valley points of each corrected cluster center on the projection curves corresponding to the two sets of straight lines are obtained, and the area corresponding to the valley points adjacent to each peak point in each set of projection curves is obtained. The coordinates of all corrected cluster centers in the area are obtained for linear fitting to obtain the fitting line.
[0075] To further illustrate, the peak point detection method is used to obtain the peak point and valley point, and the linear fitting adopts the least square method to obtain the fitting straight line, and the shortest distance points from the corrected cluster center to the x-line and the y-line are obtained respectively, and the vector of the shortest distance point corresponding to the coordinates of the corrected cluster center is obtained, and the vectors of the shortest distance points of the two straight lines are added to obtain the regular vector of the corrected cluster center.
[0076] S4: Calculate the corrected offset of the corrected cluster center, obtain the change of the maximum value of the corrected offset of all corrected cluster centers during the preset iterative clustering process, and complete the clustering in response to the change being less than the preset threshold. In response to the maximum value of the corrected offset corresponding to the corrected cluster center after clustering is completed being greater than the abnormal threshold, there is an abnormality in the hole corresponding to the corrected cluster center.
[0077] Further explanation: Get the corrected offsets of all corrected cluster centers The maximum value of the change in the preset iterative clustering process, where the correction offset The maximum value of It represents the vector modulus of the corrected offset. The preset iterative clustering process is set to 10 times. The calculation method of the change in the preset iterative clustering process is: the absolute value of the difference between the vector modulus of the corrected offset of two adjacent iterations. When the change is less than the preset threshold, clustering is completed. The preset threshold is set to 0.1, which can be adjusted according to the specific situation. After clustering is completed, if the maximum value of the corrected offset corresponding to the corrected cluster center is greater than the abnormal threshold, then there is an abnormality in the hole corresponding to the corrected cluster center. The abnormal threshold is set to 5, which can be adjusted according to the specific situation.
[0078] Specifically, the correction offset satisfies the following relationship:
[0079] ,
[0080] In the formula, Indicates the correction offset, It represents the cumulative vector of the density vector formed by the centers of each circle within the cluster radius and the modified cluster center. Indicates the modified weights of the clusters after iteration, Represents the regularized vector corresponding to the modified cluster center.
[0081] This is the end of the present invention.
[0082] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly defined.
[0083] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A method for detecting punching defects of automobile punching tubes, characterized in that: include: Obtain the plate image after historical punching and perform image segmentation to obtain the plate area, pre-process the plate area to obtain two sets of straight lines and closed edge contour data of the plate length and width; Fitting a circle center according to any pixel point in the edge contour data, obtaining a set of corresponding pixel points in each edge contour data, taking any set as a target set, selecting any three non-coplanar pixel points in the target set to construct a pixel group, fitting a circle to the pixel group, and obtaining the center of the corresponding pixel group; In response to the number of unselected pixel points being less than or equal to a preset number, the calculation is stopped to obtain a plurality of circle centers, wherein one edge contour data corresponds to a plurality of circle centers, and one circle center is a two-dimensional coordinate data; Clustering the circle centers in the edge contour data, calculating the mean of the circle center coordinates corresponding to the edge contour data as the initial cluster center, and randomly setting a preset number of cluster centers for clustering; correcting the initial cluster center to obtain multiple cluster clusters; obtaining any one of the initial cluster centers as the target cluster center, and calculating the cumulative vector of the density vectors of each circle center and the target cluster center within a preset cluster radius of the target cluster center according to the coordinate value of the target cluster center, and using the cumulative vector as the offset of the target cluster center; Calculate the vertical distance from each cluster center to the two groups of straight lines, obtain the projection values of each cluster center on the two groups of straight lines, obtain the projection curves of the two groups of straight lines corresponding to the projection values, and obtain the maximum values of the autocorrelation values in the two groups of projection curves as correction weights; According to the coordinate value of the target cluster center and the corresponding offset and correction weight, the initial cluster center of each cluster is corrected to obtain multiple clusters; Obtain the fitting straight lines of each corrected cluster center on the projection curves corresponding to the two groups of straight lines, and calculate the vector sum of the shortest distance from each corrected cluster center to the fitting straight line as the regularized vector; Calculating the corrected offset of the corrected cluster center, , where Indicates the correction offset, It represents the cumulative vector of the density vector formed by the centers of each circle within the cluster radius and the modified cluster center. Indicates the modified weights of the clusters after iteration, Represents the regular vector corresponding to the corrected cluster center, obtains the change of the maximum value of the corrected offset of all the corrected cluster centers during the preset iterative clustering process, and in response to the change being less than the preset threshold, the clustering is completed, and in response to the maximum value of the corrected offset corresponding to the corrected cluster center after the clustering is completed being greater than the abnormal threshold, there is an abnormality in the hole corresponding to the corrected cluster center.
2. A method for detecting punching defects of automobile perforated tubes according to claim 1, characterized in that: The obtaining of the plate image after historical punching and performing image segmentation to obtain the plate area includes: The plate image is marked in history, pixels belonging to the plate are marked as 1, and pixels not belonging to the plate are marked as 0, to obtain training data; The training data is input into the preset semantic segmentation network for training to complete the model training, and the collected plate image is input into the trained semantic segmentation network to obtain the plate area.
3. A method for detecting punching defects of automobile perforated tubes according to claim 1, characterized in that: The preprocessing of the plate area to obtain two sets of straight lines of the length and width of the plate includes: The plate area is grayed to obtain a grayscale image of the plate area, and the grayscale image is denoised by mean filtering. The denoised grayscale image is edge detected to obtain a plate edge image. The plate edge image is straight line detected to obtain two sets of straight lines of the length and width of the plate.
4. A method for detecting punching defects of automobile perforated tubes according to claim 1, characterized in that: Acquiring the closed edge contour data, including: The plate edge image is filled as a filling image and subtracted from the plate edge image to obtain a filling information image, the filling information image is expanded, and an image AND operation is performed on the expanded image and the filling information image to obtain an edge filling image, the edge filling image is subtracted from the filling image to obtain a closed edge image, and a connected domain is extracted from the closed edge image to obtain a plurality of closed edge contour data.
5. A method for detecting punching defects of automobile perforated tubes according to claim 1, characterized in that: Obtaining the fitting straight line includes: The peak points and valley points of each corrected cluster center on the projection curves corresponding to the two groups of straight lines are obtained, and the area corresponding to the valley points adjacent to each peak point in each group of projection curves is obtained. The coordinates of all corrected cluster centers in the area are obtained for linear fitting to obtain a fitting straight line.
