A towel rack pipe cutting size measurement method based on machine vision detection
By using machine vision inspection methods, combined with two-dimensional and three-dimensional data processing, the problems of accuracy and efficiency in dimensional inspection during the cutting process of towel rack tubing have been solved, achieving high-precision automated inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGXI AVONFLOW HVAC TECH CO LTD
- Filing Date
- 2025-11-14
- Publication Date
- 2026-06-23
AI Technical Summary
In the existing process of cutting towel rack tubing, the accuracy and efficiency of detecting indicators such as hole diameter, eccentricity, hole spacing and hole edge distance are poor. Manual sampling and two-dimensional image recognition methods are affected by factors such as lighting, resulting in poor detection results.
A machine vision-based detection method is adopted, which combines 2D image preprocessing, adaptive thresholding, edge detection and abnormal edge removal with 3D data extraction to achieve dimensional measurement of towel rack fittings. This includes edge sharpening and smoothing, removal of interference items, and obtaining accurate dimensional measurement results.
It improves the accuracy and efficiency of measuring the cutting dimensions of towel rack fittings, reduces the impact of factors such as uneven lighting and metal shavings, and achieves automated high-precision inspection.
Smart Images

Figure CN121582162B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of machine vision and towel rack tubing, and in particular to a method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection. Background Technology
[0002] During the cutting process of towel rack tubing, it is necessary to drill holes evenly at equal intervals in the tubing, referring to... Figure 2 Ideally, the center of the drilled hole should be on the same straight line parallel to the side. The hole diameter (the communication radius or diameter data of a single hole), eccentricity (the offset value of the center of a single hole from the center of the plane), hole spacing (the straight line distance between the centers of adjacent holes along the bottom direction of the inspection), and hole edge distance (the straight line distance between the center of the nearest hole to the top / bottom and the edge of the top / bottom) should meet the requirements. If any of the above indicators has a large deviation, it indicates that the pipe fitting is unqualified.
[0003] Existing methods for detecting the above indicators mostly rely on manual sampling. This involves random sampling and manual measurement and judgment using tools. This method has obvious drawbacks, limited detection tools, poor detection accuracy, and low work efficiency. Of course, some methods use image recognition, but these only perform simple edge detection and contour recognition on two-dimensional images, then perform roundness detection to judge the above indicators. This is affected by factors such as perforation and lighting, which can lead to poor contour recognition results, thus affecting the acquisition of subsequent indicators and resulting in poor detection accuracy. Summary of the Invention
[0004] The purpose of this invention is to at least address one of the shortcomings of the prior art by providing a method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] Specifically, a method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection is proposed, including the following:
[0007] Obtain a 2D image of the towel rack fittings;
[0008] The two-dimensional image is preprocessed to obtain a first image that is denoised and grayscaled, and then the first image is subjected to adaptive thresholding to obtain a second image with background removed;
[0009] Performing an edge detection operation on the second image yields multiple first edges, denoted as the first edge set;
[0010] The first edge set is mapped back to the original two-dimensional image to obtain the corresponding second edge set;
[0011] The updated second edge set is obtained by removing abnormal edge pixels from each second edge in the second edge set.
[0012] Then, based on the updated second edge set, the updated first edge set is obtained;
[0013] The updated first edge set is preprocessed to obtain a sharpened and smoothed first edge set.
[0014] The first dimension measurement result is obtained by performing dimension measurement based on the first sharpened and smoothed edge set according to the preset dimension measurement scheme.
[0015] Furthermore, the method also includes,
[0016] After extracting 3D data from the towel rack fitting, the second dimension measurement result is obtained through 3D feature extraction and positioning algorithms;
[0017] The final dimension measurement result is obtained by averaging the first dimension measurement result and the second dimension measurement result, and the dimension conformity is evaluated based on the final dimension measurement result.
[0018] Furthermore, specifically, adaptive thresholding is performed on the first image to obtain a second image with the background removed, including:
[0019] The mean_gray value is calculated by averaging the gray values of all pixels in the first image. The gray values of pixels in the first image whose gray values are lower than the mean_gray value are set to 0, thus obtaining the second image with the background removed.
[0020] Furthermore, specifically, abnormal edge pixels are removed from each second edge in the second edge set to obtain an updated second edge set, including:
[0021] For any second edge, iterate through all its pixels. For any pixel, obtain its R, G, and B components, denoted as Pix_R, Pix_G, and Pix_B respectively, and calculate its grayscale value Pix_g based on these components.
[0022] Pix_g=0.213*Pix_R+0.715*Pix_G+0.072*Pix_B;
[0023] Determine whether the following expression is true:
[0024] Max(Pix_R,Pix_G,Pix_B)-Min(Pix_R,Pix_G,Pix_B)<Pix_X;
[0025] Where Pix_X represents the preset component channel threshold value; if true, the adjustment coefficient Coef = Pix_g / M is calculated.
[0026] M=Median(Pix_R,Pix_G,Pix_B),
[0027] At this point, it is determined whether Coef*Max(Pix_R, Pix_G, Pix_B) is greater than 255. If it is greater than 255, Coef is updated to: Coef = Pix_g / Max(Pix_R, Pix_G, Pix_B). If it is not greater than 255, no Coef update is performed.
[0028] Then update the Pix_R of the pixel to Pix_R*Coef, Pix_G to Pix_G*Coef, and Pix_B to Pix_B*Coef;
[0029] If the condition is not met, the R, G, and B components of the pixel will not be updated.
[0030] After updating the R, G, and B components of all pixels on the second edge, calculate the Pix_Eva for each pixel.
[0031] Pix_Eva=(Max(Pix_R,Pix_G,Pix_B)+Min(Pix_R,Pix_G,Pix_B)) / 2;
[0032] Pixels with Pix_Eva less than Pix_X are marked as abnormal edge pixels and removed to obtain the updated second edge, and thus the updated second edge set is obtained.
[0033] Furthermore, the method also includes, during the process of performing edge detection on the second image to obtain the first edge set, removing interference items from the obtained multiple first edges. Specifically,
[0034] Obtain the area data of multiple first edges, calculate the average value of all area data at this time and record it as the first discrimination threshold, and perform scale reduction on the first discrimination threshold, that is, update the first discrimination threshold to α*first discrimination threshold, where α is the scale coefficient, α∈(0,1);
[0035] First edges whose area data is insufficient for the first discrimination threshold are removed to obtain processed first edges;
[0036] The area data of the first edge is obtained again, and the average value of all area data at this time is recorded as the second discrimination threshold. Then, the second discrimination threshold is subtracted from the preset adjustment parameter β, that is, the second discrimination threshold is updated to the second discrimination threshold - β.
[0037] Finally, the edges whose area data is insufficient for the second discrimination threshold in the first edge processing are removed, and the remaining edges constitute the first edge set.
[0038] Furthermore, specifically,
[0039] The value of Pix_X is set to 128.
[0040] This invention also proposes a machine vision-based detection system for measuring the cutting dimensions of towel rack tubing, comprising the following:
[0041] The data acquisition module is used to acquire two-dimensional images of towel rack fittings;
[0042] The first preprocessing module is used to preprocess the two-dimensional image to obtain a first image that has been denoised and grayscaled, and then to perform adaptive thresholding on the first image to obtain a second image with background removed.
[0043] The edge detection module is used to perform edge detection operations on the second image to obtain multiple first edges, denoted as the first edge set;
[0044] The first data processing module is used to map the first edge set back into the original two-dimensional image to obtain the corresponding second edge set.
[0045] The outlier removal module is used to remove outlier edge pixels from each second edge in the second edge set to obtain an updated second edge set.
[0046] The second data processing module is used to obtain the updated first edge set based on the updated second edge set;
[0047] The second preprocessing module is used to perform edge preprocessing on the updated first edge set to obtain a sharpened and smoothed first edge set.
[0048] The dimension measurement module is used to perform dimension measurement based on the first sharpened and smoothed first edge set according to the preset dimension measurement scheme to obtain the first dimension measurement result.
[0049] Furthermore, the system also includes,
[0050] The 3D measurement module is used to extract 3D data from the towel rack fitting and then obtain the second dimension measurement result through 3D feature extraction and positioning algorithms.
[0051] The final dimension measurement result is obtained by averaging the first dimension measurement result and the second dimension measurement result, and the dimension conformity is evaluated based on the final dimension measurement result.
[0052] The beneficial effects of this invention are as follows:
[0053] This invention proposes a method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection. First, by acquiring a two-dimensional image of the towel rack tubing, adaptive thresholding is applied to the 2D image to eliminate the background, accelerating subsequent processing and reducing the impact of uneven lighting on the production line. Then, considering that metal shavings may remain at the hole edges during drilling in real-world scenarios, causing edge fluctuations, the edge pixels obtained from edge detection are mapped back to the original image. An enhancement algorithm based on R, G, and B channels is used to remove any abnormal edge pixels, facilitating subsequent sharpening and smoothing. Furthermore, an edge interference removal mechanism is incorporated into the edge detection process to eliminate some small or non-closed edges, accelerating computation. Finally, dimensional measurement based on the obtained edge set yields more accurate results. This invention can automatically acquire accurate cutting dimension measurement results for towel rack tubing based on machine vision. Attached Figure Description
[0054] The above and other features of this disclosure will become more apparent from the detailed description of the embodiments illustrated in conjunction with the accompanying drawings. In the accompanying drawings, the same reference numerals denote the same or similar elements. Obviously, the drawings described below are merely some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort. In the drawings:
[0055] Figure 1 The diagram shows a flowchart of a method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection according to the present invention.
[0056] Figure 2 The diagram shown is a schematic diagram of the dimensional measurement parameters of the circular tube involved in this invention. Detailed Implementation
[0057] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The same reference numerals used throughout the accompanying drawings indicate the same or similar parts.
[0058] Example 1, referring to Figure 1 This invention proposes a method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection, comprising the following:
[0059] Obtain a 2D image of the towel rack fittings;
[0060] The two-dimensional image is preprocessed to obtain a first image that is denoised and grayscaled, and then the first image is subjected to adaptive thresholding to obtain a second image with background removed;
[0061] Performing an edge detection operation on the second image yields multiple first edges, denoted as the first edge set;
[0062] The first edge set is mapped back to the original two-dimensional image to obtain the corresponding second edge set;
[0063] The updated second edge set is obtained by removing abnormal edge pixels from each second edge in the second edge set.
[0064] Then, based on the updated second edge set, the updated first edge set is obtained (by performing pixel mapping, the updated first edge set can be obtained).
[0065] The updated first edge set is preprocessed to obtain a sharpened and smoothed first edge set.
[0066] According to the preset size measurement scheme (this scheme is a mature measurement method in this field, that is, the center of the hole is determined by Hough circle detection or straight line detection, and then the corresponding index can be calculated according to the relevant content in the background technology introduction), the size measurement is performed based on the sharpened and smoothed first edge set to obtain the first size measurement result.
[0067] In this embodiment 1, by acquiring a two-dimensional image of the towel rack fitting, the two-dimensional image is first subjected to adaptive threshold processing to obtain an image with background removed, which can speed up the subsequent processing efficiency and reduce the impact caused by uneven lighting in the production line to a certain extent. Then, considering that in the actual scene, there may be some metal shavings at the edge of the hole when drilling the fitting, which may cause some fluctuation in the edge, the edge pixels obtained by edge detection are mapped back to the original image. An enhancement algorithm based on the R, G, and B channels is used to remove any abnormal edge pixels that may exist, which facilitates subsequent sharpening and smoothing. Furthermore, an edge interference removal mechanism is added to the edge detection process, which can remove some small edges or non-closed edges, speeding up the calculation efficiency. Finally, the size measurement based on the obtained edge set can obtain more accurate results.
[0068] In a preferred embodiment of the present invention, the method further includes,
[0069] After extracting 3D data from the towel rack fitting, the second dimension measurement result is obtained through 3D feature extraction and positioning algorithms;
[0070] The final dimension measurement result is obtained by averaging the first dimension measurement result and the second dimension measurement result, and the dimension conformity is evaluated based on the final dimension measurement result.
[0071] In this preferred embodiment, if the budget allows and higher accuracy is required, three-dimensional detection can be added to the original two-dimensional detection results to obtain three-dimensional detection results. In this way, the combined two-dimensional and three-dimensional detection results can balance the errors and obtain a more accurate dimensional compliance evaluation.
[0072] In a preferred embodiment of the present invention, specifically, adaptive thresholding is performed on the first image to obtain a second image with the background removed, including...
[0073] The mean_gray value is calculated by averaging the gray values of all pixels in the first image. The gray values of pixels in the first image whose gray values are lower than the mean_gray value are set to 0, thus obtaining the second image with the background removed.
[0074] In this preferred embodiment, considering that the existing method for eliminating background is to set a fixed threshold to eliminate non-ROI areas, but since there may be uneven lighting in this application scenario, setting a fixed threshold will result in too many non-ROI areas remaining, affecting the efficiency of subsequent calculations. Therefore, the global average gray value is used as an adaptive threshold in the above manner, which can basically remove a large number of background pixels, facilitating subsequent calculations.
[0075] In a preferred embodiment of the present invention, specifically, abnormal edge pixels are removed from each second edge in the second edge set to obtain an updated second edge set, including,
[0076] For any second edge, iterate through all its pixels. For any pixel, obtain its R, G, and B components, denoted as Pix_R, Pix_G, and Pix_B respectively, and calculate its grayscale value Pix_g based on these components.
[0077] Pix_g=0.213*Pix_R+0.715*Pix_G+0.072*Pix_B;
[0078] Determine whether the following expression is true:
[0079] Max(Pix_R,Pix_G,Pix_B)-Min(Pix_R,Pix_G,Pix_B)<Pix_X;
[0080] Where Pix_X represents the preset component channel threshold value; if true, the adjustment coefficient Coef = Pix_g / M is calculated.
[0081] M=Median(Pix_R,Pix_G,Pix_B),
[0082] At this point, it is determined whether Coef*Max(Pix_R, Pix_G, Pix_B) is greater than 255. If it is greater than 255, Coef is updated to: Coef = Pix_g / Max(Pix_R, Pix_G, Pix_B). If it is not greater than 255, no Coef update is performed.
[0083] Then update the Pix_R of the pixel to Pix_R*Coef, Pix_G to Pix_G*Coef, and Pix_B to Pix_B*Coef;
[0084] If the condition is not met, the R, G, and B components of the pixel will not be updated.
[0085] After updating the R, G, and B components of all pixels on the second edge, calculate the Pix_Eva for each pixel.
[0086] Pix_Eva=(Max(Pix_R,Pix_G,Pix_B)+Min(Pix_R,Pix_G,Pix_B)) / 2;
[0087] Pixels with Pix_Eva less than Pix_X are marked as abnormal edge pixels and removed to obtain the updated second edge, and thus the updated second edge set is obtained.
[0088] In this preferred embodiment, considering that the overall color of the pipe is relatively similar in actual application scenarios, if metal shavings are distributed around the hole during drilling, their dispersed state and small quantity will cause a certain difference in contrast with the overall pipe. Therefore, the aforementioned enhancement algorithm based on the R, G, and B channels is used to remove any abnormal edge pixels, facilitating subsequent sharpening and smoothing. The value of Pix_X can be set to 128, which is exactly half of the maximum value of 255 for the three channels, resulting in better performance. Max(), Min(), and Median() respectively retrieve the maximum, minimum, and median values.
[0089] In a preferred embodiment of the present invention, the method further includes, during the process of performing edge detection on the second image to obtain a first edge set, removing interference items from the obtained multiple first edges. Specifically,
[0090] Obtain the area data of multiple first edges, calculate the average value of all area data at this time and record it as the first discrimination threshold, and perform scale reduction on the first discrimination threshold, that is, update the first discrimination threshold to α*first discrimination threshold, where α is the scale coefficient, α∈(0,1);
[0091] First edges whose area data is insufficient for the first discrimination threshold are removed to obtain processed first edges;
[0092] The area data of the first edge is obtained again, and the average value of all area data at this time is recorded as the second discrimination threshold. Then, the second discrimination threshold is subtracted from the preset adjustment parameter β, that is, the second discrimination threshold is updated to the second discrimination threshold - β.
[0093] Finally, the edges whose area data is insufficient for the second discrimination threshold in the first edge processing are removed, and the remaining edges constitute the first edge set.
[0094] In this preferred embodiment, considering that a large number of interfering edges during edge detection would affect the efficiency of subsequent calculations, the first processing step removes some obviously small interfering items. In the second processing step, considering the possibility of concentric circle interference in the punched edge image, an adjustment parameter β is set to remove edges with an area smaller than the average area of the second step, minimizing interfering items and ensuring the efficiency of subsequent calculations. β can be determined through prior experimentation. The Canny operator, known for its superior edge detection, can be used for edge detection. Alternatively, edge area calculations can be performed using OpenCV, ImageMagick, Fiji (ImageJ), or MATLAB, which are mature existing technologies and will not be described in detail here.
[0095] Example 2: The present invention also proposes a machine vision-based detection system for measuring the cutting dimensions of towel rack tubing, comprising the following:
[0096] The data acquisition module is used to acquire two-dimensional images of towel rack fittings;
[0097] The first preprocessing module is used to preprocess the two-dimensional image to obtain a first image that has been denoised and grayscaled, and then to perform adaptive thresholding on the first image to obtain a second image with background removed.
[0098] The edge detection module is used to perform edge detection operations on the second image to obtain multiple first edges, denoted as the first edge set;
[0099] The first data processing module is used to map the first edge set back into the original two-dimensional image to obtain the corresponding second edge set.
[0100] The outlier removal module is used to remove outlier edge pixels from each second edge in the second edge set to obtain an updated second edge set.
[0101] The second data processing module is used to obtain the updated first edge set based on the updated second edge set;
[0102] The second preprocessing module is used to perform edge preprocessing on the updated first edge set to obtain a sharpened and smoothed first edge set.
[0103] The dimension measurement module is used to perform dimension measurement based on the first sharpened and smoothed first edge set according to the preset dimension measurement scheme to obtain the first dimension measurement result.
[0104] In this second embodiment, the hardware system corresponds to the method proposed in this invention and has the same beneficial effects as the method.
[0105] In a preferred embodiment of the present invention, the system further includes,
[0106] The 3D measurement module is used to extract 3D data from the towel rack fitting and then obtain the second dimension measurement result through 3D feature extraction and positioning algorithms.
[0107] The final dimension measurement result is obtained by averaging the first dimension measurement result and the second dimension measurement result, and the dimension conformity is evaluated based on the final dimension measurement result.
[0108] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0109] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or system capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0110] Although the description of the invention has been quite detailed and particularly of several described embodiments, it is not intended to limit it to any of these details or embodiments or any particular embodiment, but should be considered as providing a broad possible interpretation of the claims by referring to the appended claims and taking into account the prior art, thereby effectively covering the intended scope of the invention. Furthermore, the invention has been described above with respect to embodiments foreseeable by the inventors in order to provide a useful description, and non-substantial modifications to the invention that have not yet been foreseen may still represent equivalent modifications.
[0111] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. Any embodiment that achieves the technical effects of the present invention using the same means should fall within the protection scope of the present invention. Within the protection scope of the present invention, various modifications and variations can be made to the technical solutions and / or implementation methods.
Claims
1. A method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection, characterized in that, Including the following: Obtain a 2D image of the towel rack fittings; The two-dimensional image is preprocessed to obtain a first image that is denoised and grayscaled, and then the first image is subjected to adaptive thresholding to obtain a second image with background removed; Performing an edge detection operation on the second image yields multiple first edges, denoted as the first edge set; The first edge set is mapped back to the original two-dimensional image to obtain the corresponding second edge set; The updated second edge set is obtained by removing abnormal edge pixels from each second edge in the second edge set. Then, based on the updated second edge set, the updated first edge set is obtained; The updated first edge set is preprocessed to obtain a sharpened and smoothed first edge set. The first dimension measurement result is obtained by performing dimension measurement based on the first sharpened and smoothed edge set according to the preset dimension measurement scheme; Specifically, the updated second edge set is obtained by removing abnormal edge pixels from each second edge in the second edge set, including: For any second edge, iterate through all its pixels. For any pixel, obtain its R, G, and B components, denoted as Pix_R, Pix_G, and Pix_B respectively, and calculate its grayscale value Pix_g based on these components. Pix_g=0.213×Pix_R+0.715×Pix_G+0.072×Pix_B; Determine whether the following expression is true: Max(Pix_R,Pix_G,Pix_B)-Min(Pix_R,Pix_G,Pix_B)<Pix_X; Where Pix_X represents the preset component channel threshold value; if true, the adjustment coefficient Coef = Pix_g / M is calculated. M=Median(Pix_R,Pix_G,Pix_B), At this point, it is determined whether Coef × Max(Pix_R, Pix_G, Pix_B) is greater than 255. If it is greater than 255, Coef is updated to: Coef = Pix_g / Max(Pix_R, Pix_G, Pix_B). If it is not greater than 255, no Coef update is performed. Then update the Pix_R of the pixel to Pix_R×Coef, Pix_G to Pix_G×Coef, and Pix_B to Pix_B×Coef; If the condition is not met, the R, G, and B components of the pixel will not be updated. After updating the R, G, and B components of all pixels on the second edge, calculate the Pix_Eva for each pixel. Pix_Eva=(Max(Pix_R,Pix_G,Pix_B)+Min(Pix_R,Pix_G,Pix_B)) / 2; Pixels with Pix_Eva less than Pix_X are marked as abnormal edge pixels and removed to obtain the updated second edge, and thus the updated second edge set is obtained.
2. The method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection according to claim 1, characterized in that, The method also includes, After extracting 3D data from the towel rack fitting, the second dimension measurement result is obtained through 3D feature extraction and positioning algorithms; The final dimension measurement result is obtained by averaging the first dimension measurement result and the second dimension measurement result, and the dimension conformity is evaluated based on the final dimension measurement result.
3. The method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection according to claim 1, characterized in that, Specifically, the first image is subjected to adaptive thresholding to obtain a second image with the background removed, including: The mean_gray value is calculated by averaging the gray values of all pixels in the first image. The gray values of pixels in the first image whose gray values are lower than the mean_gray value are set to 0, thus obtaining the second image with the background removed.
4. The method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection according to claim 1, characterized in that, The method further includes, during the process of performing edge detection on the second image to obtain a first edge set, removing interference items from the obtained multiple first edges. Specifically, Obtain area data for multiple first edges, calculate the average of all area data at this point, and set it as the first discrimination threshold. Then, scale down the first discrimination threshold, that is, update the first discrimination threshold to α. × The first discrimination threshold is α, which is the scaling coefficient, α∈(0,1); First edges whose area data is insufficient for the first discrimination threshold are removed to obtain processed first edges; The area data of the first edge is obtained again, and the average value of all area data at this time is recorded as the second discrimination threshold. Then, the second discrimination threshold is subtracted from the preset adjustment parameter β, that is, the second discrimination threshold is updated to the second discrimination threshold - β. Finally, the edges whose area data is insufficient for the second discrimination threshold in the first edge processing are removed, and the remaining edges constitute the first edge set.
5. The method for measuring the cutting dimensions of towel rack tubing based on machine vision inspection according to claim 1, characterized in that, Specifically, The value of Pix_X is set to 128.
6. A machine vision-based inspection system for measuring the cutting dimensions of towel rack tubing, characterized in that, The system comprising the steps of the method according to any one of claims 1-5 above, wherein the system includes the following: The data acquisition module is used to acquire two-dimensional images of towel rack fittings; The first preprocessing module is used to preprocess the two-dimensional image to obtain a first image that has been denoised and grayscaled, and then to perform adaptive thresholding on the first image to obtain a second image with background removed. The edge detection module is used to perform edge detection operations on the second image to obtain multiple first edges, denoted as the first edge set; The first data processing module is used to map the first edge set back into the original two-dimensional image to obtain the corresponding second edge set. The outlier removal module is used to remove outlier edge pixels from each second edge in the second edge set to obtain an updated second edge set. The second data processing module is used to obtain the updated first edge set based on the updated second edge set; The second preprocessing module is used to perform edge preprocessing on the updated first edge set to obtain a sharpened and smoothed first edge set. The dimension measurement module is used to perform dimension measurement based on the first sharpened and smoothed first edge set according to the preset dimension measurement scheme to obtain the first dimension measurement result.
7. A machine vision-based inspection system for measuring the cutting dimensions of towel rack tubing, as described in claim 6, is characterized in that... The system also includes, The 3D measurement module is used to extract 3D data from the towel rack fitting and then obtain the second dimension measurement result through 3D feature extraction and positioning algorithms. The final dimension measurement result is obtained by averaging the first dimension measurement result and the second dimension measurement result, and the dimension conformity is evaluated based on the final dimension measurement result.