A method for measuring the geometric size of a beam-type pumping unit and related device

By acquiring motion video of the beam pumping unit through a camera and utilizing the relationship between the motion trajectories of feature points in the image and the world coordinate system, the extrinsic parameters of the beam plane relative to the camera are calculated. This solves the problem of safe, fast, and non-contact measurement of the geometric dimensions of the beam pumping unit, and enables accurate diagnosis of the pumping unit's condition.

CN116558419BActive Publication Date: 2026-04-10CHANGZHOU AIKONG INTELLIGENT INSTR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHANGZHOU AIKONG INTELLIGENT INSTR CO LTD
Filing Date
2023-05-25
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies lack a safe, fast, and non-contact method for measuring the geometry of beam pumping units, especially when the equipment is old or relevant data is unavailable, which affects the acquisition of indicator diagrams and the diagnosis of pumping unit conditions.

Method used

The motion video of the walking beam pumping unit is acquired by a camera. The relationship between the motion trajectory of feature points in the image and the world coordinate system is used to calculate the extrinsic parameters of the crank and walking beam plane relative to the camera. Combined with the intrinsic parameters, the size of the part to be measured is measured, and a non-contact visual recognition method is adopted.

Benefits of technology

It enables safe, fast, and non-contact measurement of the geometric dimensions of beam pumping units, providing a foundation for obtaining indicator diagrams and diagnosing the condition of pumping units, and improving the accuracy and efficiency of the measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116558419B_ABST
    Figure CN116558419B_ABST
Patent Text Reader

Abstract

The application discloses a beam pumping unit geometric size measurement method and related device, and the motion video of the beam pumping unit is acquired through a camera, the motion trajectory of a feature point in an image coordinate system is extracted from the motion video, the extrinsic parameter of a crank plane relative to the camera is calculated according to the relationship between the motion trajectory coordinate points in the image coordinate system and the motion trajectory coordinate points in a world coordinate system, the extrinsic parameter of a beam plane relative to the camera is calculated according to the extrinsic parameter of the crank plane relative to the camera, and the size of a to-be-measured part is obtained according to the intrinsic parameter, all the extrinsic parameters and the image containing the to-be-measured part in the image coordinate system, so that a safe, fast and non-contact size measurement method is provided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a beam pumping unit geometry measurement method and related device, and belongs to the field of size measurement of oilfield production equipment. BACKGROUND

[0002] The beam pumping unit is an important part of oilfield production equipment, and its geometry measurement has a key influence on the electric parameter conversion indicator diagram. The indicator diagram is an important diagnostic means for the state of the pumping unit, and one of its acquisition methods is to deduce through high-speed sampling of the motor torque and speed. However, this deduction requires accurate size data of the pumping unit, including the length of the connecting rod, the length of the beam forearm, the length of the beam rear arm, the distance from the beam balance weight to the beam support center, and the size of the right triangle between the beam support center and the rotation center of the crank (including the horizontal distance, the vertical distance, and the distance therebetween). When the equipment is old or the related data cannot be obtained, a safe, fast and non-contact size measurement method is needed, but there is currently no corresponding method. SUMMARY

[0003] The present application provides a beam pumping unit geometry measurement method and related device, which solves the problems disclosed in the background art.

[0004] In order to solve the above technical problems, the technical scheme adopted by the present application is:

[0005] A beam pumping unit geometry measurement method, comprising:

[0006] obtaining a motion video of the beam pumping unit from a camera; wherein a feature point is preset on a crank of the beam pumping unit;

[0007] extracting a motion trajectory A from the motion video, and determining the correspondence between the coordinate points in the motion trajectory A and the coordinate points in a motion trajectory B; wherein the motion trajectory A is the motion trajectory of the feature point in the image coordinate system, and the motion trajectory B is the motion trajectory of the feature point in the world coordinate system;

[0008] calculating the extrinsic parameters of the crank plane relative to the camera according to the correspondence between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B, and the intrinsic parameters obtained by pre-calibration of the camera;

[0009] calculating the extrinsic parameters of the beam plane relative to the camera according to the extrinsic parameters of the crank plane relative to the camera, and the distance between the crank plane and the beam plane;

[0010] obtaining the size of the to-be-measured part according to the intrinsic parameters, all extrinsic parameters, and an image D containing the to-be-measured part in the image coordinate system; wherein the image D is extracted from the motion video.

[0011] The plumb line of the camera is parallel to the imaging plane of the camera; and the motion trajectory A is an elliptical trajectory.

[0012] The corresponding relationship between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B is determined, including:

[0013] The coordinate point at the left end of the elliptical trajectory corresponds to the coordinate point at the left end of the motion trajectory B, and the coordinate point at the right end of the elliptical trajectory corresponds to the coordinate point at the right end of the motion trajectory B; according to the frame rate of the camera, the rotation period of the uniform motion of the crank, and the crank radius, a corresponding point of any intermediate coordinate point of the elliptical trajectory in the motion trajectory B is obtained; wherein the crank radius is the distance from the rotation center point of the crank to the feature point.

[0014] The external parameter of the walking beam plane relative to the camera is calculated, and the formula is:

[0015]

[0016] In the formula, R b , t b is the external parameter of the walking beam plane relative to the camera, R b is the rotation matrix of the walking beam plane relative to the camera coordinate system in the world coordinate system, t b is the translation vector of the walking beam plane relative to the camera coordinate system in the world coordinate system, R c , t c is the external parameter of the crank plane relative to the camera, R c is the rotation matrix of the crank plane relative to the camera coordinate system in the world coordinate system, t c is the translation vector of the crank plane relative to the camera coordinate system in the world coordinate system, is the translation vector of the walking beam coordinate system relative to the crank coordinate system, and L is the distance between the crank plane and the walking beam plane.

[0017] According to the internal parameter, all external parameters, and the image D containing the to-be-measured part in the image coordinate system, the size of the to-be-measured part is obtained, including:

[0018] If the size points S1 and S2 of the to-be-measured part in the image D are located on the crank plane, the coordinates of the size points S1 and S2 in the world coordinate system are calculated according to the internal parameter, the external parameter of the crank plane relative to the camera, and the coordinates of the size points S1 and S2 in the image coordinate system, and the size of the to-be-measured part is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system; wherein the distance between the size points S1 and S2 in the world coordinate system represents the size of the to-be-measured part;

[0019] If the size points S1 and S2 of the part to be measured in the image D are located on the walking beam plane, the coordinates of the size points S1 and S2 in the world coordinate system are calculated according to the intrinsic parameters, the extrinsic parameters of the walking beam plane relative to the camera, and the coordinates of the size points S1 and S2 in the image coordinate system, and the size of the part to be measured is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system.

[0020] If the size points S1 and S2 of the part to be measured in the image D are located on the walking beam plane, the coordinates of the size points S1 and S2 in the world coordinate system are calculated according to the intrinsic parameters, the extrinsic parameters of the walking beam plane relative to the camera, and the coordinates of the size points S1 and S2 in the image coordinate system, and the size of the part to be measured is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system.

[0021] A walking beam pumping unit geometric size measurement device, comprising:

[0022] A video acquisition module is configured to acquire a motion video of the walking beam pumping unit from the camera, wherein a feature point is preset on the crank of the walking beam pumping unit.

[0023] A coordinate relationship acquisition module is configured to extract a motion trajectory A from the motion video and determine a corresponding relationship between coordinate points in the motion trajectory A and coordinate points in a motion trajectory B, wherein the motion trajectory A is a motion trajectory of the feature point in an image coordinate system, and the motion trajectory B is a motion trajectory of the feature point in a world coordinate system.

[0024] A first heterodyne calculation module is configured to calculate extrinsic parameters of the crank plane relative to the camera according to the corresponding relationship between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B and intrinsic parameters obtained by pre-calibration of the camera.

[0025] A second heterodyne calculation module is configured to calculate extrinsic parameters of the walking beam plane relative to the camera according to the extrinsic parameters of the crank plane relative to the camera and a distance between the crank plane and the walking beam plane.

[0026] A size calculation module is configured to obtain the size of the part to be measured according to the intrinsic parameters, all the extrinsic parameters, and an image D containing the part to be measured in the image coordinate system, wherein the image D is extracted from the motion video.

[0027] The chief vertical line of the camera is parallel to the imaging plane of the camera, and the motion trajectory A is an elliptical trajectory.

[0028] In the coordinate relationship acquisition module, the corresponding relationship between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B includes:

[0029] The coordinate point at the left end of the elliptical trajectory corresponds to the coordinate point at the left end of the motion trajectory B, and the coordinate point at the right end of the elliptical trajectory corresponds to the coordinate point at the right end of the motion trajectory B; according to the frame rate of the camera, the rotation period of the uniform motion of the crank, and the crank radius, a corresponding point of any intermediate coordinate point of the elliptical trajectory in the motion trajectory B is obtained; wherein the crank radius is the distance from the rotation center point of the crank to the feature point.

[0030] In the second heterodyne calculation module, the external parameter of the walking beam plane relative to the camera is calculated, and the formula is:

[0031]

[0032] In the formula, R b , t b is the external parameter of the walking beam plane relative to the camera, R b is the rotation matrix of the walking beam plane relative to the camera coordinate system in the world coordinate system, t b is the translation vector of the walking beam plane relative to the camera coordinate system in the world coordinate system, R c , t c is the external parameter of the crank plane relative to the camera, R c is the rotation matrix of the crank plane relative to the camera coordinate system in the world coordinate system, t c is the translation vector of the crank plane relative to the camera coordinate system in the world coordinate system, is the translation vector of the walking beam coordinate system relative to the crank coordinate system, and L is the distance between the crank plane and the walking beam plane.

[0033] The size calculation module is configured to:

[0034] If the size points S1 and S2 of the to-be-measured part in the image D are located on the crank plane, the coordinates of the size points S1 and S2 in the world coordinate system are calculated according to the intrinsic parameter, the external parameter of the crank plane relative to the camera, and the coordinates of the size points S1 and S2 in the image coordinate system, and the size of the to-be-measured part is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system; wherein the distance between the size points S1 and S2 in the world coordinate system represents the size of the to-be-measured part;

[0035] If the size points S1 and S2 of the to-be-measured part in the image D are located on the walking beam plane, the coordinates of the size points S1 and S2 in the world coordinate system are calculated according to the intrinsic parameter, the external parameter of the walking beam plane relative to the camera, and the coordinates of the size points S1 and S2 in the image coordinate system, and the size of the to-be-measured part is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system;

[0036] If the size points S1 and S2 of the to-be-measured part in the image D are located on the crank plane and the beam plane respectively, the coordinates of the size point S1 in the world coordinate system are calculated according to the internal parameters, the external parameters of the crank plane relative to the camera, and the coordinates of the size point S1 in the image coordinate system, the coordinates of the size point S2 in the world coordinate system are calculated according to the internal parameters, the external parameters of the beam plane relative to the camera, and the coordinates of the size point S2 in the image coordinate system, and the size of the to-be-measured part is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system.

[0037] A computer-readable storage medium stores one or more programs, the one or more programs comprising instructions which, when executed by a computing device, cause the computing device to perform a beam-type pumping unit geometric dimension measurement method.

[0038] A computer device includes one or more processors and one or more memories, one or more programs are stored in the one or more memories and configured to be executed by the one or more processors, the one or more programs include instructions for performing a beam-type pumping unit geometric dimension measurement method.

[0039] The present application has the beneficial effects: the present application obtains the motion video of the beam-type pumping unit through the camera, extracts the motion trajectory of the feature point in the image coordinate system from the motion video of the beam-type pumping unit, calculates the external parameters of the crank plane relative to the camera according to the relationship between the motion trajectory coordinate points in the image coordinate system and the motion trajectory coordinate points in the world coordinate system, calculates the external parameters of the beam plane relative to the camera according to the external parameters of the crank plane relative to the camera, and obtains the size of the to-be-measured part according to the internal parameters, all external parameters, and the image containing the to-be-measured part in the image coordinate system, which is a safe, fast and non-contact dimension measurement method. BRIEF DESCRIPTION OF DRAWINGS

[0040] Figure 1 A flowchart of a beam-type pumping unit geometric dimension measurement method;

[0041] Figure 2 A schematic diagram of a beam-type pumping unit. DETAILED DESCRIPTION

[0042] The present application will be further described below in conjunction with the drawings. The following examples are only used to more clearly illustrate the technical solutions of the present application, and cannot be used to limit the protection scope of the present application.

[0043] As Figure 1 shown, a beam-type pumping unit geometric dimension measurement method includes the following steps:

[0044] Step 1, acquiring motion video of the beam pumping unit from a camera; wherein a feature point is preset on the crank of the beam pumping unit;

[0045] Step 2, extracting a motion trajectory A from the motion video, and determining a corresponding relationship between coordinate points in the motion trajectory A and coordinate points in a motion trajectory B; wherein the motion trajectory A is a motion trajectory of the feature point in an image coordinate system, and the motion trajectory B is a motion trajectory of the feature point in a world coordinate system;

[0046] Step 3, calculating an extrinsic parameter of a crank plane relative to the camera according to the corresponding relationship between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B, and an intrinsic parameter obtained by pre-calibration of the camera;

[0047] Step 4, calculating an extrinsic parameter of a beam plane relative to the camera according to the extrinsic parameter of the crank plane relative to the camera and a distance between the crank plane and the beam plane;

[0048] Step 5, obtaining a size of a to-be-measured part according to the intrinsic parameter, all the extrinsic parameters, and an image D containing the to-be-measured part in the image coordinate system; wherein the image D is extracted from the motion video.

[0049] The above method acquires motion video of the beam pumping unit from the camera, extracts a motion trajectory of a feature point in an image coordinate system from the motion video of the beam pumping unit, calculates an extrinsic parameter of a crank plane relative to the camera according to a relationship between coordinate points in the motion trajectory in the image coordinate system and coordinate points in the motion trajectory in a world coordinate system, calculates an extrinsic parameter of a beam plane relative to the camera according to the extrinsic parameter of the crank plane relative to the camera, and obtains a size of a to-be-measured part according to an intrinsic parameter, all the extrinsic parameters, and an image containing the to-be-measured part in the image coordinate system, thereby providing a safe, fast and non-contact size measurement method.

[0050] In the above method, the camera can be a smart phone that can be carried at any time. Before implementing the above method, the camera needs to be calibrated to obtain the intrinsic parameter of the camera, which can be as follows:

[0051] First, images of multiple views are acquired, then corner points of a calibration board are found on the images, and finally an optimization algorithm is used to obtain the intrinsic parameter and distortion parameter of the camera. Specifically, a calibration board (such as a chessboard) is used for multi-view shooting, and the intrinsic parameter of the camera is solved by minimizing the projection error and using an optimization algorithm (such as the Levenberg-Marquardt algorithm), including the focal length (f x , f y ), principal point coordinates (c x , c y ), and radial and tangential distortion coefficients, which can be expressed as follows:

[0052]

[0053] In the formula, K is the camera intrinsic matrix, f x , f y are the X-axis focal length and Y-axis focal length respectively, c x , c y are the X-axis coordinate value and Y-axis coordinate value of the principal point coordinate respectively.

[0054]

[0055] In the formula, D is the camera distortion coefficient matrix, k1, k2, k3 are radial distortion coefficients, and p1, p2 are tangential distortion coefficients.

[0056] In the implementation of the above method, the camera, i.e. the smart phone, can be supported by a tripod, and the pose of the smart phone is adjusted using the IMU (Inertial Measurement Unit) sensor built in the smart phone, so that the plumb line of the smart phone (i.e. the gravity direction of the smart phone) is parallel to the imaging plane.

[0057] In order to facilitate visual recognition, a feature point is preset on the crank, as shown in Figure 2 The feature point is optimally arranged at the end of the crank rotation axis, and a magnetic attraction method can be used to attract a feature point, and a video of the walking beam pumping unit motion is captured by the smart phone with adjusted pose.

[0058] The image of each frame of the video is an image in the image coordinate system, and since there are radial distortion coefficients and tangential distortion coefficients, further distortion removal is needed to ensure accuracy.

[0059] The distortion removal is performed by the distortion coefficients obtained through the camera calibration process, and the commonly used model in the calibration process is the radial distortion and tangential distortion model; wherein the radial distortion is caused by the spherical shape of the lens, and is usually corrected by the following formula:

[0060] x corrected =x(1+k1r 2 +k2r 4 +k3r 6 )

[0061] y corrected =y(1+k1r 2 +k2r 4 +k3r 6 )

[0062] In the formula, (x, y) is the point coordinate on the distorted image, (x corrected , y corrected ) is the corrected point coordinate, and r = x 2 + y 2 .

[0063] Tangential distortion is caused by the fact that lens elements are not perfectly parallel to the imaging plane, and is usually corrected using the following equation:

[0064] x corrected = x + [2p1xy + p2(r 2 + 2x 2 )]

[0065] x corrected = y + [p1(r 2 + 2y 2 ) + 2p2xy]

[0066] In actual operation, radial distortion correction is usually performed first, and then tangential distortion correction is performed.

[0067] For the corrected video, the motion trajectory of the feature point in the image coordinate system can be extracted therefrom, and is defined as motion trajectory A. Under normal circumstances, the motion trajectory of the feature point is a circle, but due to perspective, the motion trajectory A is an elliptical trajectory.

[0068] In the mathematical field, there is a certain correspondence relationship among the image coordinate system, the camera coordinate system and the world coordinate system. The motion trajectory of the feature point in the world coordinate system is defined as motion trajectory B. Therefore, based on the motion trajectory A, the correspondence relationship between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B can be determined, which can be as follows:

[0069] Fitting the elliptical trajectory: assuming that each point on the elliptical trajectory is represented as (u, v), the entire elliptical trajectory can be represented as:

[0070]

[0071] In the formula, (u0, v0) is the center of the ellipse, and a and b are the lengths of the major and minor semi-axes of the ellipse, respectively.

[0072] Determining the correspondence relationship of the leftmost and rightmost points: since the plumb line of the smart phone remains parallel to the imaging plane, the coordinate point at the left end of the elliptical trajectory corresponds to the coordinate point at the left end of the motion trajectory B, and the coordinate point at the right end of the elliptical trajectory corresponds to the coordinate point at the right end of the motion trajectory B.

[0073] Determining the correspondence relationship of the intermediate points: the corresponding point of any intermediate coordinate point of the elliptical trajectory in the motion trajectory B can be obtained according to the frame rate of the camera, the rotation period of the uniform motion of the crank, and the crank radius, wherein the crank radius is the distance from the rotation center point of the crank to the feature point, which can be measured and obtained by setting the feature point.

[0074] Assuming the frame rate of the camera is fps, and the rotation period of the crank uniform motion is T, then the rotation angle of the crank corresponding to each frame can be expressed as:

[0075]

[0076] In the formula, t is the time of the current frame, which is calculated according to the frame rate, and θ is the rotation angle of the crank;

[0077] For any intermediate coordinate point, the corresponding point (X, Y, Z) in the world coordinate system can be obtained:

[0078] X = Rcosθ

[0079] Y = Rsinθ

[0080] Z = 0

[0081] In the formula, R is the radius of the crank.

[0082] After obtaining the correspondence between the coordinate points in motion trajectory A and the coordinate points in motion trajectory B, since the relationship between the image coordinate system and the camera coordinate system can be obtained based on the intrinsic parameters, the extrinsic parameters of the crank plane relative to the camera can be further calculated.

[0083] This is a problem of calculating the camera extrinsic parameters based on n 3D-2D corresponding points, which will be calculated using a problem called Perspective-n-Point (PnP). First, define a set of points P in the world coordinate system i = (X i , Y i , Z i ), and the corresponding points p i = (u i , v i ) in the image coordinate system, i = 1, 2,..., n. The goal here is to find R c and t c , so that the following projection equation holds:

[0084] s i p i = K(R c P i + t c )

[0085] In the formula, R c is the rotation matrix of the crank plane relative to the camera coordinate system in the world coordinate system, t c is the translation vector of the crank plane relative to the camera coordinate system in the world coordinate system, and s i is the scaling factor;

[0086] Further expanding the above formula gives:

[0087] s i u i =f x (X′ i +t cx )+u0

[0088] s i v i =f y (Y′ i +t cy )+v0

[0089] s i =Z′ i +t cz

[0090] In the formula, R c P i =P′ i =(X′ i ,Y′ i ,Z′ i );

[0091] The above equation set can be written in the form of least squares, and then the Levenberg-Marquardt optimization algorithm is used to solve R c and t c , that is, the external parameter of the crank plane relative to the camera can be obtained, and through the external parameter, the position and attitude of the crank plane relative to the camera can be known.

[0092] The size data of the pumping unit not only involves the crank plane but also involves the beam plane, the external parameter of the crank plane relative to the camera, and the distance between the crank plane and the beam plane. The external parameter of the beam plane relative to the camera is calculated, and the specific formula can be expressed as:

[0093]

[0094]

[0095] In the formula, t c,b is the translation vector of the beam coordinate system relative to the crank coordinate system, L is the distance between the crank plane and the beam plane, R b , t b is the external parameter of the beam plane relative to the camera, R b is the rotation matrix of the beam plane relative to the camera coordinate system under the world coordinate system, t b is the translation vector of the beam plane relative to the camera coordinate system under the world coordinate system, R c , t c is the external parameter of the crank plane relative to the camera.

[0096] In the case of knowing the extrinsic and intrinsic parameters, any point in the image coordinate system can find the corresponding point in the world coordinate system. Assuming the point (u, v) in the image coordinate system, the extended homogeneous coordinates are [u v 1] T According to the intrinsic parameter matrix and the rotation matrix, the point in the rotated camera coordinate system is:

[0097]

[0098] In the formula, P c is the point in the camera coordinate system. If the point (u, v) is in the crank plane, R' is R c If the point (u, v) is in the beam plane, R' is R b ;

[0099] The depth Z c is:

[0100]

[0101] In the formula, t z is the z component of the translation vector in the extrinsic parameters, P cz is the z component of P c ;

[0102] Finally, the point in the world coordinate system is:

[0103] P w = P c · Z c -t'

[0104] In the formula, P w is the point in the world coordinate system. If the point (u, v) is in the crank plane, t' is t c If the point (u, v) is in the beam plane, t' is t b .

[0105] Based on the above analysis, therefore, the image containing the measured part is extracted from the motion video, which is the image in the image coordinate system, defined as image D. According to the intrinsic parameters, all extrinsic parameters, and image D, the size of the measured part can be obtained.

[0106] The size data of the pumping unit is some distance data, so the distance between the two end points of the measured part in the world coordinate system can be directly calculated. Here, the two end points are defined as size points S1 and S2, and the distance between size points S1 and S2 in the world coordinate system represents the size of the measured part.

[0107] If the size points S1 and S2 of the part to be measured in the image D are both located on the crank plane, the coordinates of the size points S1 and S2 in the world coordinate system are calculated according to the intrinsic parameters, the extrinsic parameters of the crank plane relative to the camera, and the coordinates of the size points S1 and S2 in the image coordinate system, and the size of the part to be measured is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system.

[0108] If the size points S1 and S2 of the part to be measured in the image D are both located on the beam plane, the coordinates of the size points S1 and S2 in the world coordinate system are calculated according to the intrinsic parameters, the extrinsic parameters of the beam plane relative to the camera, and the coordinates of the size points S1 and S2 in the image coordinate system, and the size of the part to be measured is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system.

[0109] If the size points S1 and S2 of the part to be measured in the image D are located on the crank plane and the beam plane respectively, the coordinates of the size point S1 in the world coordinate system are calculated according to the intrinsic parameters, the extrinsic parameters of the crank plane relative to the camera, and the coordinates of the size point S1 in the image coordinate system, the coordinates of the size point S2 in the world coordinate system are calculated according to the intrinsic parameters, the extrinsic parameters of the beam plane relative to the camera, and the coordinates of the size point S2 in the image coordinate system, and the size of the part to be measured is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system.

[0110] After the size of the pumping unit is obtained, the mechanical structure of the pumping unit is known, so that the torque and the rotating speed of the motor can be converted into the position and the load of the polished rod, the position is taken as the horizontal coordinate, and the load is taken as the vertical coordinate, so that the dynamometer card of the polished rod is obtained; further, the fullness condition of the well, the leakage condition of the valve, and the working conditions of waxing, sand sticking, and broken rod can be diagnosed according to the shape of the dynamometer card.

[0111] The present application realizes safe, fast and non-contact size measurement of the pumping unit based on visual recognition, and provides a basis for acquisition of the dynamometer card and diagnosis of the state of the pumping unit.

[0112] Based on the same technical scheme, the present application further discloses a geometric size measurement device of the beam pumping unit, which is a virtual device, such as software, for the above method, and specifically comprises:

[0113] A video acquisition module is used to acquire the motion video of the beam pumping unit from the camera; wherein a feature point is preset on the crank of the beam pumping unit, and the plumb line of the camera is parallel to the imaging plane of the camera.

[0114] A coordinate relationship acquisition module is used to extract the motion trajectory A from the motion video, and determine the corresponding relationship between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B; wherein the motion trajectory A is the motion trajectory of the feature point in the image coordinate system, which is an elliptical trajectory, and the motion trajectory B is the motion trajectory of the feature point in the world coordinate system.

[0115] determining the correspondence between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B, comprising:

[0116] the coordinate point at the left end of the elliptical trajectory corresponds to the coordinate point at the left end of the motion trajectory B, and the coordinate point at the right end of the elliptical trajectory corresponds to the coordinate point at the right end of the motion trajectory B; according to the frame rate of the camera, the rotation period of the uniform motion of the crank, and the crank radius, the corresponding point of any intermediate coordinate point of the elliptical trajectory in the motion trajectory B is obtained; wherein the crank radius is the distance from the rotation center point of the crank to the feature point.

[0117] a first heterodyne calculation module, configured to calculate the extrinsic parameters of the crank plane relative to the camera according to the correspondence between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B, and the intrinsic parameters obtained by pre-calibration of the camera.

[0118] a second heterodyne calculation module, configured to calculate the extrinsic parameters of the walking beam plane relative to the camera according to the extrinsic parameters of the crank plane relative to the camera and the distance between the crank plane and the walking beam plane.

[0119] The extrinsic parameters of the walking beam plane relative to the camera are calculated, and the formula can be expressed as:

[0120]

[0121] In the formula, R b , t b are the extrinsic parameters of the walking beam plane relative to the camera, R b is the rotation matrix of the walking beam plane relative to the camera coordinate system in the world coordinate system, t b is the translation vector of the walking beam plane relative to the camera coordinate system in the world coordinate system, R c , t c are the extrinsic parameters of the crank plane relative to the camera, R c is the rotation matrix of the crank plane relative to the camera coordinate system in the world coordinate system, t c is the translation vector of the crank plane relative to the camera coordinate system in the world coordinate system, is the translation vector of the walking beam coordinate system relative to the crank coordinate system, and L is the distance between the crank plane and the walking beam plane.

[0122] a size calculation module, configured to obtain the size of the to-be-measured part according to the intrinsic parameters, all extrinsic parameters, and an image D containing the to-be-measured part in the image coordinate system; wherein the image D is extracted from the motion video.

[0123] The specific process can be as follows:

[0124] If the size points S1 and S2 of the to-be-measured part in the image D are located on the crank plane, the coordinates of the size points S1 and S2 in the world coordinate system are calculated according to the intrinsic parameters, the extrinsic parameters of the crank plane relative to the camera, and the coordinates of the size points S1 and S2 in the image coordinate system, and the size of the to-be-measured part is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system; wherein the distance between the size points S1 and S2 in the world coordinate system represents the size of the to-be-measured part.

[0125] If the size points S1 and S2 of the to-be-measured part in the image D are located on the walking beam plane, the coordinates of the size points S1 and S2 in the world coordinate system are calculated according to the intrinsic parameters, the extrinsic parameters of the walking beam plane relative to the camera, and the coordinates of the size points S1 and S2 in the image coordinate system, and the size of the to-be-measured part is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system.

[0126] If the size points S1 and S2 of the to-be-measured part in the image D are located on the crank plane and the walking beam plane respectively, the coordinates of the size point S1 in the world coordinate system are calculated according to the intrinsic parameters, the extrinsic parameters of the crank plane relative to the camera, and the coordinates of the size point S1 in the image coordinate system, the coordinates of the size point S2 in the world coordinate system are calculated according to the intrinsic parameters, the extrinsic parameters of the walking beam plane relative to the camera, and the coordinates of the size point S2 in the image coordinate system, and the size of the to-be-measured part is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system.

[0127] Based on the same technical scheme, the application further discloses a computer readable storage medium, which stores one or more programs, and the one or more programs comprise instructions, which, when executed by a computing device, cause the computing device to perform the walking beam pumping unit geometric dimension measurement method.

[0128] Based on the same technical scheme, the application further discloses a computer device, which comprises one or more processors and one or more memories, one or more programs are stored in the one or more memories and are configured to be executed by the one or more processors, and the one or more programs comprise instructions for performing the walking beam pumping unit geometric dimension measurement method.

[0129] Those skilled in the art should understand that embodiments of the application can be provided as a method, a system, or a computer program product. Therefore, the application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the application can adopt a computer program product in the form of being implemented on one or more computer usable storage media containing computer usable program codes (including but not limited to disk storage, CD-ROM, optical storage, etc.).

[0130] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flows and / or block diagram block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps in one or more flowcharts and / or blocks

[0131] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flows and / or block diagram block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps in one or more flowcharts and / or blocks

[0132] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flows and / or block diagram block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps in one or more flowcharts and / or blocks

[0133] The above merely provides an embodiment of the present application, but is not intended to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall fall within the scope of the claims of the present application.

Claims

1. A method of geometric dimension measurement of a beam-type pumping unit, characterized by, The method comprises the following steps: acquiring a motion video of a beam pumping unit from a camera; wherein a feature point is preset on a crank of the beam pumping unit; a plumb line of the camera is parallel to an imaging plane of the camera; extracting a motion trajectory A from the motion video, and determining a corresponding relationship between coordinate points in the motion trajectory A and coordinate points in a motion trajectory B; wherein the motion trajectory A is a motion trajectory of the feature point in an image coordinate system, the motion trajectory A is an elliptical trajectory, and the motion trajectory B is a motion trajectory of the feature point in a world coordinate system; calculating an extrinsic parameter of a crank plane relative to the camera according to the corresponding relationship between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B and an intrinsic parameter obtained by pre-calibration of the camera; calculating an extrinsic parameter of a beam plane relative to the camera according to the extrinsic parameter of the crank plane relative to the camera and a distance between the crank plane and the beam plane; obtaining a size of a to-be-measured part according to the intrinsic parameter, all the extrinsic parameters and an image D containing the to-be-measured part in the image coordinate system; wherein the image D is extracted from the motion video. The determination of the corresponding relationship between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B comprises: a coordinate point at a left end of the elliptical trajectory corresponds to a coordinate point at a left end of the motion trajectory B, and a coordinate point at a right end of the elliptical trajectory corresponds to a coordinate point at a right end of the motion trajectory B; a corresponding point of any intermediate coordinate point of the elliptical trajectory in the motion trajectory B is obtained according to a frame rate of the camera, a rotation period of the uniform motion of the crank and a crank radius; wherein the crank radius is a distance from a rotation center point of the crank to the feature point.

2. The beam-pumping unit geometry measurement method of claim 1, characterized in that The formula for calculating the extrinsic parameter of the beam plane relative to the camera is: ; wherein, R b , t b is the extrinsic parameter of the walking beam plane relative to the camera, R b is the rotation matrix of the walking beam plane relative to the camera coordinate system in the world coordinate system, t b is the translation vector of the walking beam plane relative to the camera coordinate system in the world coordinate system, R c , t c is the extrinsic parameter of the crank plane relative to the camera, R c is the rotation matrix of the crank plane relative to the camera coordinate system in the world coordinate system, t c is the translation vector of the crank plane relative to the camera coordinate system in the world coordinate system, is the translation vector of the walking beam coordinate system relative to the crank coordinate system, L is the distance between the crank plane and the walking beam plane.

3. The method of geometric dimension measurement of a beam-type pumping unit according to claim 1, characterized in that, The obtaining of the size of the to-be-measured part according to the intrinsic parameter, all the extrinsic parameters and the image D containing the to-be-measured part in the image coordinate system comprises: if size points S1 and S2 of the to-be-measured part in the image D are both located on the crank plane, calculating coordinates of the size points S1 and S2 in the world coordinate system according to the intrinsic parameter, the extrinsic parameter of the crank plane relative to the camera and coordinates of the size points S1 and S2 in the image coordinate system, and obtaining the size of the to-be-measured part according to the coordinates of the size points S1 and S2 in the world coordinate system; wherein a distance between the size points S1 and S2 in the world coordinate system represents the size of the to-be-measured part; if the size points S1 and S2 of the to-be-measured part in the image D are both located on the beam plane, calculating coordinates of the size points S1 and S2 in the world coordinate system according to the intrinsic parameter, the extrinsic parameter of the beam plane relative to the camera and the coordinates of the size points S1 and S2 in the image coordinate system, and obtaining the size of the to-be-measured part according to the coordinates of the size points S1 and S2 in the world coordinate system; if the size points S1 and S2 of the to-be-measured part in the image D are located on the crank plane and the beam plane respectively, calculating a coordinate of the size point S1 in the world coordinate system according to the intrinsic parameter, the extrinsic parameter of the crank plane relative to the camera and the coordinate of the size point S1 in the image coordinate system, calculating a coordinate of the size point S2 in the world coordinate system according to the intrinsic parameter, the extrinsic parameter of the beam plane relative to the camera and the coordinate of the size point S2 in the image coordinate system, and obtaining the size of the to-be-measured part according to the coordinates of the size points S1 and S2 in the world coordinate system.

4. A beam pump geometry measuring device, characterized by, The method comprises the following steps: The video acquisition module is configured to acquire a motion video of the beam pumping unit from a camera, wherein a feature point is preset on a crank of the beam pumping unit, and a plumb line of the camera is parallel to an imaging plane of the camera; The coordinate relationship acquisition module is configured to extract a motion trajectory A from the motion video, and determine a corresponding relationship between coordinate points in the motion trajectory A and coordinate points in a motion trajectory B, wherein the motion trajectory A is a motion trajectory of the feature point in an image coordinate system, the motion trajectory A is an elliptical trajectory, and the motion trajectory B is a motion trajectory of the feature point in a world coordinate system; The first heterodyne calculation module is configured to calculate an extrinsic parameter of a crank plane relative to the camera according to the corresponding relationship between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B, and an intrinsic parameter of the camera acquired in advance by calibration; The second heterodyne calculation module is configured to calculate an extrinsic parameter of a beam plane relative to the camera according to the extrinsic parameter of the crank plane relative to the camera and a distance between the crank plane and the beam plane; The size calculation module is configured to obtain a size of the to-be-measured part according to the intrinsic parameter, all the extrinsic parameters, and an image D containing the to-be-measured part in the image coordinate system, wherein the image D is extracted from the motion video. In the coordinate relationship acquisition module, the corresponding relationship between the coordinate points in the motion trajectory A and the coordinate points in the motion trajectory B is determined, including: A coordinate point at a left end of the elliptical trajectory corresponds to a coordinate point at a left end of the motion trajectory B, and a coordinate point at a right end of the elliptical trajectory corresponds to a coordinate point at a right end of the motion trajectory B; a corresponding point of any intermediate coordinate point of the elliptical trajectory in the motion trajectory B is obtained according to a frame rate of the camera, a rotation period of the uniform motion of the crank, and a crank radius; wherein the crank radius is a distance from a rotation center point of the crank to the feature point.

5. The beam-pumping unit geometry measuring device according to claim 4, characterised in that In the second heterodyne calculation module, the extrinsic parameter of the beam plane relative to the camera is calculated, and a formula is as follows: ; In the formula, R b , t b The extrinsic parameter of the beam plane relative to the camera. R b Let be the rotation matrix of the beam plane in the world coordinate system relative to the camera coordinate system. t b Let be the translation vector of the beam plane in the world coordinate system relative to the camera coordinate system. R c , t c The external parameter of the crank plane relative to the camera. R c Let be the rotation matrix of the crank plane in the world coordinate system relative to the camera coordinate system. t c Let be the translation vector of the crank plane in the world coordinate system relative to the camera coordinate system. Let be the translation vector of the beam coordinate system relative to the crank coordinate system. L This is the distance between the crank plane and the walking beam plane.

6. The beam-pumping unit geometry measuring device according to claim 4, characterised in that The size calculation module is configured to: if the size points S1 and S2 of the to-be-measured part in the image D are both located on the crank plane, calculate coordinates of the size points S1 and S2 in the world coordinate system according to the intrinsic parameter, the extrinsic parameter of the crank plane relative to the camera, and coordinates of the size points S1 and S2 in the image coordinate system, and obtain the size of the to-be-measured part according to the coordinates of the size points S1 and S2 in the world coordinate system; wherein a distance between the size points S1 and S2 in the world coordinate system represents the size of the to-be-measured part; if the size points S1 and S2 of the to-be-measured part in the image D are both located on the beam plane, calculate coordinates of the size points S1 and S2 in the world coordinate system according to the intrinsic parameter, the extrinsic parameter of the beam plane relative to the camera, and coordinates of the size points S1 and S2 in the image coordinate system, and obtain the size of the to-be-measured part according to the coordinates of the size points S1 and S2 in the world coordinate system. If the size points S1 and S2 of the part to be measured in the image D are located on the crank plane and the walking beam plane respectively, the coordinates of the size point S1 in the world coordinate system are calculated according to the internal parameters, the external parameters of the crank plane relative to the camera and the coordinates of the size point S1 in the image coordinate system, the coordinates of the size point S2 in the world coordinate system are calculated according to the internal parameters, the external parameters of the walking beam plane relative to the camera and the coordinates of the size point S2 in the image coordinate system, and the size of the part to be measured is obtained according to the coordinates of the size points S1 and S2 in the world coordinate system.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform any of the methods of claims 1-3.

8. A computer device, comprising: Comprise: One or more processors, and one or more memories, one or more programs stored in the one or more memories and configured to be executed by the one or more processors, the one or more programs comprising instructions for performing any of the methods of claims 1-3.

Citation Information

Patent Citations

  • Method for implementing quasi-elliptic grinding track of stylus pressure head

    CN101797718A

  • Camera calibration method and system, and computer readable storage medium

    CN116071433A