CN-115830145-B - External parameter iterative calculation method and system for structured light
Abstract
The application provides a method and a system for iterative computation of external parameters of structured light, wherein the method comprises the steps of obtaining a first parameter coordinate, a second parameter coordinate and a third parameter coordinate of a reference point by establishing the reference point, constructing a camera parameter matrix and a projector parameter matrix according to the first parameter coordinate, the second parameter coordinate, the third parameter coordinate and corresponding scaling factors, and obtaining structured light coordinate relation parameters by combining the first parameter coordinate, the second parameter coordinate and the third parameter coordinate. And then establishing parallel planes, calculating plane errors of real distances of the parallel planes and interval distances between the parallel planes through an error function, and finally carrying out simultaneous calculation on the external parameter matrix, the structured light coordinate relation parameters and the plane errors to obtain an external parameter calculation result. According to the application, the error of the external parameters is obtained by establishing different parallel planes and using an error function calculation mode through the simultaneous matrixes, so that the external parameters are calculated, the efficiency and stability of the external parameter calculation are improved, and the external parameter error is reduced through iterative calculation.
Inventors
- HAO LEI
- YANG YI
Assignees
- 凌云光技术股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20221230
Claims (8)
- 1. A method for iterative computation of a structured light, the method comprising: Establishing a reference point, and acquiring a first parameter coordinate under a world coordinate system, a second parameter coordinate under a camera pixel coordinate system and a third parameter coordinate under a projector pixel coordinate system according to the reference point; Constructing a camera parameter matrix according to the first parameter coordinates, the second parameter coordinates and a camera scaling factor, and constructing a projector parameter matrix according to the first parameter coordinates, the third parameter coordinates and a projector scaling factor; calculating a first transformation matrix transformed from the camera pixel coordinate system to the world coordinate system, and calculating a second transformation matrix transformed from the projector pixel coordinate system to the world coordinate system; traversing a first conversion parameter of the first conversion matrix and traversing a second conversion parameter of the second conversion matrix; converting the camera parameter matrix into a first simultaneous matrix in a world coordinate system according to the first conversion parameters, and converting the projector parameter matrix into a second simultaneous matrix in the world coordinate system according to the second conversion parameters; The first simultaneous matrix and the second simultaneous matrix are simultaneously connected to calculate the structural light coordinate relation parameters to obtain the structural light coordinate relation parameters; Establishing a preset number of parallel planes, wherein the parallel planes comprise plane point sets, the interval distances between the parallel planes are different, and a straight line formed by the corresponding plane point sets is perpendicular to the parallel planes; obtaining the real distance between the parallel planes, and calculating the plane error of the interval distance between the parallel planes and the real distance through an error function; And carrying out iterative simultaneous calculation on the parameter matrix of the external parameters between the projector and the camera and the structural light coordinate relation parameters and the plane error to obtain an external parameter calculation result.
- 2. The iterative calculation method for external parameters of structured light according to claim 1, wherein in the step of calculating a first conversion matrix converted from the camera pixel coordinate system to the world coordinate system, the method further comprises: Obtaining a camera internal reference matrix, a camera rotation matrix and a camera translation matrix through calibration; and inputting the camera internal reference matrix, the camera rotation matrix and the camera translation matrix into a first preset formula to calculate a first conversion matrix.
- 3. The iterative calculation method for external parameters of structured light according to claim 2, wherein in the step of calculating a second transformation matrix for transforming from said projector pixel coordinate system to said world coordinate system, said method further comprises: Acquiring an external parameter rotation matrix between a projector and a camera, wherein the external parameter rotation matrix is obtained by performing coordinate rotation on external parameters between the projector and the camera; Calculating the product of the external reference rotation matrix and the camera rotation matrix to obtain a projector rotation matrix, wherein the projector rotation matrix is a rotation matrix from the projector coordinate system to the world coordinate system; obtaining a projection internal reference matrix and a projection translation matrix through calibration; and inputting the projection internal reference matrix, the projection translation matrix and the projector rotation matrix into a second preset formula to calculate a second conversion matrix.
- 4. A method of iterative computation of a feature of structured light as claimed in claim 3, wherein in the step of obtaining the projected feature matrix and the projected translation matrix by calibration, the method further comprises: acquiring an external parameter translation matrix between a projector and a camera, wherein the external parameter translation matrix is a matrix obtained by carrying out coordinate translation on external parameters between the projector and the camera; calculating a matrix product of the extrinsic rotation matrix and the camera translation matrix; and summing the product of the external reference translation matrix and the matrix to obtain the projection translation matrix.
- 5. A method of iterative computation of the external parameters of structured light according to claim 3, wherein the camera internal parameter matrix is: Wherein, the 、 For the ratio of the focal length of the camera lens to the physical dimensions of each pixel in the x and y directions, 、 The position coordinates of the center point of the lens in the camera pixel coordinate system are obtained; The projection internal reference matrix is as follows: Wherein, the 、 For the ratio of the projector lens focal length to the physical dimensions of each pixel in the x and y directions, 、 Is the position coordinates of the projector center point in the projector pixel coordinate system.
- 6. The iterative calculation method for external parameters of structured light according to claim 1, wherein in the step of performing iterative simultaneous calculation of an external parameter matrix between a projector and a camera and the structured light coordinate relation parameter and the plane error, the method further comprises: Comparing the plane error with a distance error threshold; If the plane error is larger than a distance error threshold, performing iterative simultaneous calculation on an external parameter matrix between a projector and a camera, the structured light coordinate relation parameter and the plane error; and outputting the plane error if the plane error is smaller than a distance error threshold.
- 7. The method of iterative computation of a feature of structured light of claim 6, wherein said feature parameter matrix comprises a feature rotation matrix and a feature translation matrix, said method further comprising: if the plane error is greater than the distance error threshold, the extrinsic rotation parameters of the extrinsic rotation matrix and the extrinsic translation parameters of the extrinsic translation matrix are input together as iteration parameters into a loss function, the structured light coordinate relation parameters are combined to update the parameter of external parameter rotation and the parameter of external parameter translation; Calculating parameter errors of the parameter rotation parameters and the parameter translation parameters before and after updating; and comparing the parameter error with the error threshold again as a plane error.
- 8. A structured light, exogenous iterative computing system, the system comprising a projector, a camera, and a computing module configured to perform: Establishing a reference point, and acquiring a first parameter coordinate under a world coordinate system, a second parameter coordinate under a camera pixel coordinate system and a third parameter coordinate under a projector pixel coordinate system according to the reference point; Constructing a camera parameter matrix according to the first parameter coordinates, the second parameter coordinates and a camera scaling factor, and constructing a projector parameter matrix according to the first parameter coordinates, the third parameter coordinates and a projector scaling factor; calculating a first transformation matrix transformed from the camera pixel coordinate system to the world coordinate system, and calculating a second transformation matrix transformed from the projector pixel coordinate system to the world coordinate system; traversing a first conversion parameter of the first conversion matrix and traversing a second conversion parameter of the second conversion matrix; converting the camera parameter matrix into a first simultaneous matrix in a world coordinate system according to the first conversion parameters, and converting the projector parameter matrix into a second simultaneous matrix in the world coordinate system according to the second conversion parameters; The first simultaneous matrix and the second simultaneous matrix are simultaneously connected to calculate the structural light coordinate relation parameters to obtain the structural light coordinate relation parameters; Establishing a preset number of parallel planes, wherein the parallel planes comprise plane point sets, the interval distances between the parallel planes are the same, and a straight line formed by the corresponding plane point sets is perpendicular to the parallel planes; Obtaining the real distance between the parallel planes, and calculating the plane error of the interval between the parallel planes and the real distance through an error function; and carrying out iterative simultaneous calculation on the external parameter between the projector and the camera and the structural light coordinate relation parameter and the plane error to obtain an external parameter calculation result.
Description
External parameter iterative calculation method and system for structured light Technical Field The application relates to the field of iterative computation of structured light external parameters, in particular to a method and a system for iterative computation of structured light external parameters. Background Camera intrinsic is a parameter related to the characteristics of the camera itself, such as the focal length of the camera, the pixel size, etc. Camera external parameters are parameters in the world coordinate system such as the position, rotation direction, etc. of the camera. Camera outliers can rotate and translate real world point coordinates through a rotation matrix and a translation matrix onto the camera or camera coordinates. The LM algorithm is usually adopted for solving the internal and external parameters in a calibrating way, the LM algorithm can carry out error summarization on all samples before weight updating, and if a standard error curved surface has a plurality of local minima, the LM algorithm can be trapped in the local minima at times, so that the calibrating precision is not high. Moreover, the random gradient descent method depends on a manually set learning rate, and if the learning rate is not properly set, the LM algorithm does not converge or the existing random gradient descent method of the adaptive learning rate converges slowly. In the calibration process, the calibration method adopts a calibration plate (checkerboard or round or other patterns) mode to solve the internal parameters and the external parameters of the system, and adopts a recalibration mode or an error lookup table mode to compensate for the condition of low calibration precision, but the recalibration can influence the calibration efficiency, and the compensation mode of the error lookup table can increase the additional calculation amount and reduce the stability of the system. Disclosure of Invention In order to improve efficiency and stability of calibrating an external parameter of a camera and reduce an error value of the external parameter, according to a first aspect, some embodiments of the present application provide an external parameter iterative calculation method of structured light, where the method includes: Establishing a reference point, and acquiring a first parameter coordinate under a world coordinate system, a second parameter coordinate under a camera pixel coordinate system and a third parameter coordinate under a projector pixel coordinate system according to the reference point; Constructing a camera parameter matrix according to the first parameter coordinates, the second parameter coordinates and a camera scaling factor, and constructing a projector parameter matrix according to the first parameter coordinates, the third parameter coordinates and a projector scaling factor; The camera parameter matrix and the projector parameter matrix are combined to obtain a structured light coordinate relation parameter; Establishing a preset number of parallel planes, wherein the parallel planes comprise plane point sets, the interval distances between the parallel planes are different, and a straight line formed by the corresponding plane point sets is perpendicular to the parallel planes; obtaining the real distance between the parallel planes, and calculating the plane error of the interval distance between the parallel planes and the real distance through the error function; And carrying out iterative simultaneous calculation on the parameter matrix of the external parameters between the projector and the camera and the structural light coordinate relation parameters and the plane error to obtain an external parameter calculation result. In some embodiments, the camera parameter matrix and the projector parameter matrix are coupled, the method further comprising: calculating a first transformation matrix transformed from the camera pixel coordinate system to the world coordinate system, and calculating a second transformation matrix transformed from the projector pixel coordinate system to the world coordinate system; traversing a first conversion parameter of the first conversion matrix and traversing a second conversion parameter of the second conversion matrix; converting the camera parameter matrix into a first simultaneous matrix in a world coordinate system according to the first conversion parameters, and converting the projector parameter matrix into a second simultaneous matrix in the world coordinate system according to the second conversion parameters; And combining the first combined matrix and the second combined matrix to calculate the structured light coordinate relation parameter. In some embodiments, in the step of computing a first transformation matrix transformed from the camera pixel coordinate system to the world coordinate system, the method further comprises: Obtaining a camera internal reference matrix, a camera rotation matrix and a camera translation