Oil well casing corrosion monitoring method and device based on machine vision
Through a machine vision-based method, using the Harris operator and inclined template to locate the corrosion characteristics and geometric parameters of the oil well casing, the problems of high cost and poor effect of the oil well casing in the existing technology are solved, and more accurate and reliable monitoring results are achieved.
Patent Information
- Application Number
- CN202411476242.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-03-14
AI Technical Summary
The existing oil well casing corrosion monitoring methods have high cost, poor monitoring effect, difficulty in dealing with complex environments, relying on light conditions and complex background interference.
Using a machine vision-based method, by obtaining the image of the oil well casing, using the Harris operator to locate the corrosion feature points, and positioning the corrosion geometric features based on the inclined surface template, the corrosion geometric parameters are analyzed to determine the monitoring results.
It improves the positioning and prediction accuracy of corrosion characteristics, achieves more accurate and reliable corrosion monitoring of oil well casing, reduces the need for sensor layout, and reduces workload and cost.
Smart Images

Figure CN119624858A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of corrosion detection, and in particular to a method and device for monitoring oil well casing corrosion based on machine vision. Background Art
[0002] During the exploration and development of oil fields, due to the high flow rate and various corrosive media, oil well casings are often severely corroded, which has a great impact on oil field production. The traditional methods currently used for oil well casing corrosion monitoring have the following defects: (1) Dependence on sensor placement: Conventional oil well casing corrosion monitoring methods usually require sensors to be installed on the casing surface to monitor corrosion in real time. This involves the placement and installation of sensors during oil well construction, which increases workload and costs.
[0003] (2) Difficulty in coping with complex environments: Oil wells are subject to extreme conditions such as high temperature, high pressure, and corrosive media. Traditional monitoring devices may not work properly in these harsh environments, or may require additional protection measures. This increases the complexity and cost of the device and may reduce its reliability and stability.
[0004] (3) Dependence on lighting conditions: Machine vision methods are sensitive to lighting conditions. Insufficient light or light changes may affect image quality and the accuracy of corrosion detection. In oil well environments, lighting conditions are usually unstable, especially inside and near the wellhead. There are large lighting changes and shadow problems, which may lead to false positives and false negatives in corrosion monitoring.
[0005] (4) Complex background interference: The background in the oil well environment is usually complex, with a large number of pipes, valves, pumps and other devices, which may interfere with the results of corrosion detection. Existing machine vision methods need to accurately distinguish between the corrosion area on the casing surface and the background devices, but this can be a challenging problem in complex backgrounds. Summary of the invention
[0006] The present invention provides a method and device for monitoring oil well casing corrosion based on machine vision, which is used to solve the defects of the oil well casing corrosion monitoring method in the prior art that the method needs to consume high costs and the monitoring effect is poor. The present invention can improve the positioning and prediction accuracy of corrosion characteristics in complex environments, making the monitoring results of oil well casing corrosion more accurate and reliable. At the same time, this process does not require the deployment of a large number of sensors, reducing the workload and cost.
[0007] The present invention provides a method for monitoring oil well casing corrosion based on machine vision, comprising: obtaining an image to be monitored for corrosion; the image to be monitored for corrosion is an image of the oil well casing collected by using a pre-set machine vision device; locating corrosion feature points in the image to be monitored for corrosion according to a Harris operator positioning and prediction feature algorithm; locating corrosion geometric features in the image to be monitored for corrosion based on the corrosion feature points by using an inclined template; the corrosion geometric features are used to analyze corrosion geometric parameters of oil well casing corrosion; and determining a monitoring result of oil well casing corrosion according to the corrosion geometric parameters.
[0008] According to a machine vision-based oil well casing corrosion monitoring method provided by the present invention, after locating the geometric features in the image to be monitored for corrosion based on the corrosion feature points using a bevel template, the method further includes: according to the corrosion feature points and the image to be monitored for corrosion, using a U-shaped template with parallel sides to simulate the shape of the corrosion area to obtain simulated features, and matching the simulated features with the geometric features to obtain matched features; the matched features are used to analyze the geometric parameters of the oil well casing corrosion.
[0009] According to a machine vision-based oil well casing corrosion monitoring method provided by the present invention, the machine vision device includes a camera, a lighting element, and an image acquisition card; the camera is equipped with a lens with adjustable focal length to adapt to oil well casings of different distances and sizes; the acquisition of the image to be monitored for corrosion includes: providing uniform lighting for the camera during the image capture process through the lighting element; capturing the image of the oil well casing through the camera to obtain a digital image; performing format conversion and synchronous processing on the digital image through the image acquisition card to obtain an image to be evaluated for quality; performing real-time quality evaluation on the image to be evaluated for quality, and storing the image that meets the quality requirements when the quality of the image to be evaluated for quality meets the preset quality requirements; preprocessing and image information annotation on the image that meets the quality requirements to obtain the image to be detected for corrosion; the preprocessing methods include grayscale, filtering and denoising, contrast enhancement, and distortion correction; the image information includes timestamp, device ID, and location information.
[0010] According to a machine vision-based oil well casing corrosion monitoring method provided by the present invention, the corrosion feature points in the image to be monitored for corrosion are located according to the Harris operator positioning and prediction feature algorithm, including: calculating the horizontal and vertical gradients of each pixel point of the image to be monitored for corrosion according to the Harris operator to obtain gradient information; constructing a gradient product matrix for each pixel point according to the gradient information; calculating the characteristic response value of each pixel point according to the gradient product matrix, and taking the pixel points whose characteristic response values meet a preset response threshold as detection corner points; performing non-maximum suppression on the detected corner points and screening out corner points related to corrosion features through an interpolation algorithm to obtain the corrosion feature points.
[0011] According to a machine vision-based oil well casing corrosion monitoring method provided by the present invention, the corrosion geometric features in the image to be monitored for corrosion are located using a bevel template based on the corrosion feature points, including: designing the shape and size of the bevel template according to the historical corrosion morphology data of the oil well casing; based on the corrosion feature points, applying the bevel template to the image to be monitored for corrosion according to a template matching algorithm to determine a template matching area; the template matching area is an area in the image to be monitored for corrosion whose similarity with the bevel template meets a preset similarity threshold; locating the corrosion geometric features in the image to be monitored for corrosion according to the template matching area; selecting a universal and invariant specific sub-shape to match the corrosion geometric features to determine the corrosion geometric parameters; the corrosion geometric parameters include the center, radius, area, perimeter, volume and depth of the corrosion area.
[0012] According to a machine vision-based oil well casing corrosion monitoring method provided by the present invention, the monitoring result of the oil well casing corrosion is determined according to the corrosion geometric parameters, including: standardizing the corrosion geometric parameters to obtain standardized geometric parameters; determining the current corrosion state according to the standardized geometric parameters; the current corrosion state includes the type, location and severity of corrosion; analyzing the risk of the current corrosion state to the safe operation of the oil well in combination with the working conditions and environmental factors of the oil well casing to obtain the risk level; and determining the monitoring result of the oil well casing corrosion according to the current corrosion state and the risk level.
[0013] The present invention also provides an oil well casing corrosion monitoring device based on machine vision, comprising: an acquisition module, used to acquire an image to be monitored for corrosion; the image to be monitored for corrosion is an image of the oil well casing collected by a pre-set machine vision device; a feature point positioning module, used to locate the corrosion feature points in the image to be monitored for corrosion according to a Harris operator positioning and prediction feature algorithm; a geometric feature positioning module, used to locate the corrosion geometric features in the image to be monitored for corrosion based on the corrosion feature points and using an inclined template; the corrosion geometric features are used to analyze the corrosion geometric parameters of the oil well casing corrosion; and a result determination module, used to determine the monitoring results of the oil well casing corrosion according to the corrosion geometric parameters.
[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 computer program, the machine vision-based oil well casing corrosion monitoring method 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 method for monitoring oil well casing corrosion based on machine vision as described above is implemented.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned machine vision-based oil well casing corrosion monitoring methods.
[0017] The present invention provides a method and device for monitoring oil well casing corrosion based on machine vision, the method comprising: obtaining an image to be monitored for corrosion; the image to be monitored for corrosion is an image of the oil well casing collected by a pre-set machine vision device; locating corrosion feature points in the image to be monitored for corrosion according to a Harris operator positioning and feature prediction algorithm; locating corrosion geometric features in the image to be monitored for corrosion based on the corrosion feature points using an inclined template; the corrosion geometric features are used to analyze corrosion geometric parameters of oil well casing corrosion; and determining the monitoring results of oil well casing corrosion according to the corrosion geometric parameters. The present invention can improve the accuracy of positioning and predicting corrosion features in a complex environment, making the monitoring results of oil well casing corrosion more accurate and reliable. At the same time, this process does not require the deployment of a large number of sensors, reducing workload and costs. 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 a method for monitoring oil well casing corrosion based on machine vision provided by the present invention.
[0020] Figure 2 It is a structural schematic diagram of an oil well casing corrosion monitoring 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] It should be noted that the existing technology applied to the oil well casing corrosion monitoring method can provide certain help for the oil well casing corrosion visible on the surface, but it has the following limitations (1)-(4).
[0024] (1) Dependence on sensor placement: Conventional oil well casing corrosion monitoring methods usually require sensors to be installed on the casing surface to monitor corrosion in real time. This involves the placement and installation of sensors during oil well construction, which increases workload and costs.
[0025] (2) Difficulty in coping with complex environments: Oil wells are subject to extreme conditions such as high temperature, high pressure, and corrosive media. Traditional monitoring devices may not work properly in these harsh environments, or may require additional protection measures. This increases the complexity and cost of the device and may reduce its reliability and stability.
[0026] (3) Dependence on lighting conditions: Machine vision methods are sensitive to lighting conditions. Insufficient light or light changes may affect image quality and the accuracy of corrosion detection. In oil well environments, lighting conditions are usually unstable, especially inside and near the wellhead. There are large lighting changes and shadow problems, which may lead to false positives and false negatives in corrosion monitoring.
[0027] (4) Complex background interference: The background in the oil well environment is usually complex, with a large number of pipes, valves, pumps and other devices, which may interfere with the results of corrosion detection. Existing machine vision methods need to accurately distinguish between the corrosion area on the casing surface and the background devices, but this can be a challenging problem in complex backgrounds.
[0028] Please refer to Figure 1 , Figure 1 A schematic flow chart of a method for monitoring oil well casing corrosion based on machine vision provided by the present invention.
[0029] In order to solve the technical problems existing in the prior art, the present invention provides an oil well casing corrosion monitoring method based on machine vision, comprising: 101: Acquire the image to be monitored for corrosion; the image to be monitored for corrosion is an image of the oil well casing collected by using a pre-set machine vision device.
[0030] As a preferred embodiment, the machine vision device includes a camera, a lighting element, and an image acquisition card; the camera is equipped with a lens with adjustable focal length to adapt to oil well casings of different distances and sizes; obtaining the image to be monitored for corrosion, including: providing uniform lighting for the camera through the lighting element during the image capture process; capturing the image of the oil well casing through the camera to obtain a digital image; performing format conversion and synchronous processing on the digital image through the image acquisition card to obtain the image to be assessed for quality; performing real-time quality assessment on the image to be assessed for quality, and storing the image that meets the quality requirements if the quality of the image to be assessed for quality meets the preset quality requirements; preprocessing and image information annotation on the image that meets the quality requirements to obtain the image to be detected for corrosion; the preprocessing methods include grayscale, filtering and denoising, contrast enhancement, and distortion correction; the image information includes timestamp, device ID, and location information.
[0031] In this embodiment, a machine vision device with pre-set parameters needs to be installed at the oil well site. The machine vision device includes a high-resolution camera, a lighting element, and an image acquisition card.
[0032] Among them, high-resolution cameras can clearly capture images of oil well casings under different environmental conditions. Machine vision equipment can automatically start according to preset time intervals and capture images of the annulus inside the oil well casing through high-resolution cameras without human intervention. High-resolution cameras convert light into electrical signals through their optical sensors to generate digital images. The resolution of the camera directly affects the details and clarity of the image, which is crucial for subsequent corrosion feature point detection and geometric feature analysis. High resolution helps capture tiny signs of corrosion and provides a basis for accurate analysis.
[0033] The camera is equipped with an adjustable focal length lens, which allows the camera to focus on the oil well casing at different distances, ensuring clear images even when far away from the camera or very close to the camera. By adjusting the focal length, the depth of field and clarity of the image can be controlled, allowing the camera to capture tiny details on the surface of the oil well casing, such as corrosion spots, cracks, etc. Under different monitoring conditions, such as changing lighting or different casing surface conditions, the adjustable focus lens can optimize image quality and ensure the accuracy of image analysis. In complex field environments, the adjustable focus lens provides greater flexibility, allowing the camera to be quickly adjusted to adapt to different monitoring needs. Accurate focus adjustment reduces the need for reshoots due to blurred or unclear images, improving monitoring efficiency. In the process of continuous monitoring, maintaining the consistency of image data is crucial for analyzing corrosion development trends, and the adjustable focus lens helps to obtain consistent quality images at different time points.
[0034] Lighting components are designed to provide a stable light source to ensure clear, consistent images in all environmental conditions. Uniform lighting reduces the impact of shadows and reflections on image quality and improves image contrast. Lighting components work closely with the camera because even high-resolution cameras can degrade image quality if lighting conditions are poor. Proper lighting can highlight the difference between corroded areas and normal areas, allowing the camera to capture corrosion features more accurately.
[0035] The image acquisition card (also called a frame grabber) is responsible for receiving digital images from the camera and converting them into a format that can be processed by the computer. The image acquisition card is responsible for synchronizing the acquisition of image data, ensuring the real-time and stability of the image, and obtaining the image for quality assessment. The image acquisition card is directly related to the output of the camera, and it must be able to process the high-resolution image data provided by the camera. In addition, the image acquisition card needs to be compatible with the computer system so that the image data can be transmitted to the analysis software for further processing.
[0036] The image to be assessed is assessed in real time through the built-in image processing algorithm to ensure that the image clarity and contrast meet the needs of subsequent analysis. If necessary, the machine vision device can automatically adjust the camera parameters or lighting conditions. When the quality of the image to be assessed meets the preset quality requirements, the image that meets the quality requirements is stored in a high-capacity solid-state drive to ensure data security and accessibility. The solid-state drive supports remote access, which is convenient for data analysis and backtracking. Considering that the image that meets the quality requirements may be affected by factors such as light, dust, and oil stains, preprocessing is required, including grayscale, filtering and denoising, contrast enhancement, and distortion correction to improve image quality and provide more accurate data for subsequent corrosion detection. In order to facilitate subsequent analysis, the image information that meets the quality requirements can be annotated, including timestamps, device IDs, location information, etc., to facilitate image management and tracking.
[0037] The position and angle of the machine vision equipment are carefully designed to ensure that the key areas of the casing are covered. The machine vision equipment is waterproof, dustproof, and resistant to high and low temperatures to adapt to the harsh environmental conditions at the oil well site. The housing of the machine vision equipment is made of corrosion-resistant materials to ensure long-term stable operation. The machine vision equipment has a real-time anomaly detection function. When an abnormality is detected in the image (such as obvious signs of corrosion), it can immediately issue an alarm and trigger additional image acquisition or analysis processes. The machine vision equipment supports remote monitoring functions, and operators can remotely view real-time images and historical data through the network for remote diagnosis and maintenance. The machine vision equipment can predict the corrosion trend of the oil well casing based on the collected image data and the preset corrosion model, and remind maintenance personnel to conduct on-site inspections or maintenance work when necessary.
[0038] This embodiment ensures that the acquisition process of the corrosion monitoring image is both efficient and accurate, and provides a solid foundation for subsequent corrosion analysis and monitoring.
[0039] 102: Based on the Harris operator positioning and prediction feature algorithm, the corrosion feature points in the corrosion monitoring image are located.
[0040] As a preferred embodiment, the corrosion feature points in the corrosion monitoring image are located according to the Harris operator positioning and prediction feature algorithm, including: calculating the horizontal and vertical gradients of each pixel point in the corrosion monitoring image according to the Harris operator to obtain gradient information; constructing a gradient product matrix for each pixel point according to the gradient information; calculating the characteristic response value of each pixel point according to the gradient product matrix, and taking the pixel points whose characteristic response values meet the preset response threshold as the detection corner points; performing non-maximum suppression on the detected corner points and screening out the corner points related to the corrosion features through the interpolation algorithm to obtain the corrosion feature points.
[0041] In this embodiment, the gradient of each pixel point is calculated for the corrosion monitoring image according to the Harris operator, including the gradient in the horizontal and vertical directions. This gradient information is the basis for the Harris operator to detect feature points. The calculated gradient information is used to construct the gradient product matrix of each pixel point. M , calculate the characteristic response value of each pixel R . Points with high response values are more likely to be corrosion feature points. A response threshold is preset to screen out detection corner points. The response threshold can be adjusted according to the actual corrosion monitoring needs and image quality. According to the set response threshold, pixel points with values higher than the response threshold are screened out from the calculated feature response values. These points are considered to be candidate locations for corrosion feature points (detection corner points, where the structural changes in the image are most significant). Non-maximum suppression is performed on the screened detection corner points to ensure that each corrosion feature point is the point with the highest response value in the local area, thereby reducing false detections. The feature points after non-maximum suppression are refined to improve the accuracy of feature point positioning. Corner points related to corrosion features are screened out through an interpolation algorithm to determine the exact location of the corrosion feature points.
[0042] The Harris operator is a classic corner detection algorithm that can detect points in an image that have significant brightness changes in a certain direction of the image, and these changes are significant in both directions of the image. Harris response function R Defined as: R=det ( M )- k ( trace ( M )) 2
[0043] in, M is the gradient product matrix:
[0044] det is the determinant, trace is the sum of the elements on the main diagonal of a square matrix, I x and I y The corrosion monitoring images are x (horizontal) and y The gradient in the (vertical) direction, k is an empirical constant (usually between 0.04 and 0.06) used to adjust the weights of the determinant and the trace. i , j Used to represent the position of pixels in an image.
[0045] By adopting the Harris operator positioning and prediction feature algorithm, this embodiment can effectively identify and predict the corrosion feature points in the oil well casing image, providing strong technical support for the corrosion monitoring and prevention of the oil well.
[0046] 103: Based on the corrosion feature points, the corrosion geometric features in the corrosion monitoring image are located using a slope template; the corrosion geometric features are used to analyze the corrosion geometric parameters of the oil well casing corrosion.
[0047] As a preferred embodiment, based on corrosion feature points, a slope template is used to locate the corrosion geometric features in the image to be monitored for corrosion, including: designing the shape and size of the slope template according to the historical corrosion morphology data of the oil well casing; based on the corrosion feature points, applying the slope template to the image to be monitored for corrosion according to the template matching algorithm to determine the template matching area; the template matching area is an area in the image to be monitored for corrosion whose similarity with the slope template meets a preset similarity threshold; locating the corrosion geometric features in the image to be monitored for corrosion according to the template matching area; selecting common and invariant specific sub-shapes to match the corrosion geometric features to determine the corrosion geometric parameters; the corrosion geometric parameters include the center, radius, area, perimeter, volume and depth of the corrosion area.
[0048] In this embodiment, a series of inclined templates are designed, and the shapes and sizes of these inclined templates are customized according to the typical historical corrosion morphology data of oil well casing. The inclined template is used to match the corrosion area in the image to identify the geometric features of corrosion, such as corrosion pits, cracks, etc. The designed inclined template is applied to the image to be monitored for corrosion, and the area that best matches the inclined template is found through the template matching algorithm based on the corrosion feature points. This step involves calculating the correlation or similarity between the inclined template and the area of the image to be monitored for corrosion to determine the best matching position. A similarity threshold is preset to filter out the template matching area. The similarity threshold can be adjusted according to the actual corrosion monitoring requirements and image quality. Once the best match is found, the corrosion geometric features can be located in the image. The position, size and shape of these corrosion geometric features will be recorded to provide data for subsequent geometric parameter analysis. Of course, the matched geometric features can also be verified to ensure the accuracy of the matching results. This may involve manual inspection or the use of additional image processing techniques to confirm the matching results. Based on the verification results, the template matching algorithm is optimized to improve the accuracy and robustness of the matching. This may include adjusting the design of the template, improving the matching algorithm, or introducing machine learning technology. Select a common and unchanging specific sub-shape to match the corrosion geometric features to determine the corrosion geometric parameters. The specific sub-shape is a pre-defined circular, elliptical or other geometric shape, which can improve the stability and robustness of the corrosion geometric parameter determination and reduce errors caused by feature changes. Corrosion geometric parameters include parameters such as the center, radius, area, perimeter, volume and depth of the corrosion area. These corrosion geometric parameters are crucial to understanding the severity and development trend of corrosion, and provide detailed data support for corrosion monitoring and maintenance of oil well casing.
[0049] Similarity measures include normalized cross correlation (NCC):
[0050] in, T ( i , j ) is the inclined plane template image at coordinates ( i , j ), I ( x + i , y + j ) is the image to be monitored for corrosion at coordinates ( x + i , y + j ), I is the corrosion monitoring image, For the slope template image T The mean pixel value of For corrosion monitoring images I The mean pixel value of .
[0051] By positioning many different shaped and sized bevel templates throughout the annulus of the well casing to cover multiple contours of the moving features, this approach can cope with the irregular shapes and size variations of casing corrosion and improve the detection and positioning accuracy of features.
[0052] 104: Determine the monitoring results of oil well casing corrosion based on corrosion geometry parameters.
[0053] As a preferred embodiment, the monitoring results of oil well casing corrosion are determined according to the corrosion geometric parameters, including: standardizing the corrosion geometric parameters to obtain standardized geometric parameters; determining the current corrosion state according to the standardized geometric parameters; the current corrosion state includes the type, location and severity of corrosion; analyzing the risk of the current corrosion state to the safe operation of the oil well in combination with the working conditions and environmental factors of the oil well casing to obtain the risk level; and determining the monitoring results of oil well casing corrosion according to the current corrosion state and risk level.
[0054] In this embodiment, the collected geometric parameters are standardized to eliminate the deviations that may be caused by different image acquisition conditions. This includes converting the measured values into proportional values relative to the casing size. According to the standardized geometric parameters, the current corrosion state, such as the type, location and severity of corrosion, is determined. The types of corrosion include uniform corrosion, local corrosion, pitting, etc. Different types of corrosion may require different maintenance strategies. The severity of corrosion involves comparing the size of the corrosion area with a preset corrosion level threshold, or determining the corrosion level based on the corrosion depth and expansion rate. Combined with the working conditions and environmental factors of the oil well casing, the risk of the current corrosion state to the safe operation of the oil well is analyzed to obtain the risk level. This may include predicting structural weaknesses and potential leakage risks caused by corrosion. According to the current corrosion state and risk level, the monitoring results of the oil well casing corrosion are determined. According to the monitoring results, targeted maintenance recommendations are generated. This may include regular cleaning of the corrosion area, coating repair, or casing replacement in severe cases. The maintenance recommendations are intended to slow down the corrosion process and ensure the safe and stable operation of the oil well. Of course, a detailed corrosion monitoring report can also be compiled, which includes the analysis results of the geometric parameters, corrosion severity assessment, risk analysis, and maintenance recommendations. The confirmed monitoring results are updated into the maintenance database of the oil well casing to provide a reference for future monitoring and maintenance work.
[0055] Fit a circle using the least squares method:
[0056] Among them, the firsti The coordinates of the points, ( a , b ) are the coordinates of the center of the circle calculated by the least squares method, r is the radius of the circle calculated by the least squares method, n is the total number of points in the data set, that is, the number of points used to fit the circle.
[0057] As a preferred embodiment, after locating the geometric features in the image to be monitored for corrosion based on the corrosion feature points using a bevel template, it also includes: according to the corrosion feature points and the image to be monitored for corrosion, using a U-shaped template with parallel sides to simulate the shape of the corrosion area to obtain simulated features, and matching the simulated features with the geometric features to obtain matched features; the matched features are used to analyze the geometric parameters of oil well casing corrosion.
[0058] In this embodiment, a U-shaped template with parallel sides is selected or designed according to the typical corrosion morphology of the oil well casing. The size and shape of the U-shaped template are initialized to match the shape of the corrosion area. The U-shaped template can simulate the typical shape of the corrosion area, such as U-shaped corrosion pits or grooves. The U-shaped template is used to simulate the shape of the corrosion area in the image to be monitored for corrosion. The position and size of the template are adjusted to make it match the corrosion area in the image as much as possible, thereby obtaining a simulated feature. A feature matching algorithm is executed to match the obtained simulated feature with the geometric feature obtained by positioning the inclined template. It involves calculating the similarity or matching degree between the simulated feature and the geometric feature to determine the best matching result. Based on the matched features, the geometric parameters of the oil well casing corrosion are calculated.
[0059] By adopting the U-shaped template positioning technology, this embodiment can accurately identify and analyze the matched features in the oil well casing image, providing a scientific basis for the maintenance and safety management of the oil well. This method improves the accuracy and efficiency of corrosion monitoring, helps to extend the service life of the oil well casing, and ensures the long-term stable operation of the oil well.
[0060] The present invention can improve the accuracy of positioning and predicting corrosion characteristics in complex environments, making the monitoring results of oil well casing corrosion more accurate and reliable. At the same time, this process does not require the deployment of a large number of sensors, reducing workload and costs.
[0061] The oil well casing corrosion monitoring device based on machine vision provided by the present invention is described below. The oil well casing corrosion monitoring device based on machine vision described below and the oil well casing corrosion monitoring method based on machine vision described above can be referred to each other.
[0062] Please refer to Figure 2 , Figure 2A structural schematic diagram of an oil well casing corrosion monitoring device based on machine vision provided by the present invention.
[0063] The present invention also provides an oil well casing corrosion monitoring device based on machine vision, comprising: an acquisition module 1, used to acquire an image to be monitored for corrosion; the image to be monitored for corrosion is an image of the oil well casing collected by a pre-set machine vision device; a feature point positioning module 2, used to locate the corrosion feature points in the image to be monitored for corrosion according to the Harris operator positioning and prediction feature algorithm; a geometric feature positioning module 3, used to locate the corrosion geometric features in the image to be monitored for corrosion based on the corrosion feature points and using an inclined template; the corrosion geometric features are used to analyze the corrosion geometric parameters of the oil well casing corrosion; and a result determination module 4, used to determine the monitoring results of the oil well casing corrosion according to the corrosion geometric parameters.
[0064] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As 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 well casing corrosion monitoring method based on machine vision, the method comprising: obtaining an image to be monitored for corrosion; the image to be monitored for corrosion is an image of the oil well casing collected by a pre-set machine vision device; locating the corrosion feature points in the image to be monitored for corrosion according to the Harris operator positioning and prediction feature algorithm; locating the corrosion geometric features in the image to be monitored for corrosion based on the corrosion feature points by using a slope template; the corrosion geometric features are used to analyze the corrosion geometric parameters of the oil well casing corrosion; and determining the monitoring results of the oil well casing corrosion according to the corrosion geometric parameters.
[0065] 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.
[0066] 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 oil well casing corrosion monitoring method based on machine vision provided by the above methods, and the method includes: obtaining an image to be monitored for corrosion; the image to be monitored for corrosion is an image of the oil well casing collected by a pre-set machine vision device; locating corrosion feature points in the image to be monitored for corrosion according to the Harris operator positioning and prediction feature algorithm; based on the corrosion feature points, using a slope template to locate the corrosion geometric features in the image to be monitored for corrosion; the corrosion geometric features are used to analyze the corrosion geometric parameters of the oil well casing corrosion; and determining the monitoring results of the oil well casing corrosion according to the corrosion geometric parameters.
[0067] 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 well casing corrosion monitoring method provided by the above-mentioned methods, the method comprising: obtaining an image to be monitored for corrosion; the image to be monitored for corrosion is an image of the oil well casing collected by a pre-set machine vision device; locating corrosion feature points in the image to be monitored for corrosion according to the Harris operator positioning and prediction feature algorithm; locating corrosion geometric features in the image to be monitored for corrosion based on the corrosion feature points using a slope template; the corrosion geometric features are used to analyze the corrosion geometric parameters of the oil well casing corrosion; and determining the monitoring results of the oil well casing corrosion according to the corrosion geometric parameters.
[0068] 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.
[0069] 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.
[0070] 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 method for monitoring oil well casing corrosion based on machine vision, characterized in that: include: Acquire an image to be monitored for corrosion; the image to be monitored for corrosion is an image of the oil well casing collected by a pre-set machine vision device; Locating the corrosion feature points in the corrosion monitoring image according to the Harris operator positioning and prediction feature algorithm; Based on the corrosion feature points, a slope template is used to locate the corrosion geometric features in the corrosion monitoring image; The corrosion geometric characteristics are used to analyze the corrosion geometric parameters of oil well casing corrosion; The monitoring result of the oil well casing corrosion is determined according to the corrosion geometric parameters.
2. The oil well casing corrosion monitoring method based on machine vision according to claim 1 is characterized in that: After locating the geometric features in the image to be monitored for corrosion based on the corrosion feature points using a slope template, the method further includes: According to the corrosion feature points and the image to be monitored for corrosion, a U-shaped template with parallel sides is used to simulate the shape of the corrosion area to obtain a simulated feature, and the simulated feature is matched with the geometric feature to obtain a matched feature; the matched feature is used to analyze the geometric parameters of oil well casing corrosion.
3. The oil well casing corrosion monitoring method based on machine vision according to claim 1 is characterized in that: The machine vision device includes a camera, a lighting element, and an image acquisition card; the camera is equipped with a lens with adjustable focal length to adapt to oil well casings of different distances and sizes; The step of obtaining the image to be monitored for corrosion includes: Providing uniform illumination to the camera during image capture by means of the illumination element; Capturing the image of the oil well casing by the camera to obtain a digital image; Performing format conversion and synchronous processing on the digital image by the image acquisition card to obtain an image to be evaluated in quality; Performing real-time quality assessment on the image to be quality assessed, and if the quality of the image to be quality assessed meets a preset quality requirement, storing the image that meets the quality requirement; The image meeting the quality requirements is preprocessed and image information is annotated to obtain the image to be detected by corrosion; the preprocessing method includes grayscale, filtering and denoising, contrast enhancement and distortion correction; the image information includes timestamp, device ID and location information.
4. The oil well casing corrosion monitoring method based on machine vision according to claim 1 is characterized in that: The method of locating the corrosion feature points in the image to be monitored for corrosion according to the Harris operator positioning and prediction feature algorithm includes: Calculating the horizontal and vertical gradients of each pixel of the corrosion monitoring image according to the Harris operator to obtain gradient information; Constructing a gradient product matrix for each pixel according to the gradient information; Calculate the characteristic response value of each pixel point according to the gradient product matrix, and take the pixel point whose characteristic response value meets the preset response threshold as the detection corner point; Non-maximum suppression is performed on the detected corner points, and corner points related to corrosion features are screened out through an interpolation algorithm to obtain the corrosion feature points.
5. The oil well casing corrosion monitoring method based on machine vision according to claim 1 is characterized in that: The method of locating the corrosion geometric features in the image to be monitored for corrosion based on the corrosion feature points by using a slope template includes: Design the shape and size of the slope template according to the historical corrosion morphology data of the oil well casing; Based on the corrosion feature points, the slope template is applied to the corrosion monitoring image according to a template matching algorithm to determine a template matching area; the template matching area is an area in the corrosion monitoring image whose similarity with the slope template meets a preset similarity threshold; Locating the corrosion geometric features in the corrosion monitoring image according to the template matching area; A common and invariant specific sub-shape is selected to match the corrosion geometric feature to determine the corrosion geometric parameters; the corrosion geometric parameters include the center, radius, area, perimeter, volume and depth of the corrosion area.
6. The oil well casing corrosion monitoring method based on machine vision according to any one of claims 1 to 5, characterized in that: Determining the monitoring result of oil well casing corrosion according to the corrosion geometric parameters includes: Standardizing the corrosion geometric parameters to obtain standardized geometric parameters; Determining a current corrosion state based on the standardized geometric parameters; the current corrosion state includes the type, location and severity of corrosion; In combination with the working conditions and environmental factors of the oil well casing, the risk of the current corrosion state to the safe operation of the oil well is analyzed to obtain a risk level; The monitoring result of the oil well casing corrosion is determined according to the current corrosion state and the risk level.
7. An oil well casing corrosion monitoring device based on machine vision, characterized in that: include: An acquisition module is used to acquire an image to be monitored for corrosion; the image to be monitored for corrosion is an image of the oil well casing acquired by a pre-set machine vision device; A feature point positioning module is used to locate the corrosion feature points in the corrosion monitoring image according to the Harris operator positioning and prediction feature algorithm; A geometric feature positioning module, used to locate the corrosion geometric features in the corrosion monitoring image using a slope template based on the corrosion feature points; The corrosion geometric characteristics are used to analyze the corrosion geometric parameters of oil well casing corrosion; The result determination module is used to determine the monitoring result of the oil well casing corrosion according to the corrosion geometric parameters.
8. 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 computer program, the method for monitoring oil well casing corrosion based on machine vision 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 method for monitoring oil well casing corrosion based on machine vision as claimed 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 method for monitoring oil well casing corrosion based on machine vision as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Anti-corrosion control system and method for pipeline operation robot
CN120287314A
Anti-corrosion control system and method for pipeline operation robot
CN120287314B
Casing pipe residual buckle identification method, system and device, medium and product
CN120455842A
Pipeline corrosion repairing method and system based on artificial intelligence and storage medium
CN120543557A