Line structured light mobile scanning measurement device and calibration method thereof
By integrating cameras, lasers, spatial attitude sensors and displacement sensors, a linear structured light mobile scanning measurement device, combined with data fusion technology, solves the problems of poor real-time performance and low accuracy in three-dimensional contour surface measurement, and achieves efficient and accurate three-dimensional morphology. Measurement.
Patent Information
- Application Number
- CN202410616126.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-09-27
AI Technical Summary
Existing three-dimensional contour surface measurement methods have problems such as poor real-time performance and low accuracy, and it is difficult to accurately and comprehensively provide the three-dimensional structural form of the measured object.
Using a linear structured light mobile scanning measurement device, by integrating cameras, lasers, spatial attitude sensors and displacement sensors, combined with data fusion methods, a three-dimensional surface topography data acquisition system is formed to achieve mobile measurement of the surface profile of the measured object and improve calibration efficiency. and precision.
It effectively improves the calibration efficiency and accuracy of three-dimensional measurement, can accurately and comprehensively provide three-dimensional structural morphological information of the measured object, and avoids the problems of measurement damage and low accuracy in traditional methods.
Smart Images

Figure CN118706031A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of measuring equipment, and in particular relates to a line structured light moving scanning measuring device and a calibration method thereof. Background Art
[0002] In modern industry and scientific research, accurately measuring the shape and contour of an object is an important task, and three-dimensional contour measurement technology can meet this measurement demand. It is widely used in manufacturing, medical treatment, geographical exploration and other fields.
[0003] The three-dimensional profile surface measurement technology is being updated at a rapid pace in the development of contemporary science and technology, and has produced fast and efficient measurement methods. However, with the development of the times, people's requirements for the quality of three-dimensional profile surface measurement are getting higher and higher. The existing contact measurement has obvious damage to the surface of the object being measured, which affects the measurement accuracy and speed during the measurement process, and cannot obtain complete surface profile information; while the existing non-contact measurement equipment has low accuracy, imperfect measurement system, and small measurement range. In general, the current three-dimensional profile surface measurement has the problems of poor real-time performance, low accuracy, and difficulty in accurately and comprehensively providing the three-dimensional structural morphology of the object being measured. Summary of the invention
[0004] The embodiment of the present invention provides a linear structured light mobile scanning measurement calibration method, which aims to solve the problems of poor real-time performance, low precision and difficulty in accurately and comprehensively providing the three-dimensional structural morphology of the object being measured in the existing three-dimensional contour surface measurement method.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] In a first aspect, a line structured light mobile scanning measurement device is provided, comprising:
[0007] The movable carrying mechanism also includes a camera, a laser, a space attitude sensor and a displacement sensor which are respectively arranged on the carrying mechanism. The camera and the laser cooperate to form a line structured light scanning sensor.
[0008] Compared with the prior art, the solution shown in the embodiment of the present application integrates a line structured light sensor composed of a camera and a laser, a spatial posture sensor and a displacement sensor on a movable carrying mechanism, determines the working space of the device in combination with the measurement accuracy requirement of the object to be measured, constructs a scanning platform, and forms a surface morphology three-dimensional data acquisition system by means of data fusion, thereby replacing the traditional surface profile measurement method, achieving the purpose of mobile measurement of the surface profile of the object to be measured, and effectively improving the calibration efficiency and calibration accuracy.
[0009] In a first aspect, the present application further provides a linear structured light mobile scanning measurement calibration method, which is implemented based on the above-mentioned linear structured light mobile scanning measurement device, and the linear structured light mobile scanning measurement calibration method comprises the following steps:
[0010] S200, obtaining initial values of extrinsic parameters based on a stereo target, optimizing the initial values of the extrinsic parameters to obtain an extrinsic parameter matrix, and estimating the spatial pose of the line structured light sensor according to the extrinsic parameter matrix;
[0011] S300, extracting the laser light strip, performing laser plane fitting, and obtaining a parameter equation of the laser plane;
[0012] S400, obtaining a real-time spatial pose estimation of the spatial pose sensor in the world coordinate system, and obtaining a spatial pose estimation of the camera based on a spatial transformation relationship between the camera and the stereo target;
[0013] S500, calculating a transformation matrix between the camera and the spatial attitude sensor according to the real-time spatial attitude estimation of the spatial attitude sensor in the world coordinate system and the spatial attitude estimation of the camera to complete calibration;
[0014] S600, obtaining a mathematical model and a spatial coordinate conversion relationship for using a displacement sensor to assist in the calibration of the position relationship between a camera and a spatial attitude sensor, performing matrix operations on the calibration between the displacement sensor and the spatial attitude sensor to complete data fusion, and obtaining system calibration and point cloud reconstruction results.
[0015] In combination with the second aspect, in a possible implementation, in step S200, the three-dimensional target includes at least three non-coplanar three-dimensionally distributed feature points, and the feature points are infrared light emitting diodes.
[0016] In combination with the second aspect, in a possible implementation method, in step S200, initial values of external parameters are obtained based on the stereo target, and the initial values of the external parameters are optimized, specifically including: using Tsai two-step method to calculate the initial values of the external parameters, and optimizing the external parameters through orthogonal iteration.
[0017] In conjunction with the second aspect, in a possible implementation manner, in step S200, estimating the spatial pose of the line structured light sensor according to the extrinsic parameter matrix specifically includes:
[0018] Assume that the rotation matrix between the world coordinate system and the camera coordinate system is R, the translation vector is T, and the feature point pose estimation can be transformed into minimizing the spatial collinearity error. The objective function is
[0019]
[0020] Among them, a point P in space wi =(X wi ,Ywi ,Z wi ,1) T , the actual projection of i=(1,2,3···,n) on the image plane is p i , V i is the line of sight projection matrix.
[0021] In conjunction with the second aspect, in a possible implementation, in step S300, extracting the laser light strip specifically includes:
[0022] By combining the LM algorithm with the Gaussian function, the positioning of the center of each column of the laser light strip is used as the search for the optimal solution of the particle swarm, and then extended to all columns of the light strips on the image.
[0023] In conjunction with the second aspect, in a possible implementation, in step S600, performing matrix operation on the calibration between the displacement sensor and the spatial attitude sensor to complete data fusion specifically includes:
[0024] The state of the system model is predicted by the extended Kalman filter. θ represents the rotation angle of the system in the world coordinate system, and v represents the speed of the system in the world coordinate system. The prediction equation of the EKF model is obtained:
[0025]
[0026] The system positioning is updated according to the prediction equation of the EKF model, realizing real-time position update of the system under the fusion of displacement sensor and space attitude sensor data.
[0027] In combination with the second aspect, in a possible implementation, in step S500, calculating the transformation matrix between the camera and the spatial posture sensor specifically includes: calculating the transformation matrix between the camera and the spatial posture sensor by a hand-eye calibration method under posture image screening constraints.
[0028] In some embodiments, the hand-eye calibration method under the pose image screening constraint is used to calculate the transformation matrix between the camera and the spatial pose sensor, specifically including:
[0029] Obtaining the world coordinates of the feature points having the same distribution relationship as the feature points of the three-dimensional target based on the world coordinate system;
[0030] Combine multiple feature points of the calibrated feature points with the transformation matrix X under the specified situation to obtain the geometric center of the calibrated feature points after transformation;
[0031] Find the numerical distance D between the geometric center in a specified case and the geometric centers of all other combinations {u,(i,L)} , wherein the geometric center of all other combinations is: the geometric center of the calibrated feature point after transformation by the transformation matrix X in all other combinations;
[0032] The optimal threshold value under the specified condition is selected by the threshold segmentation method to obtain the optimal image sequence;
[0033] When the three-dimensional target is fixed, the line structured light scanning measuring device is moved arbitrarily. During the movement, the camera captures the image of the three-dimensional target at regular intervals to obtain the camera external parameters.
[0034] During the movement of the online structured light mobile scanning measurement device, the spatial attitude sensor regularly records the angular displacement data and linear displacement data of the spatial attitude sensor in the world coordinate system, and obtains the external parameters of the spatial attitude sensor;
[0035] According to the external parameter relationship between the two coordinate systems, the positional relationship between the spatial attitude sensor and the camera is obtained by solving the equation AX=XB.
[0036] In combination with the second aspect, in a possible implementation manner, in step S300, performing laser plane fitting specifically includes: performing laser plane fitting based on a random sampling consistency algorithm.
[0037] Compared with the prior art, the solution shown in the embodiment of the present application fuses the data of the line structured light scanning sensor, the spatial attitude sensor and the displacement sensor to form a surface morphology three-dimensional data acquisition system, performs matrix operation on the calibration between the displacement sensor and the spatial attitude sensor to complete the data fusion, and proposes a high-precision calibration method for the camera and the spatial attitude sensor in the system, thereby avoiding the calibration error caused by the iterative calculation of the initial state estimate value, and effectively improving the calibration efficiency and calibration accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a calibration process of a linear structured light mobile scanning measurement calibration method provided by an embodiment of the present invention;
[0039] Figure 2 A front view of a line structured light mobile scanning measurement device provided by an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of a first calibration plate of a three-dimensional target used in an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of positioning of a spatial attitude sensor and a displacement sensor used in an embodiment of the present invention;
[0042] Figure 5 A schematic diagram of obtaining a laser light strip image using a camera and a laser according to an embodiment of the present invention;
[0043] Figure 6A schematic diagram of forming the world coordinate position of a light strip using a first calibration plate according to an embodiment of the present invention;
[0044] Figure 7 A schematic diagram of laser plane fitting according to an embodiment of the present invention;
[0045] Description of reference numerals:
[0046] 1. Carrying mechanism; 110. Carrying frame; 111. Main frame; 112. Second mounting frame; 120. Moving wheel; 2. Camera; 3. Laser; 4. Space attitude sensor; 5. Displacement sensor. DETAILED DESCRIPTION
[0047] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0048] In the claims, description and the above-mentioned drawings of the present invention, unless otherwise clearly defined, the use of terms such as "first", "second" or "third" etc. are for distinguishing different objects rather than for describing a specific order.
[0049] In the claims, specification and the above-mentioned drawings of the present invention, unless otherwise explicitly defined, directional words, such as the terms "center", "lateral", "longitudinal", "horizontal", "vertical", "top", "bottom", "inside", "outside", "up", "down", "front", "back", "left", "right", "clockwise", "counterclockwise", "high", "low", etc., indicating directions or positional relationships are based on the directions and positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction or be constructed and operated in a specific direction, and therefore cannot be understood as limiting the specific protection scope of the present invention.
[0050] In the claims, specification and the above drawings of the present invention, unless otherwise clearly defined, if the term "fixed connection" or "fixed connection" is used, it should be understood in a broad sense, that is, any connection method without a displacement relationship and relative rotation relationship between the two, that is to say, including non-detachable fixed connection, detachable fixed connection, integrated connection and fixed connection through other devices or elements.
[0051] In the claims, description and drawings of the present invention, if the terms "include", "have" and their variations are used, they are intended to mean "including but not limited to".
[0052] Please also read Figure 2 and Figure 3The line structured light mobile scanning measuring device provided by the present invention is now described. The line structured light mobile scanning measuring device comprises a movable carrying mechanism 1, and also comprises a camera 2, a laser 3, a spatial attitude sensor 4 and a displacement sensor 5 respectively arranged on the carrying mechanism 1, wherein the camera 2 and the laser 3 cooperate to form a line structured light scanning sensor.
[0053] In this embodiment, the implementation of the space attitude sensor 4 includes but is not limited to an inertial measurement unit (IMU).
[0054] Compared with the prior art, the line structured light mobile scanning measurement device provided in this embodiment integrates a line structured light sensor composed of a camera 2 and a laser 3, a spatial posture sensor 4 and a displacement sensor 5 on a movable supporting mechanism 1, determines the working space of the device in combination with the measurement accuracy requirement of the object to be measured, constructs a scanning platform, and forms a surface topography three-dimensional data acquisition system by means of data fusion, replacing the traditional surface profile measurement method, thereby achieving the purpose of mobile measurement of the surface profile of the object to be measured, and effectively improving the calibration efficiency and calibration accuracy.
[0055] In some specific embodiments, the camera 2 uses a CCD array camera. Due to the undulations on the surface of the object to be measured, the laser light strip emitted by the laser 3 is deformed, and the CCD array camera is used to capture the grating formed by the laser irradiating the surface of the object to be measured, forming a digital image, and analyzing and calculating the contour point information to obtain the three-dimensional height point cloud data on this bright line; the camera 2 collects the contour line of the object to be measured in the entire area to be measured, and the two-dimensional contour of the object to be measured is fused with the angle and displacement information provided by the spatial attitude sensor 4 and the displacement sensor 5, so as to obtain the three-dimensional information of the object to be measured in the entire area, and finally realize the three-dimensional reconstruction of the surface morphology of the object to be measured based on the three-dimensional point cloud data.
[0056] In some embodiments, the supporting mechanism 1 may be configured as follows: Figure 2 In the structure shown, the bearing mechanism 1 includes a bearing frame 110 and a moving wheel 120. The camera 2, the laser 3, the spatial attitude sensor 4 and the displacement sensor 5 are all arranged on the bearing frame 110, and the installation positions of the camera 2, the laser 3, the spatial attitude sensor 4 and the displacement sensor 5 can be selectively adjusted according to the actual installation requirements. In this embodiment, the direction of the camera 2 is at an angle to the direction of the light-emitting end of the laser 3. According to the normal-incident laser triangulation principle, the laser is installed vertically on the ground, and its light-emitting end is vertically downward. The specific angle range of the camera direction is based on the laser light bar appearing in the center position of the camera 2 field of view. The angle between the camera 2 and the light-emitting end of the laser 3 is approximately 45° to 65°.
[0057] In some embodiments, the carrier 110 may be configured as follows: Figure 2In the structure shown, the carrier frame 110 includes a main frame 111, a first mounting frame and a second mounting frame 112. The main frame 111 is a polygonal prism frame (such as a rectangular parallelepiped frame or a cube frame), and a moving wheel 120 is arranged at the lower part thereof; the first mounting frame is a vertical frame, which is arranged at the head end of the main frame 111, and the camera 2 is arranged on the first mounting frame so as to be movable up and down, and the lens of the camera 2 is tilted forward and downward; the displacement sensor 5 is arranged at the front lower part of the main frame 111, and the displacement sensor 5 includes an encoder and a meter wheel, the meter wheel is connected to the main frame 111, and the encoder is connected to the meter wheel; the second mounting frame 112 is a horizontal frame extending forward and backward, which is arranged at the front upper part of the main frame 111, and the laser 3 is arranged on the second mounting frame 112 and can move forward and backward on the second mounting frame 112, and the emission end of the laser 3 faces downward; the space attitude sensor 4 is arranged at the top of the main frame 111 and is arranged close to the second mounting frame 112 to obtain more accurate attitude changes.
[0058] In specific implementation, the position and height of the camera 2 can be adjusted according to the required measurement range of the object to be measured. The camera 2 and the laser 3 are installed and fixed at a certain angle to facilitate accurate projection of the laser on the object and acquisition of the image.
[0059] In specific implementation, the meter wheel is connected to the main frame 111 to record the movement distance of the bearing mechanism 1, and the encoder is used to convert the movement of the meter wheel into an electrical signal for measurement and control; the meter wheel and the encoder together constitute a meter wheel encoder. The meter wheel rotates synchronously with the encoder, and the angle of the meter wheel is determined by the number of pulses of the encoder rotating one circle, which is 4800P / R, and the movement distance of the object is determined by the angle according to the fixed circumference of the meter wheel. The encoder is a device that converts mechanical motion into an electrical signal. Among the meter wheel encoders, the commonly used encoder is a photoelectric encoder; the photoelectric encoder is composed of a light source, a grating and a photoelectric sensor. The light source emits light and irradiates the grating. There are a certain number of transparent and opaque stripes on the grating, forming a grating pattern. The photoelectric sensor receives the light passing through the grating and converts it into an electrical signal. According to the change of the received electrical signal, the rotation angle of the meter wheel can be determined. In specific use, the encoder is connected to the bottom of the bearing frame 110 by the meter wheel, and then combined with the measurement accuracy requirements of the object to be measured, the working space of the equipment is determined, and its scanning platform is constructed. The working space of the device mainly refers to the range of the laser light strip captured by the camera 2. The camera 2 can adjust its height according to the range of the object to be measured to expand or reduce the measurement field of view.
[0060] Based on the same inventive concept, see Figure 1 The embodiment of the present application further provides a linear structured light moving scanning measurement calibration method, which is implemented based on the above-mentioned linear structured light moving scanning measurement device. The linear structured light moving scanning measurement calibration method comprises the following steps:
[0061] S200, obtaining initial values of extrinsic parameters based on a stereo target, optimizing the initial values of the extrinsic parameters to obtain an extrinsic parameter matrix, and estimating the spatial pose of the line structured light sensor according to the extrinsic parameter matrix;
[0062] S300, extracting the laser light strip, performing laser plane fitting, and obtaining a parameter equation of the laser plane;
[0063] S400, obtaining a real-time spatial pose estimation of the spatial pose sensor 4 in the world coordinate system, and obtaining a spatial pose estimation of the camera 2 according to a spatial transformation relationship between the camera 2 and the stereo target;
[0064] S500, calculating the transformation matrix between the camera 2 and the spatial attitude sensor 4 according to the real-time spatial attitude estimation of the spatial attitude sensor 4 in the world coordinate system and the spatial attitude estimation of the camera 2 to complete the calibration;
[0065] S600, obtaining a mathematical model and a spatial coordinate conversion relationship for using the displacement sensor 5 to assist in the calibration of the position relationship between the camera 2 and the spatial attitude sensor 4, performing matrix operations on the calibration between the displacement sensor 5 and the spatial attitude sensor 4 to complete data fusion, and obtaining system calibration and point cloud reconstruction results.
[0066] Compared with the prior art, the line structured light mobile scanning measurement calibration method provided in this embodiment fuses the data of the line structured light scanning sensor, the spatial attitude sensor 4 and the displacement sensor 5 to form a surface morphology three-dimensional data acquisition system, performs matrix operation on the calibration between the displacement sensor 5 and the spatial attitude sensor 4 to complete the data fusion, and proposes a high-precision calibration method for the camera 2 and the spatial attitude sensor 4 in the system, avoiding the calibration error caused by the iterative calculation of the initial state estimation value, thereby effectively improving the calibration efficiency and calibration accuracy.
[0067] It should be noted that the parametric equation of the laser plane is obtained in order to obtain the depth information of the laser light strip in the camera coordinate system. Otherwise, only two-dimensional points are extracted from the laser light strip. A three-dimensional point cloud can be obtained by solving the parametric equation of the laser plane.
[0068] The process of obtaining the parametric equation of the laser plane is roughly as follows:
[0069] The imaging system of the line structured light model is located in the camera coordinate system. It is assumed that the relationship between all points is based on the camera coordinate system, that is, the origin of the coordinate system is the position Oc where the optical center is located. The imaging system is based on the camera calibration model. After the camera 2 is calibrated, the camera internal parameters are obtained. Based on the internal parameters of the camera 2 after calibration, the point P on the object under test can be obtained. w =(X w ,Y w ,Z w ,1) TThe position coordinates on the image plane are P1 = (x Γ ,y Γ ,1) T ;
[0070]
[0071] Where (r1, r2, r3), (r4, r5, r6), (r7, r8, r9) represent the direction vectors of the X-axis, Y-axis and Z-axis in the coordinate system of the object being measured, respectively. x ,T y ,T z ) represents the displacement information, and the synthetic matrix is the transformation matrix between the coordinate system of the object being measured and the coordinate system of the camera;
[0072] The laser plane equation is shown in formula (3-4):
[0073] a Γ X w +b Γ Y w +c Γ Z w +d Γ =0 (3-4)
[0074] Point P on the contour of the object being measured w It is located both on the OP ray in the camera coordinate system and on the laser plane projected by the line laser. Therefore, the mathematical model of the line structured light sensor measurement can be obtained by combining the two parameter equations, as shown in formula (3-5):
[0075]
[0076] In some embodiments, before step S200, the method further includes:
[0077] S100, completing the internal parameter calibration of camera 2.
[0078] More specifically, step S100 specifically includes: completing the intrinsic parameter calibration of the camera 2 by Zhang's calibration method.
[0079] The intrinsic calibration of camera 2 refers to measuring the geometric and optical parameters between the sensor and the optical elements in the imaging system of camera 2. Its purpose is to derive the transformation matrix in the imaging process of camera 2, so as to improve the quality of computer vision imaging.
[0080] The overall idea of Zhang's calibration method is to first find the homography matrix from the world coordinate system to the pixel coordinate system (the homography matrix is actually the transformation matrix from the pixel point in one image to the pixel point in another image. There is also a homography matrix in the binocular camera 2 system, which is the transformation matrix between the left and right camera 2 images), then obtain the internal parameter matrix according to the homography matrix, and finally obtain the external parameter matrix to complete the calibration. This method is between the photographic calibration method and the self-calibration method. It not only overcomes the shortcomings of the high-precision three-dimensional calibration object required by the photographic calibration method, but also solves the problem of poor robustness of the self-calibration method. The calibration process of Zhang's calibration method only needs to use a printed chessboard and take several groups of pictures from different directions (theoretically, 3 groups can solve all unknowns, but generally 15 to 20 groups are used, and the optimization method is used to ensure high solution accuracy). It is not only practical, flexible and convenient, but also has high accuracy and good robustness.
[0081] In some embodiments, in step S200, the three-dimensional target includes at least three non-coplanar three-dimensionally distributed feature points, and the feature points are infrared light emitting diodes.
[0082] In this embodiment, after camera 2 obtains the image of the feature points on the stereo target, since the equation that expresses the relationship between the three-dimensional space coordinate system and the two-dimensional image coordinate system is a nonlinear equation of the internal parameters and external parameters of camera 2, if the nonlinear distortion of the camera 2 lens is ignored, and the elements in the perspective transformation matrix are taken as unknowns to give a set of three-dimensional control points and corresponding image points, then the direct linear transformation method can be used to solve each element in the perspective transformation matrix. Therefore, the internal and external parameters of the camera can be calculated from the world coordinates and image coordinates of the feature points on the stereo target.
[0083] In this embodiment, the feature points are infrared light emitting diodes, which have the advantages of small size, low power consumption, and good directivity. They can provide feature point images with clear contours. At the same time, since they realize the self-luminescence of the feature points, they are less affected by the intensity of the external ambient light during calibration, and the calibration accuracy can be guaranteed, thus avoiding the influence of posture ambiguity on the spatial posture estimation of the measuring equipment.
[0084] In some embodiments of three-dimensional targets, the line structured light mobile scanning measurement device can represent its spatial position and posture in a single manner through the feature points on the three-dimensional target. Multiple feature points are distributed in three-dimensional non-coplanar postures on the three-dimensional target. When the line structured light mobile scanning measurement device moves in space, a unique coding sequence can be constructed with it and the position and posture can be estimated. The three-dimensional target can be quickly molded using a 3D printer, and the height difference configuration can also improve the measurement accuracy and stability.
[0085] When in use, the laser light strip is projected vertically onto a dot target calibration plate with nine rows and columns, and the dot target images without laser light strips at different heights and angles and the laser light strip images on the dot target plate at the corresponding position without illumination are photographed respectively; the center point of the laser light strip extracted from the center is iteratively fitted using random sampling consistency, and an optimal mathematical model is estimated from the original center extraction point of the light strip containing environmental noise to avoid the influence of noise on the accuracy of the estimation model of the laser light strip fitting to the center point of the light strip. The laser plane can be obtained by plane fitting of the five groups of extracted laser light strips.
[0086] In some embodiments, in step S200, initial values of extrinsic parameters are obtained based on the stereoscopic target, and the initial values of the extrinsic parameters are optimized, specifically including: using Tsai two-step method to calculate the initial values of the extrinsic parameters, and optimizing the extrinsic parameters through orthogonal iteration.
[0087] Among them, Tsai two-step method is an improved algorithm, which is roughly as follows:
[0088] Tsai's two-step calibration method optimizes the defect of DLT in solving external parameters without considering imaging distortion based on radial constraints. The coordinates of the ideal imaging point of the spatial point P on the image plane are p, and the normalized image point is (x, y). Due to the distortion of the camera lens, the actual imaging point on the image plane is p. d , the normalized image point is (x d ,y d ), the traditional Tsai two-step calibration only considers radial distortion, so combined with the imaging distortion model, the mathematical expression of the ideal imaging point p can be obtained as:
[0089]
[0090] In the camera imaging model
[0091]
[0092] Arranged:
[0093]
[0094] There are 7 unknowns in the equation, so the above equation can be solved by knowing 7 spatial feature points and the corresponding image plane points. According to the orthogonality and unit of the rotation matrix, the feature point pose matrix is solved. Tsai ):
[0095] K(A Tsai )=(A Tsai T A Tsai ) -1 ·(A TsaiT A Tsai ) (4-16)
[0096] When the feature points are coplanar, the condition number K(A Tsai ) is too large, and the result is less robust. The classic Tsai two-step calibration method only considers radial distortion and ignores other distortions. In actual situations, tangential distortion still has a great impact on the image after imaging, so the calibration accuracy is limited.
[0097] Considering the camera comprehensive distortion model, the calibration accuracy of the external parameters is further improved. The projection point on the image plane obtained by ideal imaging is defined as p, and its normalized image point is (f x ,f y ). The ideal projection point is the actual projection point p d Regarding the mapping of the comprehensive even model F(u,v), p d The normalized coordinates are (x d ,y d ), then the ideal projection point p and the actual projection point p d It can be expressed as follows:
[0098]
[0099] From the relationship between the image plane coordinates and the camera coordinates, we can know
[0100]
[0101] When coplanar feature points are selected, Z w =0, the linear equation system is:
[0102]
[0103] In the linear equation system composed of formula (4-19), the vector L optim There are 8 unknown parameters, A optim With B optim All are known quantities. Therefore, if the four feature points and the corresponding image plane coordinate points are known, the least squares solution of the equation can be obtained: L optim =(A optim T A optim ) -1 A optim T B optim (4-20)
[0104] The rotation matrix R is an orthogonal unit matrix, so there is a relationship:
[0105]
[0106] Since the camera focal length has no effect on the estimation of the external parameters of the target, let the camera focal length f = 1, a1 = r 11 / t z , a2=r 12 / t z , a3=t x / t z , a4=r 21 / t z , a5=r 22 / t z , a6=t y / t z , a7=r 31 / t z , a8=r 32 / t z ,but:
[0107]
[0108] Assume t z Is positive, calculate the parameter r in the rotation matrix 11 , r 12 , r 21 , r 22 , r 31 , r 32 , through the orthogonal property of the rotation matrix, the vector (r 13 ,r 23 ,r 33 ) T Calculated by the following formula:
[0109]
[0110] t z The value of will directly affect the direction of the rotation matrix, so it is necessary to z The sign of is used for judgment. From the relationship between the image plane and the world coordinates, we can get:
[0111]
[0112] Take any feature point and substitute it into the calculation to normalize the focal length f cx , f cy When both are greater than zero, t z Assume that it holds, otherwise t z Should be a negative value. Correctly judge t z Symbol, update the calculated rotation matrix parameters.
[0113] In some embodiments, in step S200, estimating the spatial pose of the line structured light sensor according to the extrinsic parameter matrix specifically includes:
[0114] Assume that the rotation matrix between the world coordinate system and the camera 2 coordinate system is R, the translation vector is T, and the feature point pose estimation can be transformed into minimizing the spatial collinearity error. The objective function is
[0115]
[0116] Among them, a point P in space wi =(X wi ,Y wi ,Z wi ,1) T , the actual projection of i=(1,2,3···,n) on the image plane is p i After distortion correction, the normalized coordinates of the ideal projection point image plane should be qi = (x i ,y i ,1) T , V i is the line of sight projection matrix.
[0117] The rotation matrix R and covariance matrix M can be calculated by iteration. Assume that the rotation matrix of the kth iteration is R (k) , the corresponding closed solution T (k) =T(R (k) ). By calculating Q i (k) =R (k) q i +T (k) , R (k+1) The estimate is:
[0118]
[0119] The above formula (3) can be regarded as {q i} to the point set {Q i (k) The optimal rigid body transformation problem is also called the absolute orientation problem. There are many ways to solve equation (3), among which the singular value decomposition method is a fast numerical solution. Let S = U T M(R)V represents an SVD decomposition of M. In formula (3), R (k+1) =VU T To avoid det(VU T )=-1, the reflection matrix needs to be corrected. The corrected result is R (k+1) =Vdiag(1,1,det(VU T ))U T , the next estimate of the translation vector is T (k+1) =T(R (k+1) ).
[0120] The extrinsic parameters calculated using the improved Tsai two-step method are used as initial values, and the extrinsic parameters are optimized through orthogonal iteration to obtain an extrinsic parameter matrix R and T with higher accuracy and satisfying the orthogonality constraint, thereby obtaining a more accurate feature point pose estimation.
[0121] In some embodiments, in step S300, extracting the laser light strip specifically includes:
[0122] By combining the LM algorithm with the Gaussian function, the positioning of the center of each column of the laser light strip is used as the search for the optimal solution of the particle swarm, and then extended to all columns of the light strips on the image. In this embodiment, the distribution of the grayscale value of the laser light strip on a single column approximately conforms to the Gaussian distribution. The LM algorithm is used to optimize the Gaussian function of the light strip cross section as the particle swarm objective function optimization algorithm to extract the laser light strip, which can effectively find the optimal solution of the particle swarm. In this embodiment, by extending to all columns of the light strips on the image, the center points of all the light strips of the laser light strip in the image can be extracted, and the next step of calculating the light strips and the calibration external parameters is expanded into a three-dimensional point cloud to restore the entire measured surface.
[0123] More specifically, by combining the LM algorithm with the Gaussian function, the location of the center of each column of the laser light strip is used as the search for the optimal solution of the particle swarm, and then extended to all columns of the light strips on the image, including:
[0124] In the LM algorithm, let:
[0125]
[0126] Solve the equation:
[0127]
[0128] Get (k) , the initial parameter α1 and factor β can be α1=0.01, β=10.
[0129] According to the fitness value, individual optimal value and global optimal value proposed by the optimized Gaussian function, the data iteration is completed through the standard formula (6):
[0130]
[0131] In formula (6), I = 1, 2...N, N is the total number of particles in the group. i represents the velocity of the particle, x i represents the current position of the particle, rand() is a random number between (0,1), C1 is the individual learning factor, C2 is the social learning factor, usually C1=C2=2, v i The maximum value of v max (greater than 0), if v i Greater than vmax , then v i =v max . Set v max This is to control the step size each time to prevent the search step size from being too large and missing the optimal solution. Then, the center coordinates of a certain column of the laser light strip can be obtained according to the global optimal value found.
[0132] This method is a sub-pixel level extraction method. Due to iterative optimization, it can achieve resistance to noise, has a short execution time and high accuracy.
[0133] In some embodiments, in step S300, performing laser plane fitting specifically includes: performing laser plane fitting based on a random sampling consistency algorithm.
[0134] On the basis of the above embodiment, the laser plane is fitted based on the random sampling consistency algorithm to obtain the parameter equation of the laser plane, which specifically includes:
[0135] Adjust the power of laser 3 and the exposure time of camera 2 to make the dot target calibration plate intersect with the laser plane at different heights to obtain several groups of laser light strip images, see Figure 5 ;
[0136] The first calibration plate is a ceramic dot first calibration plate. By assigning values to the targets on the first calibration plate (the target here is the first calibration plate, and the assignment refers to the assignment of values to the centers of the feature points on the first calibration plate), the world coordinate positions of the light strips with standard values are formed. Figure 6 ;
[0137] After distinguishing the internal and external points of the sample through random sampling consistency, the least squares method and random sampling consistency method are used to perform laser plane fitting calculations, respectively, and the parametric equation of the laser plane is obtained.
[0138] It should be noted that the first calibration plate used in the laser plane fitting calibration process is a ceramic dot first calibration plate rather than a stereo target; the stereo target is only used in the camera external parameter calibration and the camera and space attitude sensor calibration process. It should also be noted that Figure 6 In the figure, a) is the target plane image after grayscale processing; b) is the extracted image of the target feature point center; c) is the sorting of the target feature point center; d) is the position of the laser light bar and the target in the camera.
[0139] In some embodiments, in step S600, performing matrix operation on the calibration between the displacement sensor 5 and the spatial attitude sensor 4 to complete data fusion specifically includes:
[0140] The displacement sensor and the spatial attitude sensor are regarded as rigid bodies connected to each other. In the process of system movement, the displacement sensor and the spatial attitude sensor move synchronously. The displacement of the displacement sensor is stereoscopically decomposed into the spatial attitude sensor coordinate system through the data collected at the same time, and the time uniformity of the displacement sensor and the spatial attitude sensor is maintained, thereby ensuring the uniformity of the spatial displacement of the displacement sensor and the spatial attitude sensor. The displacement of the displacement sensor after stereoscopic decomposition can be used as the data basis for calculating the translation matrix of the spatial attitude sensor relative to the world coordinate system.
[0141] See also Figure 4 , taking the initial point when not moving as the origin, the following takes the first and second acquisition point movements as examples to analyze the process of three-dimensional decomposition of the data collected during the movement. After the first movement, the system reaches point 1 in the figure. At this time, the spatial attitude sensor angle reading is A1 = [A x1 A y1 A z1 ], the displacement sensor reading is E1, at this time, the rotation matrix R1' and translation matrix T1' of the initial point relative to the first movement point can be calculated, and the rotation matrix R1 and translation matrix T1 of the first movement point relative to the initial point can be solved by conversion; the system reaches point 2 in the figure after the second movement, and the spatial attitude sensor angle reading is A2 = [A x2 A y2 A z2 ], the encoder reading is E2, at this time, the rotation matrix R2' and translation matrix T2' of the initial point relative to the second movement point can be calculated; through the rotation matrix R1' of the first movement point relative to the initial point and the rotation matrix R2' of the second movement point relative to the initial point, the rotation matrix R2 of the first movement point relative to the second movement point can be solved, at this time, the three-dimensional decomposition step is completed;
[0142] After completing the stereo decomposition step, the extended Kalman filter is used to predict the state of the system model. θ represents the rotation angle of the system in the world coordinate system, and v represents the speed of the system in the world coordinate system. The prediction equation of the EKF model is obtained:
[0143]
[0144] The system positioning is updated according to the prediction equation of the EKF model, so as to realize the real-time position update of the system under the data fusion of the displacement sensor 5 and the space attitude sensor 4.
[0145] In some embodiments, in step S500, calculating the transformation matrix between the camera 2 and the spatial posture sensor 4 specifically includes: calculating the transformation matrix between the camera 2 and the spatial posture sensor 4 by a hand-eye calibration method under posture image screening constraints.
[0146] In some embodiments, the hand-eye calibration method under the posture image screening constraint is used to calculate the transformation matrix between the camera 2 and the spatial posture sensor 4, specifically including:
[0147] Obtaining the world coordinates of the feature points having the same distribution relationship as the feature points of the three-dimensional target based on the world coordinate system;
[0148] Combine multiple feature points of the calibrated feature points with the transformation matrix X under the specified situation to obtain the geometric center of the calibrated feature points after transformation;
[0149] Find the numerical distance D between the geometric center in a specified case and the geometric centers of all other combinations {u,(i,L)} , wherein the geometric center of all other combinations is: the geometric center of the calibrated feature point after transformation by the transformation matrix X in all other combinations;
[0150] The optimal image sequence is obtained by selecting the optimal threshold value under the specified situation through the threshold segmentation method (i.e., between-class variance partitioning [OTSU]);
[0151] When the three-dimensional target is fixed, the line structured light moving scanning measuring device (i.e. the spatial attitude sensor 4 of the moving camera 2) is arbitrarily moved, and the camera 2 captures the image of the three-dimensional target at regular intervals during the movement to obtain the external parameters of the camera 2;
[0152] During the movement of the online structured light mobile scanning measurement device, the spatial attitude sensor 4 regularly records the angular displacement data and the linear displacement data of the spatial attitude sensor 4 in the world coordinate system, and obtains the external parameters of the spatial attitude sensor 4;
[0153] According to the external parameter relationship between the two coordinate systems, the positional relationship between the spatial attitude sensor 4 and the camera 2 is obtained by solving the equation AX=XB.
[0154] In the step of combining the multiple feature points of the calibrated feature points with the transformation matrix X under the specified situation, the number of feature points can be nine. It should be noted that the feature points here refer to the feature points on the three-dimensional target, which are related to the actual structure of the three-dimensional target; this embodiment exemplarily shows that the three-dimensional target is fixed to 9 non-coplanar feature points, as shown in the attached figure. Figure 3 As shown, the number of feature points must be 9 and they must have fixed relative positions.
[0155] Based on the above embodiment, the actual calibration process is as follows:
[0156] The three-dimensional target is fixed, and the line structured light scanning measurement device is moved to complete the real-time shooting of the three-dimensional target by camera 2. The posture of each frame of the three-dimensional target in the three-dimensional scene is obtained by posture solution, so that the rotation matrix R between the coordinate system of the three-dimensional target and the coordinate system of camera 2 can be obtained. C and the translation matrix T C , that is, the transformation relationship between the two coordinate systems H T2C ; At the same time, the implementation parameter data of the angle of the spatial attitude sensor 4 and the displacement of the displacement sensor 5 are recorded to facilitate subsequent data fusion.
[0157] The line structured light mobile scanning measurement device is divided into four coordinate systems, namely the target coordinate system, the camera 2 coordinate system, the spatial attitude sensor 4 coordinate system and the world coordinate system. Camera 2 shoots the checkerboard target to obtain the camera 2 internal reference; camera 2 shoots the stereo target to obtain the real-time position relationship between the stereo target and camera 2, that is, the camera 2 external reference; the encoder and the spatial attitude sensor 4 data are fused to obtain the conversion relationship between the spatial attitude sensor 4 and the world coordinate system. The position relationship between camera 2 and spatial attitude sensor 4 can be obtained through hand-eye calibration based on the above two sets of corresponding conversion relationships, completing the calibration and measurement process. T2C is the spatial coordinate transformation matrix from the target coordinate system to the camera 2 coordinate system of the line structured light sensor, H C2I is the spatial coordinate transformation matrix between the camera 2 coordinate system of the line structured light sensor and the physical coordinate system of the spatial attitude sensor 4, H I2W It is the spatial coordinate transformation matrix between the physical coordinate system of the spatial attitude sensor 4 and the restored world coordinate system. It should be noted that the checkerboard target here is only used when calibrating the camera's intrinsic parameters, and has nothing to do with the stereo target (used for camera extrinsic calibration). The setting position of the checkerboard only requires changing the angle and height within the camera's field of view.
[0158] For each position of the line structured light mobile scanning measurement device, two external parameter matrices need to be captured, one is the characteristic target image used for the camera 2 posture calculation, and the other is the external parameter matrix that can be used to obtain the spatial posture sensor 4 posture. These two external parameter matrices are called matrix pairs;
[0159] Assuming the number of matrix pairs is n and m is the number chosen for calibration using the least squares criterion, we can find combinations, each of which corresponds to a k The conversion matrix represented by the calibration result;
[0160] Given the origin of the world coordinate system, the world coordinates of the calibration feature points with the same distribution relationship as the feature points of the stereo target can be obtained;
[0161] Combine the nine feature points of the calibration feature points with the transformation matrix X in any case to obtain the geometric center of the calibration feature points after transformation, and solve the numerical distance D between this geometric center and the geometric center of the calibration feature points after transformation under all other combinations of X {u,(i,L)} , perform inter-class variance partitioning [OTSU], select the optimal threshold in this case, and obtain the optimal image sequence;
[0162] The traversal method is used to obtain the threshold k that makes the inter-class variance optimal, which is the optimal threshold of the data D(i,L). Similarly, it is extended to all classification situations. In this way, the optimal threshold T of all data is obtained. g ;
[0163] The data D {u,(i,L)} Each data in T g Compare and keep those within the threshold range, and remove those outside the threshold range;
[0164] The image sequences corresponding to the data within the threshold range are counted, and the image with the lowest frequency is removed. The remaining image sequences are (ns), where s is the number of screening times, and the remaining image sequences are rearranged;
[0165] Repeat the above screening process until the absolute difference between two consecutive optimal thresholds is less than 1×10 -3 , then the image sequence (n-(s-1)) is considered to be the optimal image sequence.
[0166] The three-dimensional target is installed in a fixed position, and the linear structured light scanning measuring device is moved arbitrarily. During the movement, the camera 2 captures the target image at regular intervals to obtain the external parameters of the camera 2. At the same time, the spatial attitude sensor 4 regularly records its angle data in the world coordinate system and the displacement data obtained by the encoder fusion to solve the external parameters of the spatial attitude sensor 4.
[0167] By solving the equation AX=XB based on the external parameter relationship between the two coordinate systems, the positional relationship between the spatial attitude sensor 4 and the camera 2 can be solved.
[0168] Solve by AX=XB, where
[0169] So we have:
[0170]
[0171] The above equation (7) can be expressed by a quaternion that conforms to the definition of the rotation matrix:
[0172]
[0173] Through SVD decomposition, the right singular vector corresponding to the minimum singular value of NQ is the desired rotation. Because N is dynamically increased during the calibration process, it is necessary to manually set the termination condition for the rotation calibration. Normally, if the second smallest singular value of the SVD decomposition (singular value decomposition) result is greater than a set threshold, it is considered that the calibration solution of the external parameter rotation quantity has reached the termination condition. After solving the relative rotation between the spatial attitude sensor 4 and the camera 2, substitute the formula to solve the translation vector, and finally obtain the positional relationship between the spatial attitude sensor 4 and the camera 2.
[0174] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A line structured light mobile scanning measurement device, characterized in that: It comprises a movable carrying mechanism, and also comprises a camera, a laser, a space attitude sensor and a displacement sensor which are respectively arranged on the carrying mechanism. The camera and the laser cooperate to form a line structure light scanning sensor.
2. A linear structured light mobile scanning measurement calibration method, characterized in that: Based on the line structured light moving scanning measurement device according to claim 1, the line structured light moving scanning measurement calibration method comprises the steps of: S200, obtaining initial values of extrinsic parameters based on a stereo target, optimizing the initial values of the extrinsic parameters to obtain an extrinsic parameter matrix, and estimating the spatial pose of the line structured light sensor according to the extrinsic parameter matrix; S300, extracting the laser light strip, performing laser plane fitting, and obtaining a parameter equation of the laser plane; S400, obtaining a real-time spatial pose estimation of the spatial pose sensor in the world coordinate system, and obtaining a spatial pose estimation of the camera based on a spatial transformation relationship between the camera and the stereo target; S500, calculating a transformation matrix between the camera and the spatial attitude sensor according to the real-time spatial attitude estimation of the spatial attitude sensor in the world coordinate system and the spatial attitude estimation of the camera to complete calibration; S600, obtaining a mathematical model and a spatial coordinate conversion relationship for using a displacement sensor to assist in the calibration of the position relationship between a camera and a spatial attitude sensor, performing matrix operations on the calibration between the displacement sensor and the spatial attitude sensor to complete data fusion, and obtaining system calibration and point cloud reconstruction results.
3. The linear structured light mobile scanning measurement calibration method according to claim 2, characterized in that: In step S200, the three-dimensional target includes at least three non-coplanar three-dimensionally distributed feature points, and the feature points are infrared light emitting diodes.
4. The linear structured light mobile scanning measurement calibration method according to claim 2, characterized in that: In step S200, initial values of extrinsic parameters are obtained based on the stereoscopic target, and the initial values of the extrinsic parameters are optimized, specifically including: using Tsai two-step method to calculate the initial values of the extrinsic parameters, and optimizing the extrinsic parameters through orthogonal iteration.
5. The linear structured light mobile scanning measurement calibration method according to claim 2, characterized in that: In step S200, estimating the spatial pose of the line structured light sensor according to the extrinsic parameter matrix specifically includes: Assume that the rotation matrix between the world coordinate system and the camera coordinate system is R, the translation vector is T, and the feature point pose estimation can be transformed into minimizing the spatial collinearity error. The objective function is Among them, a point P in space wi =(X wi ,Y wi ,Z wi ,1) T , the actual projection of i=(1,2,3···,n) on the image plane is p i , V i is the line of sight projection matrix.
6. The linear structured light mobile scanning measurement calibration method according to claim 2, characterized in that: In step S300, extracting the laser light strip specifically includes: By combining the LM algorithm with the Gaussian function, the positioning of the center of each column of the laser light strip is used as the search for the optimal solution of the particle swarm, and then extended to all columns of the light strips on the image.
7. The linear structured light mobile scanning measurement calibration method according to claim 2, characterized in that: In step S600, performing matrix operation on the calibration between the displacement sensor and the spatial attitude sensor to complete data fusion specifically includes: The state of the system model is predicted by the extended Kalman filter. θ represents the rotation angle of the system in the world coordinate system, and v represents the speed of the system in the world coordinate system. The prediction equation of the EKF model is obtained: The system positioning is updated according to the prediction equation of the EKF model, realizing real-time position update of the system under the fusion of displacement sensor and space attitude sensor data.
8. The linear structured light mobile scanning measurement calibration method according to claim 2, characterized in that: In step S500, calculating the transformation matrix between the camera and the spatial posture sensor specifically includes: calculating the transformation matrix between the camera and the spatial posture sensor by a hand-eye calibration method under posture image screening constraints.
9. The linear structured light mobile scanning measurement calibration method according to claim 8, characterized in that: The hand-eye calibration method under the posture image screening constraint is used to calculate the transformation matrix between the camera and the spatial posture sensor, specifically including: Obtaining the world coordinates of the feature points having the same distribution relationship as the feature points of the three-dimensional target based on the world coordinate system; Combine multiple feature points of the calibrated feature points with the transformation matrix X under the specified situation to obtain the geometric center of the calibrated feature points after transformation; Find the numerical distance D between the geometric center in a specified case and the geometric centers of all other combinations {u,(i,L)} , wherein the geometric center of all other combinations is: the geometric center of the calibrated feature point after transformation by the transformation matrix X in all other combinations; The optimal threshold value under the specified condition is selected by the threshold segmentation method to obtain the optimal image sequence; When the three-dimensional target is fixed, the line structured light scanning measuring device is moved arbitrarily. During the movement, the camera captures the image of the three-dimensional target at regular intervals to obtain the camera external parameters. During the movement of the online structured light mobile scanning measurement device, the spatial attitude sensor regularly records the angular displacement data and linear displacement data of the spatial attitude sensor in the world coordinate system, and obtains the external parameters of the spatial attitude sensor; According to the external parameter relationship between the two coordinate systems, the positional relationship between the spatial attitude sensor and the camera is obtained by solving the equation AX=XB.
10. The linear structured light mobile scanning measurement calibration method according to claim 2, characterized in that: In step S300, performing laser plane fitting specifically includes: performing laser plane fitting based on a random sampling consistency algorithm.
Citation Information
Cited By
Line laser array calibration method based on striped flat plate
CN119197378A
Special-shaped structure ultrasonic profiling scanning method and system based on lifting path calibration
CN119827632A
Slide rail quality detection method, detector and computer readable storage medium
CN121252653A
Miniature probe, device and method for three-dimensional measurement of internal structure of intramedullary nail
CN121818135A
A micro-probe, device and method for three-dimensional measurement of intramedullary nail internal structure
CN121818135B
