Method and device for measuring height of pipeline in well, electronic equipment and storage medium

Through edge detection algorithm and mobile alignment strategy, the problem of pipeline measurement accuracy in the prior art is solved, and high-precision pipeline height measurement in complex well environments is achieved.

CN118896554AActive Publication Date: 2024-11-05WUHAN DAOXIAOFEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410953129.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-05
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

Existing machine vision-based pipeline measurement methods are difficult to accurately distinguish well walls and pipelines in complex well environments, resulting in a decrease in measurement accuracy.

Method used

Edge detection algorithm is used to identify the edge image data of the pipeline in the well acquired by the camera, and the pipeline circle is obtained through edge coordinates, the height difference between the pipeline center and the camera is calculated, and the measurement accuracy is improved through the moving alignment strategy.

Benefits of technology

Effectively filtering out background noise improves the robustness of the algorithm and the stability of the measurement, reduces manual intervention, and improves the accuracy and reliability of the measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118896554A_ABST
    Figure CN118896554A_ABST
Patent Text Reader

Abstract

The invention relates to a method and a device for measuring the height of a pipeline in a well, electronic equipment and a storage medium, and belongs to the technical field of machine vision and pipeline measurement, and the method for measuring the height of the pipeline in the well comprises the following steps: carrying out edge identification on first image data of the pipeline in the well acquired by a camera based on an edge detection algorithm; obtaining a plurality of edge coordinates; obtaining a pipeline circle based on the edge coordinates; calculating a first height difference between the pipeline circle center and the camera based on the pipeline circle; and performing moving alignment on the camera based on the first height difference until the first height difference is smaller than a preset alignment threshold value, and outputting the height of the current camera as the height of the pipeline in the well. The problem that in the prior art, the measurement precision is reduced due to the fact that the measurement precision is easily influenced by the environment in the well is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine vision technology and pipeline measurement technology, and in particular to a method, device, electronic equipment and medium for measuring the height of a pipeline in a well. Background Art

[0002] In the oil, gas, water conservancy and other industries, the position and height measurement of pipelines in the well is of great significance to ensure project safety, maintenance management and effective use of resources. Traditional measurement methods, such as manual measurement or the use of simple measurement tools, are not only inefficient, but also often have problems with insufficient measurement accuracy. Especially in the complex and changeable well environment, these traditional methods are even more difficult to apply.

[0003] With the rapid development of machine vision technology, the measurement method based on image processing has gradually become an effective way to solve the above problems. By obtaining image data of the well environment through machine vision equipment and extracting key information using image processing algorithms, the height of the pipeline in the well can be automatically measured.

[0004] However, existing machine vision-based pipeline measurement methods mostly rely on complex feature extraction and template matching algorithms. These algorithms are difficult to accurately distinguish between the well wall and the pipeline in the complex and changeable well environment, resulting in a decrease in measurement accuracy. Summary of the invention

[0005] In view of this, it is necessary to provide a method, device, electronic equipment and medium for measuring the height of a pipeline in a well, so as to solve the problem that the existing technology is easily affected by the well environment and leads to reduced measurement accuracy.

[0006] In order to solve the above problems, the present invention provides a method for measuring the height of a pipeline in a well, comprising: Performing edge recognition on first image data of the pipeline in the well acquired by the camera based on an edge detection algorithm to obtain a plurality of edge coordinates; Obtaining a pipeline circle based on the edge coordinates; A first height difference between the center of the pipeline and the camera is calculated based on the pipeline circle; The camera is moved and aligned based on the first height difference until the first height difference is less than a preset alignment threshold, and the height of the current camera is output as the height of the pipeline in the well.

[0007] In a possible implementation, the edge recognition of the first image data of the pipeline in the well acquired by the camera based on the edge detection algorithm includes: Performing grayscale processing on the first image data to obtain second image data; Perform edge recognition on the second image data based on the edge detection algorithm.

[0008] In a possible implementation, obtaining the pipeline circle based on the edge coordinates includes: Performing circle fitting on the edge coordinates to obtain a plurality of pipeline circles to be determined; Calculating the diameters of the plurality of pipeline circles to be determined, and retaining the pipeline circles to be determined whose diameters are not greater than a preset diameter threshold; Calculate the error value between the diameter of each retained pipeline circle to be determined and the pipeline diameter respectively; The pipeline circle to be determined with the smallest error value is taken as the pipeline circle.

[0009] In a possible implementation, the calculating based on the pipeline circle to obtain a first height difference between the center of the pipeline and the camera includes: Based on the first formula, a second height difference between the center of the pipeline circle and the center of the image is calculated; Calculate a first height difference based on the second height difference; Wherein, the first formula includes:

[0010] In the formula, the image y The positive direction of the axis is vertically downward. H 圆心 is the second height difference between the center of the circle and the center of the image, Y 圆心 is the center of the circle in the image y Axis coordinates, H pixel is the vertical resolution of the first image data.

[0011] In a possible implementation manner, the calculating the first height difference based on the second height difference includes: Substituting the second height difference into the second formula for calculation, to obtain the first height difference; Wherein, the second formula includes:

[0012] In the formula, D is the angular difference between the center of the pipe and the camera, HFOV is the vertical field of view of the camera, H pixel is the vertical resolution of the first image data, P is the first height difference between the center of the pipeline and the camera device, R 井 is the shortest distance from the camera to the well wall.

[0013] In a possible implementation manner, the step of moving and aligning the camera based on the first height difference includes: Determining whether the first height difference is less than a preset alignment threshold; If it is less than, the height of the current camera is directly output as the height of the pipeline in the well; If it is not less than, further move and align according to the upper and lower positions of the center of the pipeline circle in the image.

[0014] In a possible implementation, further performing movement alignment according to the upper and lower positions of the center of the pipeline circle in the image includes: Determining whether the center of the circle is above or below the image; If it is above, move the camera upward by any distance and reacquire the first image data until the first height difference is less than the alignment threshold; If it is below, continue to move the camera downward by any distance and reacquire the first image data until the first height difference is smaller than the alignment threshold.

[0015] The present invention also provides a device for measuring the height of a pipeline in a well, comprising: An edge recognition module is used to perform edge recognition on the first image data of the well pipe acquired by the camera based on an edge detection algorithm to obtain a plurality of edge coordinates; A circle fitting module, used for obtaining a pipeline circle based on the edge coordinates; A height calculation module, used for calculating a first height difference between the center of the pipeline and the camera based on the pipeline circle; The mobile alignment module is used to move and align the camera based on the first height difference until the first height difference is less than a preset alignment threshold, and output the current camera height as the height of the pipeline in the well.

[0016] The present invention also provides an electronic device, comprising: Memory, used to store programs; A processor is coupled to the memory and is used to execute the program stored in the memory to implement the method for measuring the height of the pipeline in the well as described in any one of the above method items.

[0017] The present invention also provides a storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the method for measuring the height of a pipeline in a well as described in any one of the above-mentioned method items.

[0018] The beneficial effects of the present invention are as follows: the present invention provides a method for measuring the height of a pipeline in a well. First, an edge detection algorithm is used to extract the edge features of the pipeline, and a pipeline circle that best meets the requirements is obtained based on the extracted edge features. This method can effectively filter out background noise, accurately identify the pipeline, improve the robustness of the algorithm, and reduce the need for manual intervention. Then, a directional movement strategy is formulated based on the direction of the center of the circle in the image. This strategy can guide the mobile device to move in the correct direction so that the camera can capture the pipeline image more accurately, improve the stability and reliability of the measurement, and solve the problem that the existing technology is easily affected by the well environment, resulting in a decrease in measurement accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A method flow chart of an embodiment of a method for measuring the height of a pipeline in a well provided by the present invention; Figure 2 for Figure 1 A method flow chart of step S101 in an embodiment; Figure 3 for Figure 1 A method flow chart of an embodiment of step S102; Figure 4 for Figure 1 A method flow chart of an embodiment of step S103; Figure 5 for Figure 1 A method flow chart of an embodiment of step S104; Figure 6 for Figure 5 A method flow chart of an embodiment of step S503; Figure 7 A schematic structural diagram of an embodiment of a device for measuring the height of a pipeline in a well provided by the present invention; Figure 8 A schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0021] In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.

[0022] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0023] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0024] In order to solve the above problems, Figure 1 As shown, the present invention provides a method for measuring the height of a pipeline in a well, comprising: S101, performing edge recognition on first image data of a pipeline in a well acquired by a camera based on an edge detection algorithm to obtain a plurality of edge coordinates; Specifically, when collecting image data of the pipeline in the well, the camera can be installed on a movable device. If there is a fill light, it can be turned on to ensure that the camera can clearly capture the pipeline in the well. Then the movable device is lowered from the shaft, the camera is pointed in the direction of the pipeline, and the camera is turned on. The camera captures the image of the pipeline in the well in real time and transmits the image data to the image processing system for edge recognition.

[0025] It is understood that the camera is installed on a mobile device and can capture pipeline images in real time as the device moves. At the same time, through edge detection and pipeline recognition algorithms, the position of the mobile device can be adaptively adjusted to ensure that the camera is always aimed at the pipeline, further improving the measurement accuracy.

[0026] Furthermore, the edge detection algorithm may adopt a Canny algorithm or a Sobel algorithm.

[0027] S102, obtaining a pipeline circle based on edge coordinates; S103, calculating a first height difference between the center of the pipeline and the camera based on the pipeline circle; S104, moving and aligning the camera based on the first height difference until the first height difference is smaller than a preset alignment threshold, and outputting the height of the current camera as the height of the pipeline in the well.

[0028] Compared with the prior art, the present invention provides a method for measuring the height of a pipeline in a well. First, an edge detection algorithm is used to extract the edge features of the pipeline, and a pipeline circle that best meets the requirements is obtained based on the extracted edge features. This method can effectively filter out background noise, accurately identify the pipeline, improve the robustness of the algorithm, and reduce the need for manual intervention. Then, a directional movement strategy is formulated based on the direction of the center of the circle in the image. This strategy can guide the mobile device to move in the correct direction so that the camera can capture the pipeline image more accurately, thereby improving the stability and reliability of the measurement. In addition, traditional pipeline height measurement methods may rely on manual measurement or the use of complex physical sensors, while the present invention applies machine vision technology to pipeline height measurement, providing a non-contact, automated measurement method that improves the efficiency and accuracy of the measurement. It effectively solves the problem that the prior art is easily affected by the well environment, resulting in reduced measurement accuracy.

[0029] like Figure 2 In a possible implementation, step S101 includes: S201, grayscale processing is performed on the first image data to obtain second image data; S202: Perform edge recognition on the second image data based on an edge detection algorithm.

[0030] like Figure 3 In a possible implementation, step S102 includes: S301, performing circle fitting on edge coordinates to obtain a number of pipeline circles to be determined; S302, calculating the diameters of a number of pipeline circles to be determined, and retaining pipeline circles to be determined whose diameters are not greater than a preset diameter threshold; S303, respectively calculating the error value between the diameter of each retained pipeline circle to be determined and the pipeline diameter; S304: The pipeline circle to be determined with the smallest error value is used as the pipeline circle.

[0031] It should be noted that the present invention uses an edge detection algorithm to extract the edge features of the pipeline, and calculates the pipeline diameter through a circle fitting algorithm. This method can effectively filter out background noise, accurately identify the pipeline, and improve the robustness of the algorithm. After identifying multiple possible pipeline circles, the present invention calculates the difference between the circle diameter and the pipeline diameter, and sets a threshold to screen out the pipeline circle that best meets the requirements. At the same time, by calculating the direction of the center of the circle in the image, the optimal pipeline can be automatically located, reducing the need for manual intervention.

[0032] like Figure 4 In a possible implementation, step 103 includes: S401, calculating a second height difference between the center of the pipeline circle and the center of the image in the image based on the first formula; S402, calculating a first height difference based on the second height difference; Among them, the first formula includes: (1) In formula (1), the image y The positive direction of the axis is vertically downward. H 圆心 is the second height difference between the center of the circle and the center of the image, Y 圆心 is the center of the circle in the image y Axis coordinates, H pixel is the vertical resolution of the first image data.

[0033] In a possible implementation, step S402 includes: Substituting the second height difference into the second formula for calculation, the first height difference is obtained; The second formula includes: (2) In formula (2), D is the angle difference between the center of the pipe and the camera, HFOV is the vertical field of view of the camera, H pixel is the vertical resolution of the first image data, P is the first height difference between the center of the pipeline and the camera device, R 井 is the shortest distance from the camera to the well wall.

[0034] like Figure 5 In a possible implementation, step S104 includes: S501, determining whether the first height difference is less than a preset alignment threshold; S502: If it is less than, directly output the height of the current camera as the height of the pipeline in the well; S503: If it is not less than, further move and align according to the upper and lower positions of the center of the pipeline circle in the image.

[0035] like Figure 6 In a possible implementation, step S503 includes: S601, determining whether the center of the circle is above the image; S602: If yes, move the camera upward by any distance and reacquire the first image data until the first height difference is less than the alignment threshold; S603: If not (ie, the center of the circle is at the bottom), continue to move the camera downward by any distance and reacquire the first image data until the first height difference is less than the alignment threshold.

[0036] The present invention develops a directional movement strategy according to the direction of the center of the circle in the image, which can guide the mobile device to move in the correct direction so that the camera can capture the pipeline image more accurately, thereby improving the stability and reliability of the measurement.

[0037] like Figure 7 The present invention also provides a device 70 for measuring the height of a pipeline in a well, comprising: The edge recognition module 710 is used to perform edge recognition on the first image data of the well pipe acquired by the camera based on the edge detection algorithm to obtain a plurality of edge coordinates; A circle fitting module 720, for obtaining a pipe circle based on edge coordinates; A height calculation module 730, configured to calculate a first height difference between the center of the pipeline and the camera based on the pipeline circle; The mobile alignment module 740 is used to move and align the camera based on the first height difference until the first height difference is less than a preset alignment threshold, and output the current camera height as the height of the pipeline in the well.

[0038] like Figure 8 As shown, the present invention further provides an electronic device 80, comprising: A memory 810, used for storing programs; The processor 820 is coupled to the memory 810 and is used to execute the program stored in the memory 810 to implement the steps of the method for measuring the height of the pipeline in the well described in any one of the above embodiments.

[0039] Figure 8 Only some of the components of the electronic device 80 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0040] In some embodiments, the processor 820 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 810, such as the method for measuring the height of a pipeline in a well in the present invention.

[0041] In some embodiments, the processor 820 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 820 may be local or remote. In some embodiments, the processor 820 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.

[0042] In some embodiments, the memory 810 may be an internal storage unit of the electronic device 80, such as a hard disk or memory of the electronic device 80. In other embodiments, the memory 810 may also be an external storage device of the electronic device 80, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 80.

[0043] Furthermore, the memory 810 may include both an internal storage unit of the electronic device 80 and an external storage device. The memory 810 is used to store application software installed in the electronic device 80 and various data.

[0044] In one embodiment, when the processor 820 executes the pipeline height measurement program in the memory 810, the following steps may be implemented: Performing edge recognition on first image data of the pipeline in the well acquired by the camera based on an edge detection algorithm to obtain a plurality of edge coordinates; Get the pipe circle based on the edge coordinates; A first height difference between the center of the pipeline and the camera is calculated based on the pipeline circle; The camera is moved and aligned based on the first height difference until the first height difference is less than a preset alignment threshold, and the height of the current camera is output as the height of the pipeline in the well.

[0045] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 80 mentioned, and the electronic device 80 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 80 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0046] The present invention also provides a storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the method for measuring the height of a pipeline in a well as described in any one of the above-mentioned method items.

[0047] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer storage medium, wherein the computer storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0048] The above is a detailed introduction to the method, device, electronic device and storage medium for measuring the height of a pipeline in a well provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for measuring the height of a pipeline in a well, characterized in that: include: Performing edge recognition on first image data of the pipeline in the well acquired by the camera based on an edge detection algorithm to obtain a plurality of edge coordinates; Obtaining a pipeline circle based on the edge coordinates; A first height difference between the center of the pipeline and the camera is calculated based on the pipeline circle; The camera is moved and aligned based on the first height difference until the first height difference is less than a preset alignment threshold, and the height of the current camera is output as the height of the pipeline in the well.

2. The method for measuring the height of a pipeline in a well according to claim 1, characterized in that: The edge recognition of the first image data of the well pipe acquired by the camera based on the edge detection algorithm includes: Performing grayscale processing on the first image data to obtain second image data; Perform edge recognition on the second image data based on the edge detection algorithm.

3. The method for measuring the height of a pipeline in a well according to claim 1, characterized in that: The step of obtaining the pipeline circle based on the edge coordinates includes: Performing circle fitting on the edge coordinates to obtain a plurality of pipeline circles to be determined; Calculating the diameters of the plurality of pipeline circles to be determined, and retaining the pipeline circles to be determined whose diameters are not greater than a preset diameter threshold; Calculate the error value between the diameter of each retained pipeline circle to be determined and the pipeline diameter respectively; The pipeline circle to be determined with the smallest error value is taken as the pipeline circle.

4. The method for measuring the height of a pipeline in a well according to claim 1, characterized in that: The step of calculating a first height difference between the center of the pipeline and the camera based on the pipeline circle includes: Based on the first formula, a second height difference between the center of the pipeline circle and the center of the image is calculated; Calculate a first height difference based on the second height difference; Wherein, the first formula includes: In the formula, the image y The positive direction of the axis is vertically downward. H 圆心 is the second height difference between the center of the circle and the center of the image, Y 圆心 is the center of the circle in the image y Axis coordinates, H pixel is the vertical resolution of the first image data.

5. The method for measuring the height of a pipeline in a well according to claim 4, characterized in that: The calculating the first height difference based on the second height difference comprises: Substituting the second height difference into the second formula for calculation, to obtain the first height difference; Wherein, the second formula includes: In the formula, D is the angular difference between the center of the pipe and the camera, HFOV is the vertical field of view of the camera, H pixel is the vertical resolution of the first image data, P is the first height difference between the center of the pipeline and the camera device, R 井 is the shortest distance from the camera to the well wall.

6. The method for measuring the height of a pipeline in a well according to claim 1, characterized in that: The step of moving and aligning the camera based on the first height difference comprises: Determining whether the first height difference is less than a preset alignment threshold; If it is less than, the height of the current camera is directly output as the height of the pipeline in the well; If it is not less than, further move and align according to the upper and lower positions of the center of the pipeline circle in the image.

7. The method for measuring the height of a pipeline in a well according to claim 6, characterized in that: The further moving alignment according to the upper and lower positions of the center of the pipeline circle in the image includes: Determine whether the center of the circle is above the image; If yes, move the camera upwards by an arbitrary distance and reacquire the first image data until the first height difference is less than the alignment threshold; If not, continue to move the camera downward by any distance and reacquire the first image data until the first height difference is less than the alignment threshold.

8. A device for measuring the height of a pipeline in a well, characterized in that: include: An edge recognition module is used to perform edge recognition on the first image data of the well pipe acquired by the camera based on an edge detection algorithm to obtain a plurality of edge coordinates; A circle fitting module, used for obtaining a pipeline circle based on the edge coordinates; A height calculation module, used for calculating a first height difference between the center of the pipeline and the camera based on the pipeline circle; The mobile alignment module is used to move and align the camera based on the first height difference until the first height difference is less than a preset alignment threshold, and output the current camera height as the height of the pipeline in the well.

9. An electronic device, characterized in that: include: Memory, used to store programs; A processor is coupled to the memory and is used to execute the program stored in the memory to implement the method for measuring the height of a pipeline in a well as described in any one of claims 1 to 7.

10. A storage medium, characterized in that: Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the method for measuring the height of a pipeline in a well as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Road manhole cover height difference identification method and device based on computer vision

    CN112883778A

  • Well lid elevation difference information acquisition method, device and system

    CN112907739A

  • Road well frame difference measuring method

    CN113362284A

  • Method of measuring curvature and mapping of underground pipeline using vision

    KR101607078B1