Method for detecting local forming condition of large pipe fitting
Through machine vision system and image processing algorithms, the end face images of pipe fittings are collected and analyzed in real time, and the forming quality is automatically determined, which solves the problems of low detection efficiency, insufficient accuracy and lack of automation in the prior art, and achieves efficient and accurate pipe fitting forming detection.
Patent Information
- Application Number
- CN202510482359.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-04-17
AI Technical Summary
When detecting the local forming of large pipe fittings, the prior art is inefficient, insufficient accuracy and lack of automation, which cannot meet the development trend of Industry 4.0.
The machine vision system (camera, light source, displacement sensor) and image processing algorithm are used to collect the end face images of the pipe fittings in real time, calculate the gap value of its contour and standard circle, and compare it with the preset threshold value to automatically determine the forming quality.
Non-contact detection is realized, with the accuracy being improved to 99%, the detection time being reduced to 2 seconds per time, the efficiency being improved by 90%, and the gap value and straight edge length can be obtained simultaneously, and the ellipticity error is reduced to less than 2%.
Smart Images

Figure CN119984096A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of local forming condition detection of pipe fittings, and in particular to a local forming condition detection method for large pipe fittings. Background Art
[0002] As the precision requirements for large pipes (such as oil and gas pipelines and marine structural pipes) in the industrial field are increasing, the JCO (JCO progressive forming) process is widely used because it is suitable for the efficient forming of large-diameter straight seam welded pipes. However, the local deformation of the pipe during the JCO forming process will directly affect the ovality and geometric accuracy of the final forming of the pipe. Therefore, how to detect the local forming state of the pipe in real time and accurately has become a key technical challenge to improve the quality of the pipe. At present, the industry generally adopts manual inspection methods: that is, after each forming process, the operator uses a standard arc template to fit the surface of the pipe fitting, and uses a feeler gauge to measure the gap between the template and the pipe fitting to evaluate the forming quality. This method is highly dependent on manual experience and has the following problems in specific operations: 1. Low detection efficiency: Each detection requires shutdown operation, which takes about 10-15 seconds per time, seriously affecting the continuity of the production line; 2. Insufficient accuracy: Manual measurement is easily affected by subjective factors, and the feeler gauge can only measure the gap at a local point, and cannot capture the overall contour deviation of the pipe (such as the length of the straight edge), resulting in the subsequent ovality exceeding the standard (see Figure 8 Example); 3. Lack of automation: It relies on manual intervention and cannot be integrated with automated production lines, which is not in line with the development trend of Industry 4.0. Summary of the invention
[0003] The purpose of the present invention is to provide a method for detecting the local forming condition of large pipe fittings. The design method uses a machine vision system (camera, light source, displacement sensor) and an image processing algorithm (see Figure 5 System diagram), which can collect the end face image of the pipe in real time, calculate the gap value between its contour and the standard circle, and compare it with the preset threshold to automatically determine the forming quality.
[0004] In order to achieve the above object, the present invention adopts the following technical solution: A method for detecting the local forming condition of a large pipe fitting comprises the following steps: Step 1: Read the standard pipe diameter information and reasonable gap value information, and input them into the processor; Step 2: Adjust the position and angle of the light source and camera to ensure effective acquisition of the image of the pipe being tested; Step 3: Determine whether camera calibration is required. If yes, proceed to step 4; otherwise, proceed to step 5. Step 4: Calibrate the relative position information and scaling ratio between the end face of the pipe fitting and the camera face through the calibration module, and store the information in the processor; Step 5: Determine whether the displacement sensor sends a signal that the pipe to be tested has entered the detection position. If so, proceed to step 6; otherwise, wait for 0.1s and repeat step 5; Step 6: Collect the end face image of the tube blank; Step 7: The collected image information is transmitted to the processor, processed by the image processing program, and the image features are obtained; Step 8: According to the image features obtained in step 7, the gap between the pipe contour and the standard circle is calculated by the data calculation module, and compared with the reasonable gap value to determine whether the forming condition is qualified, and then the obtained image and test results are displayed on the display; Step 9: Store the acquired image and detection results, and determine whether to end the detection. If so, execute step 10; otherwise, execute step 5; Step 10: End.
[0005] Furthermore, in step three, the implementation of the calibration process is as follows: Step a: Read the standard calibration plate information; Step b: obtaining an image of a standard calibration plate that coincides with the end face of the tube blank and transmitting it to a processor; Step c: Use the corner detection method to detect all corner points in the image; Step d: Determine whether the number of detected corner points is the same as the number of corner points of the standard calibration plate. If so, execute step e; if not, execute step b to re-acquire the calibration image; Step e: obtaining the relative position information and scaling ratio between the end face of the pipe fitting and the camera face through a perspective transformation algorithm, and storing the information; Step f: End.
[0006] Furthermore, in step seven, the image processing process is implemented, and the specific steps are as follows: Step a: Read image information; Step b: Perform threshold segmentation on the image using a threshold segmentation algorithm written according to image features; Step c: using the algorithm for removing small areas, remove the small spots in the image after threshold segmentation; Step d: Use edge detection algorithm to detect the image contour and save the contour information in the form of coordinates; Step e: End.
[0007] Furthermore, in step eight, the data calculation process is implemented in the following specific steps: Step a: Read the contour coordinate information; Step b: Calculate the coordinates of the maximum curvature position in the contour using the algorithm for calculating the maximum curvature coordinates; Step c: using the algorithm for obtaining the maximum gap in combination with the standard circle radius, the gap value at the position with the maximum curvature under the standard circle radius is obtained as the maximum gap value; Step d: End.
[0008] The detection device adopted by the local forming condition detection method of a large pipe fitting of the present invention includes a workbench, and a camera with a light source and a photosensitive element are respectively arranged above the workbench. The light source is connected to the camera via a transmission line so that the light source can flash simultaneously when the camera takes a picture. The processor is connected to the camera via a transmission line, and the displacement sensor is connected to the processor via a transmission line. A slide rail is installed on the workbench, and the slide rail can facilitate the adjustment of the position of the camera and the light source.
[0009] The beneficial effects of the present invention are as follows: a method for detecting the local forming conditions of large pipe fittings provided by the present invention can collect the end face image of the pipe fitting in real time through the synergy of the machine vision system (camera, light source, displacement sensor) and the image processing algorithm, calculate the gap value between the pipe fitting contour and the standard circle, and compare it with the preset threshold value to automatically determine the forming quality. Specifically, the method for detecting the local forming conditions of large pipe fittings of the present invention has the following advantages: non-contact detection: it can avoid surface damage of the pipe fitting caused by mechanical contact, and the accuracy is improved to 99%; fully automated process: the detection time is shortened to 2 seconds / time, the production line does not need to be shut down, and the efficiency is improved by 90%; multi-dimensional parameter measurement: it can synchronously obtain the gap value and the straight edge length, and the ovality error is reduced to less than 2%. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 is a flow chart of the detection method of the present invention; Figure 2 It is a flow chart of the calibration process in the present invention; Figure 3 is a flowchart of the image processing process in the present invention; Figure 4 is a program flow chart of the data calculation process in the present invention; Figure 5 is a schematic diagram of a detection device used in the present invention; Figure 6 is the calibration plate image captured in the detection method of the present invention; Figure 7 The image of the calibration plate after calibration in the detection method of the invention; Figure 8 A local image of the pipe taken in the detection method of the invention; Fig. 9A local image of the pipe after being processed in the detection method of the invention; Figure 5 The numbers in the figure are: 1-workbench; 2-light source; 3-camera; 4-processor; 5-displacement sensor; 6-pipe fitting. DETAILED DESCRIPTION
[0011] Specific embodiment 1: The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention. It should be noted that: in the present invention, if there is no special description, all the embodiments and preferred implementation methods mentioned herein can be combined with each other to form a new technical solution. In the present invention, if there is no special description, all the technical features and preferred features mentioned herein can be combined with each other to form a new technical solution. The "scope" disclosed in the present invention is in the form of lower limit and upper limit, which can be one or more lower limits, and one or more upper limits, respectively. Unless otherwise specified, the professional and scientific terms used in this article have the same meaning as those familiar to those skilled in the art. In addition, any method or material similar or equal to the recorded content can also be applied to the present invention.
[0012] As the instruction manual Figure 1 As shown, a method for detecting the local forming condition of a large pipe fitting of the present invention comprises the following steps: Step 1: Read the standard pipe diameter information and reasonable gap value information, and input them into the processor; Step 2: Adjust the position and angle of the light source and camera to ensure effective acquisition of the image of the pipe being tested; Step 3: Determine whether camera calibration is required. If yes, proceed to step 4; otherwise, proceed to step 5. Step 4: Calibrate the relative position information and scaling ratio between the end face of the pipe fitting and the camera face through the calibration module, and store the information in the processor; As the instruction manual Figure 2 As shown in the figure, the specific steps of the calibration process are as follows: Step a: Read the standard calibration plate information; Step b: obtain the image of the standard calibration plate that coincides with the end face of the tube blank and transmit it to the processor; Step c: use the corner detection method (findChessboardCorners function in the OpenCV computer vision function library) to detect all corner points in the image; Step d: Determine whether the number of detected corner points is the same as the number of corner points of the standard calibration plate. If so, execute step e; if not, execute step b to re-acquire the calibration image; Step e: Obtain the relative position information and scaling ratio between the end face of the pipe fitting and the camera through the perspective transformation algorithm (cv2.getPerspectiveTransform function in the OpenCV computer vision function library), and store them; Step f: End; Step 5: Determine whether the displacement sensor sends a signal that the pipe to be tested has entered the detection position. If so, proceed to step 6; otherwise, wait for 0.1s and repeat step 5; Step 6: Collect the end face image of the tube blank; Step 7: The collected image information is transmitted to the processor, processed by the image processing program, and the image features are obtained; As the instruction manual Figure 3 As shown in the figure, the implementation of the image processing process, the specific steps are as follows: Step a: Read image information; Step b: using the threshold segmentation algorithm written according to the image features (first, according to the characteristic that the end face brightness of the tube blank is the highest, that is, the gray value is the highest, the image is processed to obtain the coordinates of all the pixels in the area of interest, specifically, starting from the first column from the left of the image, the sum of the gray values of the line graph with a length of 2 times the thickness of the plate is calculated, and the position with the maximum sum of the gray values of 2 times the thickness of the plate in the column is compared, and then the second column, the third column, and until the end, the frequency of occurrence of the maximum position of the sum of the gray values of each column is counted, and the range with the highest frequency of occurrence is found. Then, on the basis of ensuring the continuity of the slab, the connected area of interest in the image is obtained under the condition of the highest gray value within the range with the highest frequency. The number of occurrences of the gray values of all pixels in the area of interest is counted, and two concentrated gray value ranges will appear. The average gray values of the two ranges are calculated respectively, and the middle value of the two average values is used as the threshold. If the gray value of all pixels in the area of interest is less than the threshold, the gray value of the pixel is assigned to 0, and if it is greater than the threshold, the gray value of the pixel is assigned to 255) to perform threshold segmentation on the image; Step c: Use the algorithm written to remove small areas (images after threshold segmentation sometimes have small spots of non-related areas. If the next step of edge detection is performed directly, contours unrelated to the required area will appear, which will seriously affect the subsequent processing process. To avoid this situation, small areas need to be removed. The main process is to extract all connected areas with a grayscale value of 255 in the image after threshold segmentation and calculate the area of each area respectively, retain only the area with the largest area, and assign the grayscale value of the pixels in the remaining connected areas with smaller areas to 0. Then, starting from the first column from the left of the image, find the first and last pixels with a grayscale value of 255 from top to bottom, calculate the length between the two points and save it, and then perform the second column detection until the last column, and then compare all the saved lengths with 1 times the length of the board width from the first column, and find all columns with a length error of plus or minus 2. If all are within the range, the threshold segmentation is completed. If not, the average value of the vertical coordinates of all pixels with a grayscale value of 255 in the column is calculated. And take the average value as the benchmark, judge whether the difference between the average value of the vertical coordinates of the pixels with a gray value of 255 on both sides whose length error is not within plus or minus 2 and their benchmark is within 2 times the horizontal coordinate difference. If so, the gray value of the pixels within the non-0.5 times distance on both sides above and below is assigned to 0 with the vertical coordinate of the column average value as the center. If not, judge whether the highest pixel point with a gray value of 255 in the vertical coordinate of the first column is less than the highest pixel point with a gray value of 255 in the vertical coordinate of the last column. If so and the horizontal coordinate of the column is less than the horizontal coordinate of the benchmark point, the benchmark point of the column is removed. The grayscale values of the points within the non-0.5 distance on both sides of the vertical coordinate minus 2 times the horizontal coordinate value are assigned to 0. If the horizontal coordinate of the column is greater than the horizontal coordinate of the reference point, the grayscale values of the pixels within the non-0.5 distance on both sides of the vertical coordinate plus 2 times the horizontal coordinate value of the reference point in the column are assigned to 0. If the highest pixel point in the vertical coordinate of the grayscale value of the first column is greater than the highest pixel point in the vertical coordinate of the grayscale value of the last column, the positive and negative signs of the above process are swapped, and finally the algorithm for removing small areas is completed) to remove the small spot-like areas in the image after threshold segmentation; Step d: Use edge detection algorithm (only keep the grayscale values of pixels within the edge width of the area with the largest area, and assign all grayscale values of other pixels inside to 0) to detect the image contour and save the contour information in the form of coordinates; Step e: End; Step 8: According to the image features obtained in step 7, the gap between the pipe contour and the standard circle is calculated by the data calculation module, and compared with the reasonable gap value to determine whether the forming condition is qualified, and then the obtained image and test results are displayed on the display; As the instruction manual Figure 4 As shown in the figure, the implementation of the data calculation process, the specific steps are as follows: Step a: Read the contour coordinate information; Step b: Use the algorithm for finding the maximum curvature coordinates (find the line connecting the highest pixel point with a grayscale value of 255 in the first column and the highest pixel point with a grayscale value of 255 in the last column) l The equation calculates the average value of the horizontal and vertical coordinates of each column of pixels with a grayscale of 255 and calculates its distance to the line l The pixel with the maximum distance is the point with the maximum curvature. A ) Find the coordinates of the position with maximum curvature in the contour; Step c: Use the algorithm written to find the maximum gap (through the pixel point A Making Lines l The vertical line l 2. Find the distance from the point with the maximum curvature on the line to the standard circle radius r point O , with this point as the center O 1 Make a standard circle and determine whether the circle is tangent to the contour. If not, O 1 point along l 2 Move up to the nearby area, continue to make a standard circle and determine whether the circle is tangent to the contour until it is tangent. If so, O 1 A length d minus r Combined with the standard circle radius, the gap value at the position with the maximum curvature under the standard circle radius is the maximum gap value; Step d: End; Step 9: Store the acquired image and detection results, and determine whether to end the detection. If so, execute step 10; otherwise, execute step 5; Step 10: End.
[0013] It needs to be further pointed out that, as shown in Figure 5 of the specification of the present invention, the detection device adopted by the detection method of the present invention includes a workbench 1, and a camera 3 with a light source 2 and a photosensitive element is respectively arranged above the workbench 1. The light source 2 is connected to the camera 3 via a transmission line, so that the light source 2 can flash simultaneously when the camera 3 takes a picture, the processor 4 is connected to the camera 3 via a transmission line, and the displacement sensor 5 is connected to the processor 4 via a transmission line. At the same time, a slide rail is installed on the workbench 1, and the conveying slide rail can facilitate the adjustment of the positions of the camera 3 and the light source 2.
[0014] It should be further pointed out that the key technical modules of the method for detecting the local forming condition of large pipe fittings of the present invention are as follows: 1. Calibration module: This module can read the standard calibration plate information, obtain the standard calibration plate image that coincides with the end face of the tube billet, and transmit it to the processor. It uses the corner point detection method to detect all corner points in the image, and obtains the relative position information and scaling ratio between the end face of the tube and the camera through the perspective transformation algorithm, and stores it to solve the camera distortion and spatial positioning problems and ensure measurement accuracy (error <0.1mm); 2. Image processing algorithm: It can read image information, perform threshold segmentation on the image using the threshold segmentation algorithm written according to the image features, remove the small spot-like areas in the image after threshold segmentation using the algorithm written to remove small areas, detect the image contour using the edge detection algorithm, and save the contour information in the form of coordinates, accurately convert the forming conditions of the pipe in the forming process into a digital model, laying the foundation for fast and high-precision detection; 3. Curvature calculation module: It can read the contour coordinate information, use the algorithm for calculating the maximum curvature coordinates to calculate the coordinates of the maximum curvature position in the contour, use the algorithm for calculating the maximum gap combined with the standard circle radius, and calculate the gap value at the maximum curvature position under the standard circle radius, which is the maximum gap value. It is compared with the read standard pipe diameter information and reasonable gap value information to give the result, thereby improving the detection efficiency and accuracy.
[0015] The above is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A method for detecting the local forming condition of a large pipe, characterized in that: The steps include: Step 1: Read the standard pipe diameter information and reasonable gap value information, and input them into the processor; Step 2: Adjust the position and angle of the light source and camera to ensure effective acquisition of the image of the pipe being tested; Step 3: Determine whether camera calibration is required. If yes, proceed to step 4; otherwise, proceed to step 5. Step 4: Calibrate the relative position information and scaling ratio between the end face of the pipe fitting and the camera face through the calibration module, and store the information in the processor; Step 5: Determine whether the displacement sensor sends a signal that the pipe to be tested has entered the detection position. If so, proceed to step 6; otherwise, wait for 0.1s and repeat step 5; Step 6: Collect the end face image of the tube blank; Step 7: The collected image information is transmitted to the processor, processed by the image processing program, and the image features are obtained; Step 8: According to the image features obtained in step 7, the gap between the pipe contour and the standard circle is calculated by the data calculation module, and compared with the reasonable gap value to determine whether the forming condition is qualified, and then the obtained image and test results are displayed on the display; Step 9: Store the acquired image and detection results, and determine whether to end the detection. If so, execute step 10; Otherwise, go to step 5; Step 10: End.
2. A method for detecting local forming conditions of large pipe fittings according to claim 1, characterized in that: In step three, the calibration process is implemented as follows: Step a: Read the standard calibration plate information; Step b: obtaining an image of a standard calibration plate that coincides with the end face of the tube blank and transmitting it to a processor; Step c: Use the corner detection method to detect all corner points in the image; Step d: Determine whether the number of detected corner points is the same as the number of corner points of the standard calibration plate. If so, execute step e; if not, execute step b to re-acquire the calibration image; Step e: obtaining the relative position information and scaling ratio between the end face of the pipe fitting and the camera face through a perspective transformation algorithm, and storing the information; Step f: End.
3. A method for detecting local forming conditions of large pipe fittings according to claim 2, characterized in that: In step seven, the image processing process is implemented, and the specific steps are as follows: Step a: Read image information; Step b: Perform threshold segmentation on the image using a threshold segmentation algorithm written according to image features; Step c: using the algorithm for removing small areas, remove the small spots in the image after threshold segmentation; Step d: Use edge detection algorithm to detect the image contour and save the contour information in the form of coordinates; Step e: End.
4. A method for detecting local forming conditions of large pipe fittings according to claim 3, characterized in that: In step eight, the data calculation process is implemented, and the specific steps are as follows: Step a: Read the contour coordinate information; Step b: Calculate the coordinates of the maximum curvature position in the contour using the algorithm for calculating the maximum curvature coordinates; Step c: using the algorithm for obtaining the maximum gap in combination with the standard circle radius, the gap value at the position with the maximum curvature under the standard circle radius is obtained as the maximum gap value; Step d: End.
5. A method for detecting local forming conditions of large pipe fittings according to claim 3, characterized in that: The threshold segmentation algorithm described above has the following specific steps: First, based on the characteristic that the tube end face has the highest brightness, that is, the highest grayscale value, the image is processed to obtain the coordinates of all pixel points in the area of interest. Specifically, the sum of the grayscale values of the line graph with a length of 2 times the plate thickness is calculated from the first column from the left of the image, and the position with the largest sum of grayscale values with a length of 2 times the plate thickness in each column is compared. Then, the second column, the third column, and the end are processed to count the frequency of occurrence of the position with the maximum sum of grayscale values in each column, and the range with the highest frequency of occurrence is found. Then, on the basis of ensuring the continuity of the plate, the connected area of interest in the image is obtained with the highest grayscale as the condition within the range with the highest frequency of occurrence; Count the number of occurrences of the grayscale values of all pixels in the region of interest. There will be two concentrated grayscale value ranges. The average grayscale values of these two ranges are calculated respectively. The middle value of these two average values is used as the threshold. If the grayscale value of all pixels in the region of interest is less than the threshold, the grayscale value of the pixel is assigned to 0. If it is greater than the threshold, the grayscale value of the pixel is assigned to 255.
6. A method for detecting local forming conditions of large pipe fittings according to claim 5, characterized in that: The algorithm for removing small areas has the following specific steps: Extract all connected areas with a grayscale value of 255 in the image after threshold segmentation and calculate the area of each area respectively, retain only the area with the largest area, assign the grayscale value of the pixels in the remaining connected areas with smaller areas to 0, and then find the first and last pixels with a grayscale value of 255 from top to bottom starting from the first column from the left of the image, calculate the length between the two points and save it, then perform the second column detection until the last column, and then compare all saved lengths with 1 times the length of the board width starting from the first column, find all columns with a length error of within plus or minus 2, if all are within the range, complete the threshold segmentation, if not, find the average value of the vertical coordinates of all pixels with a grayscale value of 255, and use the average value as a benchmark to judge the average value of the vertical coordinates of the pixels with a grayscale value of 255 on both sides whose length errors are not within plus or minus 2. Whether the difference between the mean and its benchmark is within 2 times the horizontal coordinate difference, if so, the grayscale values of the pixels within the non-0.5 times distance on both sides are assigned to 0 with the vertical coordinate of the average value as the center. If not, determine whether the highest pixel point with a grayscale value of 255 in the vertical coordinate of the first column is smaller than the highest pixel point with a grayscale value of 255 in the vertical coordinate of the last column. If so and the horizontal coordinate is smaller than the horizontal coordinate of the benchmark point, the grayscale values of the points within the non-0.5 times distance on both sides of the vertical coordinate minus 2 times the horizontal coordinate value are assigned to 0. If the horizontal coordinate is greater than the horizontal coordinate of the benchmark point, the grayscale values of the pixels within the non-0.5 times distance on both sides of the vertical coordinate plus 2 times the horizontal coordinate value are assigned to 0. If the highest pixel point with a vertical coordinate of the grayscale value in the first column is larger than the highest pixel point with a vertical coordinate of the grayscale value in the last column, swap the positive and negative signs, and finally complete the algorithm for removing small areas.
Citation Information
Patent Citations
Machine vision-based device and method for online detection of structural steel section size
CN102441581A
Glass panel sound hole defect detection method and system
CN105447851A
Salted duck egg surface crack online visual inspection method based on morphologic edge detection
CN108051449A
Improved adaptive threshold binarization method and VIN code character segmentation method
CN110490885A
Method for processing and identifying a pavement crack digital image
CN111145161A