A processing method for threaded joint of natural gas pipeline
In the threaded interface processing of natural gas pipelines, image processing technology is used to extract edge features and fit, combined with equipment vibration monitoring data, and adaptively adjust the proportional factor of Wiener filtering, solving the problem of low image quality affecting processing parameters adjustment, and achieving higher quality processing images and more accurate parameter adjustment.
Patent Information
- Application Number
- CN202510147290.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-02-11
AI Technical Summary
During the processing of threaded interface of natural gas pipelines, the image quality is easily affected by factors such as equipment vibration, camera shake or uneven light, resulting in an increase in blur, affecting the accuracy of processing parameter adjustment and the quality of finished products.
By obtaining the processing image at the current moment, image processing is performed to extract the thread edge line, non-threaded edge line and plate tooth edge profile, determine the thread edge blur and the fit between the plate and thread, combine the equipment vibration monitoring data to determine the thread edge blur confidence, and then calculate the edge blur and grayscale concentration, determine the proportional factor of Wiener filtering, filter the processing image, and dynamically adjust the processing parameters.
It effectively improves image quality, reduces blur, enhances the accuracy of thread edge feature extraction, improves the accuracy of machining parameter adjustment and the finished product quality of natural gas pipeline thread interface.
Smart Images

Figure CN119624944B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image analysis, and in particular to a processing method for a threaded joint of a natural gas pipeline. Background Art
[0002] The primary function of natural gas pipelines is to transport natural gas from production sites to consumers or storage facilities. With the increase in natural gas demand, the safety and reliability requirements for natural gas pipelines are also increasing. Among them, the threaded interface in the natural gas pipeline is an important connecting component, and its processing quality directly affects the sealing performance and safety of the pipeline system. Therefore, an efficient and reliable natural gas pipeline threaded interface processing method is urgently needed.
[0003] At present, in the process of threading natural gas threaded interfaces using a threading machine, image processing technology can effectively make up for the shortcomings of the manual inspection process. Specifically, through high-resolution cameras and dedicated image processing algorithms, real-time three-dimensional reconstruction and precise measurement of the threaded interfaces can be performed, and the processing status of the threaded interfaces can be monitored in real time during the processing process to improve the response speed of the processing equipment and the system, thereby facilitating real-time adjustment of the threading machine's processing parameters and preventing the occurrence of abnormal situations.
[0004] When collecting video frame images during the threaded interface processing, the image quality is easily affected by factors such as equipment vibration, camera shake or uneven lighting. There will be a lot of blur in the image, which will cause deviations in the subsequent image-based processing parameter adjustments, thereby affecting the quality of the finished gas pipeline threaded interface. Currently, Wiener filtering is usually used to implement image processing. Since there may be a lot of blurry information in the image, it will not be possible to effectively obtain a more accurate signal-to-noise ratio. Using the signal-to-noise ratio with low accuracy as the scale factor of the Wiener filter is not suitable for processing blurry images and may cause further distortion of the image. Summary of the invention
[0005] In order to solve the technical problem that the image quality collected during the threaded interface processing is low, resulting in deviation in the adjustment of processing parameters, the purpose of the present invention is to provide a processing method for a threaded interface of a natural gas pipeline, and the technical solution adopted is as follows:
[0006] An embodiment of the present invention provides a method for processing a threaded joint of a natural gas pipeline, the method comprising the following steps:
[0007] Obtain a processed image of the threaded interface of the natural gas pipeline at the current moment, perform image processing on the processed image, and obtain a number of thread edge lines, non-thread edge lines, and die edge contours;
[0008] Determine the thread edge fuzziness in the processing image according to each thread edge line and non-thread edge line; determine the fit between the die and the thread in the processing image according to the number of all thread edge lines and the number of all die edge contours;
[0009] Determining the thread edge fuzzy confidence based on the fit at each moment in a preset monitoring period and the vibration monitoring data of the processing equipment;
[0010] The edge blur amount is determined by combining the thread edge blur, fit and thread edge blur confidence at the current moment;
[0011] Determine the scale factor of the Wiener filter according to the edge blur amount, and then perform filtering on the processed image at the current moment to obtain a processed image;
[0012] Features are extracted based on the processed image to dynamically adjust the processing parameters at the current moment.
[0013] Furthermore, after determining the edge blur amount, it also includes:
[0014] Obtaining a grayscale histogram of the processed image at the current moment, and determining a target grayscale interval in the grayscale histogram; the target grayscale interval is a grayscale interval corresponding to pixel points outside the background area in the processed image;
[0015] Determine the grayscale histogram width corresponding to the target grayscale interval, and determine the frequency values of all peak points corresponding to the target grayscale interval;
[0016] The grayscale concentration of the processed image is determined according to the grayscale histogram width and the frequency value difference between every two peak points; the grayscale concentration is used to determine the scale factor of the Wiener filter.
[0017] Further, the grayscale concentration of the processed image is determined according to the grayscale histogram width and the frequency value difference between every two peak points, including:
[0018] Calculating the average value of all frequency value differences and determining the ratio of the grayscale histogram width to the average value;
[0019] The ratio is subjected to negative correlation normalization processing to obtain the grayscale concentration of the processed image.
[0020] Further, determining the thread edge fuzziness in the processed image according to each thread edge line and non-thread edge line includes:
[0021] Count the number of pixels in the thread edge line, and use the thread edge line with the largest number of pixels between two vertically adjacent thread edge lines as the reference edge line;
[0022] Calculate the distance between the pixels at the same position in two vertically adjacent thread edge lines, and count the number of distance values corresponding to every two vertically adjacent thread edge lines;
[0023] The thread edge fuzziness in the processed image is determined by combining the number of pixels in the reference edge line, the number of distance values, the number of non-thread edge lines, and the difference in the number of pixels between every two thread edge lines.
[0024] Further, combining the number of pixels in the reference edge line, the number of distance values, the number of non-thread edge lines, and the difference in the number of pixels between every two thread edge lines, the thread edge fuzziness in the processed image is determined, including:
[0025] For every two vertically adjacent thread edge lines, the difference between the number of pixel points in the reference edge line and the number of distance values is calculated, and the average value of all differences is used as the thread edge discontinuity index; the average value of all the pixel point number differences is calculated;
[0026] The thread edge discontinuity index, the average value of all pixel point quantity differences and the number of non-thread edge lines are fused and calculated to obtain a fusion value; the fusion value is normalized to obtain the thread edge fuzziness in the processed image.
[0027] Furthermore, the fit between the die and the thread in the processing image is determined according to the number of all thread edge lines and the number of all die edge contours, including:
[0028] ; In the formula, represents the fit between the die and the thread in the current processing image, exp represents an exponential function with a natural constant as the base, L represents the number of all thread edge lines in the current processing image, h represents the number of all die edge contours in the current processing image, Represents a nonzero constant.
[0029] Further, according to the fit degree at each moment in a preset monitoring period and the vibration monitoring data of the processing equipment, the thread edge fuzzy confidence is determined, including:
[0030] The degree of fit and the vibration monitoring data of the processing equipment at each moment in a preset monitoring period are standardized to obtain a degree of fit sequence and a vibration monitoring data sequence;
[0031] Perform curve fitting on the fit degree sequence and the vibration monitoring data sequence respectively to obtain a fit degree curve and a vibration data curve, and then calculate the mean square error between the fit degree curve and the vibration data curve;
[0032] The severity of equipment vibration is determined according to the vibration monitoring data sequence; and the fuzzy confidence of the thread edge is determined in combination with the severity of equipment vibration and the mean square error.
[0033] Further, the severity of the equipment vibration is determined according to the vibration monitoring data sequence, including:
[0034] The variance of the vibration monitoring data sequence is calculated, and the variance of the vibration monitoring data sequence is used as the severity of equipment vibration.
[0035] Furthermore, the step of determining the edge blur amount by combining the thread edge blur, the fit and the thread edge blur confidence at the current moment includes:
[0036] The product of the thread edge blur, fit and thread edge blur confidence at the current moment is calculated, and the product is used as the edge blur amount.
[0037] Further, determining a scaling factor of the Wiener filter according to the edge blur amount includes:
[0038] The Euclidean norm of the vector composed of the edge blur amount and the grayscale concentration is calculated, the Euclidean norm is normalized, and the normalized value is used as the scale factor of the Wiener filter.
[0039] The present invention has the following beneficial effects:
[0040] The present invention provides a processing method for a threaded joint of a natural gas pipeline. Since the focus of processing a threaded joint of a pipeline is to process the thread to ensure that the thread fits the die, the main content when extracting image features and adjusting processing parameters is to extract thread edge information. Obtaining different types of edge lines here helps to provide complete and reliable basic analysis data for the subsequent determination of the proportional factor for realizing Wiener filtering; then, the thread edge blur in the processed image is determined according to each thread edge line and non-thread edge line, which is used to quantify the severity of the thread edge blur in the processed image. Analyzing the two types of edge lines helps to improve the numerical accuracy of the thread edge blur; determining the fit between the die and the thread in the processed image, the fit can characterize the fit between the die and the thread. The good condition of thread connection not only provides a calculation method for determining the degree of fit at each moment in the preset monitoring period, but is also one of the key factors for determining the amount of edge blur subsequently; determining the thread edge blur confidence broadens the analysis dimension for determining the amount of edge blur subsequently, and can further improve the reliability of the edge blur determined based on the thread edge blur, degree of fit and thread edge blur confidence at the current moment; the proportional factor of the Wiener filter determined according to the edge blur amount can characterize the quality adjustment requirements of the processed image at the current moment, and improving the quality of the processed image according to the adjustment requirements can provide reliable data support for the processing of pipe thread interfaces, further improving the efficiency of automated processing while also ensuring the precision and accuracy of processing quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A flowchart of the steps of a method for processing a threaded interface of a natural gas pipeline according to the present invention;
[0043] Figure 2 is a flowchart of step S21 in an embodiment of the present invention;
[0044] Figure 3 is an example diagram of a processed image at the current moment in an embodiment of the present invention;
[0045] Figure 4 is a flowchart of the steps of determining the grayscale concentration of a processed image in an embodiment of the present invention;
[0046] Figure 5 An example diagram of a processed image at the current moment in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0048] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0049] The application scenarios of the present invention may be:
[0050] When the image used to monitor the processing status of the threaded interface is affected by blur and noise, the statistical characteristics of the signal and noise are often no longer simply independent and clear. The influence of blur on the spectrum, the interaction between noise and blur, and the inaccuracy of the signal power spectrum estimation caused by blur make the signal-to-noise ratio estimation more difficult. However, the effect of the Wiener filter depends on the accurate estimation of the signal-to-noise ratio. If the signal-to-noise ratio of the blurred image is directly used as the scale factor of the Wiener filter, it may cause over-filtering (signal loss) or under-filtering (noise residue), thereby aggravating the image distortion.
[0051] In order to facilitate accurate adjustment of processing parameters, it is necessary to ensure the accuracy of image feature extraction of the thread edge in the deblurred image. Therefore, based on multiple aspects such as the thread edge blur feature of the processed image at the current moment, the scale factor of the Wiener filter in the deblurring process of the processed image at each moment is adaptively and in real time determined. Specifically, this embodiment provides a processing method for a threaded interface of a natural gas pipeline, such as Figure 1 As shown, the following steps are included:
[0052] S1, obtaining a processed image of a threaded joint of a natural gas pipeline at the current moment, performing image processing on the processed image, and obtaining a number of thread edge lines, non-thread edge lines, and die edge contours.
[0053] In the process of processing the threaded interface of the natural gas pipe, the thread processing machine tool is used to process the pipe thread. Since a complete product may require multiple processing to achieve a certain accuracy, the image captured by the camera can be used to detect the processing quality during the processing, thereby reducing the subjectivity and error of manual detection. Specifically, the processing image at the current moment of the processing is first obtained, and then the processing image is processed. The above step S1 can be implemented through steps S11 to S12 (not shown in the figure):
[0054] S11, obtaining a processed image of the threaded joint of the natural gas pipeline at the current moment.
[0055] When monitoring the processing status of the threaded interface, this embodiment selects a high-resolution industrial camera and an appropriate lens to ensure that the thread details are captured; then the camera and the light source are fixed on the processing equipment to ensure stability and a correct shooting angle; before starting the processing, the camera and the light source are started to ensure that the image data acquisition system can operate and work normally, and the camera shooting and the action of the processing equipment are synchronized to capture the image of the key processing stage, and the image of the threaded interface during the processing process is obtained in real time, that is, the processing image at the current moment is obtained, and the processed image is a blurred image; the camera is connected to the computer through a high-speed data interface to ensure fast transmission of image data; the collected processing image data at the current moment is transmitted to the image processing system in the computer, so as to facilitate the subsequent real-time analysis of the image, and the processing parameters are adjusted in real time based on the real-time analysis results, thereby ensuring the quality of the threaded interface.
[0056] S12, performing edge detection on the processed image to obtain a number of thread edge lines, non-thread edge lines and die edge contours.
[0057] First of all, it should be noted that in the process of processing the pipe threaded interface, the processing equipment may have some random vibrations and nonlinear interferences, such as shaking or jamming during processing. These interferences may cause some blurry states in the process of dynamic image acquisition. Therefore, in the process of image acquisition, the blurred fragments of the screened image are processed and analyzed to obtain different types of edge lines for subsequent analysis, namely thread edge lines, non-thread edge lines and die edge contours. The reason for extracting different types of edge lines in the processed image is that the processing parameters in the process of processing the threaded interface of the natural gas pipeline are mainly the pitch, angle, width and other parameters of the pipeline interface thread, and the adjustment of these processing parameters needs to ensure that the thread edge details are highlighted in the processed image, that is, to avoid blurring of the thread-related edges.
[0058] Specifically, the weighted average method is first used to grayscale the processed image to obtain a grayscale image of the processed image; then the sobel edge detection operator is used to perform edge detection on the grayscale image to obtain all edge lines in the processed image; the contours of the thread and the die can be further extracted by contour detection. The thread usually presents a rotationally symmetrical shape, and the edge line of the thread can be extracted by Hough transform circular detection or straight line detection. The contour of the die is usually some precise tooth shape, which can be extracted by template matching or edge detection followed by identification of the intersection of the straight line and the curve. Specifically, template matching is achieved by obtaining a picture template of the die in advance; the edges in the processed image except the thread edge line and the die edge contour are regarded as non-thread edge lines.
[0059] Among them, the implementation process of graying and edge detection, and the extraction process of thread edge line and die edge contour are all existing technologies, which are not within the protection scope of the present invention and will not be elaborated in detail here.
[0060] So far, this embodiment has obtained the thread edge, non-thread edge and die edge contours in the processing image at the current moment.
[0061] S2, determining the thread edge fuzziness in the processed image according to each thread edge line and non-thread edge line; determining the fit between the die and the thread in the processed image according to the number of all thread edge lines and the number of all die edge contours.
[0062] The above step S2 can be implemented through steps S21 to S22 (not shown in the figure):
[0063] S21, determining the thread edge fuzziness in the processed image according to each thread edge line and non-thread edge line.
[0064] In this embodiment, the thread edge blur refers to the degree of blur of all thread edges in the processed image. When analyzing the thread edge blur, the factors involved include the discontinuity of the thread edge line and the influence of external environmental factors, such as redundant edge lines generated by uneven lighting, which will confuse the accuracy of thread edge feature extraction.
[0065] As an implementation method, the above step S21 can be Figure 2 The steps S211 to S213 shown implement:
[0066] S211, counting the number of pixels in the thread edge line, and taking the thread edge line with the largest number of pixels between two vertically adjacent thread edge lines as a reference edge line.
[0067] In this embodiment, in order to analyze the discontinuity of the thread edge line, the thread edge line under normal conditions, that is, the thread edge line with clear edges and no abnormal discontinuity, is first selected as the reference edge line, and compared with other subsequent thread edge lines for analysis to quantify the thread edge fuzziness. For two vertically adjacent thread edge lines, the thread edge line with the largest number of pixels is used as the reference edge line.
[0068] It should be noted that, when an extreme case occurs, that is, when the number of pixel points of two vertically adjacent thread edge lines is equal, any one of the two vertically adjacent thread edge lines is used as a reference edge line.
[0069] S212, calculating the distance value between the pixel points at the same position in two vertically adjacent thread edge lines, and counting the number of distance values corresponding to every two vertically adjacent thread edge lines.
[0070] In this embodiment, in order to compare and analyze with the reference edge line to quantify the degree of thread edge discontinuity, it is necessary to determine the length of the overlapping portion of two vertically adjacent thread edge lines, that is, the number of distance values between pixels at the same position in the thread edge line. The distance value can be achieved by calculating the Euclidean distance between two pixels.
[0071] S213, determining the thread edge fuzziness in the processed image by combining the number of pixels in the reference edge line, the number of distance values, the number of non-thread edge lines, and the difference in the number of pixels between every two thread edge lines.
[0072] As a specific implementation, for every two vertically adjacent thread edge lines, the thread edge fuzziness may be determined by:
[0073] Calculate the difference between the number of pixel points in the reference edge line and the number of distance values, and use the average value of all differences as the thread edge discontinuity index; calculate the average value of all pixel point number differences.
[0074] The thread edge discontinuity index, the average value of all pixel point quantity differences and the number of non-thread edge lines are fused and calculated to obtain a fusion value; the fusion value is normalized to obtain the thread edge fuzziness in the processed image.
[0075] As an example, the calculation formula for thread edge fuzziness can be:
[0076] ; In the formula, represents the thread edge fuzziness of the processed image at the current moment, norm represents the linear normalization function, g represents the number of distance values corresponding to two vertically adjacent thread edge lines, G represents the number of pixels in the reference edge line of two vertically adjacent thread edge lines, represents the absolute value function, It represents the average value of the difference between the number of pixels in the reference edge line corresponding to each two vertically adjacent thread edge lines and the number of distance values, that is, the thread edge discontinuity index. 0.1 is used to avoid In the extreme case of zero, H represents the number of non-thread edge lines, m represents the logarithm of thread edge lines in the processed image at the current moment, and i represents the logarithmic sequence number of thread edge lines in the processed image at the current moment. Indicates the number of pixels of the e-th thread edge line in the processed image at the current moment, Indicates the number of pixels of the vth thread edge line in the processed image at the current moment, e is not equal to v, Indicates the difference in the number of pixels between the i-th pair of thread edge lines in the processed image at the current moment, Indicates the fusion value.
[0077] In the calculation formula of thread edge fuzziness, It can indicate the missing state of the thread edge in the processed image at the current moment. The more serious the missing state is, the more serious the blurring of the thread edge will be. The larger the value, the more discontinuous the edge lines are between each two vertically adjacent thread edge lines, and the more discontinuities there are. , or by determining a thread edge line with the longest length as a reference, and performing a difference analysis between the reference and all the remaining thread edges; the larger H is, the more non-thread edges there are. Non-thread edges may be redundant edges generated due to uneven lighting, which will affect the presentation of the real thread edge and cause the thread edge to be missing; It can show the difference in length of all thread edges in the processing image at the current moment. The larger the value, the greater the length difference between the thread edges. During the processing, the lengths of the thread edge lines should be equal. If there is a large length difference between all thread edge lines, it may be caused by poor image quality. Therefore, the greater the length difference, the greater the blurriness of the thread edge in the processed image.
[0078] S22, determining the fit between the die and the thread in the processing image according to the number of all thread edge lines and the number of all die edge contours.
[0079] It should be noted that during the process of threading the threaded interface of the natural gas pipeline in the threading machine, the camera is used to capture images of the dynamic changes. Generally, a thread will be formed between two adjacent dies of the threading machine. However, with the dynamic changes in the processing process, there may be a certain degree of blur in the processed image. In order to analyze the degree of blur of the image, it is necessary to quantify the degree of connection between the dies and the thread in the processing image at the current moment, that is, to determine the degree of fit.
[0080] As an example, the calculation formula for the fit between the die and the thread in the processing image at the current moment can be:
[0081] ; In the formula, represents the fit between the die and the thread in the current processing image, exp represents an exponential function with a natural constant as the base, L represents the number of all thread edge lines in the current processing image, h represents the number of all die edge contours in the current processing image, Represents a nonzero constant.
[0082] In the calculation formula of fit, Indicates the difference between the number of plate teeth and the number of thread edges of the threading machine in the processing image. Under normal circumstances, the difference between the number of plate teeth and the number of thread edges should be equal to 0. However, due to the influence of poor image quality during dynamic processing, the greater the difference between the number of plate teeth and the number of thread edges, the worse the fit between the plate teeth and the thread. In order to prevent the difference between the number of plate teeth and the number of thread edges from being zero during the calculation process, a non-zero constant is added to the calculation formula. , and its empirical value can be 0.1.
[0083] It is worth noting that, due to the influence of the distribution characteristics of threads and dies, there is a distribution feature that the number of dies of the threading machine differs from the number of actual thread edge lines by 2, as shown in the example of the processing image at the current moment. Figure 3 As shown, the number of die edge contours needs to be increased by 2 to meet the thread and die distribution characteristics.
[0084] So far, this embodiment obtains the thread edge fuzziness of the processing image at the current moment and the fit between the die and the thread in the processing image.
[0085] S3, determining the thread edge fuzzy confidence according to the fit at each moment in a preset monitoring period and the vibration monitoring data of the processing equipment.
[0086] Here, the thread edge blur confidence refers to the credibility of the thread edge blur value calculated in step S21, which is used to compensate for factors affecting image quality. Because in the process of processing the threads of the natural gas pipeline interface, the camera is used to collect the quality conditions of the processing process. However, due to the vibration of mechanical equipment during the processing, the transmission of vibration energy of the mechanical equipment may cause blur in the image collection process, which in turn leads to certain errors in the processing quality analysis of the processed image. Subsequent image quality enhancement needs to consider the factors affecting the vibration of mechanical equipment.
[0087] The above step S3 can be implemented through steps S31 to S33 (not shown in the figure):
[0088] S31, standardizing the fit degree and vibration monitoring data of the processing equipment at each moment in a preset monitoring period to obtain a fit degree sequence and a vibration monitoring data sequence.
[0089] Specifically, a vibration sensor is installed in the threading machine, and the vibration monitoring data of the processing equipment at each moment in the preset monitoring period including the current moment is obtained through the vibration sensor; the calculation process of the degree of fit at the current moment is determined with reference to the above-mentioned step S22, and the degree of fit at each moment in the preset monitoring period can be obtained; in order to facilitate subsequent calculation and analysis, the degree of fit at each moment in the preset monitoring period and the vibration monitoring data of the processing equipment are standardized using the range normalization method to unify the dimensions.
[0090] Among them, the preset monitoring period can be set to the current 3 minutes. The implementation process of range standardization is a prior art and is not within the protection scope of the present invention, and will not be elaborated here.
[0091] S32, performing curve fitting on the fit degree sequence and the vibration monitoring data sequence respectively to obtain a fit degree curve and a vibration data curve, and then calculating the mean square error between the fit degree curve and the vibration data curve.
[0092] Specifically, the least square method is used to perform curve fitting on the fit degree sequence and the vibration monitoring data sequence respectively, so as to obtain two fitting curves, and the mean square error between the fit degree curve and the vibration data curve is calculated based on the two fitting curves.
[0093] Among them, the least square method and the calculation process of the mean square error are prior arts, which are not within the scope of protection of the present invention and will not be elaborated in detail here. The larger the mean square error between the fit curve and the vibration data curve, the worse the correlation between the fit of the die thread and the equipment operating state during the processing, the less the thread edge blur is affected by the equipment operating state, and the higher the credibility of the thread edge blur.
[0094] S33, determining the severity of equipment vibration according to the vibration monitoring data sequence.
[0095] As an example, the variance of the vibration monitoring data sequence is calculated, and the variance of the vibration monitoring data sequence is used as the vibration severity of the equipment. In another example, the standard deviation of the vibration monitoring data sequence is calculated, and the standard deviation of the vibration monitoring data sequence is used as the vibration severity of the equipment.
[0096] Among them, the variance of the vibration monitoring data sequence can characterize the stability of the vibration of the processing equipment within the preset monitoring period. The larger the variance, the worse the stability, which will lead to a higher possibility of image blur during image acquisition. The quality of the processed image will be more affected by the motion state of the equipment, and the credibility of the thread edge blur calculated above will be lower.
[0097] S34, determining the thread edge fuzzy confidence by combining the equipment vibration severity and the mean square error.
[0098] In this embodiment, the vibration intensity of the equipment is negatively correlated with the fuzzy confidence of the thread edge, while the mean square error between the fit curve and the vibration data curve is positively correlated with the fuzzy confidence of the thread edge. Therefore, when calculating the fuzzy confidence of the thread edge, the vibration intensity of the equipment needs to be negatively correlated.
[0099] As an example, the calculation formula of the thread edge fuzzy confidence of the processed image at the current moment can be:
[0100] ; In the formula, Indicates the thread edge fuzzy confidence of the processed image at the current moment, It represents the variance of the vibration monitoring data sequence, that is, the severity of the equipment vibration. 0.1 is used to avoid the situation where the denominator of the fraction is zero. X represents the fit curve, and Y represents the vibration data curve. Represents the mean square error function.
[0101] In the calculation formula of thread edge fuzzy confidence, The larger the value, the greater the credibility of the fuzziness of the image collected during the processing, the more stable the vibration state of the processing equipment, and the less severe the vibration of the equipment. Under the premise of stable vibration state, the mean square error between the fit curve and the vibration data curve The larger the value is, the more the fit between the thread and the die is affected by the image blur in the current period, and the less it is affected by the vibration of the processing equipment itself. The higher the thread edge blur confidence of the processing image at the current moment.
[0102] So far, this embodiment obtains the thread edge fuzzy confidence of the processed image at the current moment.
[0103] S4, combining the thread edge blur, fit and thread edge blur confidence at the current moment, determining the edge blur amount, and then filtering the processed image at the current moment to obtain a processed image.
[0104] Here, the processed image refers to a higher quality processed image of the threaded interface of the natural gas pipeline at the current moment, which to a certain extent overcomes the image blur caused by some random vibrations and nonlinear interferences that may exist in the processing equipment during the image acquisition process. It can help improve the accuracy of subsequent processing parameter adjustments and further enhance the processing quality and efficiency of the threaded interface of the natural gas pipeline.
[0105] Specifically, the edge blur amount is first determined by combining the thread edge blur, fit and thread edge blur confidence at the current moment; then the scale factor of the Wiener filter is determined according to the edge blur amount, and the processed image at the current moment is filtered using the Wiener filter with the scale factor to obtain the processed image.
[0106] As a specific implementation method, the product of the thread edge blur, fit and thread edge blur confidence at the current moment is first calculated, and the product is used as the edge blur amount; then, the edge blur amount is used as the scale factor of the Wiener filter, and the Wiener filter with the scale factor is used to filter the processed image at the current moment to obtain the processed image.
[0107] As another specific implementation method, after the edge blur amount is calculated, the grayscale concentration of the processed image is determined according to the grayscale image of the processed image at the current moment, and the grayscale concentration can represent the contrast in the processed image; the scale factor of the Wiener filter is determined according to the edge blur amount and the grayscale concentration, and the processed image at the current moment is filtered using the Wiener filter with the scale factor to obtain a processed image. An example of the processed image at the current moment is shown in FIG. Figure 5 shown.
[0108] Among them, according to the grayscale image of the processed image at the current moment, the grayscale concentration of the processed image is determined, and the step flow chart is as follows: Figure 4 shown.
[0109] In the process of processing the threaded joints of natural gas pipelines, the poor contrast of the processed image leads to errors in the test results, which can be presented in the grayscale histogram. The distribution state of all pixels in the processed image can also explain the blur state of the processed image to a certain extent.
[0110] S401, obtaining a grayscale histogram of the processed image at the current moment, and determining a target grayscale interval in the grayscale histogram.
[0111] In this embodiment, the target grayscale interval is the grayscale interval corresponding to the pixels outside the background area in the processed image. Since there is still interference from the background area in the grayscale histogram, the distribution of pixels in the intervals of 0 to 50 and 200 to 255 is not analyzed, and only the pixel distribution of the grayscale histogram in the middle interval is analyzed, that is, the target grayscale interval is determined in the grayscale histogram, specifically the grayscale interval corresponding to 50 to 200.
[0112] S402, determining the width of the grayscale histogram corresponding to the target grayscale interval, and determining the frequency values of all peak points corresponding to the target grayscale interval.
[0113] In this embodiment, the left and right endpoints of the grayscale histogram in the target grayscale interval are recorded as and ,Will and The difference between them is used as the grayscale histogram width corresponding to the target grayscale interval; and the frequency of all peak points in the target grayscale interval is recorded. The determination of the grayscale histogram width and the frequency value of each peak point is to facilitate the subsequent calculation of the grayscale concentration of the processed image. Here, the grayscale concentration can be used as one of the factors to determine the scale factor of the Wiener filter.
[0114] S403, determining the grayscale concentration of the processed image according to the grayscale histogram width and the frequency value difference between every two peak points.
[0115] Specifically, the average value of all frequency value differences is calculated to determine the ratio of the grayscale histogram width to the average value; the contrast value is subjected to negative correlation normalization processing to obtain the grayscale concentration of the processed image.
[0116] As an example, the calculation formula for the grayscale concentration of the processed image at the current moment can be:
[0117] ; In the formula, represents the grayscale concentration of the processed image at the current moment, exp represents an exponential function with a natural constant as the base, Represents the left endpoint of the grayscale histogram of the target grayscale interval, Represents the right endpoint of the grayscale histogram of the target grayscale interval, represents the absolute value function, K represents the logarithm of the peak point, and z represents the sequence number of the logarithm of the peak point. Indicates the frequency of the dth peak point corresponding to the target grayscale interval, Indicates the frequency of the a-th peak point corresponding to the target grayscale interval, d is not equal to a, Indicates the frequency value difference of the Zth pair of peak points corresponding to the target grayscale interval.
[0118] In the calculation formula of grayscale concentration, there are frequencies of different grayscale values in the processed image, so in general There is no zero probability; The larger the value is, the wider the grayscale histogram width is, the smaller the frequency difference between the peak points is, the lower the concentration of the grayscale histogram is, and the lower the contrast of the grayscale image of the processed image is. On the contrary, it means that the concentration of the grayscale histogram is higher and the frequency difference of pixels of different gray levels is greater, that is, the contrast of the processed image may be greater.
[0119] As a specific implementation, determining the scale factor of the Wiener filter according to the edge blur amount and the grayscale concentration may include:
[0120] The Euclidean norm of the vector composed of the edge blur amount and the grayscale concentration is calculated, the Euclidean norm is normalized, and the normalized value is used as the scale factor of the Wiener filter.
[0121] As an example, the calculation formula of the scale factor of the Wiener filter can be:
[0122] ; In the formula, represents the scale factor of the processed image at the current moment when Wiener filtering is performed, th represents the normalization function, Indicates the edge blur amount of the processed image at the current moment, Indicates the grayscale concentration of the processed image at the current moment.
[0123] In the calculation formula of the proportional factor, The Euclidean norm between the quality of the processed image collected during the processing and the grayscale distribution characteristics of the processed image is used to comprehensively analyze the edge blur amount and grayscale concentration in order to output a comprehensive index to represent the adjustment requirements of the image quality during the processing, that is, to determine the proportional factor; when The larger the value is, the worse the contrast of the processed image at the current moment is and the greater the edge blur in the processed image is. At this time, the greater the adjustment demand for the processed image at the current moment is, the larger the proportional factor is.
[0124] It should be noted that, compared with the existing method of directly using the signal-to-noise ratio of the blurred image as the scaling factor of the Wiener filter, the scaling factor determined in this embodiment can avoid further distortion of the processed image, can effectively process the high-frequency components in the image, and avoid erroneous amplification or suppression of certain frequency components, resulting in unsatisfactory image restoration.
[0125] So far, this embodiment has obtained the scale factor of the processed image at the current moment when performing Wiener filtering.
[0126] S5, extracting features based on the processed image to dynamically adjust the processing parameters at the current moment.
[0127] The processed image in this embodiment is obtained by balancing the blur degree of the processed image in the dynamic process by using Wiener filtering, which effectively suppresses the amplification of noise while deblurring, thereby enhancing the contrast of the processed image and highlighting the recognition and edge details of the thread of the pipe interface; then, features are extracted based on the processed image, such as the pitch, angle, width and other parameters of the pipe interface thread, and then the processing parameters are dynamically adjusted, so that the processing equipment can adjust the parameters in real time during the dynamic processing to cope with the conditions in the processing process, and can respond to abnormal situations in a timely manner, which ensures the processing quality while also ensuring the safety of the equipment during the processing process.
[0128] So far, this embodiment has completed the quality enhancement of the processed image during the processing of the threaded joint of the natural gas pipeline, and further improved the processing quality of the threaded joint of the natural gas pipeline.
[0129] The present invention provides a processing method for a threaded interface of a natural gas pipeline. The method first obtains a processing image of a threaded interface of a natural gas pipeline at the current moment, performs image processing on the processing image, and obtains a number of thread edge lines, non-thread edge lines, and die edge contours; then determines the thread edge fuzziness in the processing image according to each thread edge line and non-thread edge line; determines the fit between the die and the thread in the processing image according to the number of all thread edge lines and the number of all die edge contours; then determines the thread edge fuzziness confidence according to the fit at each moment in a preset monitoring period and the vibration monitoring data of the processing equipment; then, determines the edge fuzziness confidence by combining the thread edge fuzziness, fit, and thread edge fuzziness confidence at the current moment; finally, determines the scale factor of the Wiener filter according to the edge fuzziness, and then performs filtering processing on the processing image at the current moment to obtain the processed processing image, so as to dynamically adjust the processing parameters at the current moment. The present invention can provide reliable data support for the processing of pipeline threaded interfaces by adaptively determining the scale factor of the Wiener filter, which improves the efficiency of automated processing while also ensuring the precision and accuracy of processing quality.
[0130] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for processing a threaded joint of a natural gas pipeline, characterized in that: The following steps are involved: Obtain a processed image of the threaded interface of the natural gas pipeline at the current moment, perform image processing on the processed image, and obtain a number of thread edge lines, non-thread edge lines, and die edge contours; Determine the thread edge fuzziness in the processing image according to each thread edge line and non-thread edge line; determine the fit between the die and the thread in the processing image according to the number of all thread edge lines and the number of all die edge contours; Determining the thread edge fuzzy confidence based on the fit at each moment in a preset monitoring period and the vibration monitoring data of the processing equipment; The edge blur amount is determined by combining the thread edge blur, fit and thread edge blur confidence at the current moment; Determine the scale factor of the Wiener filter according to the edge blur amount, and then perform filtering on the processed image at the current moment to obtain a processed image; Extracting features based on the processed image to dynamically adjust the processing parameters at the current moment; After determining the amount of edge blur, also include: Obtaining the grayscale histogram of the processed image at the current moment, and determining the target grayscale interval in the grayscale histogram; The target grayscale interval is the grayscale interval corresponding to the pixel points outside the background area in the processed image; Determine the grayscale histogram width corresponding to the target grayscale interval, and determine the frequency values of all peak points corresponding to the target grayscale interval; The grayscale concentration of the processed image is determined according to the grayscale histogram width and the frequency value difference between every two peak points; the grayscale concentration is used to determine the scale factor of the Wiener filter.
2. A method for processing a threaded joint of a natural gas pipeline according to claim 1, characterized in that: According to the grayscale histogram width and the frequency value difference between every two peak points, the grayscale concentration of the processed image is determined, including: Calculating the average value of all frequency value differences and determining the ratio of the grayscale histogram width to the average value; The ratio is subjected to negative correlation normalization processing to obtain the grayscale concentration of the processed image.
3. A method for processing a threaded joint of a natural gas pipeline according to claim 1, characterized in that: Determine the thread edge fuzziness in the processed image based on each thread edge line and non-thread edge line, including: Count the number of pixels in the thread edge line, and use the thread edge line with the largest number of pixels between two vertically adjacent thread edge lines as the reference edge line; Calculate the distance between the pixels at the same position in two vertically adjacent thread edge lines, and count the number of distance values corresponding to every two vertically adjacent thread edge lines; The thread edge fuzziness in the processed image is determined by combining the number of pixels in the reference edge line, the number of distance values, the number of non-thread edge lines, and the difference in the number of pixels between every two thread edge lines.
4. A method for processing a threaded joint of a natural gas pipeline according to claim 3, characterized in that: Determining the thread edge fuzziness in the processed image by combining the number of pixels in the reference edge line, the number of distance values, the number of non-thread edge lines, and the difference in the number of pixels between every two thread edge lines, includes: For every two vertically adjacent thread edge lines, the difference between the number of pixel points in the reference edge line and the number of distance values is calculated, and the average value of all differences is used as the thread edge discontinuity index; the average value of all the pixel point number differences is calculated; The thread edge discontinuity index, the average value of all pixel point quantity differences and the number of non-thread edge lines are fused and calculated to obtain a fusion value; the fusion value is normalized to obtain the thread edge fuzziness in the processed image.
5. A method for processing a threaded joint of a natural gas pipeline according to claim 1, characterized in that: The fit between the die and the thread in the processing image is determined based on the number of all thread edge lines and the number of all die edge contours, including: ; In the formula, represents the fit between the die and the thread in the current processing image, exp represents an exponential function with a natural constant as the base, L represents the number of all thread edge lines in the current processing image, h represents the number of all die edge contours in the current processing image, Represents a nonzero constant.
6. A method for processing a threaded joint of a natural gas pipeline according to claim 1, characterized in that: Determine the thread edge fuzzy confidence according to the fit degree at each moment in a preset monitoring period and the vibration monitoring data of the processing equipment, including: The degree of fit and the vibration monitoring data of the processing equipment at each moment in a preset monitoring period are standardized to obtain a degree of fit sequence and a vibration monitoring data sequence; Perform curve fitting on the fit degree sequence and the vibration monitoring data sequence respectively to obtain a fit degree curve and a vibration data curve, and then calculate the mean square error between the fit degree curve and the vibration data curve; Determine the severity of equipment vibration based on the vibration monitoring data sequence; The thread edge fuzzy confidence is determined by combining the vibration severity of the equipment and the mean square error.
7. A method for processing a threaded joint of a natural gas pipeline according to claim 6, characterized in that: Determine the severity of equipment vibration based on the vibration monitoring data sequence, including: The variance of the vibration monitoring data sequence is calculated, and the variance of the vibration monitoring data sequence is used as the severity of equipment vibration.
8. A method for processing a threaded joint of a natural gas pipeline according to claim 1, characterized in that: The step of determining the edge blur amount by combining the thread edge blur, the fit, and the thread edge blur confidence at the current moment includes: The product of the thread edge blur, fit and thread edge blur confidence at the current moment is calculated, and the product is used as the edge blur amount.
9. A method for processing a threaded joint of a natural gas pipeline according to claim 1, characterized in that: Determining a scaling factor of the Wiener filter according to the edge blur amount includes: The Euclidean norm of the vector composed of the edge blur amount and the grayscale concentration is calculated, the Euclidean norm is normalized, and the normalized value is used as the scale factor of the Wiener filter.
Citation Information
Patent Citations
Burr detection method and system in titanium metal processing process
CN118570072A
Thread parameter measuring method based on machine vision
CN119338884A