Skip to main content
. 2024 Jun 13;10(6):144. doi: 10.3390/jimaging10060144
Algorithm 1: Motion distortion correction based on cubature Kalman filter
Input: Original calibration target scan map, corresponding depth map, camera intrinsic parameters of binocular line matrix scanning system, parameter information of real calibration target, initialization parameter x0c, iteration error threshold Threshold, iteration number upper limit Number.
Step I: Image information acquisition phase:
1. Corner detection and image coordinate extraction for the original image of the calibration target.
2. Calculate the 3D coordinate information of the image corner points in the camera coordinate system in the previous step based on the binocular camera intrinsic parameters, the corresponding height map and the initial motion transmission correspondence.
3. Based on the information of the real calibration target corner points, set them in the X _Y plane of the calibration target coordinate system with a point spacing of 30mm and a Z coordinate of 0.
Step II: Motion parameter solution stage:
4. Initialize the parameters x0c in parameters x0n=[n1,n2,n3]=[0,1,0].
5. Match the point correspondence between the 3D coordinates of the corner points of the image and the real coordinates of the spatial corner points of the calibration target according to the characteristics of the checkerboard graph.
6. Calculate the rotation and translation relationship between the above corresponding points by using the cubature Kalman filter (Step-I) to obtain the initial value of [xkθ,xkt]=[θα,θβ,θγ,t1,t2,t3] in xkc.
7. Re-estimate the root mean square error Errork between the 3D coordinates of the image corner points and the updated coordinates of the spatial corner points in the calibration target after rotating and translating them according to [xkθ,xkt].
8. If Errork<=Threshold and the number of iterations Iter_times:k<=Number, use the cubature Kalman filter (Step-II) to calculate xkn=[n1,n2,n3] to reduce the Error. Based on the updated xkn=[n1,n2,n3], the 3D coordinate information of the image corners is updated to compensate and go to step 5.
9. If Errork<=Threshold or k>Number, output the final of k>Number and xk1n=[n1,n2,n3].
Output: Output the final [xkθ,xkt] and xk1n=[n1,n2,n3].