# Three-Dimensional Reconstruction-Based Vibration Measurement of Bridge Model Using UAVs
## 2 Methods
### Homography Transformation Method  
Figure 1 shows the procedure of displacement correction based on homography transformation for UAV measurement, which consists of three steps: (1) The DIC principle is utilized to track the pixel values of the measurement points (step 1); (2) Four reference points are used to establish the homography matrix between the original frame and the frame to be corrected (step 2a); and (3) Remove the false displacement by the homography transformation to obtain the real displacement of the target points (step 3a). The above-mentioned steps can be realized by a MATLAB (MathWorks, Natick, MA, USA) program. As shown in Figure 3, there exists a 2D projection mapping between every two frames of UAV images, which can be expressed as [32]:  
\[s\left[ \begin{array}{c}u^{\prime}\\ v^{\prime}\\ 1\end{array} \right]=\left[ \begin{array}{ccc}h_{11}&h_{12}&h_{13}\\ h_{21}&h_{22}&h_{23}\\ h_{31}&h_{32}&h_{33}\end{array} \right]\left[ \begin{array}{c}u\\ v\\ 1\end{array} \right]=\mathbf{H}_{i}\left[ \begin{array}{c}u\\ v\\ 1\end{array} \right] \tag{2}\]  
where \(s\) is a scale factor; \(\mathbf{H}_{i}\) (\(i=1,2,3\ldots,n-1\)) is called the homography matrix; \(u^{\prime}\), \(v^{\prime}\) are the pixel coordinates of the reference points on the original frame, and \(u\), \(v\) are the pixel coordinates of the reference points on the frame to be corrected. At least four reference points are needed to estimate the homography matrix between two frames:  
\[\left[ \begin{array}{cccccccc}u_{1}&v_{1}&1&0&0&0&-u_{1}u_{1}{}^{\prime}&-u_{ 1}{}^{\prime}v_{1}\\ 0&0&0&u_{1}&v_{1}&1&-u_{1}v_{1}{}^{\prime}&-v_{1}v_{1}{}^{\prime}\\ u_{2}&v_{2}&1&0&0&0&-u_{2}u_{2}{}^{\prime}&-u_{2}v_{2}\\ 0&0&0&u_{2}&v_{2}&1&-u_{2}v_{2}{}^{\prime}&-v_{2}v_{2}{}^{\prime}\\ u_{3}&v_{3}&1&0&0&0&-u_{3}u_{3}{}^{\prime}&-u_{3}v_{3}\\ 0&0&0&u_{3}&v_{3}&1&-u_{3}v_{3}{}^{\prime}&-v_{3}v_{3}{}^{\prime}\\ u_{4}&v_{4}&1&0&0&0&-u_{4}u_{4}{}^{\prime}&-u_{4}v_{4}{}^{\prime}\\ 0&0&0&u_{4}&v_{4}&1&-u_{4}v_{4}{}^{\prime}&-v_{4}v_{4}{}^{\prime}\end{array}  \right]\left[ \begin{array}{c}h_{11}\\ h_{12}\\ h_{12}\\ h_{13}\\ h_{21}\\ h_{23}\\ h_{31}\\ h_{32}\end{array} \right]=\left[ \begin{array}{c}u_{1}{}^{\prime}\\ u_{1}{}^{\prime}\\ u_{2}{}^{\prime}\\ u_{3}{}^{\prime}\\ u_{4}{}^{\prime}\end{array} \right] \tag{3}\]  
Figure 2: Moving points tracked by DIC. If there are more than four reference points, the least square method is used to solve the homography matrix. The first frame of video can be regarded as the original reference frame, and the later frames are used to set up the one-to-one homography relationship with the first frame (Figure 3), separately. The corrected pixel coordinates of a target point are given as:  
\[\left[ \begin{array}{c}u_{j}^{\prime}\\ v_{j}^{\prime}\\ 1\end{array} \right]=\mathbf{H}_{j-1}\left[ \begin{array}{c}u_{j}\\ v_{j}\\ 1\end{array} \right] \tag{4}\]  
where \(j\) is the frame number; \(\left[ \begin{array}{cc}u_{j}&v_{j}\end{array} \right]^{T}\) is the pixel coordinates of the target point on the \(j^{th}\) frame, \(\left[ \begin{array}{cc}u_{j}^{\prime}&v_{j}^{\prime}\end{array} \right]^{T}\) is the pixel coordinates of the target point after homography correction. The real displacement of the target point can be obtained by subtracting \(\left[ \begin{array}{cc}u_{1}&v_{1}\end{array} \right]^{T}\) from \(\left[ \begin{array}{cc}u_{j}^{\prime}&v_{j}^{\prime}\end{array} \right]^{T}\); here, \(\left[ \begin{array}{cc}u_{1}&v_{1}\end{array} \right]^{T}\) is the pixel coordinates of the target point on the first frame. The unit of displacement is pixels, which can be transferred to physical values in millimeters by multiplying the conversion factor \(\eta=l/n\) (where \(l\) is the actual length in the real world, \(n\) is the pixel number in the image corresponding to the actual length). The homography transformation reflects the relationship between the image plane and the fixed object plane.