# Point-Graph Neural Network Based Novel Visual Positioning System for Indoor Navigation
## 3 Proposed Method
### Voxel Labeling
#### 3.2.2. Matching the Object Pose Estimated by Deep Learning with That in the Voxel Database  
The object estimated using the method presented in Section 3.1 and the object obtained in Section 3.2.1 are identical. This section explains the generation of each 3D box using the object labels obtained in Sections 3.1 and 3.2.1, match the center points of the two 3D boxes, and then match the eight vertices of the 3D box. Figure 4 illustrates the three steps, and the detailed method can be summarized as follows. Figure 3: The Voxel database in the point cloud comprises (**a**) voxel grids and (**b**) corners of a box. **Unification of the coordinate system illustrated in Figure 4a:** The X, Y, and Z axes of the voxel database coordinate system comprise the XY plane in the ground and the Z-axis in the upward direction. The axis of most camera coordinate systems is the Z-axis in the camera optical axis direction, X-axis in the right direction, and Y-axis in the downward direction. To match the directions of the X, Y, and Z axes of the two coordinate systems, the camera coordinate system axis is rotated 90\({}^{\circ}\) counterclockwise based on the X-axis to unify the X, Y, and Z axes of the voxel database coordinate system. **Transformation of the center movement of the object box illustrated in Figure 4b:** The Euler matrix uses Equation (5) to calculate the estimated value of the improved point-GNN object box (class, x, y, z, length, width, height, pitch, yaw, roll). Eight corner vertices, corner[0] to corner[7], of the 3D box rotated as an estimate based on the object's center coordinates are generated, and the camera origin is added to the estimated labels. \[R_{xyz}=R_{x}(\phi)R_{y}(\theta)R_{z}(\psi)\]  
\[=\left[ \begin{array}{ccc}\cos\theta\cos\psi&-\cos\theta\sin\psi&\sin\theta \\ \cos\phi\sin\psi+\sin\phi\sin\theta\cos\psi&\cos\phi\cos\psi-\sin\phi\sin\theta \sin\psi&-\sin\phi\cos\theta\\ \sin\phi\sin\psi-\cos\phi\sin\theta\cos\psi&\sin\phi\cos\psi+\cos\phi\sin\theta \sin\psi&\cos\phi\cos\theta\end{array} \right] \tag{5}\]  
The 3D box of the object in the indoor space voxel database and that of the object estimated by the improved point-GNN are identical. The center point of the 3D_Box object (0, 0, 0) estimated based on the origin (0, 0, 0) of the center point of the 3D box in the voxel database is moved and transformed, and the center points of the 3D boxes of the two objects are matched. In both 3D boxes, the corner vertices are relative coordinates with respect to the center point. **Center rotation transformation of the object box and the camera origin rotation transformation illustrated in Figure 4c:** After matching the center points of the boxes of two objects, the corner vertices of the object 3D box in the voxel database are determined to calculate the rotation angle that matches the vertices of each corner. The rotation transformation value of the camera origin in the coordinate system of the database object box is calculated based on the estimated object 3D box center point. Algorithm 2 is a pseudo code for calculating the rotation value of the camera origin based on the object's center point (0, 0, 0). One corner vertex of each of the two boxes (corners[0]) and a point on the diagonal line (corners[6]) are used to calculate the cross product and dot product of each vector. Figure 4: Translate and rotate the three-dimensional (3D) box center point of an object with voxel database coordinates.