# 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
Next, the keypoint coordinates detected in the 2D RGB image are mapped to the depth map coordinate system (i.e., scaled accordingly). Each keypoint is then repositioned to the nearest edge point in the vicinity of the transformed coordinate. By doing so, the keypoints consistently reflect the object's boundary across various conditions such as changes in viewing angle or illumination. Consequently, this procedure provides a reliable set of reference points for measuring both the front and side circumferences, thereby helping to reduce errors. First, a depth map of the same scene as the RGB image captured using the iPhone's LiDAR sensor is generated. A depth map indicates that lower values are closer to the object and higher values are further away from the object. Next, the Canny edge algorithm is applied to the depth map to detect points where the depth value changes abruptly. This is useful for accurately identifying the object's boundary surfaces. Then, the coordinates of the keypoints detected in the 2D RGB image are transformed to match the scale of the depth map and moved to the nearest edge point. This process includes the following two steps: matching the resolution of the RGB image with that of the depth map. Figure 2:3 This shows the geometric relationship between 2D and 3D keypoints for the top view of an object in circumference estimation. To illustrate the proposed approach, we used an RGB image with a resolution of \(1440\times 1920\) and a depth map with a resolution of 192 \(\times\) 256. First, the keypoint coordinates detected in the RGB image were scaled by a factor of 7.5 to map them onto the depth map coordinate system. Next, each keypoint was repositioned to the nearest edge point identified in the depth map. Through this correction procedure, the 2D-detected keypoints more reliably align with boundary surfaces even under diverse conditions, thereby substantially improving the accuracy of circumference measurements. Using these corrected keypoints, both the front circumference and the side circumference were calculated. The front circumference was derived from keypoints located on both sides of the object in a front-view image, whereas the side circumference was measured using keypoints from an image in which the object was rotated by 90 degrees. By combining these two measurements, the total circumference was estimated via regression analysis. Based on ground-truth circumference measurements collected from 150 Korean male participants, an optimal regression constant was then determined to enhance the accuracy of the estimated total circumference. The total circumference (\(C_{t}\)) is calculated using the following regression model on the Equation (4):  
Figure 2:4  
Here,  
* \(C_{t}\): Total body circumference (actual value, dependent variable)
* \(C_{f}\): Front circumference (independent variable)
* \(C_{s}\): Side circumference (independent variable)
* \(\beta\): Regression coefficient (derived constant)
* \(\epsilon\): Error term  
Initially, a method was used in which separate constants were applied to the front (\(C_{f}\)) and side (\(C_{s}\)) circumferences individually. However, when the actual waist circumference was used to classify participants as lean (72 cm or less) or obese (95 cm or more) and then to compare measurement results, it was observed that both the average error and the coefficient of determination (\(R^{2}\)) were adversely affected for lean and obese body types. In reality, \(C_{f}\) and \(C_{s}\) are not independent but rather parts of the same body, inherently influencing each other. Therefore, a method was chosen in which a single constant is multiplied by the sum of \(C_{f}\) and \(C_{s}\). This approach yielded a lower mean absolute error (MAE) and a higher coefficient of determination. Based on these findings, the total circumference was ultimately optimized by simply summing \(C_{f}\) and \(C_{s}\) before multiplying by a constant.