# A Study of Correction to the Point Cloud Distortion Based on MEMS LiDAR System
## 2 Methods
### Analysis of the Causes of Distortion and Correction Methods
The following equations can be obtained from Equations (2) and (3):  
\[ \begin{array}{l}\cos(\theta_{x})=\frac{1}{\sqrt{1+x_{0i}^{2}\tan^{2}(\theta _{\rm xmax})}}\\ \sin(\theta_{x})=\frac{x_{0i}\cdot\tan(\theta_{\rm xmax})}{\sqrt{1+x_{0i}^{2} \tan^{2}(\theta_{\rm xmax})}}\\ \cos(\theta_{y})=\frac{x_{0i}\cdot\tan(\theta_{\rm xmax})}{\sqrt{1+y_{0i}^{2} \tan^{2}(\theta_{\rm ymax})}}\\ \sin(\theta_{y})=\frac{y_{0i}\cdot\tan(\theta_{\rm xmax})}{\sqrt{1+y_{0i}^{2} \tan^{2}(\theta_{\rm ymax})}}\end{array}  \tag{4}\]  
According to the range of the values for \(x_{0i}\) and \(y_{0i}\) are between \(-1\) to 1 in the normalized coordinate system, and \(\tan\theta_{xmax}\) and \(\tan\theta_{ymax}\) are less than 1. Naturally, we applied [PERSON] expansion to the formula \(\sqrt{1+x_{0i}^{2}\cdot\tan^{2}(\theta_{x\rm max})}\) and \(\sqrt{1+y_{0i}^{2}\cdot\tan^{2}(\theta_{y\rm max})}\), respectively. Omit higher-order terms above the second order from \(x_{0i}^{2}\cdot\tan^{2}(\theta_{x\rm max})\) and \(y_{0i}^{2}\cdot\tan^{2}(\theta_{y\rm max})\), Equation (4) is expressed as follows:  
\[ \begin{array}{l}\cos(\theta_{x})=1-x_{0i}^{2}\cdot\tan^{2}(\theta_{x\rm max })/2\\ \sin(\theta_{x})=x_{0i}\cdot\tan(\theta_{x\rm max})\cdot\left(1-x_{0i}^{2} \cdot\tan^{2}(\theta_{x\rm max})/2\right)\\ \cos(\theta_{y})=1-y_{0i}^{2}\cdot\tan^{2}(\theta_{y\rm max})/2\\ \sin(\theta_{x})=y_{0i}\cdot\tan(\theta_{y\rm max})\cdot\left(1-y_{0i}^{2} \cdot\tan^{2}(\theta_{y\rm max})/2\right)\end{array}  \tag{5}\]  
Figure 4: Schematic diagram of scanning angle of MEMS mirror. Bring Equation (5) into Equation (1), we have:  
\[ \begin{array}{l}X_{i}=r_{i}\cdot\bigg{\{}\bigg{[}1-\frac{1}{2}(x_{0i}^{2}\cdot \tan^{2}(\theta_{x\max})+y_{0i}^{2}\cdot\tan^{2}(\theta_{y\max}))\bigg{]}\cdot \tan(\theta_{x\max})\bigg{\}}x_{0i}\\ Y_{i}=r_{i}\cdot\bigg{\{}\bigg{[}1-\frac{1}{2}(x_{0i}^{2}\cdot\tan^{2}(\theta_{ x\max})+y_{0i}^{2}\cdot\tan^{2}(\theta_{y\max}))\bigg{]}\cdot\tan(\theta_{y \max})\bigg{\}}y_{0i}\\ Z_{i}=r_{i}\cdot\bigg{\{}\bigg{[}1-\frac{1}{2}(x_{0i}^{2}\cdot\tan^{2}( \theta_{x\max})+y_{0i}^{2}\cdot\tan^{2}(\theta_{y\max}))\bigg{]}\bigg{\}} \end{array}  \tag{6}\]  
Let  
\[M=1-\frac{1}{2}\Big{(}x_{0i}^{2}\cdot\tan^{2}(\theta_{x\max})+y_{0i}^{2}\cdot \tan^{2}(\theta_{y\max})\Big{)} \tag{7}\]  
Then the Equation (6) can be expressed in the form of a matrix as:  
\[\left( \begin{array}{c}X_{i}\\ Y_{i}\\ Z_{i}\end{array} \right)=\left( \begin{array}{c}x_{0i}\cdot M_{Xi}\\ y_{0i}\cdot M_{Yi}\\ 1\cdot M_{Zi}\end{array} \right)\cdot r_{i} \tag{8}\]  
where  
\[ \begin{array}{l}M_{Xi}=M\cdot\tan(\theta_{x\max})\\ M_{Yi}=M\cdot\tan(\theta_{y\max})\\ M_{Zi}=M\end{array}  \tag{9}\]  
\(M_{Xi}\), \(M_{Yi}\) and \(M_{Zi}\) represent the conversion factors related to normalizing coordinates (\(x_{0i}\), \(y_{0i}\), \(r_{i}\)) to the Cartesian coordinates (\(X_{i}\), \(Y_{i}\), \(Z_{i}\)) in the LiDAR system, respectively. Theoretically speaking, the three-dimensional coordinates (\(x\), \(y\), \(z\)) of each point are related to the radial distance \(r_{i}\) between the target and the receiver. In Equation (7), since the two-dimensional scan coordinates (\(x_{0i}\), \(y_{0i}\)) of each point are preset, the maximum scan angle \(2\theta_{max}\) is also known, thus, the conversion factor for each point in the scan can be determined, the actual coordinates of each point in the FOV satisfy the relationship of Equation (7). The coefficients before \(r_{i}\) on the right side of the equal sign are all known. In the actual operation of data processing, after determining the maximum angle of the scan, we can calculate the coordinate conversion factor M for each scan normalized position point according to the coordinate sequence (\(x_{0i}\), \(y_{0i}\)) in the MEMS scan track \(M_{xi}\), \(M_{yi}\), and \(M_{Xi}\), after the time measurement system obtains the distance coordinate \(r_{i}\), they can be converted into the required (\(X_{i}\), \(Y_{i}\), \(Z_{i}\)) according to Equation (8).