# Birds Eye View Look-Up Table Estimation with Semantic Segmentation
## 3 Synthetic Database
### LUT Generation  
Due to the nature of the simulator that provides a camera image without lens system distortion, the distortion removal procedure is omitted, an ideal camera matrix is created, and the rotation and translation matrices are generated using the extracted camera pose roll/pitch/yaw and translation information. \(c_{x}/c_{y}\) means the principal length of the camera and \(f_{x}/f_{y}\) means the focal length, and based on these contents, the camera matrix \(K\) is estimated, which is a conversion matrix between the camera's original plane and the normalized plane.  
\[c_{x}=width/2\]  
\[c_{y}=height/2\]  
\[pi=3.141592...\]  
\[f_{x}=c_{x}/\left(\tan\left(0.5*fov*\frac{pi}{180}\right)\right)\]  
\[f_{y}=c_{y}/\left(\tan\left(0.5*fov*\frac{pi}{180}\right)\right)\]  
Figure 1: MORAI Sim Standard: (**a**) Chungbuk National University map; (**b**) KATRI K-city map.  
\[K=\left[\begin{array}{ccc}f&0&c_{x}\\ 0&f&c_{y}\\ 0&0&1\end{array}\right]\]  
In the homography production stage, through image calibration, the existing methods combine the 3 \(\times\) 3 rotation matrix (\(R\)) and the 3 \(\times\) 1 translation matrix (\(T\)) to create and utilize a 3 \(\times\) 4 matrix \(RT\), but if this method is used, the axis before rotation is applied. Due to the gimbal lock phenomenon that occurs when huge angles are rotated on an axis, the conversion may not be performed properly. Therefore, we multiplied 3 \(\times\) 4 \(R|T_{mull}\) first and multiplied 3 \(\times\) 4 \(R_{i}|T\) later to solve the problem. The problem was solved by considering the rotation of the coordinate axis first and then applying a translation matrix based on a new three-dimensional orthogonal axis (3 \(\times\) 3 unit matrix) rather than the rotated axis (maybe with gimbal lock). The details are as follows.  
\[R|T_{null}=\left[\begin{array}{ccc}r_{11}&r_{12}&r_{13}&0\\ r_{21}&r_{22}&r_{23}&0\\ r_{31}&r_{32}&r_{33}&0\end{array}\right]\]  
\[R_{i}|T=\left[\begin{array}{ccc}1&0&0&t_{x}\\ 0&1&0&t_{y}\\ 0&0&1&t_{z}\end{array}\right]\]  
\[RT=R_{i}|T*R|T_{null}\]  
Since the \(RT\) obtained in this way is a 3 \(\times\) 4 matrix, which is a transformation between a 3D homogeneous coordinate system and a 2D homogeneous coordinate system, the \(z\)-axis data are removed, based on the camera coordinates, to be used in the BEV transformation (which is a 2D-to-2D transformation, z = 0). If column 3 is deleted in \(RT\), an effect in which the \(z\)-axis data becomes 0 is derived, and a 3 \(\times\) 3 matrix is obtained.  
The homography \(H\) between the original image and the BEV is the product of \(RT_{3 rdColRemoved}\) (which is the rotation matrix between the image and the BEV), the camera matrix \(K\), and the matrix that makes the scale and makes left-top of the BEV to (0, 0).  
\[H=\left[\begin{array}{ccc}bveScale&0&-bveWidth/2\\ 0&bveScale&-bveHeight\\ 0&0&1\end{array}\right]*K*RT_{3 rdColRemoved}\]  
Both the \(x\) and \(y\) coordinates of the original image corresponding to the BEV points can be obtained using homography \(H\). The \(x\) and \(y\) coordinate values are divided by the width and height of the original image, multiplied by 65,525, converted into 16-bit data, and then stored as images named LUT_X and LUT_Y, respectively.