Method for detecting flatness of metal bottom frame based on machine vision

Through machine vision combined with Canny edge detection, corner detection and texture analysis, the problem of inaccurate detection of traditional detection methods on complex shape metal bottom frames is solved, and efficient and accurate flatness evaluation and alarm functions are achieved.

CN120198427BActive Publication Date: 2025-07-18SHAANXI SANYUAN YANGYIHAO AUTOMOBILE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510671061.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-07-18
Estimated Expiration
2045-05-23

AI Technical Summary

Technical Problem

Traditional detection methods are difficult to capture the complex three-dimensional geometric shapes of automotive metal bottom frames in a comprehensive and accurate manner, especially in components with multiple forms and subtle changes, resulting in inaccurate flatness detection results.

Method used

Using machine vision-based detection method, edge points are obtained through Canny edge detection, combined with corner point detection and texture analysis, edge roughness and texture smoothness are calculated, irregular points are eliminated, and flattening probability is output using convolutional neural network.

Benefits of technology

It improves the accuracy and efficiency of flatness detection of metal bottom frames, can identify structural defects and external damage, output accurate flatness results and alarm in time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198427B_ABST
    Figure CN120198427B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of flatness detection, and particularly to a method for detecting the flatness of a metal bottom frame based on machine vision, including: obtaining a surface grayscale image of an automotive metal bottom frame, and obtaining edge points of the surface grayscale image based on Canny edge detection; constructing a window centered on a target edge point, and using corner detection to obtain corner points of the window to calculate the edge roughness of the target edge point; calculating the texture smoothness of the target edge point; judging the edge points according to the edge roughness and the texture smoothness to obtain new strong edge points and new weak edge points, removing the new strong edge points to obtain a new surface grayscale image, inputting the new surface grayscale image into a preset network, and outputting a flatness probability to complete the flatness detection. Through the technical solution of the present invention, the accuracy and efficiency of the flatness detection result of the metal bottom frame can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of flatness detection, and more specifically, to a method for detecting the flatness of a metal bottom frame based on machine vision. Background Art

[0002] Metal chassis plays an important structural support role in many industries, especially in electronics, machinery, automobiles and other fields. Metal chassis are usually made of metal materials through stamping, casting and other processes, and serve as an important part of electronic equipment housing or other mechanical structures. Since metal chassis need to withstand a lot of mechanical stress during the production process, the flatness of its surface is crucial to the quality of the product. Metal chassis that do not meet the flatness standards not only affect its appearance quality, but may also affect subsequent assembly, performance and reliability.

[0003] Defects that affect the flatness of the metal underframe of the car can be roughly divided into two categories. The first category is cracking defects, such as scratches, abrasions, voids, etc. These defects are usually accompanied by the cracking or local damage of the metal material, which will cause the metal underframe to have structural unevenness, affecting the accuracy of the flatness, and may even affect the safety and stability of the whole vehicle to a certain extent. The second category is structural defects, including pits, bulges, uneven layers and oxide scales, etc. These defects generally do not cause cracks, but will cause changes in the deformation of the metal underframe, thereby affecting the flatness test results. Although these defects usually do not directly affect the strength of the metal underframe, they will increase the difficulty of flatness detection, affect the measurement accuracy, and thus affect the overall quality of the product. Therefore, for the flatness detection of the metal underframe of the car, these two types of defects must be considered comprehensively to ensure the accuracy of the test results and the quality control of the product.

[0004] However, the shape of the car's underbody frame may be very complex, with different structural features such as bends, protrusions or grooves. Traditional detection methods usually rely on mechanical contact measurement tools or two-dimensional optical detection. These methods have limitations when facing complex three-dimensional geometric shapes and it is difficult to fully and accurately capture the flatness of the underbody frame. Especially in parts with various shapes and subtle changes, traditional methods often cannot fully reflect tiny irregularities and deformations, resulting in inaccurate flatness detection results. Summary of the invention

[0005] To solve the technical problem of inaccurate flatness detection results, the present invention provides a method for detecting the flatness of a metal bottom frame based on machine vision. The method includes: obtaining a surface grayscale image of an automotive metal bottom frame, and obtaining edge points of the surface grayscale image based on Canny edge detection, where the edge points include strong edge points and weak edge points; taking any edge point as a target edge point, constructing a window centered on the target edge point, and obtaining corner points of the window by using corner detection to calculate the edge roughness of the target edge point; calculating the texture smoothness of the target edge point; judging the edge points according to the edge roughness and texture smoothness to obtain new strong edge points and new weak edge points, removing the new strong edge points to obtain a new surface grayscale image, inputting the new surface grayscale image into a preset network, and outputting a flatness probability to complete the flatness detection.

[0006] Through the classification of edge points into strong and weak categories and further analysis of edge roughness and smoothness, it is possible to identify whether there are texture irregularities on the surface of the metal bottom frame due to structural defects or external damage. Specifically, the process of removing and updating strong and weak edge points enables the detection system to more accurately identify the edge points that truly represent the flatness of the metal bottom frame surface, and by removing irregular or damaged points, a more real and reliable surface grayscale image is obtained. Finally, by combining the analysis of the new grayscale image by the preset network, a flatness probability can be output, effectively reflecting the actual flatness of the metal bottom frame surface.

[0007] Preferably, the corner detection is the Harris corner detection algorithm or the FAST corner detection.

[0008] Preferably, the edge roughness includes: counting the number of corner points within the window, numbering the corner points within the window in a preset direction, calculating the distance between any two adjacent corner points, and taking the mean of all distances as the edge roughness.

[0009] Combining the number and distribution information of corner points can more comprehensively evaluate the roughness of the edge, while avoiding complex curvature calculations, improving the calculation efficiency, and being applicable to real-time or large-scale image processing tasks.

[0010] Preferably, the edge roughness further includes: counting the edge size within the window, where the edge size is the total number of edge points, and taking the ratio of the number of corner points to the edge size as the edge roughness.

[0011] Preferably, the edge roughness includes: calculating the curvature of each edge point within the window, and taking the mean of all curvatures as the edge roughness.

[0012] Preferably, the texture smoothness includes: constructing a gray-level co-occurrence matrix for the window, and taking the energy value in the gray-level co-occurrence matrix as the texture smoothness.

[0013] By constructing a gray-level co-occurrence matrix for the window and using the energy value therein as a measure of texture smoothness, the texture characteristics of the local region of the image can be effectively evaluated. The energy value of the gray-level co-occurrence matrix reflects the uniformity and consistency of the gray-level value distribution in the image. The higher the energy value, the more uniform and smooth the texture; the lower the energy value, the more complex and rough the texture.

[0014] Preferably, the texture smoothness includes: obtaining a preset number of neighborhood points centered on the target edge point, and stratifying all the neighborhood points, where the minimum number of pixel points between the neighborhood point and the target edge point is used as the number of layers; calculating the gray-level value difference sequence between any layer of neighborhood points and the target edge point, calculating the similarity of the gray-level value difference sequences of any two layers of neighborhood points, and taking the average value of all similarities as the local texture smoothness of the target edge point.

[0015] It can effectively capture the subtle changes in the texture around the edge point. By quantifying the smoothness of the texture, it helps to distinguish the normal structural features from potential defects on the surface of the metal bottom frame.

[0016] Preferably, the judgment of the edge point includes: for any strong edge point, calculating the second ratio of the texture smoothness of the strong edge point to the edge roughness, and calculating the product of the gradient value of the strong edge point and the second ratio, comparing the product with the high threshold in the Canny edge detection. In response to the product being not less than the high threshold, the strong edge point is a new strong edge point; in response to the product being less than the high threshold, the strong edge point is a new weak edge point; for any weak edge point, calculating the second ratio of the weak edge point, and calculating the product of the gradient value of the weak edge point and the second ratio, comparing the product with the low threshold in the Canny edge detection. In response to the product being not greater than the low threshold, the weak edge point is a new weak edge point; in response to the product being greater than the low threshold, the weak edge point is a new strong edge point.

[0017] It can dynamically adjust the intensity of the edge point according to the texture characteristics of the edge point, so as to remove noise and unimportant details while retaining important edge information, and improve the accuracy and robustness of edge detection.

[0018] Preferably, the preset network is a convolutional neural network, and the input of the convolutional neural network is the new surface gray-scale image, and the output is the flatness probability.

[0019] Preferably, the completion of the flatness detection includes: in response to the flatness probability being not less than the preset flatness threshold, generating and sending an alarm signal.

[0020] The beneficial effects of the present invention:

[0021] By combining edge detection, corner detection, texture analysis, and deep learning techniques, the present invention can efficiently and accurately evaluate the flatness of the metal bottom frame of an automobile. Specifically, it uses Canny edge detection to obtain edge points, and evaluates the roughness and texture characteristics of the edges through corner detection and texture smoothness calculation, so as to distinguish structural features and defects. By dynamically adjusting the intensity of the edge points, important edge information can be more accurately identified, while removing noise and unimportant details. In addition, the processed image is input into a convolutional neural network to output the flatness probability, further improving the accuracy and reliability of the detection.

[0022] It can not only quickly detect flatness problems, but also send an alarm signal in time when the flatness probability is lower than the preset threshold, providing strong support for the flatness detection in the manufacturing process of the metal bottom frame of an automobile. Description of the Drawings

[0023] Figure 1 is a flowchart of the method for detecting the flatness of the metal bottom frame based on machine vision in an embodiment of the present invention. Detailed Embodiments

[0024] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments.

[0025] The following will describe in detail the specific embodiments of the present invention in conjunction with the accompanying drawings.

[0026] Refer to Figure 1 , the method for detecting the flatness of the metal bottom frame based on machine vision includes steps S1 - S4, specifically as follows:

[0027] S1: Obtain the surface grayscale image of the metal bottom frame of the automobile, and obtain the edge points of the surface grayscale image based on Canny edge detection.

[0028] In one embodiment, by obtaining the surface grayscale image of the metal bottom frame of the automobile, the surface information of the object can be converted into a two-dimensional image, where the grayscale value of each pixel reflects the change in surface brightness. Next, the Canny edge detection algorithm is used to process this grayscale image. The Canny algorithm is a classic edge detection method, and its main steps include smoothing the image, calculating the image gradient, non-maximum suppression, and double-threshold detection. Through these steps, Canny edge detection can accurately identify the edge points in the image.

[0029] During the edge detection process, the Canny algorithm classifies edge points into two categories: strong edge points and weak edge points. Strong edge points refer to those obvious and clear edges, which in the present invention represent the bends, protrusions or grooves on the bottom frame of the vehicle, and have a relatively high gradient value. Weak edge points refer to those areas where the edges are relatively blurred or unclear, and these points have a lower gradient value.

[0030] S2: Take any edge point as the target edge point, construct a window centered on the target edge point, and use corner detection to obtain the corners of the window to calculate the edge roughness of the target edge point.

[0031] It should be noted that rupture defects, such as scratches, abrasions, voids, etc., usually accompany the rupture or local damage of the metal bottom frame, resulting in local failure of the surface or structure. The existence of these defects not only makes the surface of the metal bottom frame have obvious rough edges, but may also cause more serious fatigue, corrosion or crack propagation.

[0032] In one embodiment, take any edge point as the target edge point, and construct a window centered on the target edge point, where the window size can be set by those skilled in the art.

[0033] It should be noted that by constructing a window, the analysis scope can be limited to the local area of the target edge point. This localized analysis helps to exclude the interference of distant noise or irrelevant features, making the calculation of edge roughness more focused on the characteristics of the target edge point and its adjacent areas. For example, in the image of the metal bottom frame of a vehicle, there may be noise in some areas of the bottom frame due to uneven illumination or complex background, and the local window can effectively avoid the influence of these noises on the calculation of the edge roughness of the target edge point.

[0034] Performing corner detection and edge roughness calculation globally may involve a large amount of computing resources, especially for high-resolution images. By constructing a window, the calculation scope can be limited to a smaller area, thus significantly improving the calculation efficiency. This is particularly important for real-time processing or large-scale image analysis, which can speed up the processing speed and reduce resource consumption.

[0035] Use the Harris corner detection algorithm or the FAST corner detection algorithm to obtain a certain number of corners in the window, count the number of corners in the window, label the corners in the window in a preset direction, calculate the distance between any two adjacent corners, and take the average value of all distances as the edge roughness.

[0036] By counting the number of corner points, the complexity of the edges within the window can be directly reflected: the more corner points, usually the more irregular and rough the edges are. Calculating the average distance between adjacent corner points further quantifies this irregularity. A smaller average distance indicates that the corner points are dense, the edge changes frequently, and the edge roughness is high; a larger average distance indicates that the corner points are sparse, the edge is relatively smooth, and the edge roughness is low.

[0037] Exemplarily, taking the clockwise direction as the preset direction, each corner point is numbered.

[0038] Using the Harris corner detection algorithm or the FAST corner detection algorithm to obtain several corner points in the window can provide rich information about the local structure, thus providing strong support for the evaluation of edge roughness. These corner points are usually located at significant changes in the edge, such as protrusions, depressions, or places where the direction changes. Therefore, corner points can be used as a direct indicator of edge irregularity.

[0039] In one embodiment, the edge roughness further includes: counting the edge size within the window, where the edge size is the total number of edge points, and taking the ratio of the number of corner points to the edge size as the edge roughness.

[0040] The more corner points, the more mutations and changes in the edge; while the edge size (total number of edge points) provides the overall length information of the edge. By calculating the ratio of the two, a normalized edge roughness index can be obtained, which does not depend on the specific length of the edge, thus enabling direct comparison between edges of different lengths.

[0041] In one embodiment, the edge roughness includes: calculating the curvature of each edge point within the window and taking the average value of all curvatures as the edge roughness.

[0042] Curvature is a quantity that describes the degree of bending of an edge at a certain point. The larger the absolute value of the curvature, the stronger the degree of bending of the edge at that point. Therefore, by calculating the average curvature of all edge points within the window, an index reflecting the smoothness of the edge within the entire window can be obtained.

[0043] S3: Calculate the texture smoothness of the target edge point.

[0044] It should be noted that although structural defects do not cause the fracture or rupture of metal materials, they will cause deformation of the metal bottom frame, thereby affecting the smoothness of the surface texture.

[0045] In one embodiment, a preset number of neighborhood points are obtained centered on the target edge point, and all the neighborhood points are stratified. Herein, the minimum number of pixel points separating the neighborhood points from the target edge point is used as the number of layers; the gray value difference sequence between the neighborhood points of any layer and the target edge point is calculated, the similarity of the gray value difference sequences of any two layers of neighborhood points is calculated, and the mean value of all the similarities is used as the local texture smoothness of the target edge point.

[0046] Exemplarily, the neighborhood points of the 48-neighborhood of the target edge point are obtained. Among them, there are no pixel points between the neighborhood points of the 8-neighborhood of the target edge point and the target edge point. Then, the neighborhood points of the 8-neighborhood are the neighborhood points of the 0th layer; the neighborhood points of the 24-neighborhood of the target edge point are separated from the target edge point by the neighborhood points of the 0th layer. Then, the outermost neighborhood points of the 24-neighborhood are the neighborhood points of the 1st layer, and so on, and the neighborhood points of the 2nd layer can be obtained.

[0047] If the edge points of the metal bottom frame are formed by structural features such as bends, protrusions, or grooves it has, these natural structural changes are usually precisely machined or designed. Therefore, the texture transition presents smooth and gradual changes. Structural features such as bends, protrusions, or grooves help maintain the continuity and uniformity of the metal surface, making the texture transition from the inside to the outside natural and regular. On the contrary, if there are defects at the edge points, such as pits, cracks, or irregular surface flaws, then these defects will cause local imbalance on the metal surface, destroying the continuity and consistency of the texture.

[0048] In one embodiment, the texture smoothness includes: constructing a gray-level co-occurrence matrix for the window, and using the energy value in the gray-level co-occurrence matrix as the texture smoothness.

[0049] S4: Judging the edge points according to the edge roughness and the texture smoothness to obtain new strong edge points and new weak edge points, removing the new strong edge points, obtaining a new surface gray-scale image, inputting the new surface gray-scale image into a preset network, outputting a flatness probability, and completing the flatness detection.

[0050] In one embodiment, for any strong edge point, calculate the second ratio of the texture smoothness of the strong edge point to the edge roughness, and calculate the product of the gradient value of the strong edge point and the second ratio. Compare the product with the high threshold in the Canny edge detection. In response to the product being not less than the high threshold, the strong edge point is a new strong edge point. In response to the product being less than the high threshold, the strong edge point is a new weak edge point.

[0051] For any weak edge point, calculate the second ratio, and calculate the product of the gradient value of the weak edge point and the second ratio. Compare the product with the low threshold in the Canny edge detection. In response to the product being not greater than the low threshold, the weak edge point is a new weak edge point. In response to the product being greater than the low threshold, the weak edge point is a new strong edge point.

[0052] For strong edge points, by calculating the ratio of their texture smoothness to edge roughness and multiplying this ratio by the gradient value, a more accurate edge intensity measure can be obtained. If this product is not less than the high threshold in Canny edge detection, it indicates that the strong edge point is smooth in texture and thus can be retained as a new strong edge point; if the product is less than the high threshold, it indicates that the strong edge point is rough in texture and thus can be downgraded to a new weak edge point. For weak edge points, by calculating a second ratio in a similar way and multiplying this ratio by the gradient value, a more accurate edge intensity measure can be obtained. If this product is not greater than the low threshold in Canny edge detection, it indicates that the weak edge point is rough in texture and thus can be retained as a new weak edge point; if the product is greater than the low threshold, it indicates that the weak edge point is smooth in texture and thus can be upgraded to a new strong edge point.

[0053] Eliminate the new strong edge points to obtain a new surface grayscale image, and input the new surface grayscale image into a preset network to output a flatness probability. Among them, the preset network is a convolutional neural network, and the output of the flatness probability is a well-known technology to those skilled in the art and will not be elaborated here.

[0054] In response to the flatness probability being not less than a preset flatness threshold, generate and send an alarm signal to complete the flatness detection of the metal bottom frame.

[0055] It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of this invention patent shall be subject to the appended claims.

Claims

1. A method for detecting the flatness of a metal bottom frame based on machine vision, characterized in that, Including: Obtain the surface grayscale image of the metal bottom frame of the vehicle, and based on Canny edge detection, obtain the edge points of the surface grayscale image. The edge points include strong edge points and weak edge points; Take any edge point as the target edge point, construct a window centered on the target edge point, and use corner detection to obtain the corner points of the window, so as to calculate the edge roughness of the target edge point, including: counting the number of corner points in the window, numbering the corner points in the window in a preset direction, calculating the distance between any two adjacent corner points, and taking the average value of all distances as the edge roughness; Calculate the texture smoothness of the target edge point, including: Obtain a preset number of neighborhood points centered on the target edge point, and layer all the neighborhood points. Among them, the minimum number of pixel points between the neighborhood point and the target edge point is used as the number of layers; Calculate the gray value difference sequence between any layer of neighborhood points and the target edge point, calculate the similarity of the gray value difference sequences of any two layers of neighborhood points, and take the average value of all similarities as the texture smoothness of the target edge point; Judge the edge points according to the edge roughness and texture smoothness, including: For any strong edge point, calculate the second ratio of the texture smoothness of the strong edge point to the edge roughness, and calculate the product of the gradient value of the strong edge point and the second ratio. Compare the product with the high threshold in Canny edge detection. In response to the product being not less than the high threshold, the strong edge point is a new strong edge point. In response to the product being less than the high threshold, the strong edge point is a new weak edge point; For any weak edge point, calculate the second ratio of the weak edge point, and calculate the product of the gradient value of the weak edge point and the second ratio. Compare the product with the low threshold in Canny edge detection. In response to the product being not greater than the low threshold, the weak edge point is a new weak edge point. In response to the product being greater than the low threshold, the weak edge point is a new strong edge point; Obtain the new strong edge points and new weak edge points, remove the new strong edge points, obtain a new surface grayscale image, input the new surface grayscale image into a preset network, output a flatness probability, and complete the flatness detection.

2. The method for detecting the flatness of a metal bottom frame based on machine vision according to claim 1, wherein The corner detection is the Harris corner detection algorithm or the FAST corner detection.

3. The method for detecting the flatness of a metal bottom frame based on machine vision according to claim 1, wherein The edge roughness also includes: Count the edge size within the window. The edge size is the total number of edge points, and take the ratio of the number of corner points to the edge size as the edge roughness.

4. The method for detecting the flatness of a metal bottom frame based on machine vision according to claim 1, wherein The edge roughness includes: Calculate the curvature of each edge point within the window, and take the average value of all curvatures as the edge roughness.

5. The method for detecting the flatness of a metal bottom frame based on machine vision according to claim 1, wherein, The texture smoothness also includes: Construct a gray-level co-occurrence matrix for the window, and take the energy value in the gray-level co-occurrence matrix as the texture smoothness.

6. The method for detecting the flatness of a metal bottom frame based on machine vision according to claim 1, wherein The preset network is a convolutional neural network. The input of the convolutional neural network is the new surface grayscale image, and the output is the flatness probability.

7. The method for detecting the flatness of a metal bottom frame based on machine vision according to claim 1, characterized in that, The completion of the flatness detection includes: In response to the flatness probability being not less than the preset flatness threshold, generate and send an alarm signal.

Citation Information

Patent Citations

  • Spatial non-cooperative target corner extraction method based on Canny edge detection

    CN112132849A

  • Hardware stamping part deburring effect evaluation method

    CN116385472A