A Visualized and Precise Positioning and Retrieval Method and System for Falling Objects in Wells

By constructing a multidimensional noise interference index and dynamic filtering technology, the problem of edge detail loss in noise processing of downhole object images was solved, enabling accurate positioning and efficient retrieval of downhole objects.

CN122335847APending Publication Date: 2026-07-03DAQING RUNHAI TECH DEV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DAQING RUNHAI TECH DEV
Filing Date
2026-05-19
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In the process of visually retrieving objects from underground wells, existing technologies suffer from image noise processing issues, which can lead to the loss of edge details of the objects or residual noise, affecting recognition accuracy and positioning effectiveness.

Method used

By constructing a multidimensional noise interference index and dynamically adjusting the filtering intensity, combined with Hough circle detection, cluster analysis and edge detection algorithms, objects falling into the well can be identified.

Benefits of technology

It improves the noise reduction and detail preservation capabilities of images of objects falling into the well, thereby enhancing the accuracy and efficiency of retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122335847A_ABST
    Figure CN122335847A_ABST
Patent Text Reader

Abstract

This application relates to the field of visual retrieval technology, specifically to a method and system for visually and precisely locating and retrieving objects fallen into a well. The method includes: acquiring an image of the fallen object as the target image; determining the contour points of the target image based on the degree of circularity and grayscale; identifying abnormal contour points based on the gradient values ​​of the contour points moving away from the light source; and for different clusters, determining the light intensity attenuation coefficient by combining the dispersion and mean of the gradient values ​​with the distance to the abnormal contour points; determining the image difference contribution by the matching degree of adjacent images and the proportion of the light intensity attenuation coefficient; determining the deviation degree by the color ratio difference between the target image pixels and adjacent pixels, and then calculating a multidimensional noise interference index by combining the light intensity attenuation anomaly degree and the image difference contribution; enhancing the image using the multidimensional noise interference index, and identifying the fallen object to complete the retrieval. This application improves the denoising effect and detail preservation capability of images of fallen objects in wells.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of visual salvage technology, specifically to a visual and precise positioning and salvage method and system for objects falling into wells. Background Technology

[0002] In oil and gas well workover operations, downhole debris refers to objects such as perforating guns, logging instruments, and fracturing strings that accidentally detach and become lodged in the well during production or construction. The presence of these debris can severely impact wellbore integrity and the normal progress of subsequent production operations, necessitating retrieval operations. Visualized precision positioning retrieval refers to an integrated technology that utilizes a downhole visible light camera system to acquire real-time images of the debris's location, attitude, and top, guiding retrieval tools for precise grabbing and recovery. Due to the diverse shapes of debris and the complex downhole environment, traditional retrieval operations suffer from low success rates, long cycles, and a high risk of secondary damage.

[0003] In the process of visual retrieval of objects in underground wells, existing technologies typically use fixed filtering parameters to denoise the underground video images. This can easily lead to the loss of details or noise residue at the edges of the objects in the images, which in turn affects the accuracy of object contour recognition and the subsequent retrieval and positioning results. Summary of the Invention

[0004] To address the technical problem of low accuracy in identifying salvaged objects, this application provides a visual and precise positioning and salvage method and system for downhole objects. The specific technical solution adopted is as follows:

[0005] Firstly, this application proposes a method for visually and precisely locating and retrieving objects that have fallen into a well, the method comprising the following steps:

[0006] Images of objects falling into the well are captured using camera equipment and recorded as target images;

[0007] Contour points are determined by the area and gray level of the circular contours detected after the target image is grayscaled; the gradient value is determined by the gray level change of the contour points away from the light source; the contour points are clustered by the gradient value, and abnormal contour points are determined by the number of clusters; under different numbers of clusters, the dispersion of the gradient value is combined with the mean of the gradient value and the distance between the abnormal contour point and its adjacent contour points to determine the light intensity attenuation coefficient.

[0008] The neighboring images of the target image are denoted as neighboring images. The image difference contribution of the target image is calculated by the proportion of light intensity attenuation anomaly in the target image and neighboring images and the image matching degree between the target image and neighboring images; this is used to represent the impact of noise on the target image.

[0009] Channel deviation is determined by the ratio difference between the target image pixel and its neighboring pixels in the RGB channels; the multidimensional noise interference index of the target image is calculated based on the light intensity attenuation anomaly, image difference contribution, and channel deviation of all pixels.

[0010] By replacing the Wiener filter parameters with a multidimensional noise interference index, the target image is enhanced. After enhancement, the object falling into the well is identified by an edge detection algorithm, and the location and retrieval are completed.

[0011] In the above-mentioned scheme, this application constructs the light intensity attenuation anomaly by assessing the degree to which the light intensity attenuation law of the image is disrupted by the gray-scale gradient of the contour points away from the light intensity, thereby improving the noise recognition capability in a single frame image. This application constructs a multi-dimensional noise interference index, thereby comprehensively evaluating the degree of image disturbance from multiple dimensions such as the spatial domain, temporal domain, and color domain, achieving a refined assessment of the noise state. In view of the problem that the existing technology does not fully consider the dynamic changes in the degree of image disturbance under different noise states, resulting in poor adaptability of fixed filtering parameters, this application constructs a multi-dimensional noise interference index, thereby dynamically adjusting the filtering intensity and improving the denoising effect and detail preservation capability of the image of the falling object in the well.

[0012] In one embodiment, the method for determining contour points by the area and grayscale of the circular contour detected after grayscale conversion of the target image is as follows:

[0013] The grayscale image is used as the input to the Hough circle detection algorithm, and the output of the Hough circle detection algorithm is all the circular contours within the grayscale image.

[0014] Calculate the area of ​​each circular contour, and record the average gray value of each pixel on each circular contour as the average gray value of each circular contour; record the product of the average gray value and the area after normalization as the first product, and record the circular contour corresponding to the maximum value of the first product as the outer contour of the light source of the target image, and record the pixels on it as contour points.

[0015] In one embodiment, the method for determining the gradient value by observing the grayscale changes of the contour points as they move away from the light source is as follows:

[0016] For each contour point, a ray is constructed along the radial outward normal direction of the outer contour of the light source, with a ray width of 1 pixel. The direction of the ray starts from the contour point and points towards the image edge in a direction away from the center of the light source. The gray values ​​of each pixel on the ray are obtained sequentially from the contour point to the image edge, and a radial gray value sequence of the contour point is constructed.

[0017] Obtain the second-order difference sequence of the radial grayscale sequence, and calculate the mean of the absolute values ​​of all elements as the gradient value of the contour points.

[0018] In one embodiment, the method of clustering contour points using gradient values ​​and determining abnormal contour points based on the number of clusters is as follows:

[0019] The gradient values ​​of all contour points are used as input to the clustering algorithm for clustering; the mean of the gradient values ​​in each cluster is calculated, and the contour points corresponding to the elements of the other clusters except the cluster with the smallest mean are recorded as abnormal contour points.

[0020] In one embodiment, the method for determining the light intensity attenuation coefficient by combining the dispersion of the gradient value with the mean of the gradient value and the distance between the abnormal contour point and its adjacent contour point under different numbers of clusters is as follows:

[0021] , This represents the gradually discrete values ​​of the target image in the i-th frame. This represents the mean of the gradient values ​​of all contour points in the i-th frame of the target image. This represents the mean of the neighbor distances of all abnormal contour points within the target image of the i-th frame. Indicates the number of clusters. Represents the sensitivity coefficient. This represents an exponential function with the natural constant as its base. This represents the light intensity attenuation anomaly degree of the target image in the i-th frame.

[0022] In one embodiment, the gradient discrete value is the degree of dispersion of the gradient values ​​of all contour points; the adjacent distance is the minimum DTW distance between an abnormal contour point and its adjacent abnormal contour points.

[0023] In one embodiment, the contribution of image difference is positively correlated with the proportion of light intensity attenuation anomaly and negatively correlated with image matching degree.

[0024] In one embodiment, the method for determining channel deviation by the ratio difference between a target image pixel and its neighboring pixels in the RGB channels is as follows:

[0025] For each pixel in each target image, calculate the ratio of the R channel to the G channel, the ratio of the R channel to the B channel, and the ratio of the G channel to the B channel.

[0026] Within the eight-neighborhood of a pixel, calculate the absolute difference between the pixel and each neighboring pixel in the three-channel ratio, and record the mean of all absolute differences as the channel deviation of the pixel.

[0027] In one embodiment, the method for calculating the multidimensional noise interference index of the target image based on the light intensity attenuation anomaly, image difference contribution, and channel deviation of all pixels is as follows:

[0028] , This represents the light intensity attenuation anomaly degree of the target image in the i-th frame. This represents the image difference contribution of the target image in the i-th frame. This represents the mean channel offset of all pixels in the i-th frame of the target image. This represents an exponential function with the natural constant as its base. It represents the multidimensional noise interference index of the target image in the i-th frame.

[0029] On the other hand, this application also provides a visual and precise positioning and retrieval system for downhole objects, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any of the above-described visual and precise positioning and retrieval methods for downhole objects.

[0030] The beneficial effects of this application are as follows:

[0031] This application constructs an anomaly degree of light intensity attenuation by assessing the degree to which the light attenuation law of an image is disrupted by the gray-scale gradation of contour points away from the light intensity, thereby improving the noise recognition capability in a single frame image. This application also constructs a multi-dimensional noise interference index, enabling a comprehensive assessment of the degree of image disturbance from multiple dimensions, including the spatial, temporal, and color domains, achieving a refined evaluation of noise conditions. Addressing the problem that existing technologies do not fully consider the dynamic changes in the degree of image disturbance under different noise conditions, resulting in poor adaptability of fixed filtering parameters, this application constructs a multi-dimensional noise interference index to dynamically adjust the filtering intensity, thereby improving the denoising effect and detail preservation capability of images of objects falling from the well. Attached Figure Description

[0032] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a flowchart illustrating a method for visually locating and retrieving fallen objects from a well, as provided in one embodiment of this application. Detailed Implementation

[0034] To further illustrate the technical means and effects adopted by this application to achieve the intended purpose of the invention, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a visual and precise positioning and retrieval method and system for downhole objects proposed in this application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0036] An embodiment of a visual and precise positioning and retrieval method and system for downhole objects:

[0037] The following description, in conjunction with the accompanying drawings, details the specific scheme of the visualization and precise positioning and retrieval method and system for downhole objects provided in this application.

[0038] Please see Figure 1 The diagram illustrates a flowchart of a method for visually locating and retrieving fallen objects in a well, according to an embodiment of this application. The method includes the following steps:

[0039] Step S001: Acquire images of objects falling into the well using camera equipment and record them as target images.

[0040] The visual retrieval string is lowered into the oil well, and the logging instrument continuously monitors any objects falling into the well. When an object is initially detected and the distance between the top of the object and the bottom of the visual retrieval string reaches a preset value, the lowering of the retrieval string is stopped; this distance ranges from 45-55 cm; in this embodiment, 50 cm is used. Since there is oil in the wellbore, oil sludge can easily obscure the lens. Therefore, clean water is used to flush and wash the wellbore, allowing impurities to settle. Afterward, the logging instrument in the retrieval string is lowered to photograph the object. The method for measuring the distance between the object and the current position of the logging instrument is a known technique and will not be described further here.

[0041] The logging instrument is lowered from the retrieval string at a preset distance, and video of the falling object is captured, thus providing real-time visual guidance for the retrieval operation. The preset distance is 15-20cm; in this embodiment, 15cm is used. The retrieval method in this application is to use a perforating gun, employing a "cover-sleeve-retrieve" method to grab the falling object. The method of retrieving falling objects using a perforating gun is well-known in the art and will not be described further here.

[0042] In this application, the downhole logging instrument acquires video at a frequency of 30 frames per second. The acquired video is transmitted to a PC in real time using video encoding and transmission technology. On the PC, the video is processed into frames, converting one second of video into 30 frames, thereby obtaining an image of the object falling into the well, which is then recorded as the target image. The video encoding and transmission technology is not limited to HEVC, MPEG, or AVS; this embodiment uses the HEVC algorithm.

[0043] At this point, the target image of the object that fell into the well was obtained.

[0044] Step S002: Determine the contour points of the target image by the degree of near-circle and grayscale conditions; determine abnormal contour points by clustering the contour points with gradient values ​​that are far from the light source; and for different clusters, determine the light intensity attenuation coefficient by combining the degree of dispersion and mean of the gradient values ​​and the distance of the abnormal contour points.

[0045] During the video acquisition and transmission of objects falling into the well, the long transmission distance of the logging cable and the complex downhole environment make the video susceptible to electromagnetic interference during transmission. This interference can cause abnormalities such as blurred edges, random noise, and artifacts on the edges of the fallen objects in the acquired images, interfering with the positioning accuracy of the objects and thus affecting the subsequent guidance for object retrieval. Therefore, adaptive image enhancement is needed based on the actual degree of interference affecting the images.

[0046] For each target image, since the inner wall of the oil well pipe is a regular cylindrical structure and the position of the light source is fixed, the brightness of the pipe wall will be continuously and gradually distributed along the normal direction of the cylindrical surface under the illumination of the light source: that is, the center of the image is the area directly illuminated by the light source, which will form a bright circular spot, and the brightness of the pixels will gradually decrease from the outline of the spot outward to the edge of the image.

[0047] For the target image, it is converted to a grayscale image. This grayscale image is used as input to the Hough Circle Detection Algorithm (HCL), and the output of the HCL is all circular contours within the grayscale image. The area of ​​each circular contour is calculated, and the average grayscale value of each pixel on each contour is recorded as the grayscale mean of that contour. Based on the maximum area and the maximum grayscale mean of all circular contours in the image, maximum value normalization is performed on the area and grayscale mean of all circular contours to eliminate the influence of dimensions.

[0048] The product of the area of ​​each normalized circular contour and its own grayscale mean is recorded as the first product of each circular contour. Then, the circular contour corresponding to the maximum value of all the first products is recorded as the outer contour of the light source of the target image, and all pixels on the outer contour of the light source are recorded as contour points.

[0049] For each contour point, a ray is constructed along the radial outward normal direction of the light source's outer contour, with a ray width of 1 pixel. The direction of the ray starts from the contour point and points towards the image edge in a direction away from the center of the light source. The gray values ​​of each pixel on the ray are sequentially obtained in the order from the contour point to the image edge, and a radial gray value sequence of the contour point is constructed.

[0050] Since the brightness of the inner wall of the oil pipe gradually changes in the radial direction under the illumination of the light source, and the gray value change between adjacent pixels is relatively smooth, the second-order difference sequence of the radial gray value sequence of the contour points is obtained, and the mean of the absolute values ​​of all elements in the second-order difference sequence is recorded as the gradient value of the contour point.

[0051] The second-order difference sequence can reflect whether the gray-level change rate between adjacent pixels is relatively consistent and whether there is an abrupt change; the gradient value can reflect the overall fluctuation of the radial gray-level sequence of the contour points; the larger the value, the less smooth the gray-level change of the pixel is in the radial direction of the contour points toward the image edge, and the less it conforms to the physical characteristics of the gradual change of light source intensity.

[0052] The degree of dispersion of the gradient values ​​of all contour points is used as the gradient dispersion value of the target image. The gradient dispersion value can reflect the difference in grayscale changes of pixels in each radial direction; the larger the value, the greater the difference in grayscale changes, and the greater the possibility that the target image is affected by noise. The method of calculating the dispersion is not limited to variance, mean square deviation, or standard deviation; this embodiment uses variance calculation.

[0053] Furthermore, considering that with prolonged use, pitted areas may appear on the inner wall of the oil well, and there may be perforations on the well casing wall, or the volume of the falling object may be large, with some of the falling object extending outside the outer contour of the light source, which may in turn cause abnormal grayscale changes in the radial grayscale sequence of some pixels on the outer contour of the light source caused by non-noise factors, further analysis is needed.

[0054] The gradient values ​​of all contour points are used as input to a clustering algorithm for clustering. This embodiment uses the HDBSCAN algorithm for adaptive clustering, outputting J clusters. If J is 1, it indicates that the light attenuation in all radial directions along the outer contour of the light source is basically the same, meaning that the grayscale change rate of pixels in each direction is relatively consistent. When J is greater than 1, it indicates that there may be pits, apertures, or fallen objects in the area outside the outer contour of the light source, or it may be affected by noise interference, causing the grayscale change in some radial directions to deviate from the normal light attenuation pattern; therefore, further analysis is needed.

[0055] Calculate the mean of the gradient values ​​in each cluster. The contour points corresponding to the elements of the other clusters, except for the cluster with the smallest mean, are recorded as abnormal contour points, which represent contour points where obvious fluctuations occurred during the gradual change of light source intensity.

[0056] Since the physical structure corresponding to such areas, whether it's pits, perforations, or fallen objects, is a continuous whole in space, even if it causes grayscale fluctuations, the radial grayscale change trend of the abnormal contour point and its adjacent contour points is usually consistent, meaning that similar grayscale anomalies will appear simultaneously in adjacent radial directions. However, because noise is random and has no real physical structure, it does not have a spatial correspondence in adjacent radial directions.

[0057] Therefore, taking any abnormal contour point as the target point, the contour points within the eight-neighborhood of the target point are recorded as the target point's adjacent points. The DTW distance between the target point and each adjacent point in the radial grayscale sequence is calculated sequentially, and the minimum value among all DTW distances is recorded as the target point's adjacent distance. The smaller the adjacent distance, the closer the radial grayscale change trend of the target point is to the adjacent direction, and the grayscale fluctuation here is more likely caused by real physical structures such as pits, perforations, or fallen objects.

[0058] Therefore, for different numbers of clusters, the light intensity attenuation anomaly of the target image is calculated by using the gradient discrete value of the target image, the gradient value of all contour points, and the overall adjacent distance of the abnormal contour points in the target image.

[0059] Preferably, in this embodiment, the expression for the light intensity attenuation anomaly is:

[0060] , This represents the gradually discrete values ​​of the target image in the i-th frame. This represents the mean of the gradient values ​​of all contour points in the i-th frame of the target image. This represents the mean of the neighbor distances of all abnormal contour points within the target image of the i-th frame. Indicates the number of clusters. Represents the sensitivity coefficient. This represents an exponential function with the natural constant as its base. This represents the light intensity attenuation anomaly degree of the target image in the i-th frame. The sensitivity, empirically, ranges from 0.1 to 0.5; in this embodiment, it is set to 0.3. It's worth noting that this value is used here because if the noise is too strong, it might cause the contour points to have relatively uniform gradient values, thus clustering them into a single group. Furthermore, if the actual light source changes... Very small, if it's noise. It will be very large, therefore multiply by To perform robust analysis and avoid misjudgments.

[0061] The light intensity attenuation anomaly can reflect the overall degree of interference in the light attenuation process of the target image; the larger the value, the more serious the light attenuation law of the target image is destroyed, and the greater the possibility of being subject to noise interference and the degree of interference is severe.

[0062] It is worth noting that the anomaly of light intensity attenuation is determined through... To reflect the overall difference in the degree of light attenuation between different radial directions; through This reflects the consistency difference in radial grayscale changes between abnormal contour points and their adjacent directions, representing the continuity of the physical structure. Since real debris or potholes are spatially continuous, the calculated values ​​will differ. The value is relatively small. When When smaller, The result of the calculation will approach zero. Using this coefficient approaching zero, and... Multiplication can account for the variance caused by the actual physical structure. The surge was suppressed. The final result was... It will remain at a relatively low numerical level. This method avoids classifying the actual physical structure as severe noise, thus preventing subsequent steps from excessively smoothing out the necessary edges of the falling object.

[0063] At this point, the light intensity attenuation anomaly value of the target image was obtained.

[0064] Step S003: Determine the contribution of image differences by the matching degree of adjacent images and the proportion of light intensity attenuation coefficient.

[0065] Although light intensity attenuation anomaly can provide a preliminary assessment of the noise level, since it is based on a single frame image, it may miss or misjudge some noise interferences that are similar to the normal light attenuation trend. Therefore, it is necessary to combine multiple frames for analysis.

[0066] Since the downhole logging instrument is in a fixed position during video acquisition and continuously acquires video images to guide subsequent retrieval procedures during actual operations, the changes in scene content between adjacent frames are minimal, and each pixel should maintain a high degree of consistency between adjacent frames.

[0067] Therefore, this application analyzes target images in two adjacent frames, using these two frames as input to an image matching algorithm. The matching result between the two adjacent target images output by the algorithm is denoted as the image matching degree between them. A higher image matching degree indicates less variation in scene content between adjacent frames, more stable image quality, and less noise interference. In this embodiment, the image matching algorithm uses the TM_CCOEFF_NORMED (normalized correlation coefficient matching) algorithm.

[0068] However, considering that electromagnetic interference is persistent and fluctuates significantly between adjacent frames, the noise itself can also affect the matching results. If one of the target images in two adjacent frames is less affected by noise and the other is more affected, it can lead to errors in the calculated image matching degree, and may even result in over-filtering of the target image. Therefore, further analysis is needed.

[0069] For each target image, any adjacent frame of the target image is recorded as the neighboring image; the intensity attenuation anomaly of the target image and the neighboring image is calculated. In this embodiment, the neighboring image is the next frame of the target image.

[0070] The image difference contribution of the target image is calculated by the proportion of light intensity attenuation anomalies in the target image and neighboring images, as well as the image matching degree between the target image and neighboring images; this is used to represent the influence of noise on the target image.

[0071] The contribution of image difference is positively correlated with the proportion of light intensity attenuation anomaly, and negatively correlated with image matching degree.

[0072] It should be noted that positive correlation means that when one variable increases, the other variable also increases, and the two variables change in the same direction. When one variable changes from large to small or from small to large, the other variable also changes from large to small or from small to large. The specific relationship is determined by the actual application, and this application does not impose any special restrictions.

[0073] It should be noted that negative correlation means that when one variable increases, the other variable decreases accordingly, and the two variables change in opposite directions. When one variable changes from large to small or from small to large, the other variable also changes from small to large or from large to small. The specific relationship is determined by practical application, and this application does not impose any special restrictions.

[0074] Preferably, in this embodiment, the expression for the image difference contribution is:

[0075] , This represents the image matching degree between the target image in the i-th frame and its neighboring images. This represents the light intensity attenuation anomaly degree of the target image in the i-th frame. This represents the sum of the light intensity attenuation anomalies of the target image in the i-th frame and its corresponding neighboring images. Represents a very small positive number. This represents the image difference contribution of the target image in the i-th frame. Wherein, Its function is to prevent the denominator from being 0, and its value range is the empirical range (0.05, 0.1). In this embodiment, its value is 0.08.

[0076] in, It reflects the matching differences between two target images; This reflects the proportion of noise interference from the target image in the i-th frame in the total noise of the two frames. If the noise interference is due to the target image in the i-th frame... If it is larger, then Larger, at this time for To retain, because This accurately reflects the noise level of the target image in the i-th frame. The decrease in matching results is caused by the noise within the target image itself in the i-th frame. It is valuable for evaluating the target image in the i-th frame. Conversely, if it is caused by noise interference in the target image in the (i+1)-th frame... It is relatively large, but at this time It will be very small, leading to It will become significantly smaller, that is, for Further compression is performed to reduce its impact on the noise assessment of the target image in the i-th frame, thus avoiding misattributing noise from the target image in the (i+1)-th frame to the target image in the i-th frame. Therefore... The larger the value, the more likely the decrease in matching degree is caused by the noise of the target image in the i-th frame itself, and the more severe the noise interference on the target image in the i-th frame.

[0077] At this point, the image difference contribution of the target image in the i-th frame has been obtained.

[0078] Step S004: Determine the deviation by the color ratio difference between the target image pixel and its adjacent pixels, and then calculate the multidimensional noise interference index by combining the light intensity attenuation anomaly degree and the image difference contribution.

[0079] Because logging instruments acquire color RGB images, under normal circumstances, the local colors of objects with real physical structures, whether in pitted areas, perforation edges, or fallen debris, follow a consistent reflection pattern across the RGB channels, and the ratios between the channels (R / G, R / B, G / B) are relatively stable. However, because noise interference affects the three color channels randomly and inconsistently, the intensity and direction of interference experienced by the same pixel in the R, G, and B channels are different, which can lead to abnormal deviations in the ratios between the channels.

[0080] Therefore, for each pixel in each target image, the ratio of the pixel to the three channels is calculated, namely the ratio of the R channel to the G channel, the ratio of the R channel to the B channel, and the ratio of the G channel to the B channel; if the denominator is 0, the ratio is set to the maximum value of all ratios.

[0081] Within the eight-neighborhood of a pixel, the absolute differences between the pixel and each of its eight neighboring pixels in terms of the ratios of the three channels are calculated. The mean of all these absolute differences is recorded as the channel deviation of the pixel. The larger the channel deviation, the more severely the pixel's channel ratio deviates from the surrounding area, and the higher the likelihood of electromagnetic interference.

[0082] Therefore, the multidimensional noise interference index of the target image is calculated based on the light intensity attenuation anomaly, image difference contribution, and channel deviation of all pixels. Its expression is:

[0083] , This represents the light intensity attenuation anomaly degree of the target image in the i-th frame. This represents the image difference contribution of the target image in the i-th frame. This represents the mean channel offset of all pixels in the i-th frame of the target image. This represents an exponential function with the natural constant as its base. It represents the multidimensional noise interference index of the target image in the i-th frame.

[0084] In this embodiment, an exponential function is used to... as well as Perform nonlinear mapping; where the function When x is small, the growth is slow, which can reduce the impact of small perturbations on the final result; when x is large, it can amplify the differences under severe noise conditions. In addition, the exponential function has the property of convergence in the range, which can avoid... or When the value is large, it may cause the final result to increase excessively, so as to avoid a certain outlier having an excessive dominant effect on the final result.

[0085] The multidimensional noise interference index reflects the comprehensive degree of noise interference to a target image in the spatial, temporal, and color domains; a larger value indicates more severe noise interference to the i-th frame. Among these, the index uses... To reflect the degree to which the light attenuation law is disrupted, and to demonstrate the noise interference in the spatial domain; through To reflect the degree of difference between adjacent frames and to reflect noise interference in the temporal domain; through This reflects the degree to which the ratio between RGB channels deviates from the normal range, and demonstrates the noise interference in the color gamut.

[0086] and There is a coupling relationship between them: when the spatial domain noise of a single frame is large, the degree of inconsistency between frames is more likely to confirm the presence of noise; when the spatial domain noise of a single frame is small, even if there are differences between frames, it may just be a slight scene jitter rather than noise. Multiplying the two can produce a synergistic verification effect: only when both spatial domain anomalies and temporal domain anomalies are large will the product result increase significantly, thus giving a more reliable noise judgment. The essence is color anomaly. For example, electromagnetic interference may only affect a certain color channel, causing color noise in a local area, but it does not necessarily lead to obvious structural distortion or inter-frame jumps; therefore and The relationship between them is complementary rather than coupled. Therefore, this embodiment uses addition. and The integration.

[0087] Thus, the multidimensional noise interference index of the target image was obtained.

[0088] Step S005: Enhance the image using the multidimensional noise interference index and identify objects that have fallen into the well to complete the retrieval.

[0089] In this application, Wiener filtering is used to filter the captured image, and the filtering parameters of Wiener filtering are optimized based on the multidimensional noise interference index. This allows the filtering intensity to be adaptively adjusted according to the actual degree of disturbance to the image, avoiding the problem of over-filtering or under-filtering under different noise scenarios with fixed filtering parameters, which would result in unclear edges of falling objects and improve the image enhancement effect.

[0090] Specifically, the multidimensional noise interference index of the target image calculated above is used to replace the preset constant value in the Wiener filter approximation formula. It also participates in the calculation of the Wiener filter approximation formula. Since the multidimensional noise interference index can comprehensively reflect the degree of noise interference in the current image in the spatial domain, temporal domain, and color domain, when the image is subject to severe noise interference, the noise suppression weight in the Wiener filter will increase synchronously, thereby enhancing the ability to suppress high-frequency noise, artifacts, and random interference signals; while when the image noise is low, the smoothing intensity of the Wiener filter will decrease, thereby preserving key details such as the edges of falling objects, thread textures, and joint contours.

[0091] By replacing the traditional fixed constant γ with a dynamically calculated multidimensional noise interference index, the filtering parameters of Wiener filtering can change in real time with the actual noise state of the image, realizing adaptive adjustment of the filtering intensity. This avoids the problem that traditional fixed parameters cannot adapt to complex downhole conditions, improves noise suppression accuracy and image detail preservation, and completes adaptive image enhancement of downhole object images.

[0092] After image enhancement through filtering, an edge detection algorithm is used to detect the edges of the fallen object. This assists professionals in determining the object's location and shape, and in selecting appropriate retrieval tools for the operation. If the tools match, the object is retrieved directly; otherwise, the drill string is pulled out, tools are replaced, and the object is lowered back into the well for retrieval. In this embodiment, the Canny algorithm is used for edge detection.

[0093] After the retrieval is completed, the instrument should be removed, and video evidence of the fallen object should be preserved for future operational optimization. If the fallen object situation is complex, the operation can be terminated, and the video data should be retained to provide a basis for decision-making regarding disposal.

[0094] Based on the same inventive concept as the above method, this embodiment of the invention also provides a visual precision positioning and retrieval system for downhole objects, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements any of the steps of the above-described visual precision positioning and retrieval method for downhole objects.

[0095] It should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

[0096] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A method for visually and precisely locating and retrieving objects that have fallen into a well, characterized in that, The method includes the following steps: Images of objects falling into the well are captured using camera equipment and recorded as target images; Contour points are determined by the area and gray level of the circular contours detected after the target image is grayscaled; the gradient value is determined by the gray level change of the contour points away from the light source; the contour points are clustered by the gradient value, and abnormal contour points are determined by the number of clusters; under different numbers of clusters, the dispersion of the gradient value is combined with the mean of the gradient value and the distance between the abnormal contour point and its adjacent contour points to determine the light intensity attenuation coefficient. The neighboring images of the target image are denoted as neighboring images. The image difference contribution of the target image is calculated by the proportion of light intensity attenuation anomaly in the target image and neighboring images and the image matching degree between the target image and neighboring images; this is used to represent the impact of noise on the target image. Channel deviation is determined by the ratio difference between the target image pixel and its neighboring pixels in the RGB channels; the multidimensional noise interference index of the target image is calculated based on the light intensity attenuation anomaly, image difference contribution, and channel deviation of all pixels. By replacing the Wiener filter parameters with a multidimensional noise interference index, the target image is enhanced. After enhancement, the object falling into the well is identified by an edge detection algorithm, and the location and retrieval are completed.

2. The method for visually and precisely locating and retrieving objects fallen into a well as described in claim 1, characterized in that, The method for determining contour points by the area and gray level of the circular contour detected after grayscale conversion of the target image is as follows: The grayscale image is used as the input to the Hough circle detection algorithm, and the output of the Hough circle detection algorithm is all the circular contours within the grayscale image. Calculate the area of ​​each circular contour, and record the average gray value of each pixel on each circular contour as the average gray value of each circular contour; record the product of the average gray value and the area after normalization as the first product, and record the circular contour corresponding to the maximum value of the first product as the outer contour of the light source of the target image, and record the pixels on it as contour points.

3. The method for visually and precisely locating and retrieving objects fallen into a well as described in claim 1, characterized in that, The method for determining the gradient value by observing the grayscale changes of contour points as they move away from the light source is as follows: For each contour point, a ray is constructed along the radial outward normal direction of the outer contour of the light source, with a ray width of 1 pixel. The direction of the ray starts from the contour point and points towards the image edge in a direction away from the center of the light source. The gray values ​​of each pixel on the ray are obtained sequentially from the contour point to the image edge, and the radial gray value sequence of the contour point is constructed. Obtain the second-order difference sequence of the radial grayscale sequence, and calculate the mean of the absolute values ​​of all elements as the gradient value of the contour points.

4. The method for visually and precisely locating and retrieving objects fallen into a well as described in claim 1, characterized in that, The method of clustering contour points using gradient values ​​and determining abnormal contour points based on the number of clusters is as follows: The gradient values ​​of all contour points are used as input to the clustering algorithm for clustering; the mean of the gradient values ​​in each cluster is calculated, and the contour points corresponding to the elements of the other clusters except the cluster with the smallest mean are recorded as abnormal contour points.

5. The method for visually and precisely locating and retrieving objects fallen into a well as described in claim 1, characterized in that, The method for determining the light intensity attenuation coefficient by combining the dispersion of the gradient value with the mean of the gradient value and the distance between the abnormal contour point and its adjacent contour point under different numbers of clusters is as follows: , This represents the gradually discrete values ​​of the target image in the i-th frame. This represents the mean of the gradient values ​​of all contour points in the i-th frame of the target image. This represents the mean of the neighbor distances of all abnormal contour points within the target image of the i-th frame. Indicates the number of clusters. Represents the sensitivity coefficient. This represents an exponential function with the natural constant as its base. This represents the light intensity attenuation anomaly degree of the target image in the i-th frame.

6. The method for visually and precisely locating and retrieving objects fallen into a well as described in claim 5, characterized in that, The gradient discrete value is the degree of dispersion of the gradient values ​​of all contour points; the adjacent distance is the minimum DTW distance between an abnormal contour point and its adjacent abnormal contour points.

7. The method for visually and precisely locating and retrieving objects fallen into a well as described in claim 1, characterized in that, The contribution of image differences is positively correlated with the proportion of light intensity attenuation anomaly, and negatively correlated with image matching degree.

8. The method for visually and precisely locating and retrieving objects fallen into a well as described in claim 1, characterized in that, The method for determining channel deviation by the ratio difference between a target image pixel and its neighboring pixels in the RGB channels is as follows: For each pixel in each target image, calculate the ratio of the R channel to the G channel, the ratio of the R channel to the B channel, and the ratio of the G channel to the B channel. Within the eight-neighborhood of a pixel, calculate the absolute difference between the pixel and each neighboring pixel in the three-channel ratio, and record the mean of all absolute differences as the channel deviation of the pixel.

9. The method for visually and precisely locating and retrieving objects fallen into a well as described in claim 1, characterized in that, The method for calculating the multidimensional noise interference index of the target image based on the light intensity attenuation anomaly, image difference contribution, and channel deviation of all pixels in the target image is as follows: , This represents the light intensity attenuation anomaly degree of the target image in the i-th frame. This represents the image difference contribution of the target image in the i-th frame. This represents the mean channel offset of all pixels in the i-th frame of the target image. This represents an exponential function with the natural constant as its base. It represents the multidimensional noise interference index of the target image in the i-th frame.

10. A visual and precise positioning and retrieval system for objects falling into a well, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of a method for visually locating and retrieving downhole objects as described in any one of claims 1-9.