A method of electrical power downhole surveying with machine instead of human

By using intelligent image recognition technology and robotic surveying methods, the problems of inconsistent information, high difficulty, and low safety in power well surveying have been solved. Real-time monitoring and assessment of the underground environment of power wells have been achieved, improving surveying efficiency and safety.

CN119445251BActive Publication Date: 2025-12-12STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411601286.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-12-12
Estimated Expiration
2044-11-11

AI Technical Summary

Technical Problem

Existing technologies for power well surveying suffer from problems such as inconsistent system information, high difficulty in downhole surveying, high safety risks, frequent and time-consuming operations. They are particularly unsuitable for power wells with no obvious water accumulation or shallow water accumulation and large channel-type power wells, and cannot provide cable markings and text information.

Method used

By employing intelligent image recognition technology, utilizing Raspberry Pi, high-definition cameras, digital servos, and extendable poles, combined with OpenCV and Raspberry App, real-time monitoring and remote operation of the underground environment in power wells are achieved. Image data is collected through Python programs to perform QR code recognition, text recognition, and borehole location recognition on cable nameplates, thereby establishing an underground environment assessment system.

Benefits of technology

It has enabled safe, fast, and effective downhole power surveying, reduced the safety risks of manual downhole operations, improved surveying efficiency and accuracy, and established a complete downhole environment assessment system to support cable management and fault diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445251B_ABST
    Figure CN119445251B_ABST
Patent Text Reader

Abstract

The application relates to a power downhole surveying method replacing manual work with machines, belonging to the field of measurement. The method applies intelligent image recognition technology to downhole surveying work of a power well, takes a raspberry as a core, is supplemented with a high-definition camera, a digital steering engine and a telescopic long rod, realizes real-time monitoring, scene recording and remote operation of a downhole environment of the power well, realizes tracking of the downhole environment through automatic tracking of Open CV or through operation of a raspberry APP on a mobile phone, realizes instant presentation of images on the mobile phone through API collection of image data by a Python program, and improves operation and maintenance efficiency. The method replaces manual downhole surveying with machines, perceives and surveys a limited space through man-machine interaction, reduces safety risks faced by manual downhole surveying, avoids occurrence of various personal accidents, and improves safety of downhole surveying operation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of exploration and measurement of power wells, and particularly relates to a downhole surveying method for a power well. BACKGROUND

[0002] With the continuous development of economic construction, the pace of urban construction is increasing. In order to adapt to the development of urban planning and the construction needs of municipal transportation facilities, the laying of cables in power wells is increasingly complex. How to strengthen and improve the scientific management level of power wells, and comprehensively and accurately grasp the distribution of power wells and cables in the wells, is a problem that has been faced. This is not only the need to adapt to urban development and modern urban management, but also an important prerequisite for strengthening and improving the management level of power cables, quickly identifying power wells and cables in the wells, promptly troubleshooting, improving power grid safety, and ensuring normal power use of various users.

[0003] Underground cables are mainly laid in the form of laying in power well pipes. There are a large number of interlaced and adjacent situations with various pipelines such as communication, gas, water supply, and drainage. Although each power line and each power well has established corresponding technical archives and drawing materials. However, due to the replacement of management personnel, various construction operations and other factors, the original technical archives, drawings and on-site conditions often do not match, affecting the exploration and design, and leading to the inability to truly play a supporting, guiding and monitoring role.

[0004] Downhole field survey of power wells is carried out before, during and after the implementation of the pipe project. However, the following problems have always existed:

[0005] 1. The system cable account does not match the actual situation. The information in PMS may not be consistent with the actual situation on site, which brings a large amount of field survey workload to the design stage.

[0006] 2. Downhole surveying is difficult. Underground pipes need to open manhole covers, and the downhole operation environment is complex and variable.

[0007] 3. Downhole surveying is frequent. If there is no convenient way, it will consume a lot of time resources and human costs.

[0008] 4. Safety requirements for downhole surveying in limited space are high. Downhole operations require multiple processes such as poison detection, explosion detection, and air exhaust. If personnel go downhole, they need to wear gas masks and safety ropes.

[0009] During the project site reconnaissance stage, how to safely, quickly and effectively survey the downhole situation is a problem that needs to be solved.

[0010] The invention patent application with the application publication date of October 27, 2023 and the application publication number of CN 116953673 A discloses an underwater surveying sonar for power well, which comprises a top plate, a support arm is arranged around the top plate, a rod body is arranged below the top plate, an elbow plate is arranged at the bottom end of the rod body, a rotating steering engine is arranged on the outer side of the elbow plate, a sonar is rotatably arranged in the elbow plate, a probe is arranged at the end of the sonar, the output end of the rotating steering engine is connected with the sonar through the elbow plate, and the rotating steering engine can drive the sonar to rotate on the elbow plate. The technical scheme realizes the surveying of the working condition of the cable in the power well without using manual well drilling and discharging the accumulated water in the power well, and achieves the purpose of improving the working efficiency.

[0011] The technical scheme focuses on underwater surveying of the power well in the accumulated water state, the sonar performs multi-directional surveying and scanning on the inside of the power well, and transmits the scanned information to the master control platform, the master control platform completes imaging of the power well through the transmitted information, which can reduce the pumping time for surveying the underwater power well after pumping and the ventilation time of the underwater power well, but it is not suitable for the power well or large channel type power well without obvious accumulated water or with shallow accumulated water, and the collected image is an image composed of sonar echoes, which can only represent the contour of the underwater object and cannot provide more relevant information about the cable laid in the power well (such as cable markings, cable labels or relevant text information printed on the outer surface of the cable). SUMMARY

[0012] The technical problem to be solved by the present application is to provide a power well surveying method replacing manual work with machines. The intelligent image recognition technology is applied to the well surveying work of the power well, a raspberry pi is used as the core, supplemented by a high-definition camera, a digital steering engine and a telescopic long rod, real-time monitoring, scene recording and remote operation of the environment in the power well are realized, the Open CV automatic tracking or the raspberry APP operation on the mobile phone end is used to realize tracking of the environment in the well, the Python program is used to collect image data through the API to realize instant presentation of the image on the mobile phone end, and the operation and maintenance efficiency is improved.

[0013] The technical scheme of the present application is to provide a power well surveying method replacing manual work with machines, which is characterized by:

[0014] The intelligent image recognition technology is applied to the well surveying work of the power well;

[0015] The well surveying work comprises field image collection, cable nameplate two-dimensional code recognition, cable nameplate text information recognition and cable hole position recognition;

[0016] The power downhole survey method takes raspberry as the core, is supplemented with high-definition camera, digital steering engine and telescopic long rod, realizes real-time monitoring, scene recording and remote operation of the power downhole environment.

[0017] Through Open CV automatic tracking or through the operation of the raspberry APP on the mobile phone, the tracking of the downhole environment is realized.

[0018] The Python program collects image data through API, realizes the instant presentation of the image on the mobile phone, and improves the operation and maintenance efficiency.

[0019] Specifically, the raspberry, high-definition camera, digital steering engine and telescopic long rod constitute an image data acquisition module, which realizes real-time monitoring, scene recording and remote operation of the power downhole environment.

[0020] Specifically, the image data acquisition module is arranged at the lower end of the telescopic long rod; the upper end of the telescopic long rod is fixed on the top of a tripod.

[0021] Further, the tripod adopts an inverted structure of the central axis.

[0022] Specifically, the digital steering engine is a two-dimensional shooting holder; the two-dimensional shooting holder drives the mainboard box containing the raspberry and high-definition camera to rotate or swing horizontally and vertically by 360 degrees.

[0023] Specifically, the telescopic long rod is controlled by a worm gear and brush reduction motor, and is additionally provided with a winding wheel and 0.8mm steel wire, and is lowered by relying on the self-weight of the steel wire and is raised by relying on the torsion of the motor to wind the steel wire.

[0024] Specifically, the power downhole survey method applies image recognition technology to cable nameplate two-dimensional code recognition, character recognition and hole position recognition process, realizes the positioning of the downhole nameplate and existing hole position through image detection of opencv, and increases the two-dimensional code recognition function, and the two-dimensional code information that can be read is the two-dimensional code information generated in the library; by establishing an environment evaluation index taking gas content, water immersion, cable nameplate and hole position information as the key information, a complete downhole environment evaluation system is constructed.

[0025] Further, the downhole environment evaluation system can comprehensively evaluate the environment of the power well by scoring each index, and obtain a comprehensive evaluation score to determine whether the environment of the power well is safe, effective and compliant.

[0026] Specifically, the power downhole survey method realizes the replacement of manual power downhole survey by machines through the following steps:

[0027] 1) Data collection:

[0028] Collecting power well image data, including cable nameplate and cable hole position information, etc., to construct an image dataset;

[0029] 2) Data preprocessing:

[0030] Preprocessing the collected images, including image enhancement, noise removal, image alignment, etc., to improve the accuracy and robustness of subsequent recognition;

[0031] 3) Feature extraction:

[0032] Extracting useful features from the preprocessed images, such as texture, color, shape, etc., so that the subsequent classifier can better identify the target;

[0033] 4) Classifier design:

[0034] Designing a suitable classifier model according to the feature extraction results; recognizing cable nameplates and cable hole positions;

[0035] 5) Model training:

[0036] Training the classifier model using the dataset to enable it to accurately classify cable nameplates and cable hole positions;

[0037] 6) Application practice:

[0038] Applying the trained model to actual scenarios for automated recognition of cable nameplates and cable hole positions, improving the efficiency and accuracy of power well image analysis.

[0039] Further, in the model training phase, a deep learning model is trained using TensorFlow Lite for target detection and classification;

[0040] The classifier model includes a support vector machine, neural network, and other classifier models.

[0041] Compared with the prior art, the advantages of the present application are:

[0042] 1. The technical solution of the present application replaces manual underground surveying with machines, reducing the safety risks faced by manual underground surveying;

[0043] 2. The technical solution of the present application uses human-computer interaction to perceive and survey the limited space, does not require professional downhole personnel, does not need to carry safety tools, and can minimize safety risks to the greatest extent, avoiding various accidents and improving the safety of underground surveying operations;

[0044] 3. The technical solution of this invention applies image recognition technology to the process of cable nameplate QR code recognition, text recognition, and hole location recognition. It uses OpenCV image detection to locate the nameplate and existing hole locations in the well, and adds a QR code recognition function, capable of reading QR code information generated from the database. This helps to establish environmental assessment indicators with gas content, water immersion conditions, cable nameplates, and hole location information as key information, constructing a complete well environment assessment system. By scoring various indicators, the environmental condition of the power well can be comprehensively evaluated, resulting in a comprehensive assessment score, which determines whether the environment of the power well is safe, effective, and compliant.

[0045] 4. The technical solution of the present invention has the characteristics of improved safety, enhanced practicality and greater scalability. Its structure is formed by 3D printing, which has strong product iteration capability. The product can be redesigned or adjusted at any time according to different field requirements to meet different field needs and make rapid updates and iterations. Attached Figure Description

[0046] Figure 1 This is a schematic diagram of the downhole exploration device of the present invention;

[0047] Figure 2 This is a schematic diagram of the Raspberry Pi structure of the present invention;

[0048] Figure 3 This is a schematic diagram of the spatial transformation principle of the present invention;

[0049] Figure 4 This is a schematic diagram of the overall downhole exploration system of the present invention.

[0050] In the diagram, 1 is a tripod, 2 is a telescopic pole, 3 is a stepper motor, 4 is a motherboard box, and 5 is a camera. Detailed Implementation

[0051] The invention will now be further described with reference to the accompanying drawings.

[0052] Intelligent surveying equipment can be used in underground work environments with unsafe factors to complete corresponding survey work. It not only solves the safety problem of construction personnel, but also greatly saves labor costs and greatly improves the efficiency of underground work after the technology matures and becomes modular.

[0053] The goal of this technical solution is to replace manual downhole exploration with machines, thereby reducing the safety risks faced by manual downhole exploration.

[0054] The main core component used in the technical solution is Raspberry Pi (abbreviation: RPi, alias: RasPi / RPI, a microcomputer designed for computer programming education, only the size of a credit card, and its system is based on Linux). Raspberry Pi is a simple processor based on Linux programming language, uses SD card as internal hard disk, and uses USB interface around the card as connection, and has video analog signal TV output interface and HDMI high-definition video output interface.

[0055] The device basis of the technical solution is derived from the combination of the above components. The operation platform and visual interface are integrated to operate the direction and photography of the probe in the well, including certain lens recognition function (mainly realized by Python programming) to confirm the hole position in the pipeline, identify the cable nameplate, and evaluate the cable environment, etc., which originally requires manual well surveying. The surveying arm of the probe uses an operable telescopic rod to realize the surveying in the well.

[0056] Specifically, as shown in Figure 1 In the technical solution, a tripod structure (using an inverted central axis structure) is arranged on the ground, a telescopic rod with adjustable length is arranged at the top of the tripod, the upper end of the telescopic rod is connected with the top of the tripod, and a mainboard box is arranged at the lower end of the telescopic rod.

[0057] The telescopic rod is controlled by a worm gear and brush reduction motor, and is additionally provided with a winding wheel and 0.8mm steel wire, which is lowered by self-weight and is wound by motor torsion to realize upward movement.

[0058] At least one stepper motor is arranged on the mainboard box to constitute a digital rudder (or two-dimensional shooting holder), which drives the mainboard box to rotate or swing horizontally and / or vertically by 360 degrees.

[0059] A mainboard of Raspberry Pi is arranged in the mainboard box, and a camera is arranged on one side of the mainboard box.

[0060] The camera is a high-definition camera.

[0061] The tripod is used to build a stable base to bear the weight of the entire downhole surveying device and build the reference point of the downhole surveying device.

[0062] The telescopic rod is used to extend the mainboard box and its related accessories into the power well and adjust the specific height of the mainboard box, and also serves as the reference point for left and right rotation or up and down pitching of the mainboard box.

[0063] The camera is used for shooting the optical image of the power well and transmitting the image to the Raspberry Pi for corresponding data processing.

[0064] Around the camera, a lighting device for assisting shooting can also be provided to provide auxiliary light source for underground shooting.

[0065] The lighting device is a group of light-emitting diodes.

[0066] The Raspberry Pi, camera, telescopic long rod and stepper motor constitute an image data acquisition module.

[0067] The image data acquisition module takes Raspberry Pi as the core, supplemented by high-definition camera, digital steering engine and telescopic long rod, to realize real-time monitoring, scene recording and remote operation of the power underground environment.

[0068] The Raspberry Pi is installed with Ubuntu system and set with real-time hotspot to realize the interaction between device data and mobile phone APP.

[0069] The image data acquisition module device tracks the underground environment through OpenCV (Open Source Computer Vision Library, a cross-platform computer vision and machine learning software library based on Apache2.0 license (open source), which can run on Linux, Windows, Android and Mac OS operating systems. It is composed of a series of C functions and a small amount of C++ classes, and provides interfaces for Python, Ruby, MATLAB and other languages, realizing many general algorithms in image processing and computer vision) automatic tracking, or through the operation of raspberry APP on the mobile phone end; Python program collects image data through API to realize the instant presentation of image on the mobile phone end, improving the operation and maintenance efficiency.

[0070] The image data acquisition module is used to realize the following functions:

[0071] 1) Data acquisition: collect power well image data, including cable nameplate and cable hole position information, etc., to build image data set.

[0072] 2) Data preprocessing: preprocess the collected image, including image enhancement, noise removal, image alignment, etc., to improve the accuracy and robustness of subsequent recognition.

[0073] 3) Feature extraction: extract useful features from the preprocessed image, such as texture, color, shape, etc., so that the subsequent classifier can better identify the target.

[0074] 4) Classifier Design: Based on the feature extraction results, design appropriate classifier models such as Support Vector Machines, Neural Networks, etc. to recognize cable nameplates and cable hole positions.

[0075] 5) Model Training: Train the classifier model using the dataset to enable accurate classification of cable nameplates and cable hole positions.

[0076] 6) Application Practice: Apply the trained model to actual scenarios for automated recognition of cable nameplates and cable hole positions, improving the efficiency and accuracy of power well image analysis.

[0077] The structure of the Raspberry Pi is shown in Figure 2 .

[0078] Specifically, on the mainboard of the Raspberry Pi, a dual-frequency wireless Bluetooth chip, a power management chip, a BCM2711 quad-core CPU chip, a memory chip, a network card chip, and a USB management chip are arranged. Around the mainboard, a display screen interface, a power supply interface, an HDMI (High Definition Multimedia Interface) interface, a camera interface, a 3.5mm audio interface, a USB2.0 interface, and a USB3.0 interface are arranged.

[0079] The controller of the Raspberry Pi and other robots is essentially different, because the Raspberry Pi has a perfect operating system (others only have a control system) and supports Python very well. Therefore, using Python language can quickly develop software on the Raspberry Pi to control the sensors of the robot. The Raspberry Pi has another advantage that it can run artificial intelligence related algorithms, such as running SVM (Support Vector Machine) on it, which can simply classify data.

[0080] A、In this technical solution, the following related calculation mode is adopted:

[0081] 1) Spatial transformation principle:

[0082] As shown in Figure 3 , in this technical solution, through triangular variation, the root angle (two-dimensional shooting gimbal) and the x, y coordinate conversion of the camera position can be obtained:

[0083]

[0084] 2) Automatic object recognition:

[0085] The object recognition function is implemented through the opencv function library. Although the method of hsv segmentation binary image makes the recognized object simple and strict, the accuracy of recognition is greatly improved, and the speed can withstand the test of raspberry pi.

[0086] 3) 3D printing technology:

[0087] 3D printing technology is an additive manufacturing method that "starts from nothing", which mainly slices the three-dimensional digital model, then prints each cross section layer by layer, and simplifies the complex three-dimensional model to planar graph manufacturing. This makes 3D printing technology can use more mature planar processing technology, layer by layer printing, and finally complete the manufacturing of the whole model.

[0088] In this technical solution, most of the parts suitable for the downhole surveying device are printed by FDM printer, including connecting pieces, main body, rotating gimbal, etc.

[0089] Image recognition technology based on Raspberry Pi:

[0090] Raspberry Pi is a small single-board computer with powerful performance and functions, which can be used for image recognition and processing tasks. Here are some image recognition technologies based on Raspberry Pi:

[0091] OpenCV: OpenCV is an open-source computer vision library that supports multiple platforms, including Raspberry Pi. It can be used for image processing, object detection, feature extraction, face recognition, and other applications.

[0092] TensorFlow Lite: TensorFlow Lite is a lightweight machine learning framework that can run on Raspberry Pi. It supports image classification, object detection, segmentation, and other tasks, and provides pre-trained models and model conversion tools to make model deployment easier.

[0093] Caffe: Caffe is a popular deep learning framework that can run on Raspberry Pi. It supports multiple neural network models and provides pre-trained models for image classification, object detection, semantic segmentation, and other tasks.

[0094] PyTorch: PyTorch is another popular deep learning framework that can run on Raspberry Pi. It provides an easy-to-use interface and flexible network definition method, supporting multiple neural network models and image processing tasks.

[0095] These technologies can be implemented on Raspberry Pi through Python programming language.

[0096] B, the overall structure of the system of the present invention is shown in Figure 4 .

[0097] The underground surveying device based on 3D printing and intelligent image recognition mainly consists of a mechanical system and a video transmission system. The communication module is used to exchange data and transmit instructions between the systems.

[0098] The mechanical control system is the main management part of the entire underground surveying device operation process, which includes vertical lifting motor, horizontal rotating motor, vertical rotating motor, controller, display screen, etc.

[0099] The operator mainly interacts with the entire device through the controller and views the results; the power management part is responsible for the charge and discharge management of the overall power supply battery and the stable voltage output of the power supply; the image sensor is responsible for identification and image information collection with the corresponding algorithm; the communication module part is responsible for data and instruction analysis, encoding, compression, transmission, etc.

[0100] C. Image recognition system design scheme:

[0101] 1) Hardware selection

[0102] Select the appropriate Raspberry Pi model and camera for the application scenario. The performance and memory capacity of Raspberry Pi will affect the speed and efficiency of recognition, and the resolution and frame rate of the camera will affect the accuracy and real-time performance of recognition.

[0103] This technical solution selects Raspberry Pi 4B and a USB camera that supports a maximum resolution of 1080p and a frame rate of 30fps.

[0104] 2) Software selection:

[0105] Select the appropriate image processing and machine learning framework for the application scenario. The appropriate algorithm and model need to be selected according to the specific task, and implemented through Python programming language.

[0106] This technical solution selects OpenCV and TensorFlow Lite as the image processing and machine learning framework, and implements it through Python programming language.

[0107] 3) Data set preparation:

[0108] Prepare appropriate data sets for training and testing models. The diversity and quantity of the data set need to be ensured to improve the accuracy of recognition.

[0109] This technical solution prepares image data sets containing various underground scenes, cable nameplates, etc., including front, side, different angles, and different lighting conditions. Data augmentation techniques are used to increase the diversity of the data set.

[0110] 4) Model training and optimization:

[0111] Train a suitable model based on the dataset, and improve the accuracy and efficiency of recognition by optimizing the algorithm and parameters.

[0112] This technical solution uses TensorFlow Lite to train a deep learning model, such as MobileNetV2 or SSD, for object detection and classification. Model size and speed are optimized through techniques such as model compression and quantization.

[0113] 5) System integration and deployment:

[0114] Integrate the model and algorithm into the Raspberry Pi image recognition system, and then deploy and test it. The system's ease of use, reliability, and security need to be considered.

[0115] This technical solution integrates models and algorithms into a Raspberry Pi system, uses OpenCV and a camera to read real-time image data, and performs object detection and classification using the model. The results are displayed on a screen or transmitted to other devices via a network.

[0116] 6) Specific methods and steps in the image recognition process:

[0117] OpenCV is an image and video processing library that includes bindings for C++, C, Python, and Java. This technical solution primarily uses Python.

[0118] OpenCV is used for various image and video analysis tasks, such as face recognition and detection, license plate reading, photo editing, advanced robot vision, optical character recognition, and more.

[0119] This technical solution requires two main libraries: python-OpenCV and NumPy.

[0120] apt-get install python3-numpy

[0121] apt-get install python3-numpy

[0122] import cv2importmatplotlibimportnumpy

[0123] 1. Remotely log in to the Raspberry Pi and first install a fully functional OenpCV vision library:

[0124] sudo apt-getupdate ensures that all software is up to date;

[0125] Install the necessary dependency libraries for compiling OpenCV using the command `sudo apt-get install build-essential`.

[0126] sudo apt-get install build-libavformat-devThis library provides a method of encoding and decoding audio and video streams.

[0127] sudo apt-get install ffmpegThis library provides the function of transcoding audio and video streams.

[0128] sudo apt-get install python-opencvOpenCV depends on the Python development package.

[0129] sudo apt-get install opencv-docInstall OpenCV development documentation.

[0130] sudo apt-get install libcv-devInstall the header files and static libraries needed to compile OpenCV.

[0131] sudo apt-get install libcvaux-devInstall more development tools to compile OpenCV.

[0132] sudo apt-get install libhighgui-devInstall another header file and static library needed to compile OpenCV.

[0133] cp -r / usr / share / doc / opencv-doc / examples / dt / Copy all examples to the root directory.

[0134] 2、Prepare the camera: Insert the CSI camera dedicated to Raspberry Pi into the CSI port of Raspberry Pi and open it in raspi-config, and then use the Raspistill command directly.

[0135] Test the camera: Copy the routine just copied to the root directory camera.py

[0136] test / dt / examples / python / camera.py / home / pi /

[0137] python camera.pyRun to see if there is a video0 device.

[0138] 3、In terms of image and video analysis, the recording method of the camera is actually frame by frame, 30-60 times per second. Therefore, image recognition and video analysis mostly use the same method.

[0139] The next step of image and video analysis boils down to simplifying the source as much as possible. This starts with converting to grayscale, it could also be a color filter, a gradient or a combination of these. From here various analysis and transformations can be performed on the source.

[0140] Generally the process is conversion, then analysis, then any overlays that one would want to apply to the original source, and that is where one can often see the "finished product" of recognizing objects displayed on a full color image or video.

[0141] However, data is rarely actually handled in this raw form.

[0142] For example, in the case of edge detection, black corresponds to a pixel value of (0,0,0) and a white line is (255,255,255). Each picture and frame in a video is broken down into pixels like this and, as with edge detection, it can be inferred that edges are where there is a contrast between white and black pixels. Then, if one wanted to see the original image with the edges marked, record all the coordinate positions of the white pixels and then mark those positions on the original image or video and one has a graphic recognition of the edges, an example of which is as follows:

[0143]

[0144]

[0145] First, import numpy and cv2. Next, cap = cv2.VideoCapture(0). The first webcam on the computer returns the video.

[0146] while(True):

[0147] ret, frame = cap.read()

[0148] This code starts an infinite loop (which will be broken later by a break statement) where ret and frame are defined as cap.read(). Basically, ret is a boolean value that represents whether there was a return and frame is each frame that is returned.

[0149] gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

[0150] Define a new variable, gray, as the frame converted to grayscale, OpenCV reads colors as BGR (blue green red).

[0151] cv2.imshow('frame', gray)

[0152] Convert to grayscale source.

[0153] if cv2.waitKey(1) & 0xFF == ord('q'):

[0154] break

[0155] This statement runs once per frame, exits the while loop, and then runs:

[0156] cap.release()

[0157] cv2.destroyAllWindows()

[0158] This will release the webcam and then close all imshow() windows.

[0159] 4\. Setting a threshold

[0160] The purpose of a threshold is to further simplify the analysis of visual data.

[0161] First, it can convert to grayscale, but grayscale still has at least 255 values.

[0162] What a threshold can do, at the most basic level, is convert everything to white or black based on a threshold. For example, if you set a threshold of 125 (out of 255), everything below 125 will be converted to 0 or black, and everything above 125 will be converted to 255 or white. If you convert to grayscale as usual, it will become white and black. If we don't convert to grayscale, we will get a binary image, but with color.

[0163] An example and different types of thresholds are used here to illustrate this.

[0164] First, try a simple threshold:

[0165] retval, threshold = cv2.threshold(img, 10, 255, cv2.THRESH_BINARY)

[0166] A binary threshold is a simple yes or no threshold, where pixels are either 255 or 0\. In many cases, this is white or black, but the color has been preserved for the image, so it is still colored.

[0167] The first argument here is the image. The next argument is the threshold, which is chosen to be 10\. The next is the maximum value, which is chosen to be 255\. The last is the threshold type, which is chosen to be THRESH_BINARY.

[0168] Typically, the threshold of 10 will be a bit off. 10 was chosen because this is a low-light picture, so a low number was chosen. Something in the 125-150 range might work best in general.

[0169] import cv2importnumpy as np

[0170] img=cv2.imread('bookpage.jpg')

[0171] retval,threshold=cv2.threshold(img,12,255,cv2.THRESH_BINARY)

[0172] cv2.imshow('original',img)

[0173] cv2.imshow('threshold',threshold)

[0174] cv2.waitKey(0)

[0175] cv2.destroyAllWindows()

[0176] The picture is a bit easier to read now, but it is still difficult to analyze programmatically and needs to be simplified further.

[0177] First, grayscale the image, then use a threshold:

[0178] import cv2importnumpy as np

[0179] grayscaled=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)

[0180] retval,threshold=cv2.threshold(grayscaled,10,255,cv2.THRESH_BINARY)

[0181] cv2.imshow('original',img)

[0182] cv2.imshow('threshold',threshold)

[0183] cv2.waitKey(0)

[0184] cv2.destroyAllWindows()

[0185] Next, try adaptive thresholding to figure out the unclear image.

[0186] import cv2importnumpy as np

[0187] th = cv2.adaptiveThreshold(grayscaled, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 115, 1)

[0188] cv2.imshow('original', img)

[0189] cv2.imshow('Adaptive threshold', th)

[0190] cv2.waitKey(0)

[0191] cv2.destroyAllWindows()

[0192] 5. Color filtering

[0193] Filter the color at the bottom of the plaque to try to show it. Convert the color to HSV, which is "hue, saturation, value". This can help us determine a more specific color using varying values based on the hue and saturation ranges:

[0194]

[0195]

[0196] Target the plaque font color. The way this works is that the human eye sees anything within the visual range, which is basically 30-255, 150-255, and 50-180.

[0197] 6. Edge detection

[0198] Edge detection is mainly used to frame the range of the detected object, such as the edge of the plaque.

[0199]

[0200]

[0201] This way, you can get a camera that can automatically detect the edges of the blue plaque of the object underground.

[0202] 7) Application of underground surveying site:

[0203] In the technical solution, the downhole survey work application scenarios of the power well mainly include:

[0204] 7.1) on-site image acquisition;

[0205] 7.2) cable nameplate two-dimensional code recognition;

[0206] 7.3) cable nameplate text information recognition;

[0207] 7.4) cable hole position recognition.

[0208] 8) The specific implementation process of the software related to the technical solution:

[0209] ① Environment building: download the ubuntu system environment decompression package, use the system tool to decompress and install to the Raspberry Pi and set the user password, then use the remote port login tool putty to realize the remote instruction operation of the Raspberry Pi. Use the config instruction to open the WIFI connection, install the Python and OPENCV environment package and execute the program file. In the Python environment, the OPENCV script programming is performed on the Raspberry Pi.

[0210] ② Image training: the hole imaging and nameplate in the downhole photo are extracted for algorithm training, the circle in OPENCV is used to detect the hole, and the continuous hole is defined as the target, the algorithm accuracy is improved, the rectangular edge detection is performed using the rectangle detection rec, and the accuracy is increased according to the length-width ratio 800*600 and the color of the nameplate. The gray image is obtained using CV2.cvtcolor, BGR2GRAY, the background details are blurred using bilateralFilter to increase the recognition accuracy, the edge detection is performed using edged to realize simple outlining, the images after filtering are traversed, and a rectangular blue frame is drawn around the detection result.

[0211] ③ Function logic: the images of the downhole hole and the nameplate in the real-time image are recognized, and the hole and the nameplate recognition information in the real-time photographed photo are compared with the existing information in the library. The py.zbar package is imported to recognize the two-dimensional code, the image is decoded to realize simple two-dimensional code recognition, and a rectangular frame is also used for marking. At the same time, the information is uploaded to the database SQL for comparison with the existing information.

[0212] ④ Transmission unit: the image transmission tool (Qopen, HLS, etc.) is downloaded on the mobile phone, the RTMP server image of the Raspberry Pi is connected, and the real-time image display of the Raspberry Pi to the mobile phone is realized in the same WIFI, and the nameplate reading is realized.

[0213] ⑤ Result saving: the background generates a saomiao folder containing the screenshot of the photographed hole and the scanned two-dimensional code information.

[0214] 9) Establish a downhole environment evaluation system:

[0215] The downhole environment of power is complex, with a large number of cables, pipelines and other equipment, and the location and layout of these equipment are often very complex, and the downhole environment in different areas also has great differences, which brings certain difficulties to the survey. At the same time, the amount and quality of the data collected by the downhole survey are different, and the collected data need to be effectively processed and analyzed to extract useful information, and due to the limitation of the survey environment, the collected data are usually not complete and need to be supplemented and corrected by various ways.

[0216] In order to solve these difficulties, a standardized power downhole evaluation system needs to be established to conduct rapid, efficient and accurate survey of the power downhole, so as to improve the accuracy and efficiency of the survey, reduce the cost and risk of the survey, and provide basis for cable laying and maintenance.

[0217] The main purposes of establishing the power downhole environment evaluation system are as follows:

[0218] 9.1) Improve safety. The establishment of the evaluation system can comprehensively evaluate the environmental conditions of the power downhole, including the content of toxic and harmful gases, water immersion, cable nameplate information, cable hole position accuracy and other indicators, and evaluate the safety of the power downhole environment, so as to improve the safety of the power downhole.

[0219] 9.2) Promote standardized management. The establishment of the evaluation system can standardize the management of the power downhole, evaluate the pre-survey, mid-term operation and maintenance, and post-accounting archiving, and forcibly require each link to operate according to the standard, so as to promote the standardized management of the power downhole.

[0220] 9.3) Ensure production efficiency. The establishment of the evaluation system can timely find out the environmental problems of the power downhole, ensure the normal operation of the power downhole, and avoid the influence of environmental problems on production efficiency.

[0221] Further, the power downhole environment evaluation system needs to include the following indicators:

[0222] Toxic and harmful gas content: For the power downhole, the monitoring of gas content is very important, including the concentration, temperature and humidity of toxic and harmful gases. It is necessary to lay gas detection instruments in the downhole to monitor the concentration of harmful gases in the air in real time, including carbon monoxide, carbon dioxide, oxygen and methane.

[0223] Water immersion: If water immersion occurs in the power downhole, it will seriously affect the operation of the equipment, and even cause damage to the electrical equipment. Therefore, the water level in the downhole needs to be monitored in real time, and waterproof measures need to be taken to ensure the safe operation of the equipment.

[0224] Cable nameplate information: The cable nameplate information in the power well needs to include the cable model, rated voltage, current, conductor material, insulation material, etc. These information is crucial for the maintenance and management of cable equipment, and can be identified and recorded through the nameplate information for future maintenance and management.

[0225] Cable hole position accuracy: In the power well, the accuracy of the cable hole position is very important. If the hole position is offset or inaccurate, it will seriously affect the operation and service life of the cable. Therefore, the cable hole position needs to be located and surveyed to ensure accurate hole position.

[0226] According to the above indicators, an evaluation scoring table of the evaluation system is designed as follows:

[0227]

[0228]

[0229] For the content of toxic and harmful gases, 1-5 points can be given according to the concentration of toxic and harmful gases in the air, temperature, humidity, etc. The higher the score, the lower the content of toxic and harmful gases in the air, and the better the air quality.

[0230] For water immersion, 1-5 points can be given according to the water level in the well. The higher the score, the lower the water level in the well, and the better the water immersion.

[0231] For cable nameplate information, 1-5 points can be given according to the accuracy and completeness of identifying cable nameplate information compared with the information in the PMS system. The higher the score, the more accurate and complete the cable nameplate information.

[0232] For cable hole position accuracy, 1-5 points can be given according to the accuracy and completeness of the cable hole position compared with the information in the PMS system. The higher the score, the more accurate and complete the cable hole position.

[0233] By scoring each indicator, the environmental conditions of the power well can be comprehensively evaluated, and a comprehensive evaluation score can be obtained to determine whether the environment of the power well is safe, effective, and compliant.

[0234] At the same time, the establishment of this system helps to more comprehensively evaluate the underground environment, timely discover and solve environmental and information problems, improve production efficiency and safety, and has important significance for achieving lean management.

[0235] The technical scheme of the present application takes Raspberry Pi single-board computer as the core, and takes Internet of Things and OpenCV as technical support to build the scheme of the power underground surveying device.The image data acquisition module takes Raspberry Pi as the core, is supplemented with a high-definition camera, a digital steering engine, an extendable long rod and a relay, realizes real-time monitoring, scene recording and remote operation of the power underground environment, installs Ubuntu system on Raspberry Pi and sets up a real-time hotspot to realize the interaction between device data and the mobile phone APP;the tracking of the device to the underground environment is realized through OpenCV automatic tracking or through the operation of the raspberry APP on the mobile phone end, the Python program collects image data through API, realizes the instant presentation of the image on the mobile phone end, and improves the operation and maintenance efficiency.

[0236] Meanwhile, the technical scheme of the present application realizes rapid manufacturing and customized design of the device by using 3D printing technology, not only can verify the design idea in time, give the space for continuous optimization, but also reduces the manufacturing cost, improves the scalability and flexibility of the device, reduces the time and error of manual operation, improves the efficiency of surveying, and brings new technical application to the underground surveying work.

[0237] In summary, the technical scheme of the present application replaces manual underground surveying with machines to reduce the safety risks faced by manual workers in underground surveying; it takes underground surveying as the core, uses Raspberry Pi and Internet of Things as technical support to realize real-time transmission of images in the power well; it uses the integration of existing technologies to increase the practicability and operability of the on-site image acquisition and recognition function; by establishing the environmental condition comprehensive evaluation index and system of the power well, it is helpful to more comprehensively evaluate the underground environment, timely find and solve the environmental and information problems, improve the production efficiency and safety, and has important significance for realizing lean management.

[0238] The present application can be widely used in the exploration and measurement field of power wells.

Claims

1. A power-based downhole exploration method that replaces manual labor with machines, characterized by: Apply intelligent image recognition technology to downhole surveying of power wells; The downhole exploration work includes on-site image acquisition, cable nameplate QR code recognition, cable nameplate text information recognition, and cable hole location recognition; The aforementioned power well exploration method uses a Raspberry Pi as its core, supplemented by a high-definition camera, digital servo motor, and telescopic pole to achieve real-time monitoring, scene recording, and remote operation of the power well environment. The downhole environment can be tracked automatically via OpenCV or operated on a mobile device via a Raspberry Pi APP. Using Python programs to collect image data via API enables real-time display of images on mobile devices, improving operational efficiency; The aforementioned power well exploration method applies image recognition technology to the processes of cable nameplate QR code recognition, text recognition, and borehole location recognition. It uses OpenCV image detection to locate the nameplates and existing borehole locations in the well, and adds a QR code recognition function, reading QR code information generated from a database. By establishing environmental assessment indicators with gas content, water immersion conditions, cable nameplates, and borehole location information as key information, a complete well environment assessment system is constructed. The aforementioned power well drilling survey method achieves power well drilling surveys by replacing manual labor with machines through the following steps: 1) Data collection: Collect image data of power wells, including cable nameplates and cable hole location information, and construct an image dataset; 2) Data preprocessing: The acquired images are preprocessed, including image enhancement, noise removal, and image alignment, to improve the accuracy and robustness of subsequent recognition. 3) Feature extraction: Useful features, including texture, color, and shape, are extracted from the preprocessed image so that the subsequent classifier can better identify the target. 4) Classifier design: Based on the feature extraction results, a classifier model was designed to identify cable nameplates and cable hole locations. 5) Model training: The classifier model is trained using the dataset to accurately classify cable nameplates and cable hole locations; 6) Application Practice: The trained model is applied to real-world scenarios to automatically identify cable nameplates and cable hole locations, improving the efficiency and accuracy of power well image analysis.

2. The electric downhole survey method using machines to replace manual labor according to claim 1, characterized in that: The Raspberry Pi, high-definition camera, digital servo motor, and telescopic pole constitute an image data acquisition module, enabling real-time monitoring, scene recording, and remote operation of the underground power well environment.

3. The electric downhole survey method using machines to replace manual labor according to claim 2, characterized in that: The image data acquisition module is located at the lower end of a retractable long rod; The upper end of the telescopic rod is fixed to the top of a tripod.

4. The electric downhole survey method using machines to replace manual labor according to claim 3, characterized in that: The tripod described above has an inverted center axis structure.

5. The electric downhole survey method using machines to replace manual labor according to claim 2, characterized in that: The digital servo motor is a two-dimensional imaging gimbal; The aforementioned two-dimensional shooting gimbal drives the motherboard box containing the Raspberry Pi and the high-definition camera to rotate or swing 360 degrees horizontally and vertically.

6. The electric downhole survey method using machines to replace manual labor according to claim 1, characterized in that: The telescopic rod is controlled by a worm gear brushed reducer motor, and is also equipped with a winding reel and 0.8mm steel wire. The descent is achieved by releasing the steel wire by its own weight, and the ascent is achieved by winding the steel wire by the motor torque.

7. The electric downhole survey method using machines to replace manual labor according to claim 1, characterized in that: The aforementioned downhole environmental assessment system comprehensively evaluates the environmental conditions of power wells by scoring various indicators, and obtains a comprehensive assessment score to determine whether the environment of the power well is safe, effective, and compliant.

8. The electric downhole survey method using machines to replace manual labor according to claim 1, characterized in that... During the model training phase, a deep learning model is trained using TensorFlow Lite for object detection and classification. The classifier models mentioned include classifier models such as support vector machines and neural networks.

Citation Information

Patent Citations

  • Underwater surveying sonar for cable well

    CN116953673A

  • Nameplate inspection method and system based on image processing technology

    CN118643824A