Two-step calibration method of line laser sensor and point cloud splicing and measuring method
Through the two-step calibration method and the splicing of the transformation matrix H, the problem that the linear laser sensor cannot be measured under the same coordinate system is solved, efficient and accurate three-dimensional measurement is achieved, and detection efficiency and measurement accuracy are improved.
Patent Information
- Application Number
- CN202411166911.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-13
AI Technical Summary
When scanning the workpiece to be tested, the linear laser sensor cannot measure its point cloud data at one time under the same coordinate system, resulting in the need of multiple sensors to complete the measurement together, which increases cost and complexity.
Using a two-step calibration method, the transformation matrix H is calculated through the RANSAC algorithm and the ICP algorithm, and the point cloud data of the two line laser sensors are spliced into the same coordinate system to measure the workpiece size.
Improve measurement efficiency and accuracy, reduce dependence on the position of the line laser sensor, and realize the ability to directly perform measurement without recalibration.
Smart Images

Figure CN119123975A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of three-dimensional measurement, and in particular relates to a two-step calibration method for a line laser sensor and a point cloud splicing and measurement method. Background Art
[0002] Three-dimensional measurement technology has been proposed since the 1950s. After decades of development, it has been widely used in intelligent manufacturing industries such as aviation, aerospace, and automobiles. In the modern manufacturing industry, quality inspection is generally required in all key links of product design, research and development, production, and commissioning. However, the cumbersome inspection requirements make traditional manual inspection unable to meet the inspection standards of modern enterprises. It is time-consuming and labor-intensive and has the potential risk of missed inspections and wrong inspections. Therefore, in order to meet the ever-increasing inspection standards and realize the comprehensive transformation of the intelligent manufacturing industry, it is particularly important to combine three-dimensional measurement technology with digital and intelligent technologies.
[0003] Depending on whether the measuring sensor is in contact with the workpiece being measured, three-dimensional measurement technology is mainly divided into two categories: contact measurement technology and non-contact measurement technology. Contact measurement technology usually uses professional measuring tools, such as vernier calipers, micrometers, three-dimensional coordinate measuring machines, etc., to obtain measurement data by fully contacting the workpiece being measured. Although contact measurement technology can meet many measurement needs, it still has some limitations. First, contact measurement technology usually requires the participation of inspection personnel, and its degree of automation is not high, so the inspection efficiency is relatively low. Secondly, contact measurement technology cannot obtain the three-dimensional appearance data of the workpiece being measured, which will result in the inability to obtain some dimensions based on the processing benchmark.
[0004] In response to the above situation, non-contact measurement technology has quickly emerged. The image method is a non-contact measurement technology. The image method uses an industrial camera to collect images of the workpiece to be measured during the detection process, then extracts edge information through processing, and calculates the three-dimensional data of the object to be measured in combination with calibration parameters. Compared with contact measurement technology, the image method has achieved significant improvements in detection efficiency, but there is still a certain degree of difficulty in obtaining the complete morphological data of the workpiece to be measured. With the rapid development of technologies such as computers and microelectronics, non-contact measurement technologies represented by structured light technology have attracted widespread attention and have spawned many new theories, technologies and equipment, which have begun to be applied in the field of detection. This technology projects light with coded information onto the surface of the workpiece to be detected, and collects the coded image through an industrial camera. Through decoding processing and pre-calibrated parameters, the three-dimensional morphological data of the object to be measured can be quickly reconstructed. Among them, the point laser measurement technology collects and processes the laser points projected onto the object to be measured, and combines the triangulation method to calculate the three-dimensional morphological information of the object to be measured. However, point laser measurement can only obtain one three-dimensional coordinate at a time, with low detection efficiency, and is not suitable for the measurement of more complex parts. Line laser scanning technology projects one or more laser lines onto the object to be inspected, extracts the laser stripes in the image, and calculates the three-dimensional data of the position of the laser line in the object to be inspected. Compared with point laser measurement technology, the detection efficiency is greatly improved, it has better stability in industrial applications, and can complete the three-dimensional shape detection of the workpiece to be measured with high precision.
[0005] However, when a line laser sensor scans a workpiece, it is often unable to measure its point cloud data at once in the same coordinate system. The reason is that the size of the workpiece exceeds the measurement range of the line laser sensor, and the sensor cannot scan the complete point cloud of the workpiece at a certain angle. To obtain a complete point cloud, multiple line laser sensors are required to work together. Therefore, it is particularly important to provide a low-cost method that can complete the calibration and three-dimensional measurement of line laser sensors at the same time. Summary of the invention
[0006] In view of the deficiencies in the prior art, an object of the present invention is to provide a two-step calibration method for a line laser sensor.
[0007] Another object of the present invention is to provide a point cloud stitching method, which completes the stitching of point clouds collected by two line laser sensors based on the transformation matrix H obtained by the two-step calibration method of the line laser sensor, and then can complete the measurement of the workpiece size.
[0008] Another object of the present invention is to provide a three-dimensional measurement method.
[0009] The purpose of the present invention is achieved through the following technical solutions.
[0010] A two-step calibration method for a line laser sensor comprises the following steps:
[0011] S1, including S1-1, S1-2 and S1-3:
[0012] S1-1, prepare a cylindrical calibration object, place the calibration object horizontally, place a line laser sensor on each side of the axis of the calibration object, and place the two line laser sensors symmetrically along the axis of the calibration object so that the measurement areas of the two line laser sensors intersect and the two line laser sensors simultaneously collect point clouds of the calibration object. Each line laser sensor corresponds to a coordinate system and obtains a point cloud. The point cloud collected by the i-th line laser sensor of the two line laser sensors on the calibration object is point cloud C i ,i=1 and 2;
[0013] The RANSAC algorithm is used to quantize the point cloud C i Fitting is performed to obtain point cloud C i The expression in the coordinate system of the i-th line laser sensor is based on the point cloud C i The expression in the coordinate system of the i-th line laser sensor obtains each point cloud C i The radius r i ;
[0014] S1-2, calculate the actual value R of the calibration part radius and the point cloud C i The radius r i The ratio between And defined as the scale factor, the point cloud C i Multiply the coordinates of all points in the Get the point cloud C after accuracy calibration i , the RANSAC algorithm is used to calibrate the point cloud C i Fitting is performed to obtain the point cloud C after accuracy calibration i The axis direction vector a i ′ ;
[0015] S1-3, calculate the axis direction vector a i ′ The rotation quaternion q is the direction vector (0,0,1) of the z-axis of its coordinate system. i , the rotation quaternion q i Convert to rotation matrix T i , through the rotation matrix T i Point cloud C after accuracy calibration i Perform a rotation transformation to obtain the point cloud C after vertical calibration i ′ , the RANSAC algorithm is used to calibrate the point cloud C after verticality calibration i′ Fit and calculate the point cloud C i ′ The axis direction vector a i ″ and a random point A on the axis ′ i ′ The coordinates of
[0016] S2, including: S2-1, S2-2, S2-3, S2-4 and S2-5:
[0017] S2-1 includes: ① and ②, there is no order between ① and ②;
[0018] ①Point cloud C 1 ′ and point cloud C 2 ′ The overlapping area is point cloud C 1 ′ Point cloud Q and point cloud C in 2 ′ The ISS feature points of point cloud Q and point cloud P are extracted respectively, and the ISS feature points of point cloud Q and point cloud P are calculated respectively by fast point feature histogram, so that all ISS feature points of point cloud Q and point cloud P can obtain geometric description, and the ISS feature points with the same geometric description in point cloud Q and point cloud P are matched to obtain paired ISS feature point pairs; the random sampling consistency algorithm is used to eliminate the wrong paired ISS feature point pairs; the initial transformation matrix H is obtained by the singular value decomposition method for the remaining ISS feature point pairs after eliminating the wrong paired ISS feature point pairs 1 ;
[0019] ②Through point cloud C i ′ The axis direction vector a i ″ and point A ′ i ′ The coordinates of point cloud C are obtained 1 ′ The axis expression and point cloud C 2 ′ The axis expression is based on the point cloud C 1 ′ The axis expression of point cloud C is obtained 1 ′ The first point Q of the axis segment 1 =(x 2 ,y 2 ,z 2 ), according to the point cloud C 2 ′ The axis expression of point cloud C is obtained 2′ The first point P of the axis segment 1 =(x 1 ,y 1 ,z 1 );
[0020] S2-2, the initial transformation matrix H 1 and P 1 Substitute the coordinates of P into 1 ′ =H 1 P 1 , and get P 1 ′ =(x 1 ′ ,y 1 ′ ,z 1 ′ );
[0021] S2-3, the initial transformation matrix H 1 Substitute the point cloud P into the mathematical model P ′ =H 1 P, get the point cloud P after the initial transformation ′ ;
[0022] By P 1 ′ and Q 1 Get the transformation matrix H 2 , The point cloud P ′ And the transformation matrix H 2 Substitute P″=H 2 P ′ , and obtain the point cloud P″ after axial error compensation;
[0023] S2-4, using the ICP algorithm to align the point cloud P″ after axial error compensation with the point cloud Q, and obtain the transformation matrix H between the point cloud P″ after axial error compensation and the point cloud Q 3 ;
[0024] S2-5, the initial transformation matrix H 1 , transformation matrix H 2 , transformation matrix H 3 And the rotation matrix T obtained in step S1-3 1 and the rotation matrix T 2 Substitute H = T 1 T H 3 H 2 H 1 T 2 , and get the transformation matrix H.
[0025] In S-1, the angle α between the linear laser beams emitted by the two line laser sensors satisfies 0°<α<180°.
[0026] In S-1, point cloud C i The expression in the coordinate system of the i-th line laser sensor is:
[0027]
[0028] Among them, (x i0 ,y i0 ,z i0 ) represents the point cloud C i A random point on the axis i The coordinates of (l i ,m i ,n i ) represents the point cloud C i The axis direction vector a i , r i Represents point cloud C i The radius of (x, y, z) represents the point cloud C i The coordinates of any point in .
[0029] A point cloud stitching method comprises: obtaining a transformation matrix H according to a two-step calibration method of a line laser sensor, keeping the positions of two line laser sensors unchanged, allowing the two line laser sensors to simultaneously collect point clouds of a workpiece to obtain two point clouds, transforming one of the point clouds through the transformation matrix H so that the two point clouds are converted to the same coordinate system, obtaining a stitched point cloud, and completing point cloud stitching.
[0030] A three-dimensional stereo measurement method includes: fitting a spliced point cloud through a RANSAC algorithm to calculate a measurement value of a workpiece.
[0031] Compared with the prior art, the present invention has the following beneficial effects:
[0032] 1. After calibration using the two-step calibration method for line laser sensors proposed in the present invention, there is no need to calibrate again, provided that the positions of the two line laser sensors do not change, and measurement can be performed directly, thereby improving work efficiency and providing technical support for three-dimensional measurement of line laser sensors.
[0033] 2. The point cloud stitching method of the present invention has a good stitching effect, and has been verified by actual measurement using a three-dimensional stereo measurement method, and has a high measurement accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of two line laser sensors and a calibration component in a two-step calibration method for a line laser sensor;
[0035] Figure 2 is a schematic diagram of the angle between the emitted laser beams of two line laser sensors;
[0036] Figure 3 Point cloud Q and point cloud P;
[0037] Figure 4 is the ISS feature point in the point cloud Q;
[0038] Figure 5 is the ISS feature point in the point cloud P;
[0039] Figure 6 Match the ISS feature points of point cloud Q and point cloud P;
[0040] Figure 7 To eliminate the wrong paired ISS feature point pairs after feature point matching;
[0041] Figure 8 is the result of rough registration;
[0042] Fig. 9 is the precise registration result;
[0043] Fig.10 Collect point clouds of workpiece 1 for two line laser sensors;
[0044] Fig.11 The main and auxiliary laser sensors collect the spliced point cloud of workpiece 1;
[0045] Fig.12 Collect point clouds of workpiece 2 for two line laser sensors;
[0046] Fig.13 The main and auxiliary laser sensors collect the spliced point cloud of workpiece 2;
[0047] Fig.14 Collecting point clouds of workpiece 3 for two line laser sensors;
[0048] Fig.15 The main and auxiliary line laser sensors collect the stitched point cloud of workpiece 3. DETAILED DESCRIPTION
[0049] The technical solution of the present invention is further described below in conjunction with specific embodiments.
[0050] Example 1
[0051] A two-step calibration method for a line laser sensor comprises the following steps:
[0052] S1, including S1-1, S1-2 and S1-3:
[0053] S1-1, such as Figure 1As shown, a cylindrical calibration piece (the radius of the calibration piece is 50 mm and the length is 300 mm) and two line laser sensors are prepared. The two line laser sensors are the main line laser sensor and the auxiliary line laser sensor. The calibration piece is placed horizontally, and a line laser sensor is placed on both sides of the axis of the calibration piece. The two line laser sensors are symmetrically arranged along the axis of the calibration piece, so that the measurement areas of the two line laser sensors intersect and the two line laser sensors collect point clouds for the calibration piece at the same time. Each line laser sensor corresponds to a coordinate system and obtains a point cloud. The angle α between the linear laser beams emitted by the two line laser sensors satisfies 0°<α<180°, and α is as follows Figure 2 As shown ( Figure 2 In the two line laser sensors, the point cloud collected by the i-th line laser sensor on the calibration object is point cloud C i , i = 1 and 2, where the main line laser sensor is the first line laser sensor, and the point cloud collected is point cloud C 1 ; The auxiliary line laser sensor is the second line laser sensor, and the point cloud collected is point cloud C 2 .
[0054] The RANSAC algorithm (Fischler, Martin A, Bolles and Robert C 1981 Random sample consensus: a paradigm for model fitting with applications to image analysis and auto mated cartography Commun. ACM 381-395) was used to classify the point cloud C i Fitting is performed to obtain point cloud C i The expression in the coordinate system of the i-th line laser sensor is:
[0055]
[0056] Among them, (x i0 ,y i0 ,z i0 ) represents the point cloud C i A random point on the axis i The coordinates of (l i ,m i ,n i ) represents the point cloud C i The axis direction vector a i , r i Represents point cloud C i The radius of (x, y, z) represents the point cloud C i The coordinates (variables) of any point in .
[0057] According to the point cloud C i The expression in the coordinate system of the i-th line laser sensor obtains each point cloud C i The radius r i , axis direction vector a i (l i ,m i ,n i ) and a random point A on the axis i (x i0 ,y i0 ,z i0 )’s coordinates.
[0058] In this embodiment, the point cloud C 1 The expression in the coordinate system corresponding to the first line laser sensor (main line laser sensor) is:
[0059]
[0060] From the above expression, we can get point cloud C 1 The radius is r 1 =48.6874mm, point cloud C 1 The axis direction vector a 1 =(-0.0337,0.1181,-0.9924), point cloud C 1 A random point on the axis 1 The coordinates are (-39.6382,-13.2541,50.4994);
[0061] Point Cloud C 2 The expression in the coordinate system corresponding to the second line laser sensor (auxiliary line laser sensor) is:
[0062] From the above expression, we can get point cloud C 2 The radius is r 2 =48.3464mm, point cloud C 2 The axis direction vector a 2 =(-0.1737,0.1714,-0.9694), point cloud C 2 A random point on the axis 2 The coordinates are (63.8623,33.6179,133.0825).
[0063] S1-2, calculate the actual value R of the calibration part radius and the point cloud C i The radius r i The ratio between them is defined as the proportionality coefficient Point cloud C iMultiply the coordinates of all points in the Get the point cloud C after accuracy calibration i In the above steps, the point cloud C i Multiply the coordinates of all points in According to the proportionality factor Point cloud C i Scaling can reduce the point cloud C i The radius r i The error between the actual value R of the radius of the calibration piece is calculated, and the accuracy calibration of the i-th line laser sensor is realized; the RANSAC algorithm is used to calibrate the point cloud C after accuracy calibration. i Fitting is performed to obtain the point cloud C after accuracy calibration i The radius r i ′ , axis direction vector a i ′ and a random point A on the axis i ′ The coordinates of .
[0064] In this embodiment, point cloud C 1 The radius is r 1 =48.6874mm, the actual value of the calibration radius R = 50mm, through r 1 The proportional coefficient calculated by R is 1.027. After the accuracy calibration, the point cloud C 1 The radius is r 1 ′ =49.989mm, point cloud C after accuracy calibration 1 The axis direction vector is a 1 ′ =(-0.0339,0.1182,-0.9927), point cloud C after accuracy calibration 1 A random point on the axis 1 ′ The coordinates are (-40.431,-13.5192,51.5094);
[0065] Point Cloud C 2 The radius is r 2 =48.3464mm, the actual value of the calibration radius R = 50mm, through r 2 The proportional coefficient calculated by R is 1.034. After the accuracy calibration, the point cloud C 2 The radius is r 2 ′ =49.981mm, point cloud C after accuracy calibration 2 The axis direction vector is a 2 ′=(-0.1736,0.1712,-0.9698), point cloud C after accuracy calibration 2 A random point on the axis 2 ′ The coordinates are (65.7782,34.6265,137.075).
[0066] S1-3, calculate the axis direction vector a i ′ The rotation quaternion q is the direction vector (0,0,1) of the z-axis of its coordinate system. i (For the calculation method, see Dam, EB, Koch, M., & Lillholm, M. (2000). Quaternions, Interpolation and Animation.) i Transform (transformation method see: Dam, EB, Koch, M., & Lillholm, M. (2000). Quaternions, Interpolation and Animation.) to the rotation matrix T i , through the rotation matrix T i Point cloud C after accuracy calibration i Perform a rotation transformation to obtain the point cloud C after vertical calibration i ′ The above steps complete the vertical calibration of a single line laser sensor. The rotation transformation can eliminate the point cloud C after the precision calibration. i The deflection angle between the axis of the ith line laser sensor and the z-axis direction of the coordinate system is realized after the verticality calibration of the point cloud C i ′ The axis of the sensor coordinate system is parallel to the z-axis. The RANSAC algorithm is used to calibrate the point cloud C after verticality calibration. i ′ Fit and calculate the point cloud C i ′ The axis direction vector a i ″ and a random point A on the axis ′ i ′ The coordinates of .
[0067] In this embodiment:
[0068] Rotation quaternion q 1 =(0.0616441,0.959848,0.273662,0), rotation matrix Point Cloud C 1 ′ The axis direction vector a 1″=(-0.00015,-0.00004,1.01058), a random point A on the axis 1 The coordinates of ″ are (-39.7342,-15.9604,-39.0761);
[0069] Rotation quaternion q 2 =(0.123693,0.696985,0.706337,0), rotation matrix Point Cloud C 2 ′ The axis direction vector a 2 ″=(0.00025,-0.00014,1.01781), a random point A on the axis 2 The coordinates of ″ are (57.9882,42.3085,-144.6).
[0070] S2, including: S2-1, S2-2, S2-3, S2-4 and S2-5:
[0071] S2-1 includes: ① and ②, there is no order between ① and ②;
[0072] ①Point cloud C 1 ′ and point cloud C 2 ′ The overlapping area is point cloud C 1 ′ Point cloud Q and point cloud C in 2 ′ Point cloud P in point cloud Point Cloud Extract ISS feature points of point cloud Q and point cloud P respectively (Yu Z 2009Intrinsic shape signatures:A shape descriptor for 3D object recognition ICCV Workshops pp689-696), and use fast point feature histogram (FPFH, Radu B, Nico B and Michael B 2009Fast Point Feature Histograms (FPFH) for 3D registration 2009IEEE International Conference on Robotics and Automation pp 3212-3217) The ISS feature points of point cloud Q and point cloud P are calculated respectively, so that all ISS feature points of point cloud Q and point cloud P can obtain geometric description (geometric description calculated according to fast point feature histogram (FPFH)), and the ISS feature points with the same geometric description in point cloud Q and point cloud P are matched to obtain paired ISS feature point pairs; the random sampling consensus algorithm (RANSAC) is used to eliminate the wrong paired ISS feature point pairs; the remaining ISS feature point pairs after eliminating the wrong paired ISS feature point pairs are obtained by singular value decomposition (SVD, Kalman, D. (1996). A Singularly Valuable Decomposition: The SVD of a Matrix. The College Mathematics Journal, 27 (1), 2–23. https: / / doi.org / 10.1080 / 07468342.1996.11973744) to obtain the initial transformation matrix H 1 ;
[0073] In this embodiment, if Figure 3 As shown, the lower point cloud is point cloud Q, and the upper point cloud is point cloud P. Figure 4 and Figure 5 They are the ISS feature points of point cloud Q and point cloud P respectively, where: Figure 4 The middle circle (white point cloud) is the ISS feature point of point cloud Q. Figure 5 The Chinese point (white point cloud) is the ISS feature point of point cloud P; Figure 6 Match the ISS feature points of point cloud Q and point cloud P; Figure 7 To eliminate the wrong paired ISS feature point pairs after feature point matching; initial transformation matrix
[0074] ②Through point cloud Ci ′ The axis direction vector a i ″ and randomly obtain a point A on the axis ′ i ′ The coordinates of point cloud C are obtained 1 ′ The axis expression and point cloud C 2 ′ The axis expression of
[0075] Point Cloud C 1 ′ The axis expression is: Among them, (x Q ,y Q ,z Q ) represents the point cloud C 1 ′ Point A on the axis 1 ″, (l 1 ,m 1 ,n 1 ) represents the point cloud C after vertical calibration 1 ′ The direction vector of the axis a 1 ″,(x C1 ,y C1 ,z C1 ) represents the point cloud C 1 ′ The coordinates of the points on the axis (variable). According to the point cloud C 1 ′ The axis expression of point cloud C is obtained 1 ′ The first point Q of the axis segment 1 =(x 2 ,y 2 ,z 2 );
[0076] Point Cloud C 2 ′ The axis expression is: Among them, (x P ,y P ,z P ) represents the point cloud C 2 ′ Point A on the axis 2 ″, (l 2 ,m 2 ,n 2 ) represents the point cloud C after vertical calibration 2 ′ The direction vector of the axis a 2 ″,(x C2 ,yC2 ,z C2 ) represents the point cloud C 2 ′ The coordinates of the points on the axis (variable). According to the point cloud C 2 ′ The axis expression of point cloud C is obtained 2 ′ The first point P of the axis segment 1 =(x 1 ,y 1 ,z 1 ).
[0077] S2-2, the initial transformation matrix H 1 and P 1 Substitute the coordinates of P into 1 ′ =H 1 P 1 , and get P 1 ′ =(x 1 ′ ,y 1 ′ ,z 1 ′ ), that is, using the initial transformation matrix H 1 P 1 Make a transformation;
[0078] S2-3, the initial transformation matrix H 1 Substitute the point cloud P into the mathematical model P ′ =H 1 P, get the point cloud P after the initial transformation ′ . Through the initial transformation matrix H 1 Perform translation and rotation operations, the initial transformation matrix H 1 for Among them, R 3×3 represents the rotation matrix, T 3×1 is the translation vector.
[0079] By P 1 ′ and Q 1 Get the transformation matrix H 2 , The point cloud P ′ And the transformation matrix H 2 Substitute P″=H 2 P ′ , we get the point cloud P″ after axial error compensation, that is, due to the point cloud C 1 ′ The first point of the axis Q 1 and point cloud C 2 ′The first point P of the axis 1 There is an error between them, which is solved by translating the vector [x 2 -x 1 ′ ,y 2 -y 1 ′ ,z 2 -z 1 ′ ] T Point Cloud C 1 ′ With point cloud C 2 ′ Axial error compensation between.
[0080] In this embodiment: Figure 8 is the point cloud P ′ And point cloud Q, where the lower right (green) is point cloud Q, and the lower left (blue) is point cloud P after initial transformation ′ .
[0081] Translation vector [x 2 -x 1 ′ ,y 2 -y 1 ′ ,z 2 -z 1 ′ ] T =[128.781,29.2116,2.35006] T ,
[0082] S2-4, use the ICP algorithm (Besl P and Mckay H 1992A method for registration of 3-D shapes IEEE Transactions on Pattern Analysis and Machine Intelligence pp239-256) to register the point cloud P″ after axial error compensation with the point cloud Q, and obtain the transformation matrix H between the point cloud P″ after axial error compensation and the point cloud Q 3 , transform the matrix H 3 Substitute the point cloud P″ after axial error compensation into P″′=H 3 P″, and obtain the point cloud P″′ after precise alignment.
[0083] In this embodiment: Transformation matrix like Fig. 9The figure shows the result of the precise registration (point cloud P″′ and point cloud Q). The lower layer (green) is point cloud Q, and the upper layer (blue) is point cloud P″′ after precise registration. Point cloud Q and point cloud P″′ are almost overlapped, and the root mean square error of the registration is 1.64493×10 -4 mm.
[0084] S2-5, the initial transformation matrix H 1 , transformation matrix H 2 , transformation matrix H 3 And the rotation matrix T obtained in step S1-3 1 and the rotation matrix T 2 Substitute H = T 1 T H 3 H 2 H 1 T 2 , get the transformation matrix H, multiply the point cloud P by the transformation matrix H (P″″=HP) to transform the point cloud P into the point cloud P″″, the point cloud P″″ and the point cloud Q have the same coordinate system and almost overlap. Point Cloud Point cloud C 2 ′ Multiply by the transformation matrix H, point cloud C 2 ′ Can be transformed to point cloud C through transformation matrix H 1 ′ 's coordinate system.
[0085] In this embodiment,
[0086] Example 2
[0087] A point cloud stitching method comprises: obtaining a transformation matrix H according to the two-step calibration method of the line laser sensor in Example 1, keeping the positions of two line laser sensors unchanged, allowing the two line laser sensors to simultaneously collect point clouds of a workpiece to obtain two point clouds, transforming one of the point clouds through the transformation matrix H so that the two point clouds are converted to the same coordinate system to obtain a stitched point cloud.
[0088] Example 3
[0089] A three-dimensional stereo measurement method includes: fitting the spliced point cloud obtained in Example 2 by using a RANSAC algorithm to calculate the measurement value of the workpiece.
[0090] Example 4
[0091] Based on Example 3, the workpiece is workpiece 1, and workpiece 1 is a cylinder with a radius of 100 mm and a length of 300 mm. Fig.10The figure shows the point cloud of workpiece 1 collected by two line laser sensors. Fig.11 The figure shows the point cloud of workpiece 1 collected by two line laser sensors after stitching, and the radius (measured value) of workpiece 1 is r. 0 =99.9876mm, the absolute error between the measured value and the actual value is Δ=0.0124mm and the relative error is ε=0.0124%.
[0092] Example 5
[0093] On the basis of Example 3, the workpiece is workpiece 2, and workpiece 2 is a regular quadrangular prism with a bottom side length of 100 mm and a height of 300 mm. Fig.12 The figure shows two point clouds of workpiece 2 collected by two line laser sensors. Fig.13 The figure shows the point cloud after stitching. The measured distance (measured value) d of the opposite surface of the point cloud after stitching is calculated. 0 =99.9619mm, the absolute error between the measured value and the actual value is Δ=0.0381mm and the relative error is ε=0.0381%.
[0094] Example 6
[0095] On the basis of Example 3, the workpiece is workpiece 3, and workpiece 3 is a regular triangular prism with a bottom side length of 100 mm and a height of 300 mm. Fig.14 The figure shows two point clouds of workpiece 3 collected by two line laser sensors. Fig.15 The figure shows the point cloud after stitching. Calculate the measured angle (measured value) θ between the two point cloud planes after stitching 0 =60.008°, the absolute error between the measured value and the actual value is Δ=0.008° and the relative error is ε=0.0133%.
[0096] The present invention is described above by way of example. It should be noted that, without departing from the core of the present invention, any simple deformation, modification or other equivalent replacement that can be made by those skilled in the art without inventive effort falls within the protection scope of the present invention.
Claims
1. A two-step calibration method for line laser sensors. It is characterized in that The following steps are involved: S1, including S1-1, S1-2 and S1-3: S1-1, prepare a cylindrical calibration object, place the calibration object horizontally, place a line laser sensor on each side of the axis of the calibration object, and place the two line laser sensors symmetrically along the axis of the calibration object so that the measurement areas of the two line laser sensors intersect and the two line laser sensors simultaneously collect point clouds of the calibration object. Each line laser sensor corresponds to a coordinate system and obtains a point cloud. The point cloud collected by the i-th line laser sensor of the two line laser sensors on the calibration object is point cloud C i ,i=1 and 2; The RANSAC algorithm is used to quantize the point cloud C i Fitting is performed to obtain point cloud C i The expression in the coordinate system of the i-th line laser sensor is based on the point cloud C i The expression in the coordinate system of the i-th line laser sensor obtains each point cloud C i The radius r i ; S1-2, calculate the actual value R of the calibration part radius and the point cloud C i The radius r i The ratio between And defined as the scale factor, the point cloud C i Multiply the coordinates of all points in the Get the point cloud C after accuracy calibration i , the RANSAC algorithm is used to calibrate the point cloud C i Fitting is performed to obtain the point cloud C after accuracy calibration i The axis direction vector a i ′ ; S1-3, calculate the axis direction vector a i ′ The rotation quaternion q is the direction vector (0,0,1) of the z-axis of its coordinate system. i , the rotation quaternion q i Convert to rotation matrix T i , through the rotation matrix T i Point cloud C after accuracy calibration i Perform a rotation transformation to obtain the point cloud C after vertical calibration i ′ , the RANSAC algorithm is used to calibrate the point cloud C after verticality calibration i ′ Fit and calculate the point cloud C i ′ The axis direction vector a i ″ and a random point A on the axis ′ i ′ The coordinates of S2, including: S2-1, S2-2, S2-3, S2-4 and S2-5: S2-1 includes: ① and ②, there is no order between ① and ②; ①Point cloud C 1 ′ and point cloud C 2 ′ The overlapping area is point cloud C 1 ′ Point cloud Q and point cloud C in 2 ′ The ISS feature points of point cloud Q and point cloud P are extracted respectively, and the ISS feature points of point cloud Q and point cloud P are calculated respectively by fast point feature histogram, so that all ISS feature points of point cloud Q and point cloud P can obtain geometric description, and the ISS feature points with the same geometric description in point cloud Q and point cloud P are matched to obtain paired ISS feature point pairs; the random sampling consistency algorithm is used to eliminate the wrong paired ISS feature point pairs; the initial transformation matrix H is obtained by the singular value decomposition method for the remaining ISS feature point pairs after eliminating the wrong paired ISS feature point pairs 1 ; ②Through point cloud C i ′ The axis direction vector a i ″ and point A ′ i ′ The coordinates of point cloud C are obtained 1 ′ The axis expression and point cloud C 2 ′ The axis expression is based on the point cloud C 1 ′ The axis expression of point cloud C is obtained 1 ′ The first point Q of the axis segment 1 =(x 2 ,y 2 ,z 2 ), according to the point cloud C 2 ′ The axis expression of point cloud C is obtained 2 ′ The first point P of the axis segment 1 =(x 1 ,y 1 ,z 1 ); S2-2, the initial transformation matrix H 1 and P 1 Substitute the coordinates of P into 1 ′ =H 1 P 1 , and get P 1 ′ =(x 1 ′ ,y 1 ′ ,z 1 ′ ); S2-3, the initial transformation matrix H 1 Substitute the point cloud P into the mathematical model P ′ =H 1 P, get the point cloud P after the initial transformation ′ ; By P 1 ′ and Q 1 Get the transformation matrix H 2 , The point cloud P ′ And the transformation matrix H 2 Substitute P″=H 2 P ′ , and obtain the point cloud P″ after axial error compensation; S2-4, using the ICP algorithm to align the point cloud P″ after axial error compensation with the point cloud Q, and obtain the transformation matrix H between the point cloud P″ after axial error compensation and the point cloud Q 3 ; S2-5, the initial transformation matrix H 1 , transformation matrix H 2 , transformation matrix H 3 And the rotation matrix T obtained in step S1-3 1 and the rotation matrix T 2 Substitute H = T 1 T H 3 H 2 H 1 T 2 , and get the transformation matrix H.
2. The two-step calibration method according to claim 1, It is characterized in that In S-1, the angle α between the linear laser beams emitted by the two line laser sensors satisfies 0°<α<180°.
3. The two-step calibration method according to claim 1, It is characterized in that In S-1, point cloud C i The expression in the coordinate system of the i-th line laser sensor is: Among them, (x i0 ,y i0 ,z i0 ) represents the point cloud C i A random point on the axis i The coordinates of (l i ,m i ,n i ) represents the point cloud C i The axis direction vector a i , r i Represents point cloud C i The radius of (x, y, z) represents the point cloud C i The coordinates of any point in .
4. A point cloud stitching method, It is characterized in that include: According to the two-step calibration method described in any one of claims 1 to 3, the transformation matrix H is obtained, the positions of the two line laser sensors are kept unchanged, and the two line laser sensors simultaneously collect point clouds of the workpiece to obtain two point clouds, one of the point clouds is transformed by the transformation matrix H so that the two point clouds are converted to the same coordinate system, and the spliced point cloud is obtained, thereby completing the point cloud splicing.
5. A three-dimensional measurement method, It is characterized in that include: The RANSAC algorithm is used to fit the spliced point cloud described in claim 4 to calculate the measurement value of the workpiece.
