Oil-water well oil pipe thread profile measurement method based on three-dimensional point cloud self-adaptive slicing
Through the oil-water well thread profile measurement method based on three-dimensional point cloud adaptive slice, the problems of low oil pipe thread detection efficiency, large error and cumbersome wear detection in the prior art are solved, and efficient and accurate oil pipe thread detection is achieved, reducing the risk of crude oil production loss and the reduction of oil well fluid supply capacity.
Patent Information
- Application Number
- CN202311222348.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2025-03-21
AI Technical Summary
The existing oil pipe thread detection methods have problems such as uncleanness, low manual detection efficiency, large errors, cumbersome wear detection methods and large errors, resulting in oil well production loss and reduced liquid supply capacity.
The oil well oil pipe thread profile measurement method based on three-dimensional point cloud adaptive slice is used to obtain the three-dimensional point cloud data of the oil pipe through a laser three-dimensional scanner or depth camera, and normalize, feature extraction, slice processing and pseudo-image matching, and determine whether the thread is qualified based on the loss function.
It improves the working efficiency of oil pipe thread detection, reduces crude oil production loss, reduces labor intensity of manual measurement, improves measurement accuracy, avoids rework due to leakage of oil pipe seal, and ensures the stability of oil well fluid supply capacity.
Smart Images

Figure CN119666844A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of oil and gas artificial intelligence technology, and in particular to a method for measuring the thread shape of an oil well pipe based on three-dimensional point cloud adaptive slicing. Background Art
[0002] Causes such as knocks and corrosion may cause thread defects in the oil pipe. The oil pipe needs to be accurately tested for thread defects before use. If the threaded connection of the oil pipe is not sealed, the oil pipe will be connected to the annular space of the casing, and the liquid in the oil pipe will flow from the leakage point to the annular space of the casing, reducing the production of the oil well. The thread defects of the oil pipe will also cause the dynamic liquid level in the annular space of the casing to rise, the flow pressure to rise, the production pressure difference to drop, the current to change, the oil well's fluid supply capacity to decrease, affecting the well washing effect and balance rate, and reducing the safety and durability of the oil pipe.
[0003] The quality of the oil pipe thread directly affects the normal production of the oil field. At present, there are problems in the inspection of oil pipes: First, the oil pipe thread detector is not clean when used on site; second, in the production process of oil pipes, the oil pipe thread size is often measured manually, using thread gauges and taper gauges with a series of tools for manual inspection. This measurement method has low work efficiency and is greatly affected by human factors; third, the end threads and inner threads of the used old oil pipe threads are worn due to disassembly and assembly. When they reach a certain level, the sealing of the pipeline cannot be guaranteed. The head must be cut and reprocessed or the coupling must be replaced. If it is not replaced in time, leakage will occur, wasting energy. Fourth, to determine whether the worn threaded pipe can be used again, the commonly used method is direct observation. The rest of the oil pipes must be subjected to water pressure tests, which is troublesome and affects production efficiency, and the error is also large.
[0004] Traditional measurement methods use thread gauges and taper gauges with a series of tools for manual inspection, which is easy to damage the surface morphology of the oil pipe thread, and manual measurement has large errors and is time-consuming. Non-contact measurement methods based on two-dimensional image feature processing have limitations in measuring various morphological parameters (size, volume, etc.), and are affected by occlusion and shooting angles. The test mechanical structure is complex and the measurement error is large.
[0005] In the Chinese patent application with application number: CN202110076210.9, a bolt and nut defect diagnosis method and system based on image recognition is involved, and the method includes: first, selecting a bolt and nut defect structure diagram as a classification target database; judging whether there are defective bolts and nuts based on image recognition of bolt and nut feature information and the classification target database; if the judgment is yes, performing defect information feature analysis based on image recognition of bolt and nut feature information and the classification target database; performing defect diagnosis and target classification of defects based on the defect information feature analysis, which belongs to the general category of 2D image classification, and distinguishing nuts of different categories according to the different features reflected by the nuts in the image information.
[0006] In the Chinese patent application with application number: CN201811519636.1, a thread defect detection method and device based on linear polarized light is involved. The device includes an image sensor, a storage platform, an image acquisition card and a computer. The computer outputs and displays the grayscale image of the fastener, the processing process of the preprocessing module, and the determined type of fastener thread defects. The computer is used to analyze and process the grayscale image of the fastener collected by the image acquisition card, and the detection of missing threads, insufficient threads and thread length defects of the fastener is realized through an algorithm. It belongs to the general category of 2D grayscale image segmentation. After grayscale image processing, the nut image is segmented into several specific areas, and the length and width of the area are determined.
[0007] In the Chinese patent application with application number: 202220187886.5, a fully automatic thread defect recognition device is disclosed, which includes a slide support part, a slide moving part, a drag chain part, a high-frequency camera light source part, a pipe rack part, a lifting part and a host computer recognition device. The pipe part is fixed on the ground, the lifting part is arranged on one side of the pipe rack part, the slide support part is arranged on the side of the lifting part away from the pipe rack part, the slide support part is fixed on the ground, the slide moving part is located on the slide support part, the high-frequency camera light source part is fixed on the slide moving part, and the high-frequency camera light source part transmits the signal to the host computer recognition device through the drag chain part. The fully automatic thread defect recognition device can stably identify whether there are defects in the oil pipe thread, and it is feasible to automatically measure and estimate the shape of the oil pipe thread of the oil and water well.
[0008] The above existing technologies are greatly different from the present invention and fail to solve the technical problem we want to solve. For this reason, we have invented a new method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing. Summary of the invention
[0009] The purpose of the present invention is to provide a method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing, which can improve work efficiency, reduce crude oil production losses, and avoid the decrease of oil well fluid supply capacity due to leakage.
[0010] The purpose of the present invention can be achieved by the following technical measures: a method for measuring the shape of oil and water well pipe threads based on three-dimensional point cloud adaptive slicing, the method for measuring the shape of oil and water well pipe threads based on three-dimensional point cloud adaptive slicing includes:
[0011] Step 1, obtaining a three-dimensional point cloud image of the oil pipe thread;
[0012] Step 2, normalize 3D point cloud data;
[0013] Step 3, extracting global feature recognition point cloud images, performing point cloud positioning, and segmenting point cloud data;
[0014] Step 4, extract the marked detection area for denoising;
[0015] Step 5, dividing the 3D point cloud image into multiple blocks;
[0016] Step 6, projecting and mapping multiple point cloud blocks from front, top, and side angles to obtain pseudo images;
[0017] Step 7: Perform pseudo image matching and combine the loss function to determine whether it is qualified.
[0018] The purpose of the present invention can also be achieved by the following technical measures:
[0019] In step 1, the 3D scanner is fixed; the oil pipe is rotated, and a complete 3D point cloud image of the oil pipe is obtained through the 3D scanner.
[0020] In step 2, the acquired 3D point cloud data is converted into an N*D matrix, where N is the total number of points and D is 3, representing the corresponding coordinates of the 3D coordinates (x, y, z); the point cloud data formats include pts, LAS, and PCD formats.
[0021] Step 3 includes:
[0022] 1a) The input point cloud is an N*3 matrix, where N is the number of points;
[0023] 2a) Multiplying the point cloud data by an affine matrix to adjust the space and roughly adjust the angle of the oil pipe 3D point cloud data, wherein the affine matrix is predicted by the tensor network;
[0024] 3a) The dimension is increased to n*64 matrix through multi-layer perceptron;
[0025] 4a) Multiplying the point cloud data by an affine matrix to adjust the space and roughly adjust the angle of the oil pipe 3D point cloud data;
[0026] 5a) The dimension is increased to N*1024 through multi-layer perceptron;
[0027] 6a) Multiplying the point cloud data by an affine matrix to adjust the space and fine-tune the angle of the oil pipe 3D point cloud data;
[0028] 7a) Perform average pooling to become a 1*1024 dimensional matrix;
[0029] 8a) Concatenate the feature matrix into an N*64 dimensional matrix;
[0030] 9a) Using a multi-layer perceptron to reduce the dimension, an N*M dimensional matrix is obtained, where M is the number of categories;
[0031] 10a) Calculate the feature score of each point through the loss function.
[0032] In step 10a, the loss function loss is:
[0033]
[0034] Where x is a point in the point cloud and class is the number of categories, which is 1 in this case.
[0035] Step 4 includes:
[0036] 1b) Searching the neighborhood of a point;
[0037] 2b) Calculate the local density of each point;
[0038] 3b) Calculate the probability of drift points;
[0039] 4b) Traverse all points and delete the points whose drift probability is greater than the preset value;
[0040] 5b) Searching the neighborhood of a point, the formula for calculating the distance between a point and other points is:
[0041]
[0042]
[0043] Where p is the current point, m is the cluster center, dist(p i ,m j ) Determine the minimum distance between point p and the cluster center;
[0044] 6b) Classify p into the cluster center, and the new cluster center is obtained by the following formula:
[0045]
[0046] Among them, M jrepresents the number of all point clouds in the jth cluster, represents the point cloud set in the jth cluster, m′ j Represents the new cluster center;
[0047] 7b) Clustering is completed when the following formula is satisfied:
[0048] dist(m' j -m j ) <u1 (4)
[0049] Where u1 is the convergence threshold;
[0050] 8b) Calculate the average distance of the point cloud, the formula is:
[0051]
[0052] where m′ j is the total number of point clouds in the jth cluster, is the i-th point cloud in the j-th cluster;
[0053] 9b) Set the threshold coefficient u2, the point cloud distance within the cluster is greater than the average point cloud distance multiplied by the threshold coefficient, the formula is as follows:
[0054]
[0055] Step 5 includes:
[0056] 1d) Extracting the denoised 3D point cloud image of the oil pipe thread;
[0057] 2d) The 3D point cloud image of the oil pipe is cut into multiple cubes along the vertical direction starting from the pipe mouth, and the length, width and height of the cube are both the diameter of the oil pipe and 0.02 mm;
[0058] 3d) The 3D point cloud image of the oil pipe is cut into multiple cubes in the horizontal direction starting from the pipe mouth, and the length, width and height of the cube are both equal to the diameter of the oil pipe and 0.02 mm.
[0059] In step 6, projection mapping is performed on multiple point cloud blocks from front, top and side view angles to obtain pseudo images, and spline curves are used to fit the curve features of the 3D laser scanning shield tunnel point cloud slices.
[0060] Step 6 includes:
[0061] 1e) Based on the bottom surface of each cube, the value of each point is the maximum height of the midpoint of the cube, and a two-dimensional cross-sectional height map is generated;
[0062] 2e) Based on the bottom surface of each cube, the value of each point is the density of the point in the cube, and a two-dimensional cross-sectional density map is generated;
[0063] 3e) Based on the bottom surface of each cube, the value of each point is the maximum height of the midpoint of the cube, and a two-dimensional longitudinal height map is generated;
[0064] 4e) Based on the bottom surface of each cube, the value of each point is the density of the point in the cube, and a two-dimensional longitudinal density map is generated.
[0065] Step 7 includes:
[0066] 1f) Perform contour tracking and arc fitting on each longitudinal density map to determine the inner diameter of the oil pipe and the outer diameter of the thread. If the diameter exceeds the extreme value, the oil pipe is unqualified.
[0067] 2f) Track the contour of each cross-section density map to determine the thread spacing. If it exceeds the extreme value, it is unqualified;
[0068] 3f) Use deep learning to perform many-to-many transfer learning, match the qualification according to multiple standard YouTube training models, and determine whether it is qualified through the loss function.
[0069] The method for measuring the shape of oil pipe threads in oil and water wells based on three-dimensional point cloud adaptive slicing in the present invention uses a laser three-dimensional scanner or a depth camera to obtain three-dimensional point cloud data of the oil pipe, which is used to obtain the shape parameter index of the oil pipe threads in the oil and water wells, monitor the wear condition of the oil pipe threads, and extract the characteristic dimensions of the oil pipe threads for inspecting the quality of the oil pipe threads. The system is portable and can be embedded in a computer or an intelligent board with a certain computing power, and applied to automatic measuring equipment. Compared with the prior art, the beneficial effects of the present invention are as follows: the traditional measurement method uses a thread gauge and a taper gauge in conjunction with a series of tools for manual inspection, which is easy to damage the surface morphology of the oil pipe threads, and the manual measurement error is large and time-consuming. The non-contact measurement method based on two-dimensional image feature processing has limitations in measuring various morphological parameters (size, volume, etc.) and has a large measurement error. The problem of lax sealing of the oil pipe thread can be discovered in time, the labor intensity of manual measurement can be reduced, the measurement accuracy can be improved, the rework of the operation due to leakage of the oil pipe seal can be reduced, the work efficiency can be improved, the loss of crude oil production can be reduced, and the decline of the oil well fluid supply capacity due to leakage can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 It is a flow chart of a specific embodiment of the method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing of the present invention;
[0071] Figure 2 A schematic diagram of identifying a point cloud image in a specific embodiment of the present invention;
[0072] Figure 3 A two-dimensional cross-sectional density map in a specific embodiment of the present invention;
[0073] Figure 4It is a two-dimensional longitudinal density map in a specific embodiment of the present invention. DETAILED DESCRIPTION
[0074] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0075] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations and / or combinations thereof.
[0076] A method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing, comprising the steps of:
[0077] 1) Obtain the three-dimensional point cloud image of the oil pipe thread.
[0078] 2) Normalize 3D point cloud data.
[0079] 3) Extract global features to identify point cloud images, perform point cloud positioning, and segment point cloud data.
[0080] 4) Extract the labeled detection area for denoising.
[0081] 5) Divide the 3D point cloud image into multiple blocks.
[0082] 6) Perform projection mapping on multiple point cloud blocks from front, top and side view angles to obtain pseudo images.
[0083] 7) Perform pseudo image matching combined with loss function to determine whether it is qualified.
[0084] Furthermore, the step 1) of obtaining the three-dimensional point cloud image of the oil pipe thread includes the following steps: 1) fixing the 3D scanner. The 3D scanner includes an industrial-grade dot-matrix laser 3D scanner, an RGBD depth camera, a color 3D scanner, etc., and the accuracy should be within 0.04 mm. 2) rotating the oil pipe and obtaining a complete 3D point cloud image of the oil pipe through the 3D scanner.
[0085] Furthermore, the step 2) of normalizing the 3D point cloud data includes the following steps: 1) converting the acquired 3D point cloud data into an N*D matrix, where N is the total number of points and D is 3, representing the corresponding coordinates of the 3D coordinates (x, y, z). The point cloud data formats include pts, LAS, PCD, etc.
[0086] Furthermore, in step 3), extracting the global feature recognition point cloud image, performing image positioning, and marking the positioning frame includes the following steps: 1) inputting the point cloud as an N*3 matrix, where N is the number of points. 2) multiplying an affine matrix to adjust the point cloud data spatially and roughly adjust the angle of the 3D point cloud data of the oil pipe, wherein the affine matrix is obtained by tensor network prediction. 3) upgrading the dimension to an n*64-dimensional matrix through a multilayer perceptron. 4) multiplying an affine matrix to adjust the point cloud data spatially and roughly adjust the angle of the 3D point cloud data of the oil pipe. 5) upgrading the dimension to N*1024 through a multilayer perceptron. 6) multiplying an affine matrix to adjust the point cloud data spatially and finely adjust the angle of the 3D point cloud data of the oil pipe. 7) performing average pooling (satisfying symmetry invariance) to become a 1*1024-dimensional matrix, global eigenvalue. 8) splicing the feature matrix to an N*64-dimensional matrix. 9) reducing the dimension through a multilayer perceptron to obtain an N*M-dimensional matrix, wherein M is the number of categories. 10) Calculate the feature score of each point through the loss function.
[0087] Furthermore, the tensor network is a mathematical model for processing multidimensional data. It consists of multiple tensors, each of which represents data in a certain dimension. These tensors are combined and calculated through a series of mathematical operations (such as tensor multiplication, tensor contraction, etc.), thereby achieving modeling and analysis of complex data.
[0088] Furthermore, the extraction of the marked detection area for denoising in step 4) includes the following steps: 1) searching for a neighborhood of a point. 2) calculating the local density of each point. 3) calculating the probability of drift points. 4) traversing all points and deleting points whose probability of drift points is greater than a preset value.
[0089] Furthermore, the 3D point cloud image is divided into multiple blocks in step 5) as follows: 1) Extract the denoised 3D point cloud image of the oil pipe thread. 2) Cut the 3D point cloud image of the oil pipe vertically from the pipe mouth into multiple cubes, the length and width of the cubes are both the diameter of the oil pipe and the height is 0.02mm. 3) Cut the 3D point cloud image of the oil pipe horizontally from the pipe mouth into multiple cubes, the length and width of the cubes are both the diameter of the oil pipe and the height is 0.02mm.
[0090] Furthermore, in step 6), the 3D point cloud image is divided into a plurality of blocks in the following steps: 1) Based on the bottom surface of each cube, the value of each point is the maximum height of the midpoint of the cube, and a two-dimensional cross-section height map is generated. 2) Based on the bottom surface of each cube, the value of each point is the density of the midpoint of the cube, and a two-dimensional cross-section density map is generated. 3) Based on the bottom surface of each cube, the value of each point is the maximum height of the midpoint of the cube, and a two-dimensional longitudinal height map is generated. 4) Based on the bottom surface of each cube, the value of each point is the density of the midpoint of the cube, and a two-dimensional longitudinal density map is generated.
[0091] Furthermore, the step 7) performs pseudo image matching combined with a loss function to determine whether it is qualified includes the following steps: 1) Perform contour tracking and arc fitting on each longitudinal density map to determine the inner diameter of the oil pipe and the outer diameter of the thread. If it exceeds the extreme value, it is unqualified. 2) Perform contour tracking on each cross-sectional density map to determine the thread spacing. If it exceeds the extreme value, it is unqualified. 3) Use deep learning to perform many-to-many transfer learning, perform qualification matching based on multiple standard oil pipe training models, and determine whether it is qualified through a loss function.
[0092] The following are several specific embodiments of the present invention.
[0093] Example 1
[0094] In a specific embodiment 1 of the present invention, the present invention obtains a complete 3D point cloud map of the oil pipe by scanning the oil pipe thread through an industrial-grade 3D laser scanner. The equipment in the embodiment includes: an industrial-grade 3D laser scanner, a computer, an automatic oil pipe scanning device, and a rotating motor. The automatic oil pipe scanning device should be able to fix and rotate the oil pipe. The spherical camera should have the function of controlling the focal length and direction. The computer should have a strong core processing capability and a video memory of more than 1G. The motor drives the oil pipe to rotate at a constant speed on the track.
[0095] like Figure 1 As shown, Figure 1 The flowchart of the oil and water well oil pipe thread shape measurement method based on three-dimensional point cloud adaptive slicing of the present invention. The oil and water well oil pipe thread shape measurement method based on three-dimensional point cloud adaptive slicing includes the following steps:
[0096] 1) Obtain the three-dimensional point cloud image of the oil pipe thread.
[0097] 2) Normalize 3D point cloud data.
[0098] 3) Extract global features to identify point cloud images, perform point cloud positioning, and segment point cloud data.
[0099] 4) Extract the labeled detection area for denoising.
[0100] 5) Divide the 3D point cloud image into multiple blocks.
[0101] 6) Projection mapping is performed on multiple point cloud blocks from front, top and side view angles to obtain pseudo images, and spline curves are fitted to three-dimensional laser scanning shield tunnel point cloud slices.
[0102] 7) Perform pseudo image matching combined with loss function to determine whether it is qualified.
[0103] Further fixed 3D scanner. The 3D scanner includes industrial-grade dot laser 3D scanner, RGBD depth camera, color 3D scanner, etc., and the accuracy should be within 0.04mm. Rotate the oil pipe and obtain the complete 3D point cloud map of the oil pipe through the 3D scanner.
[0104] Further, the acquired 3D point cloud data is converted into an N*D matrix, where N is the total number of points and D is 3, representing the coordinates corresponding to the 3D coordinates (x, y, z). The point cloud data formats include pts, LAS, PCD, etc.
[0105] Further, such as Figure 2 The extraction of global feature recognition point cloud image, point cloud positioning, and segmentation of point cloud data specifically include the following steps: 1) Input point cloud is an N*3 matrix, where N is the number of points in the point cloud. 2) Multiply the point cloud data by a 3*3 affine matrix to adjust the space of the point cloud data, and the affine matrix is obtained by regularization after tensor network prediction. 3) Multiply the point cloud data by the 3*3 affine matrix to roughly adjust the angle of the oil pipe 3D point cloud data. 4) Upgrade the dimension to N*64 dimension matrix through multilayer perceptron. 5) Multiply the point cloud data by a 64*64 affine matrix to adjust the space of the point cloud data and roughly adjust the angle of the oil pipe 3D point cloud data. 6) Upgrade the dimension to N*1024 dimension through multilayer perceptron. 7) Multiply the point cloud data by a 1024*1024 affine matrix to adjust the space of the point cloud data and finely adjust the angle of the oil pipe 3D point cloud data. 8) Perform average pooling (satisfying symmetry invariance) to become a 1*1024 dimensional matrix, global eigenvalue. 9) Copy the feature matrix N times and concatenate them into an N*64-dimensional matrix to get the feature of each point. 10) Output the score with the global feature. 11) Reduce the dimension to an N*M-dimensional matrix through a multi-layer perceptron, where m is the category, and in this case, the value of m is 1. 12) Calculate the classification of each point cloud through the loss function, and the loss function is:
[0106]
[0107] Where x is a point in the point cloud and class is the number of categories, which is 1 in this case.
[0108] Furthermore, the point cloud denoising processing method is used to denoise the point cloud. In this example, the denoising steps are as follows: 1) Search the neighborhood of a point, and the formula for calculating the distance between a point and other points is:
[0109]
[0110] Where p is the current point, m is the cluster center, dist(p i ,m j ) Determine the minimum distance between point p and the cluster center.
[0111] 2) Classify p into the cluster center, and the new cluster center is obtained by the following formula:
[0112]
[0113] Among them, M j represents the number of all point clouds in the jth cluster, represents the point cloud set in the jth cluster, m′ j Represents the new cluster center.
[0114] 3) Clustering is completed when the following formula is satisfied:
[0115] dist(m' j -m j ) <u1 (4)
[0116] Where u1 is the convergence threshold.
[0117] 4) Calculate the average distance of the point cloud, the formula is:
[0118]
[0119] where m′ j is the total number of point clouds in the jth cluster, is the i-th point cloud in the j-th cluster
[0120] 5) Set the threshold coefficient u2, the point whose point cloud distance within the cluster is greater than the average point cloud distance multiplied by the threshold coefficient, the formula is as follows:
[0121]
[0122] Further, extract each point of the oil pipe thread after each point classification, and cut the 3D point cloud image of the oil pipe into multiple cubes starting from the pipe mouth along the vertical direction, and the length, width and height of the cube are both 0.02mm of the oil pipe diameter. Further, cut the 3D point cloud image of the oil pipe into multiple cubes starting from the pipe mouth along the horizontal direction, and the length, width and height of the cube are both 0.02mm of the oil pipe diameter.
[0123] Furthermore, for the two-dimensional cross-sectional density map, the bottom surface of each cube is used as the basis, and the value of each point is the maximum height of the midpoint of the cube to generate a two-dimensional cross-sectional height map, and the value of each point is the density of the midpoint of the cube to generate a two-dimensional cross-sectional density map.
[0124] For the two-dimensional longitudinal density map, the bottom surface of each cube is used as the basis, and the value of each point is the maximum height of the midpoint of the cube. A two-dimensional longitudinal height map is generated. The value of each point is the density of the midpoint of the cube. A two-dimensional longitudinal density map is generated.
[0125] Furthermore, contour tracking and arc fitting are performed on each longitudinal density map to determine the inner diameter of the oil pipe and the outer diameter of the thread. If they exceed the extreme value, they are unqualified. Contour tracking is performed on each cross-sectional density map to determine the thread spacing. If they exceed the extreme value, they are unqualified. Many-to-many transfer learning is performed using deep learning, and the qualification is matched according to multiple standard oil pipe training models, and the qualification is determined by the loss function.
[0126] Example 2
[0127] like Figure 2 As shown, a 3D point cloud dataset is used to represent the shape of a pipe thread. The point cloud dataset can be represented by a 4x3 affine matrix to generate a point cloud dataset and an affine matrix. The point cloud dataset contains 4 points, each of which is represented by three coordinate values. The affine matrix is a 4x3 matrix, in which the first three rows represent the rotation and scaling transformation of the point cloud dataset, and the last row represents the translation transformation. The shape features of the pipe thread are extracted by performing adaptive slicing measurement on the point cloud dataset. The specific method involves calculating the curvature, normal direction and other information of the point cloud, and performing slicing measurement based on this information.
[0128] Example 3
[0129] like Figure 3 As shown in the figure, the 3D point cloud data of the oil pipeline can be transformed and processed using a 4×4 affine matrix. Affine matrices can be used to represent transformation operations such as translation, rotation, scaling, and shearing, and the corresponding matrix elements are set according to specific needs. In order to maintain the properties of homogeneous coordinates, when using affine matrices for transformation, the coordinates of each point need to be expanded into homogeneous coordinates, that is, (x, y, z) is expanded to (x, y, z, 1). The transformed coordinates (x', y', z') need to be divided by w again, that is, (x' / w, y' / w, z' / w). Finally, by performing affine transformation on all points, the processing and transformation of the 3D point cloud data of the oil pipeline can be achieved.
[0130] Example 4
[0131] like Figure 3 , Figure 4As shown in the figure, a two-dimensional longitudinal density map and a two-dimensional cross-sectional density map are obtained from the 3D point cloud image of the oil pipe thread. The steps are as follows: 1. Data preprocessing: First, data preprocessing is required for the 3D point cloud image of the thread. This includes operations such as removing noise points, filtering, and point cloud registration. 2. Select the section: Select the appropriate section according to whether to generate a longitudinal density map or a cross-sectional density map. The longitudinal density map refers to cutting along the axis of the oil pipe, while the cross-sectional density map refers to cutting perpendicular to the axis of the oil pipe. 3. Cut the point cloud: According to the selected section, the point cloud is cut along the corresponding cutting plane. This can be achieved using the cutting function in the point cloud processing software. 4. Density calculation: For the cut point cloud, a density map can be generated by calculating the point cloud density on each cutting plane. This can be achieved using the calculation density function of the point cloud processing software. 5. Visualization: Use drawing software such as Matplotlib or Plotly to visualize the calculated density map.
[0132] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions recorded in the aforementioned embodiments or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0133] Except for the technical features described in the specification, all other technical features are known technologies to those skilled in the art.
Claims
1. A method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing, characterized in that: The oil and water well oil pipe thread shape measurement method based on three-dimensional point cloud adaptive slicing includes: Step 1, obtaining a three-dimensional point cloud image of the oil pipe thread; Step 2, normalize 3D point cloud data; Step 3, extracting global feature recognition point cloud images, performing point cloud positioning, and segmenting point cloud data; Step 4, extract the marked detection area for denoising; Step 5, divide the 3D point cloud image into multiple blocks; Step 6, projecting and mapping multiple point cloud blocks from front, top, and side angles to obtain pseudo images; Step 7: Perform pseudo image matching and combine the loss function to determine whether it is qualified.
2. The method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing according to claim 1 is characterized in that: In step 1, the 3D scanner is fixed; the oil pipe is rotated, and a complete 3D point cloud image of the oil pipe is obtained through the 3D scanner.
3. The method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing according to claim 1 is characterized in that: In step 2, the acquired 3D point cloud data is converted into an N*D matrix, where N is the total number of points and D is 3, representing the corresponding coordinates of the 3D coordinates (x, y, z); the point cloud data formats include pts, LAS, and PCD formats.
4. The method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing according to claim 3 is characterized in that: Step 3 includes: 1a) The input point cloud is an N*3 matrix, where N is the number of points; 2a) Multiplying the point cloud data by an affine matrix to adjust the space and roughly adjust the angle of the oil pipe 3D point cloud data, wherein the affine matrix is predicted by the tensor network; 3a) The dimension is increased to n*64 matrix through multi-layer perceptron; 4a) Multiplying the point cloud data by an affine matrix to adjust the space and roughly adjust the angle of the oil pipe 3D point cloud data; 5a) The dimension is increased to N*1024 through multi-layer perceptron; 6a) Multiplying the point cloud data by an affine matrix to adjust the space and fine-tune the angle of the oil pipe 3D point cloud data; 7a) Perform average pooling to become a 1*1024 dimensional matrix; 8a) Concatenate the feature matrix into an N*64 dimensional matrix; 9a) Using a multi-layer perceptron to reduce the dimension, an N*M dimensional matrix is obtained, where M is the number of categories; 10a) Calculate the feature score of each point through the loss function.
5. The method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing according to claim 4 is characterized in that: In step 10a, the loss function loss is: Where x is a point in the point cloud and class is the number of categories, which is 1 in this case.
6. The method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing according to claim 1 is characterized in that: Step 4 includes: 1b) Searching the neighborhood of a point; 2b) Calculate the local density of each point; 3b) Calculate the probability of drift points; 4b) Traverse all points and delete the points whose drift probability is greater than the preset value; 5b) Searching the neighborhood of a point, the formula for calculating the distance between a point and other points is: Where p is the current point, m is the cluster center, dist(p i ,m j ) Determine the minimum distance between point p and the cluster center; 6b) Classify p into the cluster center, and the new cluster center is obtained by the following formula: Among them, M j represents the number of all point clouds in the jth cluster, represents the point cloud set in the jth cluster, m′ j Represents the new cluster center; 7b) Clustering is completed when the following formula is satisfied: dist(m' j -m j )<u1 (4) Where u1 is the convergence threshold; 8b) Calculate the average distance of the point cloud, the formula is: where m′ j is the total number of point clouds in the jth cluster, is the i-th point cloud in the j-th cluster; 9b) Set the threshold coefficient u2, the point cloud distance within the cluster is greater than the average point cloud distance multiplied by the threshold coefficient, the formula is as follows:
7. The method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing according to claim 1 is characterized in that: Step 5 includes: 1d) Extracting the denoised 3D point cloud image of the oil pipe thread; 2d) The 3D point cloud image of the oil pipe is cut into multiple cubes along the vertical direction starting from the pipe mouth, and the length, width and height of the cube are both the diameter of the oil pipe and 0.02 mm; 3d) The 3D point cloud image of the oil pipe is cut into multiple cubes in the horizontal direction starting from the pipe mouth, and the length, width and height of the cube are both equal to the diameter of the oil pipe and 0.02 mm.
8. The method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing according to claim 1 is characterized in that: In step 6, projection mapping is performed on multiple point cloud blocks from front, top and side view angles to obtain pseudo images, and spline curves are used to fit the curve features of the 3D laser scanning shield tunnel point cloud slices.
9. The method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing according to claim 8 is characterized in that: Step 6 includes: 1e) Based on the bottom surface of each cube, the value of each point is the maximum height of the midpoint of the cube, and a two-dimensional cross-sectional height map is generated; 2e) Based on the bottom surface of each cube, the value of each point is the density of the point in the cube, and a two-dimensional cross-sectional density map is generated; 3e) Based on the bottom surface of each cube, the value of each point is the maximum height of the midpoint of the cube, and a two-dimensional longitudinal height map is generated; 4e) Based on the bottom surface of each cube, the value of each point is the density of the point in the cube, and a two-dimensional longitudinal density map is generated.
10. The method for measuring the thread shape of oil and water well pipes based on three-dimensional point cloud adaptive slicing according to claim 1, characterized in that: Step 7 includes: 1f) Perform contour tracking and arc fitting on each longitudinal density map to determine the inner diameter of the oil pipe and the outer diameter of the thread. If the diameter exceeds the extreme value, the oil pipe is unqualified. 2f) Track the contour of each cross-section density map to determine the thread spacing. If it exceeds the extreme value, it is unqualified; 3f) Use deep learning to perform many-to-many transfer learning, match the qualification according to multiple standard YouTube training models, and determine whether it is qualified through the loss function.
Citation Information
Patent Citations
Thread defect detecting method and device based on linearly polarized light
CN109387524A
Bolt and nut defect diagnosis method and system based on image recognition
CN112907514A
Full-automatic thread defect recognition device
CN216978862U
Water diversion vertical shaft defect detection method based on three-dimensional laser scanning technology
CN110030951A
Pipeline inner surface detection method and device based on three-dimensional point cloud
CN112581457A
Cited By
Method for measuring height and diameter of circular embossing based on three-dimensional vision
CN120651117A
Construction behavior identification method based on 3D point cloud and visible light image data fusion
CN121661708A
Automatic focusing method for oil pipe thread detection
CN122027893A