# A Mobile LiDAR-Based Deep Learning Approach for Real-Time 3D Body Measurement
## 3 Proposed Algorithm for Mobile 3D Body Circumference Measurement
### Merging Keypoints and 3D Data
This is because the boundary surface observed from the camera's viewpoint (2D keypoint) does not coincide with the actual boundary surface (3D keypoint) assumed to represent the object's true contour. * \(l\) : the circumference error caused by the discrepancy between the 2D keypoint detected in the image and the actual 3D keypoint. * \(r\) : the radius of the circle (object). * \(\theta\) : the angle between the line connecting the 2D keypoints (detected in the image) and the line connecting the center of the circle (object) from the camera's perspective. * \(d\) : the distance between the camera and the center of the circle (object). In this study, we simplify the waist-measurement process, using a smartphone LiDAR sensor, to a top-down perspective as illustrated in the figure above. The circle in the figure is assumed to be the waist as viewed from above. Given the characteristics of the LiDAR sensor and the camera, it is almost impossible to clearly capture direct 3D keypoints (i.e., points on the actual perimeter of the waist), and as a result, there is inevitably a discrepancy between the circumference estimated from 2D keypoints and the actual 3D circumference. As shown in Figure 4, let \(l\) be the distance between the actual 3D keypoint and the 2D keypoint; even if only one side is considered, the estimated circumference can differ by at least \(l\). In other words, if one simply calculates the front and back circumferences from the 2D keypoints and sums them, the result will necessarily deviate from the actual circumference. Consequently, the discrepancy \(l\) in the circumference on one side, caused by the difference between the actual and 2D keypoints, can be derived by the Equation (3):  
Figure 2:0 Figure 2:1 Figure 2:2  
Therefore, the discrepancy between the 2D keypoints and their 3D counterparts can be represented as \(r\times\arcsin\left(\frac{r}{d}\right)\). Simply adding the circumference of the front portion to that of the back portion in order to estimate the total circumference can lead to inaccuracies. Furthermore, to ensure that the detected keypoints consistently capture the same positions, this study introduces a depth map-based correction procedure. We used a depth map generated by photographing the same scene with an iPhone 12 Pro LiDAR sensor, where lower values indicate proximity to the object and higher values indicate greater distance. Applying the Canny edge algorithm allowed us to detect abrupt depth variations, enabling the adjustment of 2D keypoints to better align with actual object boundaries. Therefore, the discrepancy between the 2D keypoints and their actual 3D counterparts can be expressed as \(r\times\arcsin(\frac{r}{d})\). Since the 2D keypoints detected from a single viewpoint do not correspond to their actual positions in 3D space, simply summing the front circumference (\(C_{f}\)) and back circumference (\(C_{b}\)) to estimate the total circumference (\(C_{t}\)) can introduce errors. This discrepancy arises because 2D keypoints are projected coordinates rather than actual 3D surface points and are affected by occlusion. To address this issue, this study employs regression analysis to estimate the total circumference (\(C_{t}\)) by treating the front circumference (\(C_{f}\)) and side circumference (\(C_{s}\)) as variables. This approach is necessary because projection mismatch prevents accurate 3D measurements using only 2D keypoints. Additionally, to improve the accuracy of 2D keypoint detection, we applied a depth map-based correction technique. This process refines the alignment of the detected 2D keypoints with actual object boundaries, thereby enhancing the accuracy of circumference measurement for various body regions. This process consists of two main steps. First, the RGB image resolution is scaled to match that of the depth map. For example, a LiDAR-based depth map corresponding to the same scene as the RGB image is obtained, and the Canny edge algorithm is applied to detect boundary surfaces where the depth values exhibit steep gradients [24].