Unmanned aerial vehicle three-dimensional trajectory reconstruction method based on dual-camera imaging
By acquiring and supplementing the UAV image coordinate information, combined with dual-camera imaging technology, and using the triangulation method to reconstruct the three-dimensional trajectory of the UAV, the problem of low accuracy of three-dimensional trajectory reconstruction in binocular stereo vision technology is solved, and the problem of low accuracy of three-dimensional trajectory reconstruction is achieved in complex environments. Medium and efficient trajectory reconstruction.
Patent Information
- Application Number
- CN202410521393.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2024-08-23
AI Technical Summary
In the existing technology, when binocular stereo vision technology is used to reconstruct the three-dimensional trajectory of a drone, the coordinate information of the drone obtained by the two cameras is discrete, making it difficult to reconstruct the exact three-dimensional trajectory, especially when the starting shooting time is inconsistent. The accuracy of three-dimensional trajectory reconstruction is low.
By obtaining the coordinate information of the drone in each frame of image, the interpolation method is used to supplement the coordinate information, and the coordinates of the drone in additional frames are calculated. Combined with dual-camera imaging technology, the triangulation method is used to reconstruct the three-dimensional movement trajectory of the drone.
It achieves the reconstruction of more accurate three-dimensional drone trajectories in indoor environments without GPS or with weak external GPS signals. It is suitable for the reconstruction of high-speed or complex motion trajectories, and the system has low cost and simple structure.
Smart Images

Figure CN118537482A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of binocular stereo vision for reconstructing unmanned aerial vehicle trajectories, and in particular relates to a method for reconstructing three-dimensional trajectories of unmanned aerial vehicles based on dual-camera imaging. Background Art
[0002] When binocular stereo vision technology is used to reconstruct the 3D trajectory of a drone, the two cameras can only obtain discrete coordinate information of the drone. For example, a 30-frame camera can take 30 images in one second, and another 60-frame camera can take 60 images in one second. These two cameras can only take 30 images of the drone at the same time in one second, which often makes it difficult to reconstruct the exact 3D trajectory. In addition, the starting shooting time of the two cameras is inconsistent, so in practice, fewer images of the drone will be taken at the same time. Therefore, adding extra frames between two adjacent frames of the camera and calculating the coordinate information of the drone in the extra frames are conducive to reconstructing the exact 3D trajectory of the drone.
[0003] After searching the existing technical literature and papers, it is found that the reconstruction of the three-dimensional trajectory of the UAV based on dual-camera imaging uses two cameras to capture images from different angles, and obtains the three-dimensional trajectory of the UAV by simulating the human binocular vision mechanism. For example, in the paper "Moving Target Tracking and Measurement Based on Binocular Vision", a method of moving object tracking and measurement based on binocular stereo is proposed. This method uses the images of moving objects captured by two cameras at the same time to measure the actual three-dimensional position and depth of the object. However, this method only uses the existing camera to capture images and cannot obtain the accurate motion trajectory of the object. Summary of the invention
[0004] The purpose of the present invention is to provide a method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging, which solves the problem of low accuracy of three-dimensional trajectory reconstruction in the prior art.
[0005] The technical solution adopted by the present invention is a method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging, which is specifically implemented in the following steps:
[0006] Step 1, obtain the coordinate information of the drone in each frame of the image;
[0007] Step 2, supplement the drone coordinate information through interpolation method;
[0008] Step 3: Reconstruct the 3D motion trajectory of the UAV.
[0009] The present invention is also characterized in that:
[0010] Step 1 is implemented as follows:
[0011] Step 1.1, place two cameras on the ground at different positions and angles, and ensure that the drone can be photographed by these two cameras at the same time;
[0012] Step 1.2, obtain the images taken by the cameras, manually mark the horizontal and vertical coordinates of the drone position in each frame of the two cameras, and record the timestamp of each frame of the two cameras;
[0013] Step 1.3, save the coordinate information from the initial frame to the end frame in the form of a list, the first column of the list is the timestamp of each frame of the camera, and the second and third columns are the horizontal and vertical coordinates of the drone position in each frame of the camera.
[0014] Step 2 is implemented as follows:
[0015] Step 2.1, calculate the time difference d between the initial frames of the two cameras and align the initial frames of the two cameras.
[0016] Step 2.2, add an extra frame between each frame of the two cameras so that the two cameras are aligned in each frame after the initial frame;
[0017] Step 2.3, calculate the x and y coordinates of the drone in the supplementary frame.
[0018] Step 3 is implemented as follows:
[0019] Step 3.1, obtain the intrinsic parameters of the two cameras, including the intrinsic focal length, intrinsic parameter matrix K and other information, and calculate the extrinsic parameter rotation matrix R, translation vector v and projection matrix P of the two cameras;
[0020] Step 3.2, use the triangulation method to reconstruct the three-dimensional motion trajectory of the UAV.
[0021] Step 2.1 is implemented as follows:
[0022] Step 2.1.1, select one of the cameras as the main camera, and obtain the different starting shooting times t1 and t2 of the two cameras and the FPS value fps1 of the main camera;
[0023] Step 2.1.2, multiply the FPS value of the main camera by the starting shooting time difference between the main camera and the non-main camera to obtain the initial frame time difference d of the two cameras, which can be expressed as:
[0024] d = fps1*(t1-t2) (1)
[0025] Among them, fps1 is the FPS value of the main camera, in frames; t1 and t2 are the start shooting times of the main camera and non-main camera, in seconds;
[0026] Step 2.1.3, if the initial frame time difference d is a non-negative number, the initial frame of the non-main camera is added with the initial frame time difference d; if the initial frame time difference d is a negative number, the initial frame of the main camera is added with the initial frame time difference d to align the initial frames of the two cameras.
[0027] Step 2.2 is implemented according to the following steps:
[0028] Step 2.2.1, based on the FPS values fps1 and fps2 of the two cameras, calculate the least common multiple LCM of the FPS values of the two cameras, which can be expressed as:
[0029]
[0030] Among them, fps1 and fps2 are the FPS values of the two cameras, and gcd is the greatest common divisor of the FPS values of the two cameras;
[0031] Step 2.2.2, calculate the number of additional frames n required between each frame of the i-th camera based on the least common multiple LCM of the two cameras' FPS values and the FPS value fps of the i-th camera. i , which can be expressed as:
[0032]
[0033] Among them, fps i is the FPS value of the i-th camera, in frames; LCM is the least common multiple of the FPS values of the two cameras, in frames.
[0034] The x and y coordinates of the drone in the supplementary frame in step 2.3 are expressed as follows:
[0035]
[0036]
[0037] Among them, x1, y1, x2, and y2 are the horizontal and vertical directions of the drone in two adjacent frames of images taken by a camera.
[0038] Vertical axis; n is the number of additional frames required between each frame of the two cameras; α is a positive integer from 1 to n.
[0039] Step 3.1 is implemented as follows:
[0040] Step 3.1.1, calculate the rotation matrix R of the camera, which can be expressed as:
[0041]
[0042] Among them, α, β, and γ are the rotation angles of the camera around the X-axis, Y-axis, and Z-axis of the world coordinate system, respectively, in degrees; · is the matrix dot multiplication operator symbol;
[0043] Step 3.1.2, calculate the camera translation vector v, which can be expressed as:
[0044] v=P C -R.P W (7)
[0045] Among them, P C is the coordinate of the drone in the camera coordinate system; P W is the coordinate of the drone in the world coordinate system; R is the rotation matrix of the camera; · is the matrix dot multiplication operator;
[0046] Step 3.1.3, obtain the camera's intrinsic parameter matrix K and calculate the camera projection matrix P, which can be expressed as:
[0047] P=K·[R|v] (8)
[0048] Among them, K is the camera's intrinsic parameter matrix; R is the camera's rotation matrix; v is the camera's translation vector; [R|v] is the camera's extrinsic parameter matrix; | is the matrix merging symbol; . is the matrix dot multiplication operator symbol.
[0049] Step 3.2 is implemented as follows:
[0050] Step 3.2.1, vertically concatenate the projection matrices P1 and P2 of the two cameras with the homogeneous pixel coordinate matrices C1 and C2 of the drone to obtain the coefficient matrix A of the linear equation system, which can be expressed as:
[0051]
[0052]
[0053]
[0054] Among them, C1 and C2 are the homogeneous pixel coordinate matrices of the drone in the images taken by the two cameras; l1, m1, l2, and m2 are the horizontal and vertical coordinates of the drone in the images taken by the two cameras; P1 and P2 are the projection matrices of the two cameras; × is the matrix cross multiplication operator symbol;
[0055] Step 3.2.2, solve the homogeneous coordinates X according to the relationship between the coefficient matrix A of the linear equations and the homogeneous coordinates X. The specific relationship can be expressed as:
[0056] A T ·A·X=λ·X (10)
[0057] Step 3.2.3, normalized homogeneous coordinates X = [a1, a2, a3, a4] T , get the three-dimensional coordinates of the drone X′=[a′1, a′2, a′3] T , reconstruct the three-dimensional trajectory of the UAV motion, and the normalized homogeneous coordinates can be expressed as:
[0058]
[0059] Among them, a′1, a′2, and a′3 are the three elements of the homogeneous coordinate X′ after normalization; a1, a2, a3, and a4 are the four elements of the homogeneous coordinate X; a1, a2, and a3 are the coordinates on the x-axis, y-axis, and z-axis of the spatial coordinates, respectively, and a4 is the position weight of the point.
[0060] The beneficial effects of the present invention are:
[0061] 1) The present invention uses binocular stereo vision technology to reconstruct the three-dimensional trajectory of the drone, which can be highly adaptable to the environment and perform well in indoor environments without GPS and outdoor environments with weak or interfered GPS signals. Moreover, compared with other high-end sensors, binocular stereo vision systems are usually low-cost and have a simple system structure, which is suitable for online and non-contact application scenarios.
[0062] 2) The present invention adds extra frames between adjacent frames of the camera and calculates the coordinate information of the drone in the extra frames, so the present invention can reconstruct a more accurate three-dimensional trajectory of the drone. Compared with the existing object three-dimensional trajectory reconstruction method, the three-dimensional trajectory of the object with high-speed motion or complex motion trajectory can be reconstructed. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 is a flow chart of the present invention;
[0064] Figure 2 is a flow chart of the present invention for obtaining coordinate information of the drone in each frame of image;
[0065] Figure 3 is a flow chart of the present invention for supplementing the coordinate information of the drone by an interpolation method;
[0066] Figure 4 is a flow chart of reconstructing the three-dimensional motion trajectory of the UAV according to the present invention;
[0067] Figure 5 It is a three-dimensional display diagram of the reconstructed UAV motion trajectory of the present invention;
[0068] Figure 6 It is a three-dimensional display of the reconstructed UAV motion trajectory without frame supplementation. DETAILED DESCRIPTION
[0069] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0070] The present invention provides a method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging, such as Figure 1 As shown, the specific implementation steps are as follows:
[0071] Step 1, obtain the coordinate information of the drone in each frame of the image;
[0072] Step 1 is implemented as follows:
[0073] Step 1.1, place two cameras on the ground at different positions and angles, and ensure that the drone can be photographed by these two cameras at the same time;
[0074] Step 1.2, obtain the images taken by the cameras, manually mark the horizontal and vertical coordinates of the drone position in each frame of the two cameras, and record the timestamp of each frame of the two cameras;
[0075] Step 1.3, save the coordinate information from the initial frame to the end frame in the form of a list, the first column of the list is the timestamp of each frame of the camera, and the second and third columns are the horizontal and vertical coordinates of the drone position in each frame of the camera;
[0076] Step 2, supplement the drone coordinate information through interpolation method;
[0077] Step 2 is implemented as follows:
[0078] Step 2.1, calculate the time difference d between the initial frames of the two cameras and align the initial frames of the two cameras;
[0079] Step 2.1 is implemented as follows:
[0080] Step 2.1.1, select one of the cameras as the main camera, and obtain the different starting shooting times t1 and t2 of the two cameras and the FPS value fps1 of the main camera;
[0081] Step 2.1.2, multiply the FPS value of the main camera by the starting shooting time difference between the main camera and the non-main camera to obtain the initial frame time difference d of the two cameras, which can be expressed as:
[0082] d = fps1*(t1-t2) (1)
[0083] Among them, fps1 is the FPS value of the main camera, in frames; t1 and t2 are the start shooting times of the main camera and non-main camera, in seconds;
[0084] Step 2.1.3, if the initial frame time difference d is a non-negative number, the initial frame of the non-main camera is added with the initial frame time difference d; if the initial frame time difference d is a negative number, the initial frame of the main camera is added with the initial frame time difference d to align the initial frames of the two cameras;
[0085] Step 2.2, add an extra frame between each frame of the two cameras so that the two cameras are aligned in each frame after the initial frame;
[0086] Step 2.2 is implemented according to the following steps:
[0087] Step 2.2.1, based on the FPS values fps1 and fps2 of the two cameras, calculate the least common multiple LCM of the FPS values of the two cameras, which can be expressed as:
[0088]
[0089] Among them, fps1 and fps2 are the FPS values of the two cameras, and gcd is the greatest common divisor of the FPS values of the two cameras;
[0090] Step 2.2.2, calculate the number of additional frames n required between each frame of the i-th camera based on the least common multiple LCM of the two cameras' FPS values and the FPS value fps of the i-th camera. i , which can be expressed as:
[0091]
[0092] Among them, fps i is the FPS value of the i-th camera, in frames; LCM is the least common multiple of the FPS values of the two cameras, in frames;
[0093] Step 2.3, calculate the x and y coordinates of the drone in the supplementary frame;
[0094] The x and y coordinates of the drone in the supplementary frame in step 2.3 are expressed as follows:
[0095]
[0096]
[0097] Among them, x1, y1, x2, y2 are the horizontal and vertical coordinates of the drone in two adjacent frames of images taken by a camera; n is the number of additional frames required between each frame of the two cameras; α is a positive integer from 1 to n;
[0098] Step 3, reconstruct the three-dimensional motion trajectory of the drone;
[0099] Step 3 is implemented as follows:
[0100] Step 3.1, obtain the intrinsic parameters of the two cameras, including the intrinsic focal length, intrinsic parameter matrix K and other information, and calculate the extrinsic parameter rotation matrix R, translation vector v and projection matrix P of the two cameras;
[0101] Step 3.1 is implemented as follows:
[0102] Step 3.1.1, calculate the rotation matrix R of the camera, which can be expressed as:
[0103]
[0104] Among them, α, β, and γ are the rotation angles of the camera around the X-axis, Y-axis, and Z-axis of the world coordinate system, respectively, in degrees; · is the matrix dot multiplication operator symbol;
[0105] Step 3.1.2, calculate the camera translation vector v, which can be expressed as:
[0106] v=P C -R.P W (7)
[0107] Among them, P C is the coordinate of the drone in the camera coordinate system; P W is the coordinate of the drone in the world coordinate system; R is the rotation matrix of the camera; · is the matrix dot multiplication operator;
[0108] Step 3.1.3, obtain the camera's intrinsic parameter matrix K and calculate the camera projection matrix P, which can be expressed as:
[0109] P=K·[R|v] (8)
[0110] Where K is the camera's intrinsic parameter matrix; R is the camera's rotation matrix; v is the camera's translation vector; [R|v] is the camera's extrinsic parameter matrix; | is the matrix merging symbol; · is the matrix dot multiplication operator symbol;
[0111] Step 3.2, reconstruct the three-dimensional motion trajectory of the UAV using the triangulation method;
[0112] Step 3.2 is implemented as follows:
[0113] Step 3.2.1, vertically concatenate the projection matrices P1 and P2 of the two cameras with the homogeneous pixel coordinate matrices C1 and C2 of the drone to obtain the coefficient matrix A of the linear equation system, which can be expressed as:
[0114]
[0115]
[0116]
[0117] Among them, C1 and C2 are the homogeneous pixel coordinate matrices of the drone in the images taken by the two cameras; l1, m1, l2, and m2 are the horizontal and vertical coordinates of the drone in the images taken by the two cameras; P1 and P2 are the projection matrices of the two cameras; × is the matrix cross multiplication operator symbol;
[0118] Step 3.2.2, solve the homogeneous coordinates X according to the relationship between the coefficient matrix A of the linear equations and the homogeneous coordinates X. The specific relationship can be expressed as:
[0119] A T ·A·X=λ·X (10)
[0120] Step 3.2.3, normalized homogeneous coordinates X = [a1, a2, a3, a4] T , get the three-dimensional coordinates of the drone X′=[a′1, a′2, a′3] T , reconstruct the three-dimensional trajectory of the UAV motion, and the normalized homogeneous coordinates can be expressed as:
[0121]
[0122] Among them, a′1, a′2, and a′3 are the three elements of the homogeneous coordinate X′ after normalization; a1, a2, a3, and a4 are the four elements of the homogeneous coordinate X; a1, a2, and a3 are the coordinates on the x-axis, y-axis, and z-axis of the spatial coordinates, respectively, and a4 is the position weight of the point.
[0123] Example 1
[0124] In this embodiment, Figure 1 As shown in the figure, the two-dimensional coordinate information of the UAV taken simultaneously by two cameras manually marked is used as the experimental data, and Python is used as a tool to reconstruct the three-dimensional trajectory of the UAV. The implementation steps of reconstructing the trajectory include: obtaining the coordinate information of the UAV in each frame of the image; supplementing the coordinate information of the UAV by interpolation method; and reconstructing the three-dimensional motion trajectory of the UAV.
[0125] like Figure 2 As shown, the steps to obtain the coordinate information of the drone are:
[0126] Step 1: Place two cameras on the ground at different positions and angles, and ensure that the drone can be photographed by the two cameras at the same time. In this embodiment, two mobile phone cameras are used, namely a 30-frame Huawei Mate 7 mobile phone camera and a 60-frame Xiaomi 9 mobile phone camera;
[0127] Step 2: Get the images taken by the cameras, manually mark the horizontal and vertical coordinates of the drone position in each frame of the two cameras, and record the timestamp of each frame of the two cameras;
[0128] Step 3: Save the coordinate information from the initial frame to the end frame in a list format. The first column of the list is the timestamp of each frame of the camera, and the second and third columns are the horizontal and vertical coordinates of the drone position in each frame of the camera. In this embodiment, a total of 1,000 images are manually annotated, and the coordinate information list is:
[0129] [[1, 2, 3, ...], [0, 5, 10, ...], [0, 2, 4, ...]]
[0130] [[1, 2, 3, ...], [0, 20, 56, ...], [0, -9, -30, ...]].
[0131] Example 2
[0132] In this embodiment, Figure 3 As shown, the steps to supplement the drone coordinate information are:
[0133] Step 1: Calculate the time difference d between the initial frames of the two cameras and align the initial frames of the two cameras:
[0134] Step 11: Select one of the cameras as the main camera, and obtain the different starting shooting times t1 and t2 of the two cameras and the FPS (frame rate) value fps1 of the main camera; in this embodiment, the Xiaomi 9 mobile phone camera with 60 frames is used as the main camera, fps1=60, the starting shooting time t1=16 of the Xiaomi 9 mobile phone camera, and the starting shooting time t2=9 of the Huawei mate7 mobile phone camera;
[0135] Step 12: Multiply the FPS value of the main camera by the starting shooting time difference between the main camera and the non-main camera to obtain the initial frame time difference d of the two cameras, which can be expressed as: d = fps1*(t1-t2)
[0136] Wherein, fps1 is the FPS value of the main camera, in frames; t1 and t2 are the start shooting time of the main camera and the non-main camera, in seconds; in this embodiment, the initial frame time difference between the two cameras is
[0137] d = 60*(16-9) = 420;
[0138] Step 13: If the initial frame time difference d is a non-negative number, the initial frame of the non-main camera is added with the initial frame time difference d; if the initial frame time difference d is a negative number, the initial frame of the main camera is added with the initial frame time difference d to align the initial frames of the two cameras; in this embodiment, the initial frame of the Huawei Mate 7 mobile phone camera is added with the initial frame time difference, and the coordinate information list is obtained as follows:
[0139] [[1, 2, 3, ...], [0, 5, 10, ...], [0, 2, 4, ...]]
[0140] [[421, 422, 423, ...], [0, 9, 19, ...], [0, 4, 9, ...]];
[0141] Step 2: Add additional frames between each frame of the two cameras so that the two cameras are aligned in each frame after the initial frame:
[0142] Step 21: According to the FPS values fps1 and fps2 of the two cameras, calculate the least common multiple LCM of the FPS values of the two cameras, which can be expressed as:
[0143] Wherein, fps1 and fps2 are the FPS values of the two cameras, and gcd is the greatest common divisor of the FPS values of the two cameras; in this embodiment, the least common multiple LCM of the FPS values of the two cameras is 60;
[0144] Step 22: Calculate the number of additional frames n required between each frame of the i-th camera based on the least common multiple LCM of the two cameras' FPS values and the camera's FPS value fps. i , which can be expressed as:
[0145] Among them, fps i is the FPS value of the i-th camera, in frames; LCM is the least common multiple of the FPS values of the two cameras, in frames; in this embodiment, the number of additional supplementary frames required between each frame of the Huawei Mate 7 mobile phone camera n1=1, and the number of additional supplementary frames required between each frame of the Xiaomi 9 mobile phone camera n2=0;
[0146] Step 3: Calculate the x and y coordinates of the drone in the supplementary frame, which can be expressed as:
[0147]
[0148]
[0149] Among them, x1, x2, y1, y2 are the horizontal and vertical coordinates of the drone in two adjacent frames of images taken by a camera; n is the number of additional frames required between each frame of the two cameras; α is a positive integer from 1 to n; in this embodiment, 421.5 frames are added between the 421st and 422nd frames of the Huawei Mate 7 mobile phone camera, and the coordinate information list is obtained as follows:
[0150] [[1, 2, 3, ...], [0, 5, 10, ...], [0, 2, 4, ...]]
[0151] [[421, 421.5, 422, ...], [0, 4.5, 9, ...], [0, 2, 4, ...]].
[0152] Example 3
[0153] In this embodiment, Figure 4 As shown in the figure, the steps to supplement and reconstruct the three-dimensional motion trajectory of the UAV are:
[0154] Step 1: Obtain the intrinsic parameters of the two cameras, including the intrinsic focal length, intrinsic parameter matrix K and other information, and calculate the extrinsic parameter rotation matrix R, translation vector v and projection matrix P of the two cameras;
[0155] Step 11: Calculate the camera's rotation matrix R, which can be expressed as:
[0156]
[0157] Among them, α, β, and γ are the rotation angles of the camera around the X-axis, Y-axis, and Z-axis of the world coordinate system, respectively, in degrees; · is the matrix dot multiplication operator symbol;
[0158] Step 12: Calculate the camera's translation vector v, which can be expressed as:
[0159] v=P C -R.P W
[0160] Among them, P C is the coordinate of the drone in the camera coordinate system; P W is the coordinate of the drone in the world coordinate system; R is the rotation matrix of the camera; · is the matrix dot multiplication operator;
[0161] Step 13: Get the camera's intrinsic parameter matrix K and calculate the camera projection matrix P, which can be expressed as:
[0162] P=K·[R|v]
[0163] Where K is the camera's intrinsic parameter matrix; R is the camera's rotation matrix; v is the camera's translation vector; [R|v] is the camera's extrinsic parameter matrix; | is the matrix merging symbol; · is the matrix dot multiplication operator symbol;
[0164] Step 2: Reconstruct the 3D motion trajectory of the UAV using the triangulation method;
[0165] Step 21: Vertically concatenate the projection matrices P1 and P2 of the two cameras with the coordinate matrices C1 and C2 of the drone to obtain the coefficient matrix A of the linear equation system, which can be expressed as:
[0166]
[0167]
[0168]
[0169] Among them, C1 and C2 are the homogeneous pixel coordinate matrices of the drone in the images taken by the two cameras; l1, m1, l2, and m2 are the horizontal and vertical coordinates of the drone in the images taken by the two cameras; P1 and P2 are the projection matrices of the two cameras; × is the matrix cross multiplication operator symbol;
[0170] Step 22: Solve the homogeneous coordinates X according to the relationship between the coefficient matrix A of the linear equations and the homogeneous coordinates X. The specific relationship can be expressed as:
[0171] A T ·A·X=λ·X
[0172] Where A is the coefficient matrix of the linear equations; A T The coefficient transposed matrix of the linear equation system; λ is A T ·The smallest eigenvalue of A; ·It is the symbol of matrix dot multiplication operation;
[0173] Step 23: Normalized homogeneous coordinates X = [a1, a2, a3, a4] T , get the three-dimensional coordinates of the drone X′=[a′1, a′2, a′3] T , reconstruct the three-dimensional trajectory of the UAV motion, and the normalized homogeneous coordinates can be expressed as:
[0174]
[0175] Among them, a′1, a′2, and a′3 are three vectors of the normalized homogeneous coordinates X′; a1, a2, a3, and a4 are four vectors of the homogeneous coordinates X. a1, a2, and a3 are the coordinates on the x-axis, y-axis, and z-axis of the spatial coordinates, and the position weight of point a4. In this embodiment, the camera projection matrix P is calculated using the Python library function, and the three-dimensional coordinates X′ of the drone are obtained by the triangulation method.
[0176] The three-dimensional display image of the UAV motion trajectory reconstructed by the present invention is as follows: Figure 5 As shown in the figure, each yellow dot is the 3D coordinate point of the drone after frame interpolation. The 3D display image of the drone motion trajectory without frame interpolation reconstruction is as follows: Figure 6 As shown, each yellow dot is the three-dimensional coordinate point of the drone before the frame is supplemented.
Claims
1. A method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging, characterized in that: Please follow the steps below to implement: Step 1, obtain the coordinate information of the drone in each frame of the image; Step 2, supplement the drone coordinate information through interpolation method; Step 3: Reconstruct the 3D motion trajectory of the UAV.
2. The method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging according to claim 1, characterized in that: The step 1 is specifically implemented according to the following steps: Step 1.1, place two cameras on the ground at different positions and angles, and ensure that the drone can be photographed by these two cameras at the same time; Step 1.2, obtain the images taken by the cameras, manually mark the horizontal and vertical coordinates of the drone position in each frame of the two cameras, and record the timestamp of each frame of the two cameras; Step 1.3, save the coordinate information from the initial frame to the end frame in the form of a list, the first column of the list is the timestamp of each frame of the camera, and the second and third columns are the horizontal and vertical coordinates of the drone position in each frame of the camera.
3. The method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging according to claim 1, characterized in that: The step 2 is specifically implemented according to the following steps: Step 2.1, calculate the time difference d between the initial frames of the two cameras and align the initial frames of the two cameras; Step 2.2, add an extra frame between each frame of the two cameras so that the two cameras are aligned in each frame after the initial frame; Step 2.3, calculate the x and y coordinates of the drone in the supplementary frame.
4. The method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging according to claim 1, characterized in that: The step 3 is specifically implemented according to the following steps: Step 3.1, obtain the intrinsic parameters of the two cameras, including the intrinsic focal length, intrinsic parameter matrix K and other information, and calculate the extrinsic parameter rotation matrix R, translation vector v and projection matrix P of the two cameras; Step 3.2, use the triangulation method to reconstruct the three-dimensional motion trajectory of the UAV.
5. The method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging according to claim 3, characterized in that: The step 2.1 is specifically implemented according to the following steps: Step 2.1.1, select one of the cameras as the main camera, and obtain the different starting shooting times t1 and t2 of the two cameras and the FPS value fps1 of the main camera; Step 2.1.2, multiply the FPS value of the main camera by the starting shooting time difference between the main camera and the non-main camera to obtain the initial frame time difference d of the two cameras, which can be expressed as: d = fps1*(t1-t2) (1) Among them, fps1 is the FPS value of the main camera, in frames; t1 and t2 are the start shooting times of the main camera and non-main camera, in seconds; Step 2.1.3, if the initial frame time difference d is a non-negative number, the initial frame of the non-main camera is added with the initial frame time difference d; if the initial frame time difference d is a negative number, the initial frame of the main camera is added with the initial frame time difference d to align the initial frames of the two cameras.
6. The method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging according to claim 3, characterized in that: The step 2.2 is specifically implemented according to the following steps: Step 2.2.1, based on the FPS values fps1 and fps2 of the two cameras, calculate the least common multiple LCM of the FPS values of the two cameras, which can be expressed as: Among them, fps1 and fps2 are the FPS values of the two cameras, and gcd is the greatest common divisor of the FPS values of the two cameras; Step 2.2.2, calculate the number of additional frames n required between each frame of the i-th camera based on the least common multiple LCM of the two cameras' FPS values and the FPS value fps of the i-th camera. i , which can be expressed as: Among them, fps i is the FPS value of the i-th camera, in frames; LCM is the least common multiple of the FPS values of the two cameras, in frames.
7. The method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging according to claim 3, characterized in that: The horizontal and vertical coordinates x and y of the drone in the supplementary frame in step 2.3 are expressed according to the following formula: Among them, x1, y1, x2, y2 are the horizontal and vertical coordinates of the drone in two adjacent frames of images taken by a camera; n is the number of additional frames required between each frame of the two cameras; α is a positive integer from 1 to n.
8. The method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging according to claim 4, characterized in that: The step 3.1 is specifically implemented according to the following steps: Step 3.1.1, calculate the rotation matrix R of the camera, which can be expressed as: Among them, α, β, and γ are the rotation angles of the camera around the X-axis, Y-axis, and Z-axis of the world coordinate system, respectively, in degrees; · is the matrix dot multiplication operator symbol; Step 3.1.2, calculate the camera translation vector v, which can be expressed as: v=P C -R·P W (7) Among them, P C is the coordinate of the drone in the camera coordinate system; P W is the coordinate of the drone in the world coordinate system; R is the rotation matrix of the camera; · is the matrix dot multiplication operator; Step 3.1.3, obtain the camera's intrinsic parameter matrix K and calculate the camera projection matrix P, which can be expressed as: P=K·[R|v] (8) Among them, K is the camera's intrinsic parameter matrix; R is the camera's rotation matrix; v is the camera's translation vector; [R|v] is the camera's extrinsic parameter matrix; | is the matrix merging symbol; · is the matrix dot multiplication operator symbol.
9. The method for reconstructing the three-dimensional trajectory of an unmanned aerial vehicle based on dual-camera imaging according to claim 4, characterized in that: The step 3.2 is specifically implemented according to the following steps: Step 3.2.1, vertically concatenate the projection matrices P1 and P2 of the two cameras with the homogeneous pixel coordinate matrices C1 and C2 of the drone to obtain the coefficient matrix A of the linear equation system, which can be expressed as: Among them, C1 and C2 are the homogeneous pixel coordinate matrices of the drone in the images taken by the two cameras; l1, m1, l2, and m2 are the horizontal and vertical coordinates of the drone in the images taken by the two cameras; P1 and P2 are the projection matrices of the two cameras; × is the matrix cross multiplication operator symbol; Step 3.2.2, solve the homogeneous coordinates X according to the relationship between the coefficient matrix A of the linear equations and the homogeneous coordinates X. The specific relationship can be expressed as: A T ·A·X=λ·X (10) Step 3.2.3, normalized homogeneous coordinates X = [a1, a2, a3, a4] T , get the three-dimensional coordinates of the drone X′=[a′1, a′2, a′3] T , reconstruct the three-dimensional trajectory of the UAV motion, and the normalized homogeneous coordinates can be expressed as: Among them, a'1, a'2, and a'3 are the three elements of the normalized homogeneous coordinate X'; a1, a2, a3, and a4 are the four elements of the homogeneous coordinate X; a1, a2, and a3 are the coordinates on the x-axis, y-axis, and z-axis of the spatial coordinates, and a4 is the position weight of the point.
