Oil and gas pipeline safety early warning method and device based on machine vision
Through machine vision-based methods, the texture energy matrix of oil and gas pipelines is calculated and abnormal detection is performed, which solves the problems of high cost, low accuracy and reliability in the prior art, and achieves an efficient and economical safety warning of oil and gas pipelines.
Patent Information
- Application Number
- CN202411503390.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-03-07
AI Technical Summary
The existing oil and gas pipeline safety warning methods are costly, have low accuracy and reliability, making it difficult to effectively detect complex and concealed faults.
Using a machine vision-based method, by obtaining image data of oil and gas pipelines, calculating directional texture features and texture energy matrix, abnormality detection is performed to identify abnormal areas and pipeline location information, and a safety warning report is generated.
It realizes safety warning of oil and gas pipelines with low cost, high accuracy and reliability, and can promptly detect pipeline defects and hidden dangers of different sizes and provide more comprehensive safety information.
Smart Images

Figure CN119580083A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of oil and gas pipeline safety early warning, and in particular to an oil and gas pipeline safety early warning method and device based on machine vision. Background Art
[0002] Oil and gas pipelines are an important part of the modern industrial system and play a vital role in the transportation of energy and economic development. However, oil and gas pipelines are at high risk of being damaged by third-party intrusions, such as mechanical construction, manual excavation, malicious damage, and heavy vehicle crushing. In addition, natural disasters such as landslides and mudslides also seriously endanger pipeline safety and may cause significant losses such as oil and gas leakage, environmental pollution, and personal injury.
[0003] The traditional safety monitoring method is to use manual patrol to conduct daily safety inspections of oil and gas pipelines. This method consumes a lot of manpower and material resources and has low timeliness. The patrol personnel are mainly comprehensive maintenance workers (plumbers) with a certain level of skills in pipeline companies and hired local farmers. The pipeline patrol resource allocation is usually divided into patrol sections directly according to the pipeline mileage. The basic content of the patrol is relatively general, generally checking whether there is any third-party construction along the line, whether the three piles of the pipeline are intact, and changes in the terrain above the pipeline. Manual pipeline patrol has problems such as extensive management, uneven patrol quality, closed information along the pipeline, and backward technical means.
[0004] In order to solve the problems caused by traditional inspection methods, the existing oil and gas pipeline safety early warning methods usually install a large number of sensors around the pipeline to monitor various parameters, such as temperature, pressure, flow, etc. However, this early warning method relies on the deployment of sensor networks, which is labor-intensive and costly, and requires the maintenance and management of sensor networks. The system is complex and has high operating costs. The detection ability of complex hidden faults (such as small leaks, internal corrosion, etc.) is limited, which can easily threaten the safety of the system. In addition, the final early warning is mainly based on simple threshold detection or rule judgment, lacking intelligent analysis and decision-making capabilities. This makes the early warning system vulnerable to noise, false alarms and missed alarms, with limited accuracy and reliability, and has major limitations and deficiencies in key multi-scale support.
[0005] In summary, the existing technology has the problems of high cost, low accuracy and low reliability. Summary of the invention
[0006] The present invention provides a machine vision-based oil and gas pipeline safety early warning method and device, which are used to solve the defects of high cost, low accuracy and low reliability in the prior art, and realize low-cost, high-accuracy and high-reliability oil and gas pipeline safety early warning.
[0007] The present invention provides an oil and gas pipeline safety early warning method based on machine vision, comprising the following steps: Acquire image data of oil and gas pipelines to be warned; Obtaining directional texture features according to the distance intervals of image pixels of the image data in multiple preset directions represented by different chromaticities, and constructing a directional texture feature map according to the directional texture features; Calculating texture energy according to the directional texture feature map to obtain a texture energy matrix; Anomaly detection is performed according to the texture energy matrix to obtain abnormal area and pipeline position information, and an early warning is issued according to the abnormal area and pipeline position information.
[0008] According to a machine vision-based oil and gas pipeline safety early warning method provided by the present invention, the texture energy is calculated according to the directional texture feature map to obtain a texture energy matrix, which specifically includes: The texture energy is calculated using a directional texture energy algorithm according to the directional texture feature map to obtain a texture energy matrix.
[0009] According to a machine vision-based oil and gas pipeline safety early warning method provided by the present invention, anomaly detection is performed according to the texture energy matrix to obtain abnormal area and pipeline location information, specifically including: Obtaining a set of feature vectors according to the texture energy matrix; wherein each vector of the set of feature vectors represents an image pixel; Calculating the local density of each pixel of the image according to the feature vector set; Calculating a local anomaly factor of each pixel of the image according to the local density; Screening first abnormal image pixels that are higher than the preset abnormal factor threshold according to the preset abnormal factor threshold; The abnormal area is obtained according to the first abnormal image pixels, and the corresponding pipeline position information is recorded.
[0010] According to a machine vision-based oil and gas pipeline safety early warning method provided by the present invention, anomaly detection is performed according to the texture energy matrix to obtain abnormal area and pipeline location information, specifically including: Performing singular value decomposition on the texture energy matrix to obtain singular values and corresponding singular vectors; Selecting a preset number of singular values and singular vectors to reconstruct the texture energy matrix to obtain a reconstructed texture energy matrix; Calculating a residual matrix between the original texture energy matrix and the reconstructed texture energy matrix; Screening second abnormal image pixels in the residual matrix that are higher than the preset residual threshold according to the preset residual threshold; The abnormal area is obtained according to the second abnormal image pixels, and the corresponding pipeline position information is recorded.
[0011] According to a machine vision-based oil and gas pipeline safety early warning method provided by the present invention, image data of the oil and gas pipeline to be warned is obtained, specifically including: A plurality of pre-set image acquisition devices are used to dynamically operate the oil and gas pipeline to be warned to obtain image data of the oil and gas pipeline to be warned.
[0012] According to a machine vision-based oil and gas pipeline safety early warning method provided by the present invention, early warning is performed according to the abnormal area and pipeline location information, specifically comprising: Associating the abnormal area with the pipeline location information, and generating a pipeline safety early warning report according to the association result; The pipeline safety early warning report includes the location coordinates, defect type and severity of the abnormal area.
[0013] The present invention also provides an oil and gas pipeline safety early warning device based on machine vision, comprising the following modules: An image unit, used to obtain image data of the oil and gas pipeline to be warned; A feature unit, used to obtain directional texture features according to the distance intervals of image pixels of the image data in multiple preset directions represented by different chromaticities, and to construct a directional texture feature map according to the directional texture features; An energy unit, used for calculating texture energy according to the directional texture feature map to obtain a texture energy matrix; The early warning unit is used to perform anomaly detection according to the texture energy matrix, obtain abnormal area and pipeline position information, and issue an early warning according to the abnormal area and pipeline position information.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, an oil and gas pipeline safety early warning method based on machine vision as described above is implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements any of the above-mentioned machine vision-based oil and gas pipeline safety early warning methods.
[0016] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned machine vision-based oil and gas pipeline safety early warning methods.
[0017] The machine vision-based oil and gas pipeline safety early warning method and device provided by the present invention obtain image data of the oil and gas pipeline to be warned; represent the distance intervals of the image pixels of the image data in multiple preset directions with different chromaticities to obtain directional texture features, and construct a directional texture feature map according to the directional texture features; calculate the texture energy according to the directional texture feature map to obtain a texture energy matrix; perform abnormality detection according to the texture energy matrix to obtain abnormal area and pipeline position information, and perform early warning according to the abnormal area and pipeline position information. The present invention uses the image data of the oil and gas pipeline to be warned for early warning analysis, does not need to deploy multiple sensors, and saves costs. In the analysis process, the distance intervals of the pixels in multiple preset directions are represented with different chromaticities, which improves the accuracy of texture feature extraction. In addition, the directional texture energy algorithm used in the present invention can better capture texture direction information, has strong anti-interference ability to noise and interference, improves reliability in complex environments, and supports analysis of texture features of different scales. The present invention can help timely discover pipeline defects and hidden dangers of different scales, and provide more comprehensive information for pipeline safety early warning. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0019] Figure 1 It is a flow chart of the oil and gas pipeline safety early warning method based on machine vision provided by the present invention.
[0020] Figure 2 It is a structural schematic diagram of the oil and gas pipeline safety early warning device based on machine vision provided by the present invention.
[0021] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.
[0023] Combine the following Figure 1Describe the oil and gas pipeline safety early warning method based on machine vision of the present invention, Figure 1 is a flow chart of the oil and gas pipeline safety early warning method based on machine vision provided by the present invention, such as Figure 1 As shown, the method comprises the following steps: Step 110: Acquire image data of the oil and gas pipeline to be warned.
[0024] It should be noted that the use of machine vision to obtain videos and then use image inversion to segment images is a hot topic of research at home and abroad. Image inversion technology is widely used in military, medical, unmanned driving and other fields. This technology classifies each pixel in the image to generate images segmented by category. Each pixel in the image or each voxel of the three-dimensional body is labeled as a certain category. Applications include road segmentation in autonomous driving, cancer cell segmentation in medical diagnosis, etc. The present invention uses machine vision to segment oil and gas pipelines by category, thereby achieving safety warning.
[0025] In step 110, an image acquisition device is used to acquire image data of the oil and gas pipeline to be warned. The present invention does not limit the specific image acquisition device, and the image acquisition device can be selected according to actual conditions.
[0026] In a specific embodiment, the image acquisition device is a high-definition video detector. Furthermore, the core components of the video detector include two versions, the first version of the visual array is keyed at the back end, and the second version of the visual array is keyed at the front end, annulus and back end, both of which include circuit design, collector, video camera selection, and explosion-proof shell design.
[0027] In some embodiments, multiple fixed-position image acquisition devices are arranged around the oil and gas pipeline to be warned to collect image data. In a specific embodiment, the image acquisition device includes three high-quality cameras with a 120-degree angle, which can simultaneously collect images in front of the pipeline, behind the pipeline, and in the annular space.
[0028] In other embodiments, a plurality of pre-set image acquisition devices are used to dynamically operate the oil and gas pipeline to be warned to obtain image data of the oil and gas pipeline to be warned.
[0029] After the image data is obtained, in order to enhance the accuracy of subsequent processing, the image data is preprocessed.
[0030] It is understandable that the purpose of preprocessing is to reduce interference factors and prepare for the processing of subsequent steps. After preprocessing, it also includes: updating the image data according to the results of the preprocessing to perform subsequent steps.
[0031] In some embodiments, the preprocessing includes denoising, enhancement, image correction, etc. In one embodiment, image denoising, enhancement, and image correction are performed on the image data in sequence.
[0032] It should be noted that the present invention does not limit the specific algorithm for performing preprocessing. For example, image denoising can be achieved by using threshold processing, image enhancement can be achieved by using grayscale transformation, and image correction can be achieved by using radiometric correction.
[0033] Step 120: obtaining directional texture features according to the distance intervals of the image pixels of the image data in multiple preset directions represented by different chromaticities, and constructing a directional texture feature map according to the directional texture features.
[0034] In step 120, the distance intervals of the image pixels of the image data in multiple preset directions are represented by different chromaticities to construct a directional texture feature map. It should be noted that the preset directions are multiple different possible directions of textures that are predetermined, such as horizontal, vertical, diagonal, or directions of 0 degrees, 45 degrees, 90 degrees, 135 degrees, etc. The present invention does not limit the specific preset directions, and can be selected according to the specific image pixels during actual operation.
[0035] The present invention effectively solves the problem of the characteristic change of texture intensity in the image area with the high periodicity of the outlined boundary and the different degrees of regularity and randomness of the texture by representing the distance intervals of pixels in different directions with different chromaticities, thereby improving the accuracy of texture feature extraction.
[0036] Step 130: Calculate texture energy according to the directional texture feature map to obtain a texture energy matrix.
[0037] In step 130, a directional texture energy method is used to calculate the texture energy of each pixel in the image in different directions represented by different chromaticities, and obtain a corresponding texture energy image. It should be explained that the texture energy image can be expressed in the form of a texture energy matrix.
[0038] It should be noted that the oriented texture energy method referred to in the present invention is an image processing technology based on the local spatial frequency characteristics of texture, which is used to analyze and identify texture features in images. The oriented texture energy method not only considers the energy of the texture (i.e., the intensity or significance of the texture), but also considers the directionality of the texture. By calculating the texture energy of each pixel in the image in different directions, different texture types can be better described and distinguished.
[0039] Traditional texture analysis methods may be inaccurate or incomplete when describing texture features in images. The present invention uses a directional texture energy method to more accurately describe texture features in images, especially when there are outlined boundaries. At the same time, the directional texture energy method can better capture texture direction information and has a strong anti-interference ability to noise and interference, and can better cope with various complex factors in the actual operating environment of oil and gas pipelines.
[0040] Step 140: Perform anomaly detection based on the texture energy matrix to obtain abnormal area and pipeline position information, and issue an early warning based on the abnormal area and pipeline position information.
[0041] In step 140, based on the texture energy matrix, an abnormality detection algorithm is used to identify abnormal areas on the pipeline surface, that is, potential defect locations are obtained, and pipeline location information is recorded. Then, an early warning can be issued based on the abnormal area and pipeline location information.
[0042] In addition, after step 140, the process also includes: performing pipeline maintenance and repair according to the early warning result.
[0043] The machine vision-based oil and gas pipeline safety early warning method provided by the present invention is based on the principle of industrial endoscopes, uses machine vision technology, develops high-definition visual detectors, studies image processing and inversion algorithms, comprehensively monitors and accurately diagnoses the internal state of the pipeline (internal corrosion), and accurately identifies and evaluates tiny, early defects and corrosion conditions to ensure the safe operation of the pipeline. The present invention can analyze and process texture features of different scales and provide support for multi-scale detection of pipeline defects. Compared with the existing pipeline safety early warning methods based on machine vision, the present invention has achieved breakthroughs in texture feature extraction, analysis robustness, system performance, and multi-scale support. It can help timely discover pipeline defects of different scales, provide more comprehensive information for pipeline safety early warning, and provide a new technical path for the further development of oil and gas pipeline safety monitoring and early warning systems.
[0044] The following further describes the calculation of texture energy using the directional texture energy algorithm. In some embodiments, the texture energy is calculated according to the directional texture feature map to obtain a texture energy matrix, which specifically includes: The texture energy is calculated using a directional texture energy algorithm according to the directional texture feature map to obtain a texture energy matrix.
[0045] Specifically, based on the directional texture feature map, for each pixel point, the texture energy is calculated along each preset direction.
[0046] In the process of calculating texture energy, in some embodiments, the calculation of texture energy is achieved by calculating the local gradient or the local frequency response, wherein the local frequency can be calculated by the amplitude of the response of a high-pass filter (such as Sobel, Prewitt, Laplacian, etc.).
[0047] In order to save computing resources, before calculating the texture energy, the dominant texture direction of each image pixel is selected, and then the texture energy is calculated only along the dominant texture direction of each image pixel. It should be noted that the embodiment of the present invention does not limit the number of dominant texture directions of each image pixel, which can be multiple or only one. In a specific embodiment, the direction with the largest texture energy is selected as the dominant texture direction of the image pixel.
[0048] Furthermore, after the texture energy is calculated, the texture feature can be updated according to the texture energy of each image pixel and the dominant texture direction. The texture feature can include statistical information of the texture energy in each direction, such as mean, variance, skewness, kurtosis, etc.
[0049] The following will further describe the abnormality detection based on the texture energy matrix. In some embodiments, the abnormality detection is performed based on the texture energy matrix to obtain the abnormal area and pipeline location information, specifically including: Obtaining a set of feature vectors according to the texture energy matrix; wherein each vector of the set of feature vectors represents an image pixel; Calculating the local density of each pixel of the image according to the feature vector set; Calculating a local anomaly factor of each pixel of the image according to the local density; Screening first abnormal image pixels that are higher than the preset abnormal factor threshold according to the preset abnormal factor threshold; The abnormal area is obtained according to the first abnormal image pixels, and the corresponding pipeline position information is recorded.
[0050] Specifically, the embodiment of the present invention uses a local anomaly factor to detect abnormal areas. It should be noted that the local anomaly factor is a density-based anomaly detection method that evaluates the degree of abnormality of a point by comparing the local density of a point with the local density of its neighbors.
[0051] In the specific anomaly detection process, the feature vector is first constructed. Specifically, the texture energy matrix is converted into a set of feature vectors, each of which represents a pixel in the image.
[0052] Then the local anomaly factor is calculated. In the specific calculation process, for each point in the feature vector set (i.e., the image pixel corresponding to the vector), its local density is calculated.
[0053] Furthermore, the calculation of local density includes the following steps: for each point in the feature vector set, calculate its k-distance, that is, the distance from point p to its kth nearest neighbor. According to the calculation of k-distance reachability distance, it can be understood that the reachability distance is a concept based on k-distance, which is used to measure the relative proximity of a point p to another point o. In a specific embodiment, the reachability distance is defined as the maximum value of the k-distance of point o and the actual distance between point p and point o. Thereafter, the local density is calculated based on the reachable distance. In a specific embodiment, the local density is defined as the inverse of the average reachability distance of points in the k-neighborhood of point p.
[0054] After obtaining the local density, the local outlier factor (LOF) of each point is calculated based on the local density. It can be understood that the local outlier factor is the average of the ratio of the local reachable density of point p to the local reachable density of the points in its k-neighborhood. The higher the LOF value, the greater the possibility that the point is abnormal.
[0055] After obtaining the LOF values of all points, a preset anomaly factor threshold can be set, and points above the threshold are considered to be abnormal points, that is, the first abnormal image pixels that are abnormal are screened according to the preset anomaly factor threshold. It should be noted that the present invention does not limit the preset anomaly factor threshold, and it can be determined according to the specific data set and domain knowledge in the actual operation process.
[0056] The abnormal region can be obtained according to the first abnormal image pixels. In some embodiments, the abnormal region is formed by clustering or connecting the first abnormal image pixels.
[0057] Furthermore, it should be emphasized that after the abnormal area is determined, the pipeline position information corresponding to the abnormal area needs to be recorded according to the position of the corresponding image pixels.
[0058] The following will further describe the abnormality detection based on the texture energy matrix. In some embodiments, the abnormality detection is performed based on the texture energy matrix to obtain the abnormal area and pipeline location information, specifically including: Performing singular value decomposition on the texture energy matrix to obtain singular values and corresponding singular vectors; Selecting a preset number of singular values and singular vectors to reconstruct the texture energy matrix to obtain a reconstructed texture energy matrix; Calculating a residual matrix between the original texture energy matrix and the reconstructed texture energy matrix; Screening second abnormal image pixels in the residual matrix that are higher than the preset residual threshold according to the preset residual threshold; The abnormal area is obtained according to the second abnormal image pixels, and the corresponding pipeline position information is recorded.
[0059] Specifically, the embodiment of the present invention uses singular value decomposition to detect abnormal regions. It should be noted that singular value decomposition is a matrix decomposition technology that can be used to extract the main features of an image.
[0060] In the specific anomaly detection process, the texture energy matrix is first subjected to singular value decomposition to obtain singular values and corresponding singular vectors. It should be explained that singular value decomposition (SVD) is an important matrix decomposition method in linear algebra, which can decompose a matrix of any shape into the product of three matrices.
[0061] After the singular value decomposition, a preset number of singular values and singular vectors are selected from the obtained singular values and corresponding singular vectors. It should be noted that the selected singular values and singular vectors need to be able to represent the main texture features of the image.
[0062] After obtaining the preset number of singular values and singular vectors, the texture energy matrix is reconstructed using the main singular values and singular vectors, and the residual matrix between the original matrix and the reconstructed matrix is calculated. It can be understood that in the residual matrix, a larger residual value may indicate an abnormal area.
[0063] After obtaining the residual matrix, a preset residual threshold can be set, and the second abnormal image pixels in the residual matrix that are higher than the preset residual threshold can be screened according to the preset residual threshold. It should be noted that the present invention does not limit the preset residual threshold, and it can be determined according to the specific data set and domain knowledge in the actual operation process.
[0064] The abnormal region can be obtained according to the second abnormal image pixels. In some embodiments, the abnormal region is formed by clustering or connecting the second abnormal image pixels.
[0065] Furthermore, it should be emphasized that after the abnormal area is determined, the pipeline position information corresponding to the abnormal area needs to be recorded according to the position of the corresponding image pixels.
[0066] Further, based on the above embodiment, after obtaining the abnormal area, the method further includes: Use morphological operations such as opening, closing, and median filtering to remove noise and small areas; For scattered outliers, a region growing algorithm is used to connect multiple small outlier regions into larger regions; Manual review of inspection results to confirm whether abnormal areas are indeed potential defects.
[0067] Step 140 will be further described below. In some embodiments, the early warning is issued according to the abnormal area and pipeline location information, specifically including: Associating the abnormal area with the pipeline location information, and generating a pipeline safety early warning report according to the association result; The pipeline safety early warning report includes the location coordinates, defect type and severity of the abnormal area.
[0068] Specifically, in the actual early warning process, the detected abnormal area is associated with the pipeline location information to generate a pipeline safety early warning report. The early warning report contains information such as the location coordinates, defect type and severity of the abnormal area, providing a basis for subsequent pipeline maintenance and repair.
[0069] The machine vision-based oil and gas pipeline safety early warning method provided by the present invention obtains image data of the oil and gas pipeline to be warned; represents the distance intervals of the image pixels of the image data in multiple preset directions with different chromaticities to obtain directional texture features, and constructs a directional texture feature map according to the directional texture features; calculates the texture energy according to the directional texture feature map to obtain a texture energy matrix; performs abnormal detection according to the texture energy matrix to obtain abnormal area and pipeline position information, and performs early warning according to the abnormal area and pipeline position information. The present invention uses the image data of the oil and gas pipeline to be warned for early warning analysis, does not need to deploy multiple sensors, and saves costs. In the analysis process, the distance intervals of the pixels in multiple preset directions are represented with different chromaticities, which improves the accuracy of texture feature extraction. In addition, the directional texture energy algorithm used in the present invention can better capture texture direction information, has strong anti-interference ability to noise and interference, improves reliability in complex environments, and supports analysis of texture features of different scales. The present invention can help timely discover pipeline defects and hidden dangers of different scales, and provide more comprehensive information for pipeline safety early warning.
[0070] The following is a description of the oil and gas pipeline safety early warning device based on machine vision provided by the present invention. The oil and gas pipeline safety early warning device based on machine vision described below and the oil and gas pipeline safety early warning method based on machine vision described above can be referred to each other. Figure 2 As shown, the device includes the following modules: An image unit 210 is used to obtain image data of the oil and gas pipeline to be warned; A feature unit 220, configured to obtain directional texture features according to the distance intervals of the image pixels of the image data in multiple preset directions represented by different chromaticities, and to construct a directional texture feature map according to the directional texture features; An energy unit 230, configured to calculate texture energy according to the directional texture feature map to obtain a texture energy matrix; The early warning unit 240 is used to perform anomaly detection according to the texture energy matrix, obtain abnormal area and pipeline position information, and issue an early warning according to the abnormal area and pipeline position information.
[0071] According to a machine vision-based oil and gas pipeline safety early warning device provided by the present invention, the texture energy is calculated according to the directional texture feature map to obtain a texture energy matrix, which specifically includes: The texture energy is calculated using a directional texture energy algorithm according to the directional texture feature map to obtain a texture energy matrix.
[0072] According to a machine vision-based oil and gas pipeline safety early warning device provided by the present invention, anomaly detection is performed according to the texture energy matrix to obtain abnormal area and pipeline location information, specifically including: Obtaining a set of feature vectors according to the texture energy matrix; wherein each vector of the set of feature vectors represents an image pixel; Calculating the local density of each pixel of the image according to the feature vector set; Calculating a local anomaly factor of each pixel of the image according to the local density; Screening first abnormal image pixels that are higher than the preset abnormal factor threshold according to the preset abnormal factor threshold; The abnormal area is obtained according to the first abnormal image pixels, and the corresponding pipeline position information is recorded.
[0073] According to a machine vision-based oil and gas pipeline safety early warning device provided by the present invention, anomaly detection is performed according to the texture energy matrix to obtain abnormal area and pipeline location information, specifically including: Performing singular value decomposition on the texture energy matrix to obtain singular values and corresponding singular vectors; Selecting a preset number of singular values and singular vectors to reconstruct the texture energy matrix to obtain a reconstructed texture energy matrix; Calculating a residual matrix between the original texture energy matrix and the reconstructed texture energy matrix; Screening second abnormal image pixels in the residual matrix that are higher than the preset residual threshold according to the preset residual threshold; The abnormal area is obtained according to the second abnormal image pixels, and the corresponding pipeline position information is recorded.
[0074] According to a machine vision-based oil and gas pipeline safety early warning device provided by the present invention, image data of the oil and gas pipeline to be warned is obtained, specifically including: A plurality of pre-set image acquisition devices are used to dynamically operate the oil and gas pipeline to be warned to obtain image data of the oil and gas pipeline to be warned.
[0075] According to the present invention, a machine vision-based oil and gas pipeline safety early warning device is provided, which provides an early warning according to the abnormal area and pipeline location information, specifically including: Associating the abnormal area with the pipeline location information, and generating a pipeline safety early warning report according to the association result; The pipeline safety early warning report includes the location coordinates, defect type and severity of the abnormal area.
[0076] The machine vision-based oil and gas pipeline safety early warning device provided by the present invention obtains image data of the oil and gas pipeline to be warned; represents the distance intervals of the image pixels of the image data in multiple preset directions with different chromaticities to obtain directional texture features, and constructs a directional texture feature map according to the directional texture features; calculates the texture energy according to the directional texture feature map to obtain a texture energy matrix; performs abnormal detection according to the texture energy matrix to obtain abnormal area and pipeline position information, and issues an early warning according to the abnormal area and pipeline position information. The present invention uses the image data of the oil and gas pipeline to be warned for early warning analysis, does not need to deploy multiple sensors, and saves costs. In the analysis process, the distance intervals of the pixels in multiple preset directions are represented with different chromaticities, which improves the accuracy of texture feature extraction. In addition, the directional texture energy algorithm used in the present invention can better capture texture direction information, has strong anti-interference ability to noise and interference, improves reliability in complex environments, and supports analysis of texture features of different scales. The present invention can help timely discover pipeline defects and hidden dangers of different scales, and provide more comprehensive information for pipeline safety early warning.
[0077] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the oil and gas pipeline safety early warning method based on machine vision, the method comprising: obtaining image data of the oil and gas pipeline to be warned; expressing the image pixels of the image data in different chromaticities according to the distance intervals in multiple preset directions, obtaining directional texture features, and constructing a directional texture feature map according to the directional texture features; calculating the texture energy according to the directional texture feature map to obtain a texture energy matrix; performing abnormality detection according to the texture energy matrix to obtain abnormal area and pipeline position information, and issuing an early warning according to the abnormal area and pipeline position information.
[0078] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0079] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the machine vision-based oil and gas pipeline safety warning method provided by the above methods, and the method includes: obtaining image data of the oil and gas pipeline to be warned; expressing the image pixels of the image data in different chromaticities in multiple preset directions to obtain directional texture features, and constructing a directional texture feature map based on the directional texture features; calculating texture energy based on the directional texture feature map to obtain a texture energy matrix; performing anomaly detection based on the texture energy matrix to obtain abnormal area and pipeline position information, and issuing an early warning based on the abnormal area and pipeline position information.
[0080] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the machine vision-based oil and gas pipeline safety warning method provided by the above-mentioned methods, the method comprising: acquiring image data of the oil and gas pipeline to be warned; expressing the image pixels of the image data in different chromaticities in a plurality of preset directions to obtain directional texture features, and constructing a directional texture feature map according to the directional texture features; calculating texture energy according to the directional texture feature map to obtain a texture energy matrix; performing anomaly detection according to the texture energy matrix to obtain abnormal area and pipeline position information, and issuing an early warning according to the abnormal area and pipeline position information.
[0081] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0082] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A machine vision-based oil and gas pipeline safety early warning method, characterized in that: include: Acquire image data of oil and gas pipelines to be warned; Obtaining directional texture features according to the distance intervals of image pixels of the image data in multiple preset directions represented by different chromaticities, and constructing a directional texture feature map according to the directional texture features; Calculating texture energy according to the directional texture feature map to obtain a texture energy matrix; Anomaly detection is performed according to the texture energy matrix to obtain abnormal area and pipeline position information, and an early warning is issued according to the abnormal area and pipeline position information.
2. The oil and gas pipeline safety early warning method based on machine vision according to claim 1 is characterized in that: The texture energy is calculated according to the directional texture feature map to obtain a texture energy matrix, which specifically includes: The texture energy is calculated using a directional texture energy algorithm according to the directional texture feature map to obtain a texture energy matrix.
3. The oil and gas pipeline safety early warning method based on machine vision according to claim 1 is characterized in that: Anomaly detection is performed according to the texture energy matrix to obtain abnormal area and pipeline location information, specifically including: Obtaining a set of feature vectors according to the texture energy matrix; wherein each vector of the set of feature vectors represents an image pixel; Calculating the local density of each pixel of the image according to the feature vector set; Calculating a local anomaly factor of each pixel of the image according to the local density; Screening first abnormal image pixels that are higher than the preset abnormal factor threshold according to the preset abnormal factor threshold; The abnormal area is obtained according to the first abnormal image pixels, and the corresponding pipeline position information is recorded.
4. The oil and gas pipeline safety early warning method based on machine vision according to claim 1 is characterized in that: Anomaly detection is performed according to the texture energy matrix to obtain abnormal area and pipeline location information, specifically including: Performing singular value decomposition on the texture energy matrix to obtain singular values and corresponding singular vectors; Selecting a preset number of singular values and singular vectors to reconstruct the texture energy matrix to obtain a reconstructed texture energy matrix; Calculating a residual matrix between the original texture energy matrix and the reconstructed texture energy matrix; Screening second abnormal image pixels in the residual matrix that are higher than the preset residual threshold according to the preset residual threshold; The abnormal area is obtained according to the second abnormal image pixels, and the corresponding pipeline position information is recorded.
5. The oil and gas pipeline safety early warning method based on machine vision according to claim 1 is characterized in that: Obtain image data of the oil and gas pipeline to be warned, including: A plurality of pre-set image acquisition devices are used to dynamically operate the oil and gas pipeline to be warned to obtain image data of the oil and gas pipeline to be warned.
6. The oil and gas pipeline safety early warning method based on machine vision according to claim 1 is characterized in that: According to the abnormal area and pipeline location information, early warning is carried out, specifically including: Associating the abnormal area with the pipeline location information, and generating a pipeline safety early warning report according to the association result; The pipeline safety early warning report includes the location coordinates, defect type and severity of the abnormal area.
7. An oil and gas pipeline safety early warning device based on machine vision, characterized in that: include: An image unit, used to obtain image data of the oil and gas pipeline to be warned; A feature unit, used to obtain directional texture features according to the distance intervals of image pixels of the image data in multiple preset directions represented by different chromaticities, and to construct a directional texture feature map according to the directional texture features; An energy unit, used for calculating texture energy according to the directional texture feature map to obtain a texture energy matrix; The early warning unit is used to perform anomaly detection according to the texture energy matrix, obtain abnormal area and pipeline position information, and issue an early warning according to the abnormal area and pipeline position information.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the machine vision-based oil and gas pipeline safety early warning method as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the machine vision-based oil and gas pipeline safety early warning method as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the machine vision-based oil and gas pipeline safety early warning method as described in any one of claims 1 to 6 is implemented.