A method and system for quickly adjusting a pipe bending machine

Through the multi-camera system and three-dimensional reconstruction algorithm, the problems of high cost and insufficient accuracy of pipe fitting detection in the existing technology are solved, non-contact and efficient pipe fitting measurement and dimensional correction are achieved, and the detection efficiency and accuracy are significantly improved.

CN112489195BActive Publication Date: 2024-09-20XINTUO 3D TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011349784.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-26
Publication Date
2024-09-20
Estimated Expiration
2040-11-26

AI Technical Summary

Technical Problem

The existing technology has high cost and inflexible fixed fixture requirements in pipe inspection, as well as the inability to achieve high-accuracy dimensional correction. In particular, it is difficult to achieve effective measurement and correction in pipes with complex shapes and special structures.

Method used

A multi-camera system is used to combine high-resolution cameras, LED light panels and light source diffusion panels. Through image capture and three-dimensional reconstruction algorithms, non-contact, efficient and accurate pipe fitting measurement and dimensional correction are achieved. The seed cylinder method and linear interpolation method are used to perform image processing. Matching and reconstruction, combined with camera internal and external parameter calibration to improve measurement accuracy.

Benefits of technology

It achieves complete pipe fitting reconstruction within 3 seconds with an error of 0.15mm. It has significant robustness and automated operation, is suitable for a variety of pipe fitting types, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112489195B
    Figure CN112489195B
Patent Text Reader

Abstract

The present invention discloses a method and system for rapid adjustment of a pipe bending machine. First, a multi-camera system is selected; a model of internal and external parameters of the multi-camera system is established; the multi-camera system is calibrated using the internal and external parameter model of the multi-camera system and a calibration plate; the image of the pipe fitting is captured by the calibrated multi-camera system to fit a seed cylinder; the three-dimensional model of the pipe fitting is retrieved and reconstructed based on the seed cylinder and the image of the pipe fitting captured by the multi-camera system; and the size of the pipe bending machine is corrected using the three-dimensional model of the pipe fitting. The present invention proposes a high-precision and high-robust multi-camera calibration method for solving the internal and external parameters of the camera using a specific calibration plate. In the image matching process based on the seed cylinder, the edge of the seed cylinder is located in combination with the grayscale threshold. In order to minimize the deviation of the reconstruction process, the linear interpolation method is combined with the method based on the seed cylinder.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pipe fittings, and in particular to a quick adjustment method and system for a pipe bending machine. Background Art

[0002] Pipe fittings are important parts in the aviation and automotive fields, responsible for the transportation of liquids and gases and the connection of components. Considering the safety of aircraft and automobiles, the shape of the pipe must be checked before installation to prevent potential dangers caused by excessive assembly stress (especially in the engine). On the other hand, with the development of CNC machine tools (Computer numerical control machine tools) technology for pipe bending machines, most of the pipes used for automobile or aircraft bodies are produced by CNC pipe bending machines. In order to reduce the waste of pipe fitting materials during the bending process, an auxiliary pipe shape measurement system that can correct the size of pipe fittings is required. However, because the spatial morphology of most pipe fittings is relatively complex and it is difficult to mark and detect their surfaces, how to achieve rapid measurement and feedback of measurement results is a very difficult task.

[0003] At present, industrial sites mostly use fixed fixtures to inspect pipe fittings, which can quickly detect whether the pipe shape meets the requirements. However, there are some limitations that cannot be ignored: (1) One type of pipe fitting corresponds to one fixed fixture. The more types of pipe fittings are inspected, the more types of fixtures are needed. (2) The fixture needs to be made by mold making, which is too expensive. In addition, some pipe fittings are difficult to produce corresponding fixtures due to their special structure. This situation is often encountered in pipe fittings used in aircraft. In addition, manufacturing too many fixtures is not in line with the sustainable development strategy, because once a certain type of pipe fitting is no longer used, the corresponding fixture will no longer be used. (3) The fixture can only check the shape of the bent pipe fitting. When used in conjunction with a CNC bending machine, it can only qualitatively check whether it meets the requirements, and cannot provide the correction required in production. Summary of the invention

[0004] The purpose of the present invention is to make up for the defects of the existing technology, provide a method and system for rapid adjustment of a pipe bending machine, realize non-contact, efficient and high-accuracy pipe measurement, and can perform pipe detection and deviation correction in the bending process. In this process, there are three core technical points: capturing pipe images, multi-camera self-calibration, and three-dimensional reconstruction algorithm of pipes. First, the selected multi-camera system is designed with a high-resolution camera, lens, backlight source, and light source diffusion plate, so that high-quality and clear-contrast pipe images can be captured quickly and stably, and are not affected by ambient light changes and surface texture of the object to be measured; secondly, a high-precision and high-robust multi-camera calibration method is proposed to solve the internal and external parameters of the camera using a specific calibration plate. Third, for image matching and reconstruction in the process of pipe measurement, an efficient, accurate and complete seed cylinder method is proposed. In the image matching process based on the seed cylinder, the edge of the seed cylinder is located in combination with the grayscale threshold. In order to minimize the deviation of the reconstruction process, the linear interpolation method is combined with the seed cylinder-based method. The external parameters of a camera refer to the transformation matrix R and translation matrix T between a single camera coordinate system and the image plane coordinate system. These two parameters can solve the problem of converting the specific coordinates of each point captured by the camera between different coordinate systems. The relative external parameters also refer to the transformation matrix R and translation matrix T, but they regard two or more cameras as a whole and the translation and conversion relationship between the coordinate system of a third camera.

[0005] The present invention is achieved through the following technical solutions:

[0006] A method for quickly adjusting a pipe bending machine comprises the following steps:

[0007] S1, select a multi-camera system;

[0008] S2. Establishing a model of internal and external parameters of the multi-camera system;

[0009] S3, calibrating the multi-camera system using an internal and external parameter model of the multi-camera system and a calibration plate;

[0010] S4, using the calibrated multi-camera system to capture the image of the pipe fitting and fit the seed cylinder;

[0011] S5, taking the seed cylinder as a reference and combining the pipe image captured by the multi-camera system, retrieving and reconstructing the three-dimensional model of the pipe;

[0012] S6. Utilizing the three-dimensional model of the pipe fitting to perform size correction on the pipe bending machine.

[0013] The multi-camera system includes multiple high-resolution cameras installed on a support frame. The frame rate of the high-resolution camera is 21fps, the pixel resolution is 1920*1440, the high-resolution camera uses a fixed-focus lens with a focal length of 6mm, and the high-resolution camera is also connected to a computer via a U3 standard interface cable.

[0014] An LED light board, a diffusion plate and a glass plate are respectively installed on the support frame. The high-resolution camera is installed on the top of the support frame. LED light boards and glass plates are installed on the sides and bottom of the support frame. The side LED light board is located under the side glass plate, and the bottom LED light board is located under the bottom glass plate. A diffusion plate is also installed on the bottom of the support frame, and the diffusion plate is located under the bottom glass plate.

[0015] The model of the internal and external parameters of the multi-camera system is established in step S2. The specific method is as follows: During the imaging process of the multi-camera system, there is a deviation between the imaging point of the target point on the plane and the theoretical imaging point. The collinear equation of the multi-camera system during the imaging process is as follows:

[0016]

[0017] Among them, (X, Y, Z) represents the world coordinates of the marker point, (X W ,Y W ,Z W ) represents the world coordinates of the center projection point, (x, y) represents the two-dimensional image coordinates of the marker point, (x0, y0) represents the image coordinates of the center projection point, f represents the focal length, (Δx, Δy) represents the coordinate deviation, a1, b1, c1, a2, b2, c2, a3, b3, c3 each represent a constant coefficient, the external parameter rotation matrix R and translation matrix T model of the multi-camera system are shown as follows:

[0018]

[0019] The deviation between the imaging point of the target point on the plane and the theoretical imaging point includes radial deviation, tangential deviation and image plane deviation. The deviation model is as follows:

[0020] Δx=K1xr 2 +K2xr 4 +K3xr 6 +B1(r 2 +2x 2 )+2B2xy+E1x+E2y

[0021] Δy=K1yr 2 +K2yr 4 +K3yr 6 +2B1xy+B2(r2 +2y 2 ) (2)

[0022] Among them: K1, K2, K3 represent radial deviations, B1, B2 represent tangential deviations, E1, E2 represent image plane deviations, k1, k2, k3, B1, B2, E1, E2 are all internal parameters of the multi-camera system, r 2 =x 2 +y 2 , (x,y) represents the two-dimensional image coordinates of the marker point.

[0023] The method of calibrating the multi-camera system by using the extrinsic parameter model and the calibration plate in step S3 is as follows:

[0024] S3.1. Establishing the relationship between 2D image points and 3D points

[0025] The image coordinates and world coordinates of each coding point on the calibration plate are matched by coding mark point detection technology;

[0026] S3.2 Image Data Preprocessing

[0027] Using affine transformation, the world coordinates of each coding point on the calibration plate are planarized, projected onto a spatial plane, and compared and matched with the image coordinates of each coding point, filtering out points with poor matching degrees and leaving the best matching points;

[0028] S3.3. Estimation of camera internal and external parameters

[0029] Using the best matching points obtained by screening in step S3.2, the initial values ​​of the internal and external parameters of each camera are solved by using the direct linear transformation method combined with the principle of least squares method;

[0030] S3.4. First global point adjustment

[0031] Using the initial values ​​of the internal and external parameters of each camera obtained in step S3.3, a pinhole camera model is established based on formulas (1)-(2), and the function G(x) is introduced to represent the image coordinates of each coding point, that is:

[0032] G=f(X,Y,Z,f x ,f y ,c x ,c y ,k1,k2,k3,B1,B2,E1,E2,R,T) (4)

[0033] Where (X, Y, Z) represents the world coordinates of the corresponding code point, f x ,f y is the projection of the focal length in the image coordinate system, c x ,cy represents the offset from the origin of the image coordinate system to the optical axis, k1, k2, k3 represent radial deviations, B1, B2 represent tangential deviations, E1, E2 represent image plane deviations, and f x 、f y 、c x 、c y It is also the internal parameter of the multi-camera system;

[0034] Carry out the first-order expansion of Taylor formula for equation (4), then:

[0035] G(x)=f(x0)+f'(x0)(x-x0)+α (5)

[0036] The error α tends to 0 only under the premise of Δx→0, that is, x→x0;

[0037] Since the influence of variables above the second order in Taylor expansion is small, α is ignored, that is:

[0038] G(x)-f(x0)=f'(x0)Δx (6)

[0039] Let matrix [B] represent G(x)-f(x0), matrix [A] represent f'(x0), let Δx→0, then:

[0040] [B] = [A] dx (7) Solve for dx, that is:

[0041] dx=(A T *A) -1 *A T *B (8)

[0042] The solution is:

[0043] x i =x0+dx (9)

[0044] Where G(x i ) is the initial value of the function input in each iteration; f(x0) is the function value after adjusting the world coordinates of each point;

[0045] Substitute the initial coordinate values ​​of each point and the initial values ​​of the internal and external parameters of each camera into the function relationship of formula (4). Formula (8) tends to infinitesimal. Solve to obtain x1, bring it back to formula (4), and obtain a new set of camera internal and external parameter values. Keep the solved camera internal parameters and the world coordinate values ​​of the encoding point unchanged, change the camera external parameter values, and perform the calculation process (4)-(8). If the adjusted camera external parameter values ​​satisfy formula (8) and tend to infinitesimal, the external parameter values ​​of the group of cameras are determined, and x2 is output. Bring x2 and the group of camera external parameter values ​​back to formula (4) for the next adjustment, until the three adjustments are completed, output the final determined camera internal and external parameters, and complete the first global point adjustment.

[0046] S3.5. Application of non-coding points

[0047] After the first global point adjustment, accurate camera internal and external parameters are obtained, and non-encoding points on the calibration plate except the encoding points are matched, and the adjustment calculation is performed using the principle in step S3.4;

[0048] S3.6. Calculation of relative external parameters

[0049] A camera in the multi-camera system is selected as a reference camera, and a camera model with relative external parameters is established based on the relative position relationship between the remaining non-reference cameras and the reference camera. The initial value of the relative external parameter calculated by each non-reference camera is calculated before adjustment. The camera model is as follows:

[0050] T=f1(X i ,Y i ,Z i ,f x ,f y ,c x ,c z ,k1,k2,B1,B2,B3,E1,E2,L i ) (10)

[0051] Where (X i ,Y i ,Z i ) represents the world coordinates of the corresponding landmark point, L i represents the relative external parameters of the non-reference camera. The relative external parameters are determined by the position of the non-reference camera relative to the reference camera. The parameter values ​​of the reference camera and the non-reference camera adjusted in step S3.5 are used as the initial values ​​of the parameters of each camera. The relative external parameters L of each non-reference camera are solved. i ;

[0052] S3.7. Use step S3.4 to adjust the global point again.

[0053] The calibration plate is a customized calibration plate of 800mm*600mm.

[0054] The method of capturing the pipe image by using the calibrated multi-camera system and fitting the seed cylinder described in step S4 is as follows:

[0055] The grayscale threshold gradient is set for the captured pipe image, and the edge pixel points of the pipe are determined by combining the linear interpolation method. The seed cylinder is found and fitted using the least squares method.

[0056] The step S5 is described as taking the seed cylinder as a reference and combining the pipe images captured by the multi-camera system to retrieve and reconstruct the three-dimensional model of the pipe. Specifically, the three-dimensional model of the pipe is retrieved and reconstructed based on the obtained seed cylinder as a reference and combining the pipe images taken by each camera. The relationship between the three-dimensional structure of the pipe and the seed cylinder is expressed as follows:

[0057]

[0058] Where (c x ,c y ,c z ) represents the camera coordinates of the center of the seed cylinder section, represents the unit direction vector of the seed cylinder, r represents the radius of the seed cylinder cross section;

[0059] One camera in the multi-camera system is selected as the seed camera. The seed cylinder photographed by the seed camera is used as a reference. The iterative optimization algorithm is used to select the sections of the pipe that best meet the characteristics of the pipe, and finally a complete three-dimensional model of the pipe is formed.

[0060] The specific method of using the three-dimensional model of the pipe fitting to correct the size of the pipe bender in step S6 is as follows:

[0061] First, the theoretical data of the pipe fitting is input into the pipe bending machine, and a pipe marked as pipe A is produced according to the three-dimensional model of the pipe fitting. Then, pipe A is measured, and the measured pipe fitting data is compared with the theoretical data of the pipe fitting. The deviation result obtained by the comparison is input into the pipe bending machine for size correction.

[0062] A quick adjustment system for a pipe bending machine, comprising:

[0063] Multi-camera system: used to capture images of pipes;

[0064] A multi-camera system calibration unit: used to establish a model of the internal and external parameters of the multi-camera system, and calibrate the multi-camera system using the internal and external parameter model of the multi-camera system and a calibration plate;

[0065] A pipe fitting 3D model reconstruction unit: uses a calibrated multi-camera system to capture pipe fitting images, fits a seed cylinder, and retrieves and reconstructs the 3D model of the pipe fitting based on the seed cylinder and the pipe fitting images captured by the multi-camera system;

[0066] Size correction unit: uses the three-dimensional model of the pipe fitting to perform size correction on the pipe bending machine.

[0067] The advantages of the present invention are: the present invention can reconstruct the test tube within 3 seconds, the developed system error is 0.15 mm, in addition to the outstanding advantages of the present invention having significant robustness, the multi-camera system is easy to use and has the function of fully automatic operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 It is a schematic diagram of the structure of a multi-camera measurement system according to an embodiment of the present invention.

[0069] Figure 2 The invention discloses a method for rapidly adjusting a pipe bending machine according to a process flow diagram of the invention.

[0070] Figure 3 This is a real picture of the 800*600 calibration board according to the embodiment of the present invention.

[0071] Figure 4 Schematic diagram of multi-camera imaging according to an embodiment of the present invention.

[0072] Figure 5 This is a diagram of measurement results before correction of the cast data in an embodiment of the present invention.

[0073] Figure 6 1 is a diagram of the fixture measurement results before correction according to an embodiment of the present invention.

[0074] Figure 7 1 is a diagram of measurement results after tube shape correction according to an embodiment of the present invention.

[0075] Figure 8 1 is a diagram of the fixture measurement results after the tube shape is corrected according to an embodiment of the present invention.

[0076] Fig. 9 Schematic diagram of coding points and non-coding points. DETAILED DESCRIPTION

[0077] like Figure 2 As shown, a method for quickly adjusting a pipe bending machine comprises the following steps:

[0078] S1, select a multi-camera system;

[0079] S2. Establishing a model of internal and external parameters of the multi-camera system;

[0080] S3, calibrating the multi-camera system using an internal and external parameter model of the multi-camera system and a calibration plate;

[0081] S4, using the calibrated multi-camera system to capture the image of the pipe fitting and fit the seed cylinder;

[0082] S5, taking the seed cylinder as a reference and combining the pipe image captured by the multi-camera system, retrieving and reconstructing the three-dimensional model of the pipe;

[0083] S6. Utilizing the three-dimensional model of the pipe fitting to perform size correction on the pipe bending machine.

[0084] A quick adjustment system for a pipe bending machine, comprising:

[0085] Multi-camera system: used to capture images of pipes;

[0086] A multi-camera system calibration unit: used to establish a model of the internal and external parameters of the multi-camera system, and calibrate the multi-camera system using the internal and external parameter model of the multi-camera system and a calibration plate;

[0087] A pipe fitting 3D model reconstruction unit: uses a calibrated multi-camera system to capture pipe fitting images, fits a seed cylinder, and retrieves and reconstructs the 3D model of the pipe fitting based on the seed cylinder and the pipe fitting images captured by the multi-camera system;

[0088] Size correction unit: uses the three-dimensional model of the pipe fitting to perform size correction on the pipe bending machine.

[0089] 1.1 Multi-camera measurement system

[0090] Figure 1 The diagram shows a multi-camera system for pipe measurement. It consists of ten high-resolution cameras 1 (generally at least eight cameras, up to 18), fixed-focus lenses, LED light panels, diffuser panels 2, glass panels 3, light sources 4, support frames and computers. The camera has a frame rate of 21fps, a pixel resolution of 1920*1440, a U3 standard interface cable to connect to the computer, and a lens focal length of 6mm.

[0091] The multi-camera system includes multiple high-resolution cameras installed on a support frame. The frame rate of the high-resolution camera is 21fps, the pixel resolution is 1920*1440, the high-resolution camera uses a fixed-focus lens with a focal length of 6mm, and the high-resolution camera is also connected to a computer via a U3 standard interface cable.

[0092] An LED light board, a diffusion plate and a glass plate are respectively installed on the support frame. The high-resolution camera is installed on the top of the support frame. LED light boards and glass plates are installed on the sides and bottom of the support frame. The side LED light board is located under the side glass plate, and the bottom LED light board is located under the bottom glass plate. A diffusion plate is also installed on the bottom of the support frame, and the diffusion plate is located under the bottom glass plate.

[0093] The biggest advantage of the system is how it works: high-resolution cameras and fixed-focus lenses capture clearer images, and the more details that can be shown in the image, the better the measurement performance. The diffuser helps to form a more uniform backlight. Uniform backlighting helps to provide a more obvious contrast for the measurement object, which facilitates the subsequent more efficient and accurate extraction of the edge line of the object to be measured. In addition, providing a backlight for the measurement object can effectively prevent the influence of ambient light on the measurement results.

[0094] 1.2 Actual measurement process

[0095] 1.2.1 Camera Calibration

[0096] In order to achieve high-precision pipe measurement, it is first necessary to calibrate the cameras in the system with high precision. Without changing the relative positions of the cameras, a high-precision measurement method is proposed in combination with the designed multi-camera system characteristics. This method uses a customized calibration plate 5 to directly solve the internal and external parameters of the camera. The existing camera calibration process starts with solving the internal and external parameters of the camera, and the innovation of the invention is to establish a new mathematical model to solve the internal and external parameters of the camera, which should be considered a new method. The above calibration method uses the pinhole imaging principle. In actual imaging, factors such as camera lens distortion affect the imaging point of the target point on the plane, and there is a certain deviation between the theoretical value. The collinearity equations used in the actual imaging process are as follows:

[0097]

[0098] Among them, (X, Y, Z) represents the world coordinates of the marker point, (X W ,Y W ,Z W ) represents the world coordinates of the center projection point, (x, y) represents the two-dimensional image coordinates of the marker point, (x0, y0) represents the image coordinates of the center projection point, f represents the focal length, (△x, △y) represents the coordinate deviation, a1, a2, a3, b1, b2, b3, c1, c2, c3 each represent a constant coefficient, which is the constant coefficient relationship between the coordinate values ​​obtained after modeling. The external parameter rotation matrix R and translation matrix T model of the multi-camera system are shown as follows:

[0099]

[0100] In order to obtain higher calibration accuracy, all possible deviations are considered. The deviation between the imaging point of the target point on the plane and the theoretical imaging point includes radial deviation, tangential deviation and image plane deviation. The deviation model is as follows:

[0101] Δx=K1xr 2 +K2xr 4 +K3xr 6 +B1(r2 +2x 2 )+2B2xy+E1x+E2y

[0102] 4y=K1yr 2 +K2yr 4 +K3yr 6 +2B1xy+B2(r 2 +2y 2 (2)

[0103] Among them: K1, K2, K3 represent radial deviations, B1, B2 represent tangential deviations, E1, E2 represent image plane deviations, k1, k2, k3, B1, B2, E1, E2 are all internal parameters of the multi-camera system; r 2 =x 2 +y 2 .

[0104] like Figure 3 As shown, use a 800mm*600mm calibration plate, calibrate the plate with the XTDP system in advance, and then use it to calibrate the camera, which can ensure that the measurement results are more accurate and reliable. Use the above method to calibrate the camera. Move and rotate the calibration plate at different positions where the pipe fittings may exist on the measuring platform, and collect 10-15 images (the pictures are valid as long as they are placed within the field of view of the camera). Using the coordinate transformation relationship and deviation model of the above camera system, the average reprojection error on the calibration plane is solved to be no more than 0.05 pixels, which means that the purpose of calibrating the camera is achieved. The specific implementation steps are:

[0105] S3.1 Establishing the relationship between 2D image points and 3D points

[0106] Through the marker point detection technology (the current technology uses the 01 binary method to distinguish and confirm the marker point code), the image coordinates and world coordinates of each coded point on the calibration plate are matched (the distinction between coded points and non-coded points lies in whether there are concentric segmented arc segments on the outer side of the inner circle, as shown in the figure). Fig. 9 As shown, Fig. 9 (a) is the code point, Fig. 9 (b) is a non-coding point.

[0107] S3.2 Image data preprocessing

[0108] Using affine transformation, the world coordinates of each coding point on the calibration plate are planarized and projected onto a spatial plane. The z-axis coordinates of each point on the plane are unified to zero, and compared and matched with the image coordinates of each coding point. Some points with poor matching degree are screened out, leaving the best matching points.

[0109] The center circle of the positioning calibration plate is taken as the detection center. Assuming that the position of the center circle in the projection space plane and the image plane can completely overlap, the corresponding coordinate deviation of the surrounding points is solved. The lower the deviation, the higher the matching degree, which can be used as the matching point for the next step of estimating parameters.

[0110] There are three coordinate systems in calibration: camera coordinate system (xyz), image plane coordinate system (xy) and pixel coordinate system (uv). The camera coordinate system is three-dimensional, and the remaining two are two-dimensional. The aforementioned spatial plane is to first project each coded point onto a plane with a Z coordinate of 0, that is, to project each point onto a two-dimensional plane, and compare the deviation of each marker point in the image plane coordinate and the spatial plane coordinate.

[0111] S3.3. Estimation of camera internal and external parameters

[0112] The optimal points are obtained by screening in (2), and the initial values ​​of the internal and external parameters of each camera are solved using the DLT (Direct Linear Transformation) method combined with the principle of least squares.

[0113] S3.4. First global point adjustment

[0114] In S3.5, the initial values ​​of the camera parameters are obtained. Without changing the existing collinear equations, in order to better improve the accuracy of the camera's internal and external parameters, a pinhole camera model is established based on formulas (1)-(2), and the function G(x) is introduced to represent the image coordinates of each coding point, that is:

[0115] G=f(X,Y,Z,f x ,f y ,c x ,c y ,k1,k2,k3,B1,B2,E1,E2,R,T) (4)

[0116] Where (X, Y, Z) represents the world coordinates of the corresponding code point, f x ,f y is the projection of the focal length in the image coordinate system, c x ,c y represents the offset from the origin of the image coordinate system to the optical axis, k1, k2, k3 represent radial deviations, B1, B2 represent tangential deviations, E1, E2 represent image plane deviations, and R, T represent the rotation matrix and translation matrix between the world coordinate system and the camera coordinate system, respectively. x 、f y 、c x 、c y It is also an intrinsic parameter of the multi-camera system.

[0117] Carry out the first-order expansion of Taylor formula for equation (4), then:

[0118] G(x)=f(x0)+f'(x0)(x-x0)+α (5)

[0119] The α error tends to 0 only under the premise of Δx→0, that is, x→x0, so if Δx is too large, the error will be relatively large.

[0120] Since the influence of variables above the second order in Taylor expansion is small, α can be ignored, that is:

[0121] G(x)-f(x0)=f'(x0)Δx (6)

[0122] Let matrix [B] represent G(x)-f(x0), matrix [A] represent f'(x0), let Δx→0, then:

[0123] [B]=[A]dx (7)

[0124] Solve for dx, that is:

[0125] dx=(A T *A) -1 *A T *B (8)

[0126] The solution is:

[0127] x i =x0+dx (9)

[0128] Where G(x i ) is the initial value of the function input for each iteration; f(x0) is the function value after adjusting the parameters or the world coordinates of each point, which is affected by the internal and external parameters of the camera and the coordinate values ​​of each encoding point.

[0129] Based on the above principles, after multiple iterations, x is solved i, the first global point adjustment can be completed. In formula (4), except for the three coordinate systems of the encoding point, the other variables in the function are the internal and external parameters of the camera. For the first time, the initial values ​​of the coordinates of each point and the initial values ​​of the internal and external parameters of the camera solved in the previous step are substituted into the function relationship of formula (4). The specific calculation process is as follows: formula (4)--(8) is guaranteed to be infinitely small, and x1 is obtained by solving it. It is brought back to formula (4) to obtain a new set of camera internal and external parameter values. The specific adjustment is as follows: keep the solved camera internal parameters and 3D point coordinates unchanged, change the camera external parameter values, and perform the calculation process (4)--(8). If the adjusted camera external parameter values ​​can satisfy formula (8) tending to infinitesimal, that is, determine the camera external parameter values, output x2, bring x2 and the camera external parameter values ​​back to formula (4) for the next adjustment, until the three adjustments are completed, and output the final camera internal and external parameters. In order to ensure stable calculation, this global point adjustment is performed in three steps. First, the camera intrinsic parameters and 3D point coordinates are fixed, and only the camera extrinsic parameters of each image are adjusted. Second, the camera extrinsic parameters and 3D point coordinates of each image are fixed, and only the camera intrinsic parameters of each camera are adjusted. Finally, the coordinates of the 3D points are fixed, and the intrinsic and extrinsic parameters of each camera are adjusted. Specifically, the function relationship in (4) is used to change the intrinsic parameter values ​​without changing the existing marker point coordinate values ​​and extrinsic parameters.

[0130] S3.5. Application of non-coding points

[0131] After the first global point adjustment, relatively accurate camera internal parameters can be obtained. In order to improve the calculation accuracy, it is necessary to match the non-encoding points on the calibration plate except the encoding points, and adjust the calculation using the principle in S3.4.

[0132] (6) Calculation of relative external parameters

[0133] After the adjustment in steps S3.4 and S3.5, the preliminary adjustment of the camera's internal and external parameters is completed. To ensure the accuracy and stability of the global point adjustment, the 10 cameras used in the present invention are selected to capture the clearest and most complete image as the reference camera, and a camera model with relative external parameters is established based on the relative position relationship between the other 9 non-reference cameras and the reference camera, and the initial value of the relative external parameters of each non-reference camera is calculated before adjustment.

[0134] T=f1(X i ,Y i ,Z i ,f x ,f y ,c x ,c z ,k1,k2,B1,B2,B3,E1,E2,L i ) (10)

[0135] Ti represents the image coordinates of the landmark point captured by the i-th non-reference camera, where (X i ,Y i ,Z i ) represents the world coordinates of the corresponding landmark point, L i Represents the relative external parameters of the non-reference camera, which is determined by the position of the non-reference camera relative to the reference camera. The parameter values ​​of the reference camera and the non-reference camera adjusted by S3.5 are used as the initial values ​​of the parameters of each camera to solve the relative external parameters L of each non-reference camera. i .

[0136] (7) Global point adjustment again

[0137] After completing the first global point adjustment and relative external parameter adjustment, the second global point adjustment can be performed. The specific principle is as shown in S3.4. Note that this adjustment will fix the world coordinates of the already determined marker points during the adjustment process, including the best matching points used to achieve the first global point adjustment, as well as the marker points with better coordinate matching during the adjustment. At this point, the calibration of the multi-camera system is completed.

[0138] 1.2.2 Pipeline reconstruction

[0139] It is difficult to reflect all the features of the pipe fittings by marking them, and the pipe fittings themselves are affected by the surface texture features, so it is also difficult to stick marking points. The lack of matching features is a key problem in the measurement process. Since the three-dimensional structure of the pipe fitting can be obtained by extending the central axis of the pipe diameter, the key to pipe fitting reconstruction lies in reconstructing the central axis. Pipe fitting reconstruction is achieved by constructing a seed cylinder model and combining real-time verification and linear interpolation methods. This method is not limited by the pipe shape and is also effective for pipe fittings with branches. The specific pipe fitting image after multi-camera measurement is as follows Figure 4 shown.

[0140] (1) Obtaining the seed cylinder

[0141] The camera system used in the present invention uses an LED backlight and a light source diffusion plate to enhance the contrast between the pipe in the image and the surrounding environment. A grayscale threshold gradient is set for the captured pipe image, and the edge pixel points of the pipe are determined by combining the linear interpolation method. At this point, the principle of the least squares method can be used to find and fit the straight line segment where the seed cylinder is located.

[0142] In order to achieve pipe reconstruction more efficiently, a camera is selected as the seed camera, and the above solution process is first performed with this camera to obtain the seed cylinder of the pipe. Combined with the principle of relative external parameter setting in calibration, the seed cylinders of the other 9 cameras are obtained using the limit matching method.

[0143] (2) Pipeline reconstruction

[0144] Taking the seed cylinder obtained in (1) as the reference, taking each seed cylinder as the reference, and combining the pipe images taken by each camera, the three-dimensional model of the pipe is retrieved and reconstructed. The relationship between the three-dimensional structure of the pipe and the seed cylinder can be expressed by the following formula:

[0145]

[0146] Where (c x ,c y ,c z ) represents the camera coordinates of the center of the seed cylinder section, represents the unit direction vector of the seed cylinder, and r represents the radius of the seed cylinder cross section.

[0147] Due to the different shooting angles of each camera, the pipes retrieved and fitted by each camera may only reflect part of the pipe features. Based on the seed cylinder photographed by the seed camera, the iterative algorithm is used to optimize the selection of each pipe segment that best matches the pipe features, and finally form a complete three-dimensional model of the pipe. The iterative algorithm is to find the image of each part of the pipe that best matches the pipe features from the pipe images taken by each camera, extract the central axis, fit the small cylinder, and splice it with the seed cylinder to obtain the pipe shape.

[0148] 1.2.3 CNC bending machine size correction

[0149] Based on the above principle process, in order to prove the practicality and efficiency of the advanced multi-camera system used in conjunction with the CNC tube bending machine for tube size correction, a complex tube that usually requires operators to calibrate more than 20 times in the CNC tube bending machine was used. First, the theoretical data of the tube was input into the CNC bending machine to produce a tube marked as tube A. Then, the developed system was used to measure tube A, and the results were as follows: Figure 5 As shown, Figure 5 The horizontal axis represents the bending point, and the vertical axis represents the tolerance. Figure 6 It can be seen that the first tube bent does not match the fixture model very well, with the most obvious deviations at points C, D, and F. The obtained deviation results are compared with the theoretical data of the tube and sent to the CNC bending machine for dimensional correction. Finally, the tube named tube B is generated through the correction data in the CNC bending machine. Figure 7 As shown in the figure, the tube2 measured by the system meets the tolerance requirements and just matches Figure 8 The fixture device, Figure 7 The horizontal axis represents the bending point and the vertical axis represents the tolerance.

[0150] Through the above experiments, we found that only one correction is needed to meet the requirements of correcting the pipe shape. In addition, the developed system displays the deviation of each bending point to show the characteristics of the measured pipe fittings, and the results are more accurate than manual visual inspection. This also proves that the system can solve the pipe fitting correction problem in the production of pipe bending machines.

[0151] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art of the present invention, several equivalent substitutions or obvious variations can be made without departing from the concept of the present invention, and the performance or use is the same, which should be regarded as belonging to the protection scope of the present invention.

Claims

1. A method for quickly adjusting a pipe bending machine, characterized in that: The specific steps include: S1, select a multi-camera system; S2. Establishing a model of internal and external parameters of the multi-camera system; S3, calibrating the multi-camera system using an internal and external parameter model of the multi-camera system and a calibration plate; S4, using the calibrated multi-camera system to capture the image of the pipe and fit the seed cylinder; S5, taking the seed cylinder as a reference and combining the pipe fitting image captured by the multi-camera system, retrieving and reconstructing a three-dimensional model of the pipe fitting; S6. Correcting the size of the pipe bender using the three-dimensional model of the pipe fitting; Step S2 establishes a model of the internal and external parameters of the multi-camera system, and the specific method is as follows: The external parameter rotation matrix R and translation matrix T model of the multi-camera system are as follows: Among them, (X W ,Y W ,Z W ) represents the world coordinates of the central projection point, a1, b1, c1, a2, b2, c2, a3, b3, c3 represent constant coefficients, The deviation between the imaging point of the target point on the plane and the theoretical imaging point includes radial deviation, tangential deviation and image plane deviation. The deviation model is as follows: Δx = K1xr 2 + K2xr 4 + K3xr 6 + B1(r 2 + 2x 2 ) + 2B2xy + E1x + E2y <h2 style=";text-align:left;direction:ltr">Δy = K1yr<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +K2yr<h2 style=";text-align:left;direction:ltr"> 4 <h2 style=";text-align:left;direction:ltr"> +K3yr<h2 style=";text-align:left;direction:ltr"> 6 <h2 style=";text-align:left;direction:ltr"> +2B1xy+B2(r<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +2y<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> ) (2) Among them: K1, K2, K3 represent radial deviations, B1, B2 represent tangential deviations, E1, E2 represent image plane deviations, k1, k2, k3, B1, B2, E1, E2 are all internal parameters of the multi-camera system, r 2 =x 2 +y 2 , (x, y) represents the two-dimensional image coordinates of the marker point; The step S5 is described as taking the seed cylinder as a reference and combining the pipe images captured by the multi-camera system to retrieve and reconstruct the three-dimensional model of the pipe. Specifically, the three-dimensional model of the pipe is retrieved and reconstructed based on the obtained seed cylinder as a reference and combining the pipe images taken by each camera. The relationship between the three-dimensional structure of the pipe and the seed cylinder is expressed as follows: Where (c x ,c y ,c z ) represents the camera coordinates of the center of the seed cylinder section, represents the unit direction vector of the seed cylinder, r represents the radius of the seed cylinder cross section; One camera in the multi-camera system is selected as the seed camera. The seed cylinder photographed by the seed camera is used as a reference. The iterative optimization algorithm is used to select the sections of the pipe that best meet the characteristics of the pipe, and finally a complete three-dimensional model of the pipe is formed.

2. The rapid adjustment method of a pipe bending machine according to claim 1, characterized in that: The multi-camera system includes a plurality of high-resolution cameras mounted on a support frame, and the high-resolution cameras are connected to a computer.

3. The rapid adjustment method of a pipe bending machine according to claim 2 is characterized in that: The high-resolution camera is installed on the top of the support frame, and LED light panels and glass panels are installed on the sides and bottom of the support frame. The side LED light panel is located under the side glass panel, and the bottom LED light panel is located under the bottom glass panel. A diffusion plate is also installed on the bottom of the support frame, and the diffusion plate is located under the bottom glass panel.

4. The rapid adjustment method of a pipe bending machine according to claim 1, characterized in that: Step S3 utilizes the intrinsic and extrinsic parameter model and a calibration plate to calibrate the multi-camera system, including obtaining the intrinsic and extrinsic parameters of the camera and the relative extrinsic parameters of the camera, wherein obtaining the intrinsic and extrinsic parameters of the camera includes: S3.

1. Use the coding mark point detection technology to correspond the image coordinates and world coordinates of each coding point on the calibration plate; S3.2, using affine transformation, planarize the world coordinates of each coding point on the calibration plate, project them on a spatial plane, and compare and match them with the image coordinates of each coding point, filter out points with poor matching, and leave the best matching points; S3.3, using the best matching point, using the direct linear transformation method, combined with the principle of least squares method, to solve the initial values ​​of the internal and external parameters of each camera; S3.4, using the initial values ​​of the internal and external parameters of each camera and the image coordinates of each encoding point to perform the first global point adjustment; S3.5, after the first global point adjustment, obtain the adjusted internal and external parameters of the camera, match the non-encoding points on the calibration plate except the encoding points, and apply step S3.4 to perform adjustment calculations; Wherein, obtaining the relative external parameters of the camera includes: S3.

6. Select one camera in the multi-camera system as a reference camera, and establish a camera model with relative external parameters based on the relative position relationship between the remaining non-reference cameras and the reference camera. Calculate the initial value of the relative external parameter calculated for each non-reference camera before adjustment, and use step S3.4 to perform global point adjustment again to obtain the relative external parameters of the camera.

5. A method for rapid adjustment of a pipe bending machine according to claim 1 or 4, characterized in that: The calibration plate uses a customized calibration plate of 800mm*600mm.

6. A method for rapid adjustment of a pipe bending machine according to claim 4, characterized in that: The method of capturing the pipe image by using the calibrated multi-camera system and fitting the seed cylinder described in step S4 is as follows: The grayscale threshold gradient is set for the captured pipe image, and the edge pixel points of the pipe are determined by combining the linear interpolation method. The seed cylinder is found and fitted using the least squares method.

7. The rapid adjustment method of a pipe bending machine according to claim 1, characterized in that: The specific method of using the three-dimensional model of the pipe fitting to correct the size of the pipe bender in step S6 is as follows: Inputting the theoretical data of the pipe fitting into a pipe bending machine, and producing a pipe marked as pipe A according to the three-dimensional model of the pipe fitting; The pipe A is measured, the measured pipe data is compared with the theoretical data of the pipe, and the deviation result obtained by the comparison is input into the pipe bending machine for size correction.

8. A method for rapid adjustment of a pipe bending machine as claimed in claim 4, characterized in that: Using the initial values ​​of the internal and external parameters of each camera obtained in step S3.3, a pinhole camera model is established based on formulas (1)-(2), and the function G(x) is introduced to represent the image coordinates of each coding point, that is: G=f(X,Y,Z,f x ,f y ,c x ,c y ,k1,k2,k3,B1,B2,E1,E2,R,T) (4) Where (X, Y, Z) represents the world coordinates of the corresponding code point, f x ,f y is the projection of the focal length in the image coordinate system, c x ,c y represents the offset from the origin of the image coordinate system to the optical axis, k1, k2, k3 represent radial deviations, B1, B2 represent tangential deviations, E1, E2 represent image plane deviations, and fx, fy, cx, cy are also internal parameters of the multi-camera system; Carry out the first-order expansion of Taylor formula for equation (4), then: G(x)=f(x0)+f'(x0)(x-x0)+α (5) The error α tends to 0 only under the premise of Δx→0, that is, x→x0; Since the influence of variables above the second order in Taylor expansion is small, α is ignored, that is: G(x)-f(x0)=f'(x0)Δx (6) Let matrix [B] represent G(x)-f(x0), matrix [A] represent f'(x0), let Δx→0, then: [B]=[A]dx (7) Solve for dx, that is: dx=(A T *A) -1 *A T *B (8) The solution is: x i =x0+dx (9) Where G(x i ) is the initial value of the function input in each iteration; f(x0) is the function value after adjusting the world coordinates of each point; Substitute the initial coordinate values ​​of each point and the initial values ​​of the intrinsic and extrinsic parameters of each camera into the function relationship of formula (4). Formula (8) tends to infinitesimal. Solve to obtain x1, substitute it back into formula (4) to obtain a new set of camera intrinsic and extrinsic parameter values. Keep the solved camera intrinsic parameters and the world coordinate values ​​of the encoding points unchanged, change the camera extrinsic parameter values, and perform the calculation process (4)-(8). If the adjusted camera extrinsic parameter values ​​satisfy formula (8) and tend to infinitesimal, the extrinsic parameter values ​​of the group of cameras are determined, and x2 is output. x2 and the group of camera extrinsic parameter values ​​are brought back to formula (4) for the next adjustment until the three adjustments are completed. The final determined camera intrinsic and extrinsic parameters are output to complete the first global point adjustment.

9. A method for rapid adjustment of a pipe bending machine as claimed in claim 4, characterized in that: The camera model is as follows: T=f1(X i ,Y i ,Z i ,f x ,f y ,c x ,c z ,k1,k2,B1,B2,B3,E1,E2,L i ) (10) Where (X i ,Y i ,Z i ) represents the world coordinates of the corresponding landmark point, L i represents the relative external parameters of the non-reference camera. The relative external parameters are determined by the position of the non-reference camera relative to the reference camera. The parameter values ​​of the reference camera and the non-reference camera adjusted in step S3.5 are used as the initial values ​​of the parameters of each camera. The relative external parameters L of each non-reference camera are solved. i .

10. A rapid adjustment system for a pipe bending machine, characterized in that: Included are: Multi-camera system: used to capture images of pipes; A multi-camera system calibration unit: used to establish a model of the internal and external parameters of the multi-camera system, and calibrate the multi-camera system using the internal and external parameter model of the multi-camera system and a calibration plate; The pipe fitting 3D model reconstruction unit uses the calibrated multi-camera system to capture the pipe fitting image, fits the seed cylinder, and retrieves and reconstructs the pipe fitting 3D model based on the seed cylinder and the pipe fitting image captured by the multi-camera system; Size correction unit: using the three-dimensional model of the pipe fitting to correct the size of the pipe bending machine; A model of the internal and external parameters of the multi-camera system is established, and the specific method is as follows: The external parameter rotation matrix R and translation matrix T model of the multi-camera system are as follows: Among them, (X W ,Y W ,Z W ) represents the world coordinates of the central projection point, a1, b1, c1, a2, b2, c2, a3, b3, c3 represent constant coefficients, The deviation between the imaging point of the target point on the plane and the theoretical imaging point includes radial deviation, tangential deviation and image plane deviation. The deviation model is as follows: <h2 style=";text-align:left;direction:ltr">Δx = K1xr<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +K2xr<h2 style=";text-align:left;direction:ltr"> 4 <h2 style=";text-align:left;direction:ltr"> +K3xr<h2 style=";text-align:left;direction:ltr"> 6 <h2 style=";text-align:left;direction:ltr"> +B1(r<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +2x<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> )+2B2xy+E1x+E2y <h2 style=";text-align:left;direction:ltr">Δy = K1yr<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +K2yr<h2 style=";text-align:left;direction:ltr"> 4 <h2 style=";text-align:left;direction:ltr"> +K3yr<h2 style=";text-align:left;direction:ltr"> 6 <h2 style=";text-align:left;direction:ltr"> +2B1xy+B2(r<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +2y<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> ) (2) Among them: K1, K2, K3 represent radial deviations, B1, B2 represent tangential deviations, E1, E2 represent image plane deviations, k1, k2, k3, B1, B2, E1, E2 are all internal parameters of the multi-camera system, r 2 =x 2 +y 2 , (x, y) represents the two-dimensional image coordinates of the marker point; The three-dimensional model of the pipe fitting is retrieved and reconstructed based on the seed cylinder and the pipe fitting image captured by the multi-camera system. Specifically, the three-dimensional model of the pipe fitting is retrieved and reconstructed based on the obtained seed cylinder and the pipe fitting images captured by each camera. The relationship between the three-dimensional structure of the pipe fitting and the seed cylinder is expressed as follows: Where (c x ,c y ,c z ) represents the camera coordinates of the center of the seed cylinder section, represents the unit direction vector of the seed cylinder, r represents the radius of the seed cylinder cross section; One camera in the multi-camera system is selected as the seed camera. The seed cylinder photographed by the seed camera is used as a reference. The iterative optimization algorithm is used to select the sections of the pipe that best meet the characteristics of the pipe, and finally a complete three-dimensional model of the pipe is formed.