A calibration method for realizing high-precision measurement of an external cylindrical surface by a line laser 3D camera

By combining RANSAC and least squares method with eccentricity and camera offset function fitting, the line laser 3D camera calibration problem is solved, and high-precision measurement of the outer cylindrical surface of the cylindrical workpiece is achieved, eliminating the influence of installation error.

CN115601354BActive Publication Date: 2025-10-17SHANGHAI UNIV OF ENG SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211397409.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-09
Publication Date
2025-10-17
Estimated Expiration
2042-11-09

AI Technical Summary

Technical Problem

Existing technologies cannot effectively calibrate line laser 3D cameras for measuring the outer cylindrical surface of cylindrical workpieces, resulting in eccentricity and tangential deviation caused by installation errors affecting measurement accuracy.

Method used

The RANSAC method is used to remove outliers in the depth image, and the least squares method is combined to calculate the average depth. The depth change function relationship between eccentricity and camera offset is established. The eccentricity and offset are eliminated through iterative fitting to achieve high-precision calibration.

Benefits of technology

Adaptive error elimination ensures high-precision measurement of the outer cylindrical surface of cylindrical workpieces, significantly improving measurement accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115601354B_ABST
    Figure CN115601354B_ABST
Patent Text Reader

Abstract

The application discloses a kind of calibration methods for realizing high-precision measurement of line laser 3D camera outer cylindrical surface, comprising: S1, the depth image of the outer surface of cylindrical workpiece is obtained by line laser 3D camera, the depth information and coordinate information of each row data of depth image are recorded by computer, and the average depth of each row is calculated;S2, the depth variation set of cylindrical workpiece is generated;S3, the eccentric depth variation function relationship of cylindrical workpiece is established and the depth variation set is fitted, and the eccentricity and eccentric direction angle of cylindrical workpiece are calculated;S4, the camera offset depth variation function relationship is established and the fitting deviation is fitted, and the offset of camera is calculated;S5, repeat steps S3, S4 operation, until the difference between the eccentricity, eccentric direction angle and camera offset of cylindrical workpiece and last round data is less than preset value, end iteration.The application can realize adaptive error elimination, and ensure high-precision measurement of line laser 3D camera to outer cylindrical surface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a calibration method for realizing high-precision measurement of an outer cylindrical surface by a line laser 3D camera, and belongs to the technical field of image measurement. Background Art

[0002] Line laser 3D cameras can be used in industry to reconstruct 3D cylindrical workpieces. By using the camera to scan the outer surface of the cylindrical workpiece with laser light, and by capturing the laser line, the depth information of the outer surface of the cylindrical workpiece can be calculated using triangulation and the grayscale value and depth value of the position can be saved. Figure 1 As shown in the figure, the 3D camera is fixed on a rotary platform controlled and driven by a rotary motor. The rotary motor is driven by a PLC controller and has its own encoder. The camera works in a line scan mode triggered by the encoder. The trigger signal of the encoder is used to ensure the synchronous execution of the camera and the rotation. When working, the PLC controller drives the rotary motor to rotate, and the rotary motor drives the rotary platform to rotate, thereby driving the 3D camera to rotate. At the same time, the encoder on the rotary motor sends a trigger signal to the 3D camera. After receiving the trigger signal of the encoder, the 3D camera scans the cylindrical workpiece. In this way, the trigger signal of the encoder can ensure the synchronous execution of the camera and the rotation. Each time the camera samples, it can obtain a piece of contour information of the position, and scans each piece to form a depth image of the outer surface of the cylindrical workpiece. The formed depth image is finally sent to the computer for processing.

[0003] However, in actual engineering applications, the data cannot be directly used due to installation errors between the 3D camera and the cylindrical workpiece. The main manifestations are: 1) There will be a certain eccentricity when the cylindrical workpiece is installed, resulting in a certain offset in the depth direction of the data; 2) When the 3D camera is installed, it cannot ensure that the direction of the camera's laser line is in the same plane as the axis of rotation. There is a certain tangential deviation, which will cause the scanned depth information to have radial distortion. When the cylindrical workpiece is installed with a large eccentricity, the distortion caused by the tangential deviation will be aggravated.

[0004] In order to achieve high-precision measurement of the outer cylindrical surface, the scanned depth information needs to be calibrated to eliminate the impact of installation errors. However, existing line scanning correction methods are unable to calibrate the outer cylindrical surface, which affects the high-precision measurement of the outer surface of the cylindrical workpiece by the 3D camera. Summary of the Invention

[0005] In view of the above problems existing in the prior art, the object of the present invention is to provide a calibration method for realizing high-precision measurement of an outer cylindrical surface by a line laser 3D camera.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] A calibration method for realizing high-precision measurement of an outer cylindrical surface of a line laser 3D camera, comprising the following steps:

[0008] S1, obtaining a depth image of an outer surface of a cylindrical workpiece by a line laser 3D camera, and delivering the depth image to a computer, the computer recording depth information and coordinate information of each row of data of the depth image, removing abnormal points in the data by using a RANSAC method for each row of depth information, then performing a least square method on the remaining points, and then calculating and recording the average depth of each row;

[0009] S2, traversing each row of data of the depth image, and generating a depth variation set of the cylindrical workpiece according to the average depth of each row of data according to the corresponding angle;

[0010] S3, establishing an eccentric depth variation function relationship of the cylindrical workpiece and fitting the depth variation set, calculating the eccentricity and eccentric direction angle of the cylindrical workpiece through the variation curve, and recording the fitting deviation of each point;

[0011] S4, establishing a camera offset depth variation function relationship and fitting the fitting deviation, calculating the offset of the camera through the variation curve, and recording the fitting deviation of each point;

[0012] S5, repeating the steps S3 and S4 until the difference between the eccentricity, the eccentric direction angle and the camera offset of the cylindrical workpiece and the previous round of data is less than a preset value, and ending the iteration.

[0013] In an embodiment, the specific operation of step S1 is as follows:

[0014] a) driving a rotary motor by a PLC controller, the rotary motor driving a rotary platform to rotate and in turn driving a line laser 3D camera on the rotary platform to rotate, while an encoder on the rotary motor sending a trigger signal to the line laser 3D camera, the line laser 3D camera receiving the trigger signal of the encoder to perform laser scanning on the cylindrical workpiece to obtain a depth image of an outer surface of the cylindrical workpiece and deliver the depth image to a computer;

[0015] b) the computer recording depth information and coordinate information of each row of data of the depth image:

[0016] the depth information of the i-th row and j-th column data is set as the coordinate information is the data set of the i-th row is

[0017] c) the computer removing abnormal points in the data by using a RANSAC method for the depth information, then performing a least square method on the remaining points, and then calculating and recording the average depth of each row:

[0018] Set the original depth image size as h x w, the horizontal unit pixel corresponds to the actual distance x r For (360 / h) ° / pixel, the vertical unit pixel corresponds to the actual distance y r Is a preset parameter of the camera; randomly select n points from the set H i As initial samples Fit a straight line L i , set the straight line L i Equation as h=a0y+b0;

[0019] Substitute all points in the initial sample Into the straight line equation L i And calculate the average loss function Loss0:

[0020] Wherein Is the depth information corresponding to the jth point in the initial sample , a0 and b0 are the initial fitting parameters in the straight line equation L i , Is the theoretical value of ; Is the vertical coordinate of the i-th row and j-th column data;

[0021] In order to find the minimum value of the average loss function Loss0, respectively, let the derivative of Loss0 to a0 and b0 take 0:

[0022]

[0023] Simplify the above formula:

[0024]

[0025] After calculating the parameters a0 and b0, the straight line L i Equation is h=a0y+b0;

[0026] The straight line L i Equation is made into the form of the general straight line equation Ax+By+C=0, and the remaining points (y p , h p ) in the point set H i And calculate the distance d p From the fitting straight line:

[0027]

[0028] Set the distance threshold thresh, judge whether the point is an inner point by the following formula, if it is an inner point, add it to the sample set :

[0029] If d p<thresh, it is an interior point; if d p ≥thresh, it is an external point;

[0030] After one round of traversal is completed, the sample set is used to refit a new straight line equation and a new round of iteration is performed; after 10 to 30 iterations, the sample set with the largest number of internal points is taken as the best sample set, and the corresponding straight line equation is taken as the best straight line equation; finally, the average depth of the scan profile is obtained based on the best straight line equation combined with the range of the y coordinates in the sample set.

[0031] In one implementation scheme, the specific operations of step S2 are as follows:

[0032] While recording the depth information and coordinate information of each row of depth image data, it also records the rotation angle θ of the rotary platform corresponding to when the encoder sends a trigger signal to the line laser 3D camera;

[0033] The computer traverses each row of data in the depth image and generates the depth change set Y of the cylindrical workpiece based on the average depth recorded in each row of data and the corresponding rotation angle of the rotary platform:

[0034] Where, The rotation angles of the rotary platform are θ0, θ1, θ w-1 The average depth corresponding to , where θ satisfies 0≤n<w, w is the width of the depth image.

[0035] In one implementation scheme, the specific operations of step S3 are as follows:

[0036] The xy coordinate system is established with the center O1 of the rotary platform as the origin, and the radius of the cylindrical workpiece is set to r1, the center coordinates are (Δx, Δy), and the eccentricity is Then the eccentricity angle α satisfies:

[0037] In ΔO1O2B θ In the equation, using the cosine theorem, we can get: O2B θ 2 =O1O2 2 +O1B θ 2 -2·O1O2·cos∠B θ O1O2, where O2 is the actual center of the cylindrical workpiece, B θ is the intersection point of the 3D camera laser line and the cylindrical workpiece contour when the rotary platform has a rotation angle of θ, O1O2 is the distance from the center of the rotary platform to the actual center of the cylindrical workpiece, that is, the eccentricity Δr, O2B θThe distance from the actual center of the cylindrical workpiece to the intersection point of the 3D camera laser line and the profile of the cylindrical workpiece, that is, the radius r1 of the cylindrical workpiece; O1B θ The distance from the center of the rotating platform to the intersection point of the 3D camera laser line and the profile of the cylindrical workpiece;

[0038] Simplifying, we have:

[0039] O1B θ 2 -2·Δr·cos(α-θ)·O1B θ +Δr 2 -r1 2 =0;

[0040] Using the root-finding formula, we have:

[0041]

[0042] Since r1>>Δr, we can approximately consider that:

[0043]

[0044] Combining O1B θ >0, we have:

[0045] O1B θ =Δr·cos(α-θ)+r1;

[0046] Then the eccentricity depth variation function of the cylindrical workpiece is:

[0047] h θ =A θ B θ =A θ O1-B θ O1=R-r1-Δr·cos(α-θ), wherein: h θ is the eccentricity depth of the cylindrical workpiece when the rotating platform has a rotation angle of θ, A θ is the position of the 3D camera when the rotating platform has a rotation angle of θ, and R is the rotating radius of the 3D camera.

[0048] Let a1=-Δr and b1=R-r1, then h θ =a1·cos(α-θ)+b1;

[0049] Substitute all points in the depth variation set Y into the above formula and calculate the average loss function Loss1:

[0050] In the formula, h θ is the average depth in the depth variation set Y when the rotating angle is θ, is the theoretical value of h θ .

[0051] Since the Loss1 expression is nonlinear and contains multiple variables, i.e., a1, b1 and α, in order to find the minimum value of the average loss function Loss1, the corresponding Hession matrix is established as follows:

[0052] Where X is an input parameter, satisfying X=(a1b1 α) T ;

[0053] The gradient of the average loss function Loss1 is defined as:

[0054]

[0055] Where:

[0056]

[0057] The final iteration formula is:

[0058] Where X0 is the initial value of the parameter, which is taken as (1 1 0) here, is the inverse matrix of .

[0059] In an embodiment, the specific operation of step S4 is as follows:

[0060] An x-y coordinate system is established with the center O1 of the rotary platform as the origin, the ideal position of the line laser 3D camera is point A, the actual position of the line laser 3D camera is point C, and the offset is Δc. Due to the existence of the offset, the intersection point of the laser line of the line laser 3D camera and the cylindrical workpiece will be offset, i.e., from the original point B to point D, resulting in the distance measured by the 3D camera finally changing from AB to CD. Therefore, it is necessary to establish a relationship between Δc and the difference between AB and CD, i.e., EB;

[0061] According to the relative motion relationship, the coordinates of the fixed line laser 3D camera are obtained, and the relative coordinates of the center of the cylindrical workpiece are (r2·cosθ, r2·sinθ), r2 being the motion radius of the cylindrical workpiece. Therefore, points B and D will satisfy the following formula:

[0062]

[0063] In the formula, (x B ,y B ), (x D ,y D ) are the coordinates of points B and D respectively, and r1 is the radius of the cylindrical workpiece.

[0064] The above formula is simplified as:

[0065]

[0066] Therefore

[0067] Let the step S3 in Substitute all points in the depth change set Y into the EB expression and calculate the corresponding average loss function Loss2:

[0068]

[0069] In the formula, The theoretical value of Δh θ ;

[0070] The corresponding Newton iteration formula is:

[0071] In the formula, Δc0 is the initial value of the deviation, which is 0 here, and Δc n is the result of Δc0 after n iterations, and Loss2'(Δc) is the derivative of Loss2(Δc).

[0072] Compared with the prior art, the beneficial technical effects of the present application are:

[0073] The present application is based on a basic mathematical model, and by fully considering the hardware errors existing in the line laser 3D camera scanning cylindrical workpieces, adaptive error elimination is realized, thereby ensuring high-precision measurement of the outer cylindrical surface of the cylindrical workpiece, and having significant progress and application value compared with the prior art. BRIEF DESCRIPTION OF DRAWINGS

[0074] Figure 1 is the working process schematic diagram of the line laser 3D camera measuring the outer cylindrical surface of the cylindrical workpiece in the present application;

[0075] Figure 2 is the measurement principle schematic diagram of the eccentricity of the cylindrical workpiece provided by the embodiment of the present application;

[0076] Figure 3 is the measurement principle schematic diagram of the offset of the line laser 3D camera provided by the embodiment of the present application;

[0077] The figure labels are as follows: 1, line laser 3D camera; 2, cylindrical workpiece; 3, computer; 4, PLC controller; 5, rotary motor; 6, rotary platform; 7, encoder. DETAILED DESCRIPTION

[0078] The technical solutions of the present application will be further described in detail below in combination with the drawings and embodiments.

[0079] EMBODIMENT

[0080] Please combineFigures 1 to 3 As shown: the application provides a kind of realization line laser 3D camera high-precision measurement outer cylindrical surface calibration method, comprising the following steps:

[0081] S1, by line laser 3D camera 1 obtains the depth image of the outer surface of cylindrical workpiece 2, and the depth image is passed to computer 3, computer 3 records the depth information and coordinate information of each row data of depth image, and the abnormal points existing in data are removed using RANSAC method to the depth information, then the least square method is carried out to the remaining points, then the average depth of each row is calculated and recorded, as follows:

[0082] a) as shown, by PLC controller 4 drive rotary motor 5, rotary motor 5 drive rotary platform 6 rotation and drive line laser 3D camera 1 on rotary platform 6 rotation, while the encoder 7 on rotary motor 5 sends trigger signal to line laser 3D camera 1, line laser 3D camera 1 receives the trigger signal of encoder 7 and scans cylindrical workpiece 2 to obtain the depth image of the outer surface of cylindrical workpiece 2 and pass the depth image to computer 3; Figure 1 b) computer 3 records the depth information and coordinate information of each row data of depth image:

[0083] Set the depth information of the i-th row j-th column data as

[0084] Coordinate information is Then the data set of the i-th row is

[0085] c) computer uses RANSAC method to remove abnormal points existing in data to the depth information, then the least square method is carried out to the remaining points, then the average depth of each row is calculated and recorded:

[0086] Set the original depth image size as h x w, the actual distance x corresponding to horizontal unit pixel is r (360 / h) ° / pixel, the actual distance y corresponding to vertical unit pixel is r y r , which is a preset parameter of camera, in the embodiment, y r 0.1mm, x i 0.1 °; randomly extract n points from set H Fitting line L i , set the equation of line L i As h=a0y+b0;

[0087] Substitute all points in initial sample into line equation L i And calculate average loss function Loss0:

[0088] ​ In the formula For the initial sample The depth information corresponding to the j-th point, a0 and b0 are the linear equations L i The initial fitting parameters in , yes Theoretical value of

[0089] In order to find the minimum value of the average loss function Loss0, let the derivatives of Loss0 with respect to a0 and b0 be 0:

[0090]

[0091] Simplifying the above formula we get:

[0092]

[0093] After calculating the parameters a0 and b0, the straight line L i The equation is h=a0y+b0;

[0094] The straight line L i The equation is transformed into the form of a general linear equation Ax+By+C=0, and the point set H is traversed. i The remaining points (y p ,h p ), and calculate the distance d from the point to the fitting line p :

[0095]

[0096] Set the distance threshold thresh and use the following formula to determine whether the point is an inlier. If it is an inlier, add it to the sample set. middle:

[0097]

[0098] After one round of traversal is completed, the sample set is used to refit a new linear equation and a new round of iteration is performed. After 10 to 30 iterations (the number of iterations in this embodiment is 20), the sample set with the largest number of inliers is taken as the best sample set and the corresponding linear equation is taken as the best linear equation. Finally, the average depth of the scan profile is obtained based on the best linear equation combined with the range of the y coordinates in the sample set.

[0099] S2. Traverse each row of data in the depth image and generate a depth variation set of the cylindrical workpiece based on the average depth recorded in each row of data according to its corresponding angle, specifically:

[0100] The depth information and coordinate information of each row of data of the depth image are recorded, and the rotation angle θ of the rotary platform corresponding to the time when the encoder sends a trigger signal to the line laser 3D camera is also recorded;

[0101] The computer traverses each row of data of the depth image, and generates a depth variation set Y of the cylindrical workpiece according to the average depth recorded by each row of data and the rotation angle of the rotary platform corresponding thereto:

[0102] In the formula, are the average depths corresponding to the rotation angles θ0, θ1, θ w-1 of the rotary platform, respectively, wherein θ satisfies

[0103] S3, an eccentric depth variation function relationship of the cylindrical workpiece is established, and the depth variation set is fitted, the eccentricity and eccentric direction angle of the cylindrical workpiece are calculated through the variation curve, and the fitting deviation of each point is recorded, and specifically:

[0104] Referring to Figure 2 , an x-y coordinate system is established with the center O1 of the rotary platform as the origin, and the radius of the cylindrical workpiece is set as r1, the center coordinates of the cylindrical workpiece are (Δx, Δy), and the eccentricity is The eccentric direction angle α satisfies: In addition, in the embodiment Figure 2 , O2 is the actual center of the cylindrical workpiece, R is the rotation track radius of the 3D camera, A0, A θ and A 90 are the positions of the 3D camera corresponding to the rotation angles of 0°, θ° and 90° of the rotary platform, respectively, B0, B θ and B 90 are the intersection points of the 3D camera laser line and the profile of the cylindrical workpiece when the rotation angles of the rotary platform are 0°, θ° and 90°, respectively;

[0105] In ΔO1O2B θ , the cosine theorem can be used to obtain: O2B θ 2 = O1O2 2 + O1B θ 2 - 2·O1O2·cos∠B θ O1O2,

[0106] In the formula, O1O2 is the distance from the center of the rotary platform to the actual center of the cylindrical workpiece, that is, the eccentricity Δr, O2B θ is the distance from the actual center of the cylindrical workpiece to the intersection point of the 3D camera laser line and the profile of the cylindrical workpiece, that is, the radius r1 of the cylindrical workpiece; and O1B θis the distance from the center of the rotary platform to the intersection of the 3D camera laser line and the cylindrical workpiece contour;

[0107] Simplifying, we can get:

[0108] O1B θ 2 -2·Δr·cos(α-θ)·O1B θ +Δr 2 -r1 2 =0;

[0109] Using the root-finding formula we can get:

[0110]

[0111] Since r1>>Δr, it can be approximately considered that:

[0112]

[0113] Combined with O1B θ >0, we can get:

[0114] O1B θ =Δr·cos(α-θ)+r1;

[0115] Then the functional relationship of the eccentric depth change of the cylindrical workpiece is:

[0116] h θ =A θ B θ =A θ O1-B θ O1=R-r1-Δr·cos(α-θ), where: h θ A is the eccentric depth of the cylindrical workpiece corresponding to the rotation angle of the rotary platform. θ is the position of the 3D camera when the rotation angle of the rotating platform is θ, and R is the rotation radius of the 3D camera.

[0117] Let a1=-Δr,b1=R-r1, then h θ =a1·cos(α-θ)+b1;

[0118] Substitute all points in the depth change set Y into the above formula and calculate the average loss function Loss1:

[0119]

[0120] Where h θ is the average depth corresponding to the rotation angle θ in the depth change set Y, h θ Theoretical value of

[0121] Since the Loss1 expression is nonlinear and contains multiple variables, i.e., a1, b1 and α, in order to find the minimum value of the average loss function Loss1, the corresponding Hession matrix is established as follows:

[0122] Where X is an input parameter, satisfying X=(a1b1 α) T ;

[0123] The gradient of the average loss function Loss1 is defined as:

[0124]

[0125] Where:

[0126]

[0127] The final iteration formula is:

[0128] Where X0 is the initial value of the parameter, which is taken as (1 1 0) here, is the inverse matrix of H Loss (X);

[0129] S4, the camera offset depth change function relationship is established and the fitting deviation is fitted, the offset of the camera is calculated through the change curve, and the fitting deviation of each point is recorded, specifically:

[0130] Referring to Figure 3 , an x-y coordinate system is established with the center O1 of the rotary platform as the origin, the ideal position of the line laser 3D camera is point A, the actual position is point C, and the offset is Δc. Due to the existence of the offset, the intersection point of the laser line of the line laser 3D camera and the cylindrical workpiece will be offset, i.e., from the original B point to the D point, resulting in that the depth measured by the 3D camera changes from AB to CD. Therefore, the relationship between Δc and the difference between AB and CD, i.e., EB, needs to be established. Figure 3 , where AB is the ideal measurement depth, CD is the actual measurement depth, EB is the deviation between the ideal and actual measurement depths, O2 is the actual center of the cylindrical workpiece, E is the projection of point D on AE, and the center of the cylindrical workpiece moves from O2 to O2'. At this time, points B, D and E move to B', D' and E';

[0131] According to the relative motion relationship, the coordinates of the fixed line laser 3D camera are obtained, and the relative coordinates of the center of the cylindrical workpiece are (r2·cosθ, r2·sinθ), where r2 is the motion radius of the cylindrical workpiece. Therefore, points B and D will satisfy the following formula:

[0132]

[0133] In the formula: (x By B ), (x D ,y D ) are the coordinates of points B and D respectively, and r1 is the radius of the cylindrical workpiece;

[0134] Simplifying the above formula gives:

[0135]

[0136] Therefore

[0137] Let Substitute all points in the depth variation set Y into the EB expression and calculate the corresponding average loss function Loss2:

[0138]

[0139] In the formula, is the theoretical value of Δh θ ;

[0140] The corresponding Newton iteration formula is:

[0141] In the formula, Δc0 is the initial value of the deviation, which is set to 0 here, and Δc n is the result of Δc0 after n iterations, and Loss2'(Δc) is the derivative of Loss2(Δc).

[0142] S5, repeat steps S3 and S4 until the eccentricity of the cylindrical workpiece, the eccentric direction angle and the camera offset are all less than the preset value, and the iteration is ended.

[0143] Finally, it is necessary to point out that: the above only describes the preferred specific embodiments of the present application, but the protection scope of the present application is not limited to this, any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A calibration method for realizing high-precision measurement of an outer cylindrical surface by a line laser 3D camera, characterized in that: The steps include: S1. Use a line laser 3D camera to obtain a depth image of the outer surface of the cylindrical workpiece and transmit the depth image to a computer. The computer records the depth information and coordinate information of each row of data in the depth image, and uses the RANSAC method to remove abnormal points in the data for each row of depth information. Then, the least squares method is performed on the remaining points, and the average depth of each row is calculated and recorded. S2. traverse each row of data in the depth image, and generate a depth variation set of the cylindrical workpiece based on the average depth recorded in each row of data and the angle corresponding to it; S3. Establish a functional relationship of the eccentric depth change of the cylindrical workpiece and fit the depth change set, calculate the eccentricity and eccentricity direction angle of the cylindrical workpiece through the change curve, and record the fitting deviation of each point; S4. Establish a camera offset depth change function relationship and fit the fitting deviation, calculate the camera offset through the change curve, and record the fitting deviation of each point; S5. Repeat steps S3 and S4 until the differences between the eccentricity, eccentricity direction angle, and camera offset of the cylindrical workpiece and the previous round of data are all less than the preset values, and the iteration ends.

2. The calibration method according to claim 1, wherein: The specific operations of step S1 are as follows: a) The PLC controller drives the rotary motor, which drives the rotary platform to rotate, thereby driving the line laser 3D camera on the rotary platform to rotate. At the same time, the encoder on the rotary motor sends a trigger signal to the line laser 3D camera. After receiving the encoder's trigger signal, the line laser 3D camera performs a laser scan on the cylindrical workpiece to obtain a depth image of the cylindrical workpiece's outer surface and transmits the depth image to the computer; b) The computer records the depth information and coordinate information of each row of data in the depth image: Set the depth information of the data in row i and column j to The coordinate information is Then the data set of row i is c) The computer uses the RANSAC method to remove abnormal points in the data for each row of depth information, and then performs the least squares method on the remaining points. It then calculates the average depth of each row and records it: Set the original depth image size to h×w, and the horizontal unit pixel corresponds to the actual spacing x r = (360 / h)° / piexl, the vertical unit pixel corresponds to the actual spacing y r Preset parameters for the camera; from the set H i Randomly select n points as the initial sample Fitting straight line L i , set straight line L i The equation is h=a0y+b0; Substitute all points in the initial sample into the straight line equation L i And calculate the average loss function Loss0: In the formula For the initial sample The depth information corresponding to the j-th point, a0 and b0 are the linear equations L i The initial fitting parameters in , yes Theoretical value of is the vertical coordinate of the data in row i and column j; In order to find the minimum value of the average loss function Loss0, let the derivatives of Loss0 with respect to a0 and b0 be 0: Simplifying the above formula we get: After calculating the parameters a0 and b0, the straight line L i The equation is h=a0y+b0; The straight line L i The equation is transformed into the form of a general linear equation Ax+By+C=0, and the point set H is traversed. i The remaining points (y p ,h p ), and calculate the distance d from the point to the fitting line p : Set the distance threshold thresh and use the following formula to determine whether the point is an inlier. If it is an inlier, add it to the sample set. middle: If d p <thresh, it is an interior point; if d p ≥thresh, it is an external point; After one round of traversal is completed, the sample set is used to refit a new straight line equation and a new round of iteration is performed; after 10 to 30 iterations, the sample set with the largest number of inliers is taken as the best sample set, and the corresponding straight line equation is taken as the best straight line equation; finally, the average depth of the scan profile is obtained based on the best straight line equation combined with the range of the y coordinates in the sample set.

3. The calibration method according to claim 2, wherein: The specific operations of step S2 are as follows: While recording the depth information and coordinate information of each row of depth image data, it also records the rotation angle θ of the rotary platform corresponding to when the encoder sends a trigger signal to the line laser 3D camera; The computer traverses each row of data in the depth image and generates the depth change set Y of the cylindrical workpiece based on the average depth recorded in each row of data and the corresponding rotation angle of the rotary platform: Where, The rotation angles of the rotary platform are θ0, θ1, θ w-1 The average depth corresponding to , where θ satisfies w is the width of the depth image.

4. The calibration method according to claim 3, wherein: The specific operations of step S3 are as follows: The xy coordinate system is established with the center O1 of the rotary platform as the origin, and the radius of the cylindrical workpiece is set to r1, the center coordinates are (Δx, Δy), and the eccentricity is Then the eccentricity angle α satisfies: In ΔO1O2B θ In the equation, we can use the law of cosines to get: O2B θ 2 =O1O2 2 +O1B θ 2 -2·O1O2·cos∠B θ O1O2, where O2 is the actual center of the cylindrical workpiece, B θ is the intersection point of the 3D camera laser line and the cylindrical workpiece contour when the rotary platform has a rotation angle of θ, O1O2 is the distance from the center of the rotary platform to the actual center of the cylindrical workpiece, that is, the eccentricity Δr, O2B θ The distance from the actual center of the cylindrical workpiece to the intersection of the 3D camera laser line and the cylindrical workpiece contour, that is, the radius r1 of the cylindrical workpiece; O1B θ is the distance from the center of the rotary platform to the intersection of the 3D camera laser line and the cylindrical workpiece contour; Simplified: O1B θ 2 -2·Δr·cos(α-θ)·O1B θ +Δr 2 -r1 2 =0; Using the root-finding formula we get: Since r1>>Δr, we can approximate that: Combined with O1B θ >0, we get: O1B θ =Δr·cos(α-θ)+r1; Then the functional relationship of the eccentric depth change of the cylindrical workpiece is: h θ =A θ B θ =A θ O1-B θ O1=R-r1-Δr·cos(α-θ), where: h θ A is the eccentric depth of the cylindrical workpiece corresponding to the rotation angle of the rotary platform. θ is the position of the 3D camera when the rotation angle of the rotating platform is θ, and R is the rotation radius of the 3D camera; Let a1=-Δr,b1=R-r1, then h θ =a1·cos(α-θ)+b1; Substitute all points in the depth change set Y into the above formula and calculate the average loss function Loss1: Where h θ is the average depth of the depth change set Y when the corresponding rotation angle is θ, h θ Theoretical value of Since the Loss1 expression is nonlinear and contains multiple variables, namely a1, b1, and α, in order to find the minimum value of the average loss function Loss1, the corresponding Hession matrix is ​​established as follows: Where X is the input parameter, satisfying X=(a1 b1 α) T ; The gradient of the average loss function Loss1 is defined as: in: The final iterative formula is: Where X0 is the initial value of the parameter, here it is (1 1 0), for The inverse matrix of .

5. The calibration method according to claim 4, characterized in that: The specific operations of step S4 are as follows: Establish an xy coordinate system with the center O1 of the rotary platform as the origin. The ideal position of the line laser 3D camera is point A, the actual position of the line laser 3D camera is point C, and the offset is Δc. Due to the existence of the offset, the intersection point of the laser line of the line laser 3D camera and the cylindrical workpiece will shift from the original point B to point D, causing the distance measured by the 3D camera to change from the original AB to CD. Therefore, it is necessary to establish a relationship between Δc and the difference between AB and CD, that is, EB; According to the relative motion relationship, the coordinates of the fixed line laser 3D camera are obtained, and the relative coordinates of the center of the cylindrical workpiece are: (r2·cosθ, r2·sinθ), where r2 is the motion radius of the cylindrical workpiece. Then point B and point D will satisfy the following formula: Where: (x B ,y B )、(x D ,y D ) are the coordinates of point B and point D, r1 is the radius of the cylindrical workpiece; Simplifying the above formula, we get: Therefore Let step S3 Substitute all points in the depth change set Y into the EB expression and calculate the corresponding average loss function Loss2: Where, is Δh θ Theoretical value of The corresponding Newton iteration formula is: Where Δc0 is the initial value of the deviation, which is set to 0 here, and Δc n is the result of Δc0 after n iterations, and Loss2'(Δc) is the derivative of Loss2(Δc).

Citation Information

Patent Citations

  • milling machine FOR CRANKSHAFT OD. DGL

    AT286067B

  • Living things imitating recreation toy trolley

    CN2050777U