Industrial part size automatic detection method

The part images are collected by industrial cameras and used the Canny edge detection algorithm to identify feature points and calculate part size information, which solves the problem of time-consuming and laborious and error-prone problems in the prior art, and realizes automatic detection report generation, which improves detection efficiency and accuracy.

CN119810174APending Publication Date: 2025-04-11SUZHOU XIANYANG ROBOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411968764.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the existing industrial parts dimension detection methods, the detection table needs to be manually entered after obtaining the dimension data, which is time-consuming and labor-intensive and can easily lead to data errors, affecting the accuracy and efficiency of the detection table.

Method used

An industrial camera is used to collect part images, extract edge information through the Canny edge detection algorithm, identify feature points and calculate size information, and automatically generate a detection report table to avoid manual entry.

Benefits of technology

Effectively save labor, reduce data errors caused by human factors, and improve the accuracy and acquisition efficiency of detection tables.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810174A_ABST
    Figure CN119810174A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial part size automatic detection method which comprises the following steps: acquiring an image of an industrial part to be detected, and acquiring parameters of a CDD industrial camera; preprocessing an industrial part image to be detected; extracting edge information in the preprocessed to-be-detected industrial part image; the edge information is identified, feature points of the industrial part are identified, and coordinates of the feature points in the image are obtained; calculating size information of the industrial part in the image; calculating the actual size information of the industrial part according to the size information of the industrial part in the image and the parameters of the CDD industrial camera; and generating an industrial part size detection report form according to the actual size information of the industrial part. The problems that in an existing industrial part size detection method, after size data of an industrial part are obtained, the data still need to be manually input into a detection table in a manual mode, time and labor are consumed, and data input errors are likely to be caused by human factors are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of industrial part size detection, in particular to an industrial part size automatic detection method. Background Art

[0002] In modern industrial production, the dimensional accuracy of industrial parts is crucial to product quality and performance. With the development and popularization of industrial automation technology, manufacturing companies are increasingly inclined to adopt automated production lines and equipment to improve production efficiency and quality levels. Therefore, automated industrial part size detection methods have become an important demand for industrial production. The prior art discloses an industrial part size detection method, which specifically uses an image acquisition system to collect images, and performs median filtering, threshold segmentation, image filling, Canny edge coarse extraction, edge fine extraction and size calibration on the images in sequence, so as to obtain the size data of industrial parts. However, after obtaining the size data of industrial parts, it is still necessary to rely on manual methods to manually enter these data into the detection table. This step is not only time-consuming and labor-intensive, but also prone to data entry errors due to human factors, thereby affecting the accuracy and acquisition efficiency of the detection table. Summary of the invention

[0003] In view of the above-mentioned defects, the present invention proposes an automated industrial parts size detection method, which aims to solve the problem that in the existing industrial parts size detection method, after obtaining the size data of the industrial parts, it is still necessary to rely on manual methods to manually enter these data into the detection table. This is not only time-consuming and labor-intensive, but also prone to data entry errors due to human factors, thereby affecting the accuracy of the detection table and the acquisition efficiency.

[0004] To achieve this object, the present invention adopts the following technical solutions:

[0005] An automatic detection method for industrial parts size comprises the following steps:

[0006] Step S1: using a CDD industrial camera to collect images of industrial parts to be inspected, and obtaining parameters of the CDD industrial camera;

[0007] Step S2: preprocessing the image of the industrial part to be detected to obtain the preprocessed image of the industrial part to be detected;

[0008] Step S3: using the Canny edge detection algorithm to extract the edge of the preprocessed industrial part image to be detected, and obtain edge information in the industrial part image;

[0009] Step S4: identifying edge information in the industrial part image, identifying feature points of the industrial part, and obtaining coordinates of the feature points of the industrial part in the image;

[0010] Step S5: Calculate the size information of the industrial part in the image according to the coordinates of the feature points of the industrial part in the image;

[0011] Step S6: Calculate the actual size information of the industrial part according to the size information of the industrial part in the image and the parameters of the CDD industrial camera;

[0012] Step S7: Generate an industrial part size detection report table based on the actual size information of the industrial part.

[0013] Preferably, step S3 specifically includes the following sub-steps:

[0014] Step S31: Use Gaussian filtering to remove noise in the pre-processed industrial part image to be detected, and obtain a smoothed industrial part image, wherein the mathematical expression of Gaussian filtering is as follows:

[0015]

[0016] Where G(x, y) represents the output of the Gaussian function; x represents the horizontal coordinate of the pixel in the image; y represents the vertical coordinate of the pixel in the image; σ represents the standard deviation;

[0017] Step S32: Use the Sobel operator to calculate the horizontal gradient I of each pixel in the smoothed industrial part image. x and vertical gradient I y , and according to I x and I y , calculate the gradient amplitude I and gradient direction θ of each pixel in the smoothed industrial part image, where the specific calculation formulas of I and θ are as follows:

[0018]

[0019] in,

[0020] Step S33: determining whether the gradient amplitude of each pixel in the smoothed industrial part image is a local maximum in its gradient direction, if so, retaining the corresponding pixel, if not, setting the gradient amplitude of the corresponding pixel to 0;

[0021] Step S34: using a double threshold method to detect the gradient amplitude of the retained pixel point to determine the type of the edge where the retained pixel point is located;

[0022] If the gradient amplitude of a retained pixel is greater than the high threshold, the type of edge where the pixel is located is a strong edge; if the gradient amplitude of a retained pixel is between the high threshold and the low threshold, the type of edge where the pixel is located is a weak edge; if the gradient amplitude of a retained pixel is less than the low threshold, the type of edge where the pixel is located is a non-edge;

[0023] Step S35: using the feature of connecting the weak edge with the strong edge, edge connection is performed to obtain edge information in the industrial part image.

[0024] Preferably, in step S4, edge information in the industrial part image is identified to identify feature points of the industrial part, which specifically includes the following sub-steps: according to the edge information in the industrial part image, the corner points of the industrial part are detected using the Harris corner detection algorithm, which specifically includes the following sub-steps:

[0025] Step S41: According to I x and I y , calculate the Harris matrix corresponding to each pixel on the edge of the industrial part image. The specific calculation formula of the Harris matrix is ​​as follows:

[0026]

[0027] Where, M represents the Harris matrix;

[0028] Step S42: Calculate the Harris response value corresponding to each pixel point on the edge of the industrial part image according to the Harris matrix corresponding to each pixel point on the edge of the industrial part image. The specific calculation formula of the Harris response value is as follows:

[0029] R = det(M) - k (trace(M)) 2 ;

[0030] Where R represents the Harris response value; det(M) represents the determinant of the Harris matrix; trace(M) represents the trace of the Harris matrix; k represents a constant, ranging from 0.04 to 0.06;

[0031] Step S43: performing non-maximum suppression on the Harris response values ​​corresponding to each pixel point on the edge of the industrial part image to determine the corner points of the industrial part.

[0032] Preferably, in step S5, the following sub-steps are specifically included:

[0033] Let the coordinates of the feature points of the two industrial parts in the image be P1(x1, y1) and P2(x2, y2), calculate the straight-line distance d between the feature points of the two industrial parts to determine a length or width of the industrial parts in the image, and calculate the angle α of the edge where the feature points of the two industrial parts are located relative to the x-axis to determine an angle of the industrial parts in the image. The calculation formula of the straight-line distance d between the feature points of the two industrial parts is as follows:

[0034]

[0035] The calculation formula for the angle α of the edge where the feature points of the two industrial parts are located relative to the x-axis is as follows:

[0036]

[0037] Preferably, in step S5, the following steps are also included:

[0038] Let the coordinates of the feature points of industrial parts in the image be P i (x i ,y i ), calculate the characteristic points P of industrial parts i The angle α of the edge relative to the x-axis i ;

[0039] Calculate the characteristic points P of industrial parts i The distance between each edge point on the edge and the reference origin ρ i ;

[0040] Create an accumulator array in Hough space;

[0041] Transform each edge point into (ρ i , α i ) coordinates and add 1 to the corresponding position in the accumulator array;

[0042] Find the peak points in the accumulator array to determine the shape of the industrial part in the image.

[0043] Preferably, in step S5, the following steps are also included: using a linear regression algorithm or a polynomial regression algorithm to fit the curve where the shape of the industrial part in the image is located, wherein the mathematical formula of the linear regression algorithm is as follows:

[0044] u=mv+b;

[0045] Among them, u represents the output after fitting; v represents the coordinate value of the pixel point in the image; m represents the slope, and the specific calculation formula is as follows: b represents the level, and the specific calculation formula is as follows: n represents the total number of observed data points used to estimate model parameters;

[0046] The mathematical formula for the polynomial regression algorithm is as follows:

[0047] u=Va;

[0048] Among them, u represents the output after fitting; V represents the design matrix, which includes the powers of various orders of pixels in the image; a represents the polynomial coefficient vector.

[0049] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0050] In this solution, after calculating and obtaining the actual size information of industrial parts, an industrial parts size inspection report form is automatically generated. Compared with the traditional method of manually entering industrial parts size data into the inspection form, this solution can effectively save labor and reduce data entry errors caused by human factors, thereby improving the accuracy and acquisition efficiency of the inspection form. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a flow chart of the steps of an automated detection method for industrial part dimensions. DETAILED DESCRIPTION

[0052] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0053] An automatic detection method for industrial parts size comprises the following steps:

[0054] Step S1: using a CDD industrial camera to collect images of industrial parts to be inspected, and obtaining parameters of the CDD industrial camera;

[0055] Step S2: preprocessing the image of the industrial part to be detected to obtain the preprocessed image of the industrial part to be detected;

[0056] Step S3: using the Canny edge detection algorithm to extract the edge of the preprocessed industrial part image to be detected, and obtain edge information in the industrial part image;

[0057] Step S4: identifying edge information in the industrial part image, identifying feature points of the industrial part, and obtaining coordinates of the feature points of the industrial part in the image;

[0058] Step S5: Calculate the size information of the industrial part in the image according to the coordinates of the feature points of the industrial part in the image;

[0059] Step S6: Calculate the actual size information of the industrial part according to the size information of the industrial part in the image and the parameters of the CDD industrial camera;

[0060] Step S7: Generate an industrial part size detection report table based on the actual size information of the industrial part.

[0061] This solution is an automated detection method for industrial parts size, such as Figure 1As shown, the first step is to collect the image of the industrial part to be detected by the CDD industrial camera and obtain the parameters of the CDD industrial camera. In this embodiment, the CDD industrial camera is used to collect the image of the industrial part to be detected to ensure the clarity and information integrity of the industrial part image. The parameters of the CDD industrial camera include internal parameters, external parameters, resolution and pixel size. The second step is to preprocess the image of the industrial part to be detected to obtain the image of the industrial part to be detected after preprocessing. In this embodiment, the preprocessing includes removing noise in the image, adjusting the brightness and contrast of the image, and performing edge enhancement. Preprocessing the image of the industrial part to be detected is conducive to improving the quality of the image of the industrial part to be detected, so as to extract features in the subsequent industrial part image. The third step is to use the Canny edge detection algorithm to extract the edge of the preprocessed industrial part image to be detected to obtain the edge information in the industrial part image. In this embodiment, the Canny edge detection algorithm is an existing edge detection algorithm. The edge information in the preprocessed industrial part image to be detected is extracted by the Canny edge detection algorithm, which is conducive to the recognition of subsequent edge feature points. The fourth step is to identify the edge information in the industrial part image, identify the feature points of the industrial part, and obtain the coordinates of the feature points of the industrial part in the image. In this embodiment, the feature points of the industrial part include the corner points, intersection points and concave and convex points of the industrial part. By identifying the feature points of the industrial part and obtaining the corresponding coordinate information, it is beneficial to measure the size of the industrial part in the subsequent image. The fifth step is to calculate the size information of the industrial part in the image according to the coordinates of the feature points of the industrial part in the image. In this embodiment, by calculating the size information of the industrial part in the image, it is beneficial to calculate the actual size information of the industrial part in the subsequent calculation. The sixth step is to calculate the actual size information of the industrial part according to the size information of the industrial part in the image and the parameters of the CDD industrial camera. In this embodiment, the actual size of the industrial part can be inferred through the size information of the industrial part in the image and the parameters of the CDD industrial camera, so as to achieve accurate measurement of the size of the industrial part. The seventh step is to generate an industrial part size detection report table according to the actual size information of the industrial part. In this embodiment, the industrial part size detection report table includes size measurement data and error analysis. By automatically generating the industrial part size detection report table, a reference basis is provided for quality management and production decision-making.

[0062] In this solution, after calculating and obtaining the actual size information of industrial parts, an industrial parts size inspection report form is automatically generated. Compared with the traditional method of manually entering industrial parts size data into the inspection form, this solution can effectively save labor and reduce data entry errors caused by human factors, thereby improving the accuracy and acquisition efficiency of the inspection form.

[0063] Preferably, in step S3, the following sub-steps are specifically included:

[0064] Step S31: Use Gaussian filtering to remove noise in the pre-processed industrial part image to be detected, and obtain a smoothed industrial part image, wherein the mathematical expression of Gaussian filtering is as follows:

[0065]

[0066] Where G(x, y) represents the output of the Gaussian function; x represents the horizontal coordinate of the pixel in the image; y represents the vertical coordinate of the pixel in the image; σ represents the standard deviation;

[0067] Step S32: Use the Sobel operator to calculate the horizontal gradient I of each pixel in the smoothed industrial part image. x and vertical gradient I y , and according to I x and I y , calculate the gradient amplitude I and gradient direction θ of each pixel in the smoothed industrial part image, where the specific calculation formulas of I and θ are as follows:

[0068]

[0069] in,

[0070] Step S33: determining whether the gradient amplitude of each pixel in the smoothed industrial part image is a local maximum in its gradient direction, if so, retaining the corresponding pixel, if not, setting the gradient amplitude of the corresponding pixel to 0;

[0071] Step S34: using a double threshold method to detect the gradient amplitude of the retained pixel point to determine the type of the edge where the retained pixel point is located;

[0072] If the gradient amplitude of a retained pixel is greater than the high threshold, the type of edge where the pixel is located is a strong edge; if the gradient amplitude of a retained pixel is between the high threshold and the low threshold, the type of edge where the pixel is located is a weak edge; if the gradient amplitude of a retained pixel is less than the low threshold, the type of edge where the pixel is located is a non-edge;

[0073] Step S35: using the feature of connecting the weak edge with the strong edge, edge connection is performed to obtain edge information in the industrial part image.

[0074] In this embodiment, in step S31, by using Gaussian filtering to remove noise in the industrial part image to be detected after preprocessing, it is beneficial to further improve the quality of the industrial part image to be detected. In step S32, by calculating the gradient amplitude I and gradient direction θ of each pixel in the smoothed industrial part image, it is beneficial to subsequently suppress the non-maximum value of the pixel. In step S33, by performing non-maximum suppression on each pixel in the industrial part image, it is beneficial to refine the edge in the industrial part image. In step S34, by determining the type of edge where the retained pixel is located, it is beneficial to subsequent edge connection. In step S35, by using the feature of weak edge connected to strong edge for edge connection, it is beneficial to reduce the situation of misjudging non-edge as edge or missing edge as non-edge. It is further explained that when a weak edge is connected to a strong edge, it is considered that the weak edge is generated by the extension or refinement of the real edge, so it is included in the edge detection result.

[0075] Preferably, in step S4, edge information in the industrial part image is identified to identify feature points of the industrial part, which specifically includes the following sub-steps: according to the edge information in the industrial part image, the corner points of the industrial part are detected using the Harris corner detection algorithm, which specifically includes the following sub-steps:

[0076] Step S41: According to I x and I y , calculate the Harris matrix corresponding to each pixel on the edge of the industrial part image. The specific calculation formula of the Harris matrix is ​​as follows:

[0077]

[0078] Where, M represents the Harris matrix;

[0079] Step S42: Calculate the Harris response value corresponding to each pixel point on the edge of the industrial part image according to the Harris matrix corresponding to each pixel point on the edge of the industrial part image. The specific calculation formula of the Harris response value is as follows:

[0080] R = det(M) - k (trace(M)) 2 ;

[0081] Where R represents the Harris response value; det(M) represents the determinant of the Harris matrix; trace(M) represents the trace of the Harris matrix; k represents a constant, ranging from 0.04 to 0.06;

[0082] Step S43: performing non-maximum suppression on the Harris response values ​​corresponding to each pixel point on the edge of the industrial part image to determine the corner points of the industrial part.

[0083] In this embodiment, the Harris corner point detection algorithm can be used to identify the corner points in the industrial part image, which is convenient for the subsequent measurement of the size of the industrial part in the image. In step S43, for the current pixel point on the edge of the industrial part image, the Harris response values ​​corresponding to the two adjacent pixel points in the gradient direction are compared. If the Harris response value corresponding to the current pixel point is the largest, the current pixel point is retained and used as the corner point of the industrial part.

[0084] Preferably, in step S5, the following sub-steps are specifically included:

[0085] Let the coordinates of the feature points of the two industrial parts in the image be P1(x1, y1) and P2(x2, y2), calculate the straight-line distance d between the feature points of the two industrial parts to determine a length or width of the industrial parts in the image, and calculate the angle α of the edge where the feature points of the two industrial parts are located relative to the x-axis to determine an angle of the industrial parts in the image. The calculation formula of the straight-line distance d between the feature points of the two industrial parts is as follows:

[0086]

[0087] The calculation formula for the angle α of the edge where the feature points of the two industrial parts are located relative to the x-axis is as follows:

[0088]

[0089] In this embodiment, by calculating the length or width and the angle of the industrial part in the image, it is convenient to subsequently calculate the actual size of the industrial part.

[0090] Preferably, in step S5, the following steps are also included:

[0091] Let the coordinates of the feature points of industrial parts in the image be P i (x i ,y i ), calculate the characteristic points P of industrial parts i The angle α of the edge relative to the x-axis i ;

[0092] Calculate the characteristic points P of industrial parts i The distance between each edge point on the edge and the reference origin ρ i ;

[0093] Create an accumulator array in Hough space;

[0094] Transform each edge point into (ρ i , α i ) coordinates and add 1 to the corresponding position in the accumulator array;

[0095] Find the peak points in the accumulator array to determine the shape of the industrial part in the image.

[0096] In this embodiment, the shape of the industrial parts in the image is determined by Hough transform, so that the actual size of the industrial parts can be calculated more accurately later. Further explanation: in Hough transform, each point in the image space has a corresponding shape in the parameter space, and the curves where these shapes are located may intersect. The point with the most intersections is the peak point. This peak point corresponds to a function equation in the image space. If there are multiple different peak points, the corresponding function equations are also different, so as to determine the shape of the industrial parts in the image.

[0097] Preferably, in step S5, the following steps are also included: using a linear regression algorithm or a polynomial regression algorithm to fit the curve where the shape of the industrial part in the image is located, wherein the mathematical formula of the linear regression algorithm is as follows:

[0098] u=mv+b;

[0099] Among them, u represents the output after fitting; v represents the coordinate value of the pixel point in the image; m represents the slope, and the specific calculation formula is as follows: b represents the level, and the specific calculation formula is as follows: n represents the total number of observed data points used to estimate model parameters;

[0100] The mathematical formula for the polynomial regression algorithm is as follows:

[0101] u=Va;

[0102] Among them, u represents the output after fitting; V represents the design matrix, which includes the powers of various orders of pixels in the image; a represents the polynomial coefficient vector.

[0103] In this embodiment, by using a linear regression algorithm or a polynomial regression algorithm to fit the curve where the shape of the industrial part in the image is located, it is beneficial to subsequently obtain a more accurate actual size of the industrial part. In other embodiments, a nonlinear regression algorithm or a piecewise linear regression algorithm can also be used to fit the curve where the shape of the industrial part in the image is located.

[0104] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0105] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. An automated detection method for industrial parts dimensions, characterized in that: The following steps are involved: Step S1: using a CDD industrial camera to collect images of industrial parts to be inspected, and obtaining parameters of the CDD industrial camera; Step S2: preprocessing the image of the industrial part to be detected to obtain the preprocessed image of the industrial part to be detected; Step S3: using the Canny edge detection algorithm to extract the edge of the preprocessed industrial part image to be detected, and obtain edge information in the industrial part image; Step S4: identifying edge information in the industrial part image, identifying feature points of the industrial part, and obtaining coordinates of the feature points of the industrial part in the image; Step S5: Calculate the size information of the industrial part in the image according to the coordinates of the feature points of the industrial part in the image; Step S6: Calculate the actual size information of the industrial part according to the size information of the industrial part in the image and the parameters of the CDD industrial camera; Step S7: Generate an industrial part size detection report table based on the actual size information of the industrial part.

2. The method for automatic detection of industrial parts dimensions according to claim 1, characterized in that: In step S3, the following sub-steps are specifically included: Step S31: Use Gaussian filtering to remove noise in the pre-processed industrial part image to be detected, and obtain a smoothed industrial part image, wherein the mathematical expression of Gaussian filtering is as follows: Where G(x, y) represents the output of the Gaussian function; x represents the horizontal coordinate of the pixel in the image; y represents the vertical coordinate of the pixel in the image; σ represents the standard deviation; Step S32: Use the Sobel operator to calculate the horizontal gradient I of each pixel in the smoothed industrial part image. x and vertical gradient I y , and according to I x and I y , calculate the gradient amplitude I and gradient direction θ of each pixel in the smoothed industrial part image, where the specific calculation formulas of I and θ are as follows: in, Step S33: determining whether the gradient amplitude of each pixel in the smoothed industrial part image is a local maximum in its gradient direction, if so, retaining the corresponding pixel, if not, setting the gradient amplitude of the corresponding pixel to 0; Step S34: using a double threshold method to detect the gradient amplitude of the retained pixel point to determine the type of the edge where the retained pixel point is located; If the gradient amplitude of a retained pixel is greater than the high threshold, the type of edge where the pixel is located is a strong edge; if the gradient amplitude of a retained pixel is between the high threshold and the low threshold, the type of edge where the pixel is located is a weak edge; if the gradient amplitude of a retained pixel is less than the low threshold, the type of edge where the pixel is located is a non-edge; Step S35: using the feature of connecting the weak edge with the strong edge, edge connection is performed to obtain edge information in the industrial part image.

3. The method for automatic detection of industrial parts dimensions according to claim 2, characterized in that: In step S4, edge information in the industrial part image is identified to identify feature points of the industrial part, which specifically includes the following sub-steps: based on the edge information in the industrial part image, the Harris corner detection algorithm is used to detect the corner points of the industrial part, which specifically includes the following sub-steps: Step S41: According to I x and I y , calculate the Harris matrix corresponding to each pixel on the edge of the industrial part image. The specific calculation formula of the Harris matrix is ​​as follows: Where, M represents the Harris matrix; Step S42: Calculate the Harris response value corresponding to each pixel point on the edge of the industrial part image according to the Harris matrix corresponding to each pixel point on the edge of the industrial part image. The specific calculation formula of the Harris response value is as follows: R=det(M)-k·(trace(M)) 2 ; Where R represents the Harris response value; det(M) represents the determinant of the Harris matrix; trace(M) represents the trace of the Harris matrix; k represents a constant, ranging from 0.04 to 0.06; Step S43: performing non-maximum suppression on the Harris response values ​​corresponding to each pixel point on the edge of the industrial part image to determine the corner points of the industrial part.

4. The method for automatic detection of industrial parts dimensions according to claim 1, characterized in that: In step S5, the following sub-steps are specifically included: Let the coordinates of the feature points of the two industrial parts in the image be P1(x1, y1) and P2(x2, y2), calculate the straight-line distance d between the feature points of the two industrial parts to determine a length or width of the industrial parts in the image, and calculate the angle α of the edge where the feature points of the two industrial parts are located relative to the x-axis to determine an angle of the industrial parts in the image. The calculation formula of the straight-line distance d between the feature points of the two industrial parts is as follows: The calculation formula for the angle α of the edge where the feature points of the two industrial parts are located relative to the x-axis is as follows:

5. The method for automatic detection of industrial parts dimensions according to claim 4, characterized in that: In step S5, the following steps are also included: Let the coordinates of the feature points of industrial parts in the image be P i (x i ,y i ), calculate the characteristic points P of industrial parts i The angle α of the edge relative to the x-axis i ; Calculate the characteristic points P of industrial parts i The distance between each edge point on the edge and the reference origin ρ i ; Create an accumulator array in Hough space; Transform each edge point into (ρ i , α i ) coordinates and add 1 to the corresponding position in the accumulator array; Find the peak points in the accumulator array to determine the shape of the industrial part in the image.

6. The method for automatic detection of industrial parts dimensions according to claim 5, characterized in that: In step S5, the following steps are also included: a linear regression algorithm or a polynomial regression algorithm is used to fit the curve where the shape of the industrial part in the image is located, wherein the mathematical formula of the linear regression algorithm is as follows: u=mv+b; Among them, u represents the output after fitting; v represents the coordinate value of the pixel point in the image; m represents the slope, and the specific calculation formula is as follows: b represents the level, and the specific calculation formula is as follows: n represents the total number of observed data points used to estimate model parameters; The mathematical formula for the polynomial regression algorithm is as follows: u=Va; Among them, u represents the output after fitting; V represents the design matrix, which includes the powers of various orders of pixels in the image; a represents the polynomial coefficient vector.