Sleeve height and size identification method based on machine vision
By adopting machine vision-based casing height and dimension identification methods in petroleum drilling operations, the problem that manual operation is difficult to ensure the accuracy of casing connection is solved, high-precision casing identification and connection are achieved, and the safety and efficiency of drilling projects are improved.
Patent Information
- Application Number
- CN202411455364.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-03-14
AI Technical Summary
In oil drilling operations, due to the complex underground environment and harsh operating conditions, it is difficult to ensure the height and dimensional identification accuracy of the casing, resulting in problems such as unsolid casing connections and dimensional deviations, which affect the quality and safety of the drilling project.
Using machine vision-based casing height and size recognition methods, the casing image is captured through industrial cameras, and using trained casing detection models and edge detection algorithms to obtain accurate dimensions and buckle information to achieve automated height, size and thread recognition.
It improves the accuracy and efficiency of the lower casing process in drilling operations, reduces the error and safety risks of manual measurement, ensures that each section of casing is safe and firmly connected, and improves the reliability and operation safety of the entire drilling project.
Smart Images

Figure CN119624856A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of oil drilling, and in particular to a method for identifying casing height and size based on machine vision. Background Art
[0002] In oil drilling operations, casing installation is an important part of the drilling project. Casing is an important component used to stabilize the well wall, prevent well collapse, isolate the bottom pressure, and protect the production string. In actual operations, the installation quality of casing is directly related to the safety of downhole operations and the smooth progress of subsequent production.
[0003] Traditional casing lowering operations usually rely on manual operation, mainly using casing pliers to connect casing. Casing pliers are mechanical tools used to tighten and tighten casing connectors. In this traditional operation, operators need to rely on experience and visual inspection to determine whether the height and size of the casing meet the requirements. However, due to the complex downhole environment and harsh operating conditions, the accuracy and reliability of manual operation are greatly limited, which may lead to problems such as loose casing connection and dimensional deviation, thus affecting the quality and safety of the entire drilling project.
[0004] With the increase of depth of field and the complexity of downhole operation environment, traditional manual measurement methods are increasingly unable to meet the needs of modern oil drilling operations in terms of accuracy, efficiency and safety. During the operation, the height and size identification of the casing is crucial to ensure the accuracy and efficiency of the casing operation.
[0005] Therefore, there is an urgent need for a method for sleeve height and size recognition based on machine vision. Summary of the invention
[0006] 1. Technical issues to be resolved
[0007] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a method for casing height and size recognition based on machine vision, which solves the technical problem in the prior art that due to the complex downhole environment and harsh working conditions, the accuracy and reliability of manual operation are greatly limited, which may lead to problems such as loose casing connection and dimensional deviation, thereby affecting the quality and safety of the entire drilling project.
[0008] (II) Technical solution
[0009] In order to achieve the above object, the main technical solutions adopted by the present invention include:
[0010] The embodiment of the present invention provides a method for identifying casing height and size based on machine vision, comprising:
[0011] S100, receiving a detection instruction issued by an iron roughneck, and acquiring an original image of the casing iron roughneck working according to the detection instruction; performing image preprocessing on the original image of the casing iron roughneck working to acquire a processed image;
[0012] S200, inputting the processed image into a pre-trained casing detection model to obtain first casing feature information;
[0013] The casing detection model is a YOLOv8 model with a small target detection layer added to the neck network;
[0014] S300, inputting the first sleeve feature information into a pre-set edge detection algorithm to obtain second sleeve feature information;
[0015] S400: Acquire final casing characteristic information by using data calibration according to the second casing characteristic information.
[0016] Optionally, before S100, the step further includes:
[0017] S000. Collect images of casing processes on the drilling platform at different times, use them as training data sets, train the casing detection model, and obtain a trained casing detection model.
[0018] Optionally, the S000 specifically includes:
[0019] The images of the casing process on the drilling platform at different times are input into the casing detection model, and the cross entropy function and Adam optimizer are used with a learning rate of 0.001 until the cross entropy regression loss function is minimized to obtain a trained casing detection model.
[0020] Optionally, in S200,
[0021] The first casing characteristic information includes:
[0022] The upper edge pixel information of the casing box, the lower edge pixel information of the upper part of the casing pin thread, and the preliminary pixel size of the casing.
[0023] Optionally, in S100, performing image preprocessing on the original image of the casing roughneck working, and obtaining the processed image includes:
[0024] S11 0, cropping the original image of the casing roughneck work to obtain an image of a region of interest ROI including the upper part of the casing box and pin threads;
[0025] S120 , performing Gaussian blur processing on the image of the region of interest ROI, and acquiring the processed image of the region of interest ROI as a processed image.
[0026] Optionally, the S400 specifically includes:
[0027] S410, obtaining the marker points of the original image of the casing iron roughneck working, and obtaining the actual height information and pixel information corresponding to the marker points;
[0028] The number of the landmark points is greater than or equal to 3;
[0029] S420, obtaining a proportionality factor between the actual height information and the pixel information according to the actual height information and the pixel information of the marker point using the geometric principle of similar triangles;
[0030] S430: According to the scale factor, convert the second casing characteristic information into corresponding actual height information as final casing characteristic information.
[0031] Optionally, the method further comprises:
[0032] S500, judging whether the casing is made up according to the final casing characteristic information, if the casing is not made up, re-execute steps S100 to S400 until the casing is made up.
[0033] Optionally, the S500 specifically includes:
[0034] S510, obtaining an actual height difference between the upper part of the casing pin thread and the box thread according to the final casing characteristic information;
[0035] When the actual height difference between the upper part of the thread of the casing pin buckle and the box buckle is equal to zero, the make-up is completed;
[0036] When the actual height of the difference between the upper part of the thread of the sleeve pin buckle and the box buckle is greater than zero, the make-up is not completed, and steps S100 to S400 are re-executed until the make-up is completed.
[0037] Optionally, the casing detection model includes:
[0038] Backbone network, neck network, head network;
[0039] The backbone network is used for feature extraction; the neck network is used for feature fusion and enhancement; the head network is used for decision making and is responsible for generating the final detection result;
[0040] The neck network includes a small object detection layer.
[0041] Optionally, the pre-set edge detection algorithm is Canny edge detection.
[0042] (III) Beneficial effects
[0043] The beneficial effects of the present invention are as follows: the method of casing height and size recognition based on machine vision of the present invention captures casing images through industrial cameras, sets a special ROI area, focuses on the casing and its joint position, and uses the trained casing detection model, edge detection algorithm and data calibration method. Compared with the prior art, it can obtain accurate size and deduction difference information, thereby greatly improving the accuracy and efficiency of the casing lowering process in drilling operations, and reducing the errors and safety risks of manual measurement. In addition, the real-time feedback monitoring data can ensure that each section of casing is safely and firmly connected, thereby improving the reliability and operation safety of the entire drilling project. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a flow chart of a method for recognizing casing height and size based on machine vision according to Embodiment 1 of the present invention;
[0045] Figure 2 A schematic diagram of a casing structure and a model recognition target according to Embodiment 2 of the present invention;
[0046] Figure 3 This is a schematic diagram of the casing detection process of Example 2 of the present invention. DETAILED DESCRIPTION
[0047] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.
[0048] A method for identifying casing height and size based on machine vision is proposed in an embodiment of the present invention. The casing image is captured by an industrial camera, and a special ROI area is set to focus on the casing and its joint position, thereby reducing interference from other drill pipe structures; in addition, the casing detection model is used to preliminarily identify the key parts of the casing, and then the edge detection algorithm is used to further accurately locate these parts to obtain more accurate size and buckle difference information; finally, the pixel data in the image is converted into actual casing size and height through calibration, thereby accurately calculating the installation status of the casing and the tightening condition of the thread; the embodiment of the present invention greatly improves the accuracy and efficiency of the casing lowering process in drilling operations, and reduces the errors and safety risks of manual measurement; the real-time feedback monitoring data ensures that each section of casing can be safely and firmly connected, thereby improving the reliability and operational safety of the entire drilling project.
[0049] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0050] Example 1
[0051] See also Figure 1 A method for recognizing casing height and size based on machine vision in an embodiment of the present invention includes:
[0052] Step S100, receiving a detection instruction issued by the iron roughneck, and obtaining an original image of the casing iron roughneck working according to the detection instruction; performing image preprocessing on the original image of the casing iron roughneck working to obtain a processed image;
[0053] Step S200: input the processed image into a pre-trained casing detection model to obtain first casing feature information;
[0054] The casing detection model is a YOLOv8 model with a small target detection layer added to the neck network;
[0055] Step S300, inputting the first sleeve feature information into a pre-set edge detection algorithm to obtain the second sleeve feature information;
[0056] Step S400: According to the second casing characteristic information, final casing characteristic information is obtained by data calibration.
[0057] During the specific implementation process, a visual industrial camera is installed 3-5m opposite to the casing iron roughneck of the drilling platform. The camera is fixed in a position that can cover the entire casing operation area and ensure that there is no obstruction in the field of view.
[0058] The present invention greatly improves the accuracy and efficiency of the casing process during drilling operations through automated height, size and thread recognition, and reduces manual measurement errors and safety risks. Real-time feedback of detection data can ensure that each section of casing can be safely and firmly connected, thereby improving the reliability and operational safety of the entire drilling project.
[0059] Example 2
[0060] See also Figure 3 , a method for recognizing casing height and size based on machine vision in this embodiment includes:
[0061] Step S100, receiving a detection instruction issued by the iron roughneck, and obtaining an original image of the casing iron roughneck working according to the detection instruction; performing image preprocessing on the original image of the casing iron roughneck working to obtain a processed image;
[0062] Step S200: input the processed image into a pre-trained casing detection model to obtain first casing feature information;
[0063] The casing detection model is a YOLOv8 model with a small target detection layer added to the neck network;
[0064] Step S300, inputting the first sleeve feature information into a pre-set edge detection algorithm to obtain the second sleeve feature information;
[0065] Step S400: According to the second casing characteristic information, final casing characteristic information is obtained by data calibration.
[0066] In this embodiment, before step S100, the following steps are also included:
[0067] Step S000: Collect images of casing processes on the drilling platform at different times, use them as training data sets, train the casing detection model, and obtain a trained casing detection model.
[0068] In the specific implementation process, step S000 specifically includes:
[0069] The images of the casing process on the drilling platform at different times are input into the casing detection model, and the cross entropy function and Adam optimizer are used with a learning rate of 0.001 until the cross entropy regression loss function is minimized to obtain the trained casing detection model.
[0070] In this embodiment, the images of the casing process on the drilling platform collected at different times include various possible operating states, lighting conditions and background environments.
[0071] In addition, before inputting the images of the casing process on the drilling platform at different times into the casing detection model, it is necessary to use Labelmg or VIA to mark the position of the casing and the position of the female and male buckles. At the same time, it is also necessary to adjust the size of all images to a uniform size for easy model processing.
[0072] In this embodiment, in step S200,
[0073] The first casing characteristic information includes:
[0074] The upper edge pixel information of the casing box, the lower edge pixel information of the upper part of the casing pin thread, and the preliminary pixel size of the casing.
[0075] In this embodiment, in step S100, the original image of the casing roughneck working is preprocessed to obtain the processed image, including:
[0076] Step S110, cropping the original image of the casing roughneck's work to obtain an image of a region of interest ROI including the upper part of the casing box and pin threads;
[0077] Step S120 , performing Gaussian blur processing on the image of the region of interest ROI, and obtaining the processed image of the region of interest ROI as the processed image.
[0078] In the specific implementation process, the drilling central control platform first receives the detection instruction issued by the roughneck, obtains the real-time video stream captured by the industrial camera according to the detection instruction, and obtains the original image of the casing roughneck working from the real-time video stream; based on prior knowledge, the position of the upper part of the casing box and pin thread is determined, and the fixed pixel value is widened left and right with the vertical center of the casing as the central axis, including the casing and part of the casing roughneck caliper; using the cropping function, the original image is cropped according to the determined coordinate range, and irrelevant parts are removed, and only the image of the region of interest ROI including the upper part of the casing box and pin thread is retained;
[0079] Next, a Gaussian blur filter is applied to the image of the region of interest ROI using the selected parameters to reduce image noise while maintaining edge information so that it is easier to distinguish different object boundaries in subsequent processing, and the processed image of the region of interest ROI is obtained as the processed image, such as Figure 2 shown.
[0080] In this embodiment, step S400 specifically includes:
[0081] Step S410, obtaining the marker points of the original image of the casing iron roughneck working, and obtaining the actual height information and pixel information corresponding to the marker points;
[0082] The number of landmark points is greater than or equal to 3;
[0083] Step S420: According to the actual height information and pixel information of the marker point, the proportionality factor between the actual height information and the pixel information is obtained by using the geometric principle of similar triangles;
[0084] Step S430: According to the scale factor, the second casing characteristic information is converted into corresponding actual height information as final casing characteristic information.
[0085] In the specific implementation process, the actual height information of three known pixel height points in space is first measured. This step is completed by selecting three clear marker points in the camera's field of view. The ordinates (pixel height points) of these points in the image coordinate system are recorded respectively, and the corresponding actual heights in the world coordinate system are also measured and recorded synchronously. The actual positions of these points are estimated by applying the geometric principle of similar triangles.
[0086] First, the pixel width of the object is calculated; then it is converted to actual width using the height scale factor calculated previously; finally, the system applies a linear interpolation algorithm to estimate the actual height of the object based on its pixel position in the image.
[0087] When running the algorithm, the camera must be calibrated first to determine the conversion relationship between the vertical coordinates in the world coordinate system and the image coordinate system. The specific process is as follows:
[0088] Use a ruler to select three points on the drill pipe image in the wellhead. The ordinates of these three points in the image coordinates are y0, y1, and y2, and their real heights from the drilling floor in the world coordinate system are y00, y11, and y22 respectively.
[0089] Then the proportional factor λ1 is calculated as follows:
[0090]
[0091] Then the actual height information corresponding to the second casing characteristic information is:
[0092] ω real =λ1*ω pixel
[0093] Among them, ω real is the actual height information corresponding to the second casing feature information, ω pixel is the characteristic information of the second casing, and λ1 is the proportional factor.
[0094] The second casing feature information is the upper edge pixel information of the secondary processed casing box buckle, the lower edge pixel information of the upper part of the secondary processed casing pin buckle thread, and the initial pixel size of the secondary processed casing.
[0095] A method for recognizing casing height and size based on machine vision in this embodiment also includes:
[0096] Step S500: determine whether the casing is made up according to the final casing feature information. If the casing is not made up, re-execute steps S100 to S400 until the casing is made up.
[0097] In this embodiment, the step S500 specifically includes:
[0098] Step S510, obtaining the actual height difference between the upper part of the casing pin thread and the box thread according to the final casing feature information;
[0099] When the actual height difference between the upper part of the casing male thread and the female thread is equal to zero, the make-up is completed;
[0100] When the actual height difference between the upper part of the sleeve pin thread and the box thread is greater than zero, the make-up is not completed, and steps S100 to S400 are re-executed until the make-up is completed.
[0101] In a specific implementation process, the final casing characteristic information includes: the actual size of the casing, the actual height of the upper edge of the casing box, and the actual height of the lower edge of the upper part of the pin thread;
[0102] Then in step S510, the actual height difference between the upper part of the casing pin thread and the box thread is the difference between the actual height of the lower edge of the upper part of the pin thread and the actual height of the upper edge of the casing box thread.
[0103] Based on the actual size of the casing and the actual height difference between the upper part of the casing male thread and the female thread, it can be determined whether the make-up is completed and how many threads are left if the screwing is not completed.
[0104] Furthermore, after obtaining the accurate actual size of the casing, if the make-up is not completed, the torque that the iron roughneck should apply to make the make-up can be obtained by looking up the casing size table until the make-up is completed.
[0105] In the specific implementation process, the casing detection model includes:
[0106] Backbone network, neck network, head network;
[0107] The backbone network is used for feature extraction; the neck network is used for feature fusion and enhancement; the head network is used for decision-making and is responsible for generating the final detection results;
[0108] The neck network includes a large-scale detection layer, a medium-scale detection layer, and a small-scale detection layer; the large-scale detection layer is used to detect larger objects, the medium-scale detection layer is used to detect medium-sized objects, and the small-scale detection layer is used to detect smaller objects;
[0109] The neck network in this embodiment also includes a small target detection layer, which provides a smaller scale detection layer. By adding the small target detection layer, the detection accuracy of the casing detection model for targets of different sizes can be improved, thereby improving the overall detection accuracy and recall rate.
[0110] Furthermore, the neck network also includes an adaptive feature fusion layer for solving the difference problem between features of different scales. By dynamically fusing feature maps from different scales, the casing detection model of this embodiment can better fuse information of different scales.
[0111] In this embodiment, the edge detection algorithm set in advance is Canny edge detection.
[0112] In this embodiment, the backbone network is responsible for extracting high-level features from the processed image, which includes multiple residual blocks and convolutional layers to gradually extract different levels of features in the processed image; the neck network is responsible for fusing the features extracted by the backbone network to enhance the detection capability of different targets. The head network includes multiple convolutional layers, fully connected layers, and anchor points. Multiple convolutional layers are used to further extract features, fully connected layers are used to generate bounding box coordinates, and anchor points are used to generate candidate boxes of different sizes and proportions.
[0113] The present invention greatly improves the accuracy and efficiency of the casing lowering process during drilling operations through automated height, size and thread recognition, and reduces errors and safety risks in manual measurement; real-time feedback of monitoring data ensures that each section of casing can be safely and securely connected, thereby improving the reliability and operational safety of the entire drilling project.
[0114] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0115] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0116] In the present invention, unless otherwise clearly specified and limited, when a first feature is “on” or “below” a second feature, it may be that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. Moreover, when a first feature is “above”, “above” or “above” a second feature, it may be that the first feature is directly above or obliquely above the second feature, or it may simply mean that the first feature is higher in level than the second feature. When a first feature is “below”, “below” or “below” a second feature, it may be that the first feature is directly below or obliquely below the second feature, or it may simply mean that the first feature is lower in level than the second feature.
[0117] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0118] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may alter, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A method for identifying casing height and size based on machine vision, characterized in that: include: S100, receiving a detection instruction issued by an iron roughneck, and acquiring an original image of the casing iron roughneck working according to the detection instruction; performing image preprocessing on the original image of the casing iron roughneck working to acquire a processed image; S200, inputting the processed image into a pre-trained casing detection model to obtain first casing feature information; The casing detection model is a YOLOv8 model with a small target detection layer added to the neck network; S300, inputting the first sleeve feature information into a pre-set edge detection algorithm to obtain second sleeve feature information; S400: Acquire final casing characteristic information by using data calibration according to the second casing characteristic information.
2. The method for sleeve height and size recognition based on machine vision according to claim 1, characterized in that: The S100 also includes: S000. Collect images of casing processes on the drilling platform at different times, use them as training data sets, train the casing detection model, and obtain a trained casing detection model.
3. The method for sleeve height and size recognition based on machine vision according to claim 2, characterized in that: The S000 specifically includes: The images of the casing process on the drilling platform at different times are input into the casing detection model, and the cross entropy function and Adam optimizer are used with a learning rate of 0.001 until the cross entropy regression loss function is minimized to obtain a trained casing detection model.
4. The method for sleeve height and size recognition based on machine vision according to claim 1, characterized in that: In the S200, The first casing characteristic information includes: The upper edge pixel information of the casing box, the lower edge pixel information of the upper part of the casing pin thread, and the preliminary pixel size of the casing.
5. The method for sleeve height and size recognition based on machine vision according to claim 1, characterized in that: In S100, the original image of the casing roughneck working is preprocessed to obtain the processed image, which includes: S110, cropping the original image of the casing roughneck working to obtain an image of a region of interest ROI including the upper part of the casing box and pin threads; S120 , performing Gaussian blur processing on the image of the region of interest ROI, and acquiring the processed image of the region of interest ROI as a processed image.
6. The method for sleeve height and size recognition based on machine vision according to claim 1, characterized in that: The S400 specifically includes: S410, obtaining the marker points of the original image of the casing iron roughneck working, and obtaining the actual height information and pixel information corresponding to the marker points; The number of the landmark points is greater than or equal to 3; S420, obtaining a proportionality factor between the actual height information and the pixel information according to the actual height information and the pixel information of the marker point using the geometric principle of similar triangles; S430: According to the scale factor, convert the second casing characteristic information into corresponding actual height information as final casing characteristic information.
7. The method for sleeve height and size recognition based on machine vision according to claim 1, characterized in that: The method further comprises: S500, judging whether the casing is made up according to the final casing characteristic information, if the casing is not made up, re-execute steps S100 to S400 until the casing is made up.
8. The method for sleeve height and size recognition based on machine vision according to claim 7, characterized in that: The S500 specifically includes: S510, obtaining an actual height difference between the upper part of the casing pin thread and the box thread according to the final casing characteristic information; When the actual height difference between the upper part of the thread of the casing pin buckle and the box buckle is equal to zero, the make-up is completed; When the actual height of the difference between the upper part of the thread of the sleeve pin buckle and the box buckle is greater than zero, the make-up is not completed, and steps S100 to S400 are re-executed until the make-up is completed.
9. The method for sleeve height and size recognition based on machine vision according to claim 1, characterized in that: The casing detection model includes: Backbone network, neck network, head network; The backbone network is used for feature extraction; the neck network is used for feature fusion and enhancement; the head network is used for decision making and is responsible for generating the final detection result; The neck network includes a small object detection layer.
10. The method for sleeve height and size recognition based on machine vision according to claim 1, characterized in that: The edge detection algorithm set in advance is Canny edge detection.
Citation Information
Cited By
Oil pipe state recognition method and device based on machine vision
CN120833586A