Full-automatic monofilament measurement method and system
Through the fully automatic single-filament measurement system, the number of single-filament in the weld is automatically identified by using deep learning models and image processing technology, solving the problems of low manual measurement efficiency and poor accuracy, and achieving high-accuracy single-filament measurement and improving production efficiency.
Patent Information
- Application Number
- CN202510067819.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-03-28
AI Technical Summary
The existing welding field relies on manual observation of single filaments, which are inefficient and prone to errors, resulting in inaccurate detection of welds.
A fully automatic single-filament measurement system is designed, including a motion control module, an image acquisition module and an automatic measurement module. Using weld detection deep learning model, edge detection algorithm, linear detection algorithm and other technologies, weld detection methods are used to automatically identify single filaments in weld ray images and output the number of single filaments.
The high accuracy of single filament measurement is achieved, reaching more than 99.2%, avoiding the subjective factors and inconsistent standards of manual measurement, improving production efficiency, and providing conditions for the construction of fully automatic unmanned chemical plants.
Smart Images

Figure CN119715625A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision, and in particular to a fully automated method and system for measuring monofilaments. Background Art
[0002] Welding is a crucial step in equipment manufacturing, and the quality of the weld directly impacts product quality. We detect weld defects by acquiring radiographic images of the weld location. The quality of these images directly affects subsequent inspection results, making image quality assessment extremely important. A set of monofilaments with decreasing diameters is placed at the weld location. The number of monofilaments visible in the acquired image is used to judge the image quality.
[0003] Currently, the traditional manual observation method is still used in the entire welding field. This method is not only inefficient, but also prone to errors, because humans may overlook some discontinuities in single wires or make counting errors, thus drawing incorrect conclusions. Summary of the Invention
[0004] The problem that this invention aims to solve is:
[0005] A fully automatic single-wire measurement system includes a motion control module, an image acquisition module, and an automatic measurement module. The system controls the single wire to be placed directly above the weld seam via the motion control module. The image acquisition module is responsible for acquiring radiographic images of the weld seam and transmitting them to the automatic measurement module. The automatic measurement module automatically identifies the single wires in the radiographic images of the weld seam and outputs the number of single wires.
[0006] A measurement method for a fully automated monofilament measurement system, the specific steps of which are as follows:
[0007] Step 1: The automatic measurement module uses a deep learning model for weld detection to detect the weld from the weld ray image acquired by the image acquisition module, and outputs the coordinates of the upper left corner and the length and width of the weld area;
[0008] Step 2: The automatic measurement module expands the weld area from Step 1 horizontally and cuts out the expanded area as a single-wire image;
[0009] Step 3: The automatic measurement module uses an edge detection algorithm to process the monofilament image from Step 2 to obtain an edge detection image;
[0010] Step 4: The automatic measurement module uses a line detection algorithm to perform line detection on the edge detection image from Step 3, obtaining a series of lines;
[0011] Step 5: The automatic measurement module uses slope characteristics to filter the straight lines in Step 4, leaving only the straight lines at the single-wire positions and filtering out the straight lines at non-single-wire positions.
[0012] Step Six: The automatic measurement module uses the line spacing feature to merge the lines filtered in Step Five, ensuring that there is only one line at each single filament.
[0013] Step 7: Draw a rectangle centered on each straight line from Step 6. The long side of the rectangle is parallel to the straight line and extends directly to the boundary of the monofilament image. The short side of the rectangle is perpendicular to the straight line and its length cannot exceed the width of the thinnest monofilament. Average the gray values of the monofilament image from Step 2 along the long side of the rectangle along the short side of the rectangle. Check these gray value averages one by one to see if there are any abrupt changes in gray value. If there is an abrupt change and the width of the abrupt change area is greater than the breakpoint width threshold, then it is determined that the monofilament is broken at this point. Select the longest segment from the many truncated sub-monoliths of the monofilament. If its length is greater than the monofilament length threshold, then the monofilament is successfully identified; otherwise, the identification fails. Finally, count the number of successfully identified monofilaments, and the monofilament measurement task is completed.
[0014] Preferably, the deep learning model for weld detection is specifically designed as follows: based on the YOLOv8 model, it is trained using a large number of weld images. After training, it can automatically detect welds in test images. YOLOv8 uses a deep convolutional neural network (CNN) to process the input image. YOLOv8 uses anchor boxes in the image to estimate the boundaries of objects. Within each cell, it predicts the probability of multiple anchor boxes, including the position, size, and category of the bounding boxes. Finally, techniques such as non-maximum suppression are used to remove overlapping boxes, ensuring that each object is detected only once.
[0015] Preferably, in step two, the horizontal expansion specifically refers to half the width of each of the left and right expansion welds.
[0016] Preferably, the specific steps of step five, slope feature, are as follows: First step: Filter out straight lines with a slope greater than the slope threshold. The slope threshold is set to 0.25, which can be flexibly adjusted according to the actual situation.
[0017] Step 2: Calculate the slope of the remaining lines, the mean and standard deviation, and filter out lines whose slope deviates from the mean by more than 3 times the standard deviation.
[0018] Preferably, the line spacing feature in step six is as follows: all lines detected at a certain single filament have a vertical distance of less than 5 pixels, and lines detected at different single filaments have a vertical distance of more than 25 pixels. Lines with a vertical distance of less than 5 pixels are merged.
[0019] Preferably, the verification basis in step seven is: if the latter value is 20% larger than the former value, it is considered that the latter value has undergone a sudden change.
[0020] Compared with existing technologies, this invention has the following advantages: This invention proposes a fully automated single-wire measurement method and system. The system includes a motion control module, an image acquisition module, and an automatic measurement module. The motion control module is responsible for placing the single wire directly above the weld when needed, ensuring an appropriate distance between the single wire and the weld. When not needed, the single wire is placed in a waiting position without affecting the normal operation of other components. The image acquisition module is responsible for acquiring radiographic images of the weld. The automatic measurement module automatically identifies the single wires in the radiographic images of the weld using technologies such as weld detection, image cropping, edge detection, line detection, line filtering, line merging, and single-wire verification, and outputs the number of single wires. The single-wire measurement accuracy of this invention reaches over 99.2%, exceeding the average level of manual measurement. It solves the problems of inconsistent standards due to subjective factors and the easy omission of single-wire breakpoints in manual single-wire measurement. This invention completely eliminates manual labor, not only saving time spent manually picking up and measuring single wires and improving production line efficiency, but also creating conditions for building fully automated unmanned factories. Attached Figure Description
[0021] Figure 1 A structural block diagram of a fully automatic monofilament measurement system
[0022] Figure 2 This is a flowchart of a fully automated monofilament measurement method.
[0023] Figure 3 These are images acquired by the image acquisition module in implementation 2.
[0024] Figure 4 This is a single-filament image from implementation 2.
[0025] Figure 5 It is a single filament that was successfully identified in implementation 2. Detailed Implementation
[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0027] Example 1
[0028] like Figure 1-5As shown, a fully automatic single-wire measurement system includes a motion control module, an image acquisition module, and an automatic measurement module. The control module controls the single wire to be placed directly above the weld seam through the motion control module, ensuring that the distance between the single wire and the weld seam is appropriate. When not needed, the single wire is placed in a waiting position without affecting the normal operation of other components. The image acquisition module is responsible for acquiring the weld seam radiographic image and transmitting it to the control module. The automatic measurement module automatically identifies the single wires in the weld seam radiographic image through technologies such as weld seam detection, image cropping, edge detection, line detection, line filtering, line merging, and single-wire verification, and outputs the number of single wires to the control module.
[0029] A measurement method for a fully automated monofilament measurement system, the specific steps of which are as follows:
[0030] Step 1: Use a deep learning model for weld detection to detect the weld from the weld ray image acquired by the image acquisition module, and output the coordinates of the upper left corner and the length and width of the weld region;
[0031] Step 2: Expand the weld area from Step 1 horizontally and cut out the expanded area. Since the monofilament is located in this area, we call it the monofilament image.
[0032] Step 3: Use edge detection algorithms (including but not limited to the Canny algorithm) to process the monofilament image from Step 2 to obtain an edge detection image, highlighting the monofilament features.
[0033] Step 4: Use a line detection algorithm (including but not limited to the Hough line detection algorithm) to perform line detection on the edge detection image from Step 3 to obtain a series of lines;
[0034] Step 5: Filter the straight lines in Step 4 using features such as slope, keeping only the straight lines at the single-wire positions and filtering out the straight lines at non-single-wire positions.
[0035] Step Six: Merge the lines filtered in Step Five using features such as line spacing to ensure that there is only one line at each single filament.
[0036] Step 7: Draw a rectangle centered on each straight line from Step 6. The long side of the rectangle is parallel to the straight line and extends directly to the boundary of the monofilament image. The short side of the rectangle is perpendicular to the straight line and its length is manually set (e.g., 3, 5, 7...), but cannot exceed the width of the thinnest monofilament. We average the gray values of the monofilament image from Step 2 along the short side of the rectangle (the image is a two-dimensional array, and each element in the array is the gray value of the image at that location, which can be read directly). This gives us a series of gray average values. We check these gray average values one by one to see if there are any abrupt changes in gray values. If there is abrupt change and the width of the abrupt change area is greater than the breakpoint width threshold, we determine that the monofilament is broken at this point. From the many sub-monoliths that are cut off, we select the longest segment. If its length is greater than the monofilament length threshold (as specified by industry standards), we determine that the monofilament has been successfully identified; otherwise, the identification has failed. Finally, we count the number of successfully identified monofilaments, and the monofilament measurement task is completed.
[0037] The deep learning model for weld detection is specifically designed based on the YOLOv8 model. It is trained using a large number of weld images. After training, it can automatically detect welds in test images. YOLOv8 uses deep convolutional neural networks (CNNs) to process input images. These networks learn features such as color, shape, and texture to better identify objects. YOLOv8 uses anchor boxes in the image to estimate the boundaries of objects. Within each cell, it predicts the probability of multiple anchor boxes, including the position, size, and category of the bounding boxes. Finally, techniques such as non-maximum suppression are used to remove overlapping boxes, ensuring that each object is detected only once.
[0038] In step two, the horizontal expansion specifically refers to half the width of each of the left and right expansion welds.
[0039] The specific steps for the slope and other features in step five are as follows: First step: Filter out straight lines with a slope greater than the slope threshold. Since the monofilament is close to horizontal, the slope threshold can be set to 0.25. The specific value can be adjusted flexibly according to the actual situation.
[0040] Step 2: Calculate the slope of the remaining lines, the mean and standard deviation, and filter out lines whose slope deviates from the mean by more than 3 times the standard deviation.
[0041] The features such as line spacing in step six are as follows: all lines detected at a certain single filament have a vertical distance of less than 5 pixels, and lines detected at different single filaments have a vertical distance of more than 25 pixels. Lines with a vertical distance of less than 5 pixels can be merged.
[0042] The verification criteria in step seven are as follows: if the latter value is 20% larger than the former value, it is considered that the latter value has undergone a sudden change.
[0043] Example 2
[0044] like Figure 1-5 As shown, a fully automated monofilament measurement method and system is described. We select an image acquired by the image acquisition module (e.g., ...). Figure 3 The demonstration shown illustrates the automatic measurement process and its effects for monofilaments. The specific steps are as follows:
[0045] 1. Detect welds from images acquired by the image acquisition module using a deep learning model for weld detection, and output the coordinates of the upper left corner and the length and width (70, 240, 290, 280) of the weld area.
[0046] 2. Expand the weld area horizontally (50% of the weld width on each side), and cut out the expanded area. Since the monofilament is located in this area, we call it the monofilament image, such as... Figure 4 As shown.
[0047] 3. Use the Canny algorithm to process the monofilament image in step 2 to obtain the edge detection image, highlighting the monofilament features.
[0048] 4. Use the Hough line detection algorithm to detect lines in the edge detection image from step 3 to obtain a series of lines.
[0049] 5. Filter the straight lines in step 4 using features such as slope. First, filter out straight lines with a slope greater than 0.25. For the remaining straight lines, filter out straight lines whose slope deviates from the mean slope by more than 3 times the standard deviation. Only keep the straight lines at the single-wire position and filter out the straight lines at non-single-wire positions.
[0050] 6. Merge the filtered lines from step 5 using features such as line spacing, merging lines with a vertical distance of less than 5 pixels to ensure that there is only one line at each filament.
[0051] Draw a rectangle centered on each straight line from step 6. The long side of the rectangle is parallel to the straight line and extends directly to the boundary of the monofilament image. The short side of the rectangle is perpendicular to the straight line and has a length of 3. We average the gray values of the monofilament image along the short side of the rectangle, thus obtaining a series of gray value averages. We check these gray value averages one by one to see if there are any abrupt changes in gray value. If there is a change, and the width of the change region is greater than the breakpoint width threshold (value is 3), then we determine that the monofilament is broken at this point. We select the longest segment from the many broken sub-monoliths. If its length is greater than the monofilament length threshold (value is 100), then we determine that the monofilament is successfully identified; otherwise, the identification fails. Finally, we count the number of successfully identified monofilaments as 4. Figure 5 As shown, the single-filament measurement task has been completed.
[0052] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. A fully automatic monofilament measuring system, characterized in that: The fully automatic single-wire measurement system includes a motion control module, an image acquisition module and an automatic measurement module. The system controls the single wire to be placed directly above the weld through the motion control module. The image acquisition module is responsible for collecting the weld radiographic image and transmitting it to the automatic measurement module. The automatic measurement module automatically identifies the single wire in the weld radiographic image and outputs the number of single wires.
2. The measuring method of a fully automatic monofilament measuring system according to claim 1, characterized in that: The specific steps of the fully automatic monofilament measurement method are: Step 1: The automatic measurement module uses the weld detection deep learning model to detect the weld from the weld radiographic image collected by the image acquisition module, and outputs the coordinates of the upper left corner and the length and width of the weld area; Step 2: The automatic measurement module expands the weld area in step 1 horizontally, and cuts out the expanded area as a single-wire image; Step 3: The automatic measurement module uses an edge detection algorithm to process the single-filament image in step 2 to obtain an edge detection image; Step 4: The automatic measurement module uses a straight line detection algorithm to perform straight line detection on the edge detection image in step 3 to obtain a series of straight lines; Step 5: The automatic measurement module uses the slope feature to filter the straight lines in step 4, leaving only the straight lines at the monofilament position and filtering out the straight lines at the non-monofilament position; Step 6: The automatic measurement module uses the straight line spacing feature to merge the straight lines filtered in step 5 to ensure that there is only one straight line at each single wire; Step 7: Draw a rectangle with each straight line in step 6 as the center, with the long side of the rectangle parallel to the straight line and the length directly extending to the boundary of the monofilament image, and the short side of the rectangle perpendicular to the straight line and the length cannot be greater than the width of the thinnest monofilament; average the grayscale values of the monofilament image in step 2 in the direction of the short side of the rectangle along the long side of the rectangle, and review these grayscale means in turn to see if there is a sudden change in the grayscale value. If there is a sudden change and the width of the sudden change area is greater than the breakpoint width threshold, it is determined that the monofilament is broken here, and the longest section is selected from the many truncated sub-monosilanes of the monofilament. If its length is greater than the monofilament length threshold, it is determined that the monofilament is successfully identified, otherwise, the identification fails. Finally, the number of successfully identified monofilaments is counted, and the monofilament measurement task is completed.
3. The measuring method of a fully automatic monofilament measuring system according to claim 2, characterized in that: The weld detection deep learning model is specifically as follows: based on the YOLOv8 model, a large number of weld images are used for training. After the training is completed, the welds in the test images can be automatically detected. YOLOv8 uses a deep convolutional neural network (CNN) to process the input image. YOLOv8 uses anchor boxes in the image to estimate the boundaries of the object. In each grid, it predicts the possibility of multiple anchor boxes, including the position, size and category of the bounding box. Finally, non-maximum suppression and other techniques are used to remove overlapping boxes to ensure that each object is detected only once.
4. The measuring method of a fully automatic monofilament measuring system according to claim 2, characterized in that: In the step 2, the outward expansion along the horizontal direction is specifically half of the width of the left and right outward expansion welds.
5. The measuring method of a fully automatic monofilament measuring system according to claim 2, characterized in that: The specific steps of the step 5 slope feature are as follows: Step 1: filter out straight lines whose slope is greater than the slope threshold, and the slope threshold is set to 0.25, which can be flexibly adjusted according to actual conditions; Step 2: Count the slopes of the remaining straight lines, calculate the mean and standard deviation, and filter out the straight lines whose slope deviates from the mean by more than 3 times the standard deviation.
6. The measuring method of a fully automatic monofilament measuring system according to claim 2, characterized in that: The straight line spacing feature in step six is specifically as follows: all straight lines detected at a certain single wire have a vertical distance less than 5 pixels, and the vertical distances of straight lines detected at different single wires are greater than 25 pixels. The straight lines with vertical distances less than 5 pixels are merged.
7. The measuring method of a fully automatic monofilament measuring system according to claim 2, characterized in that: The basis for the review in step seven is: if the latter value is 20% greater than the former value, it is considered that the latter value has undergone a mutation.