## 4 Software System
### Three-Dimensional Modeling of the Lasted Upper
#### 4.1.4 From Depth Image to 3D Model  
Using individual laser ranging systems, the height values obtained from the transformation curves of each laser stripe are combined to construct a 2.5D depth image of the lasted upper. Figure 14 presents the 2.5D depth images of the left side, right side, and bottom of the lasted upper, respectively. In each image, the grayscale value of a pixel represents its corresponding height, where lower grayscale values indicate lower surface elevations, and higher grayscale values correspond to greater heights. In the three 2.5D depth images, the grayscale values representing height have already been converted to physical units in millimeters. However, the X and Y directions, as indicated in the top-left corner of each image, are still expressed in pixel units. To obtain accurate physical dimensions, the pixel values in the XY directions must be multiplied by the corresponding pixel-to-millimeter conversion factors. This transformation is essential  
Figure 14: The 2.5D depth images generated from individual scanning views: (**Top**) left side, (**Middle**) right side, and (**Bottom**) top view of the lasted upper. Grayscale values represent relative height. Figure 13: Transformation curve fitted using the least squares method. for reconstructing a geometrically accurate 3D model with real-world units (mm), and the process is discussed in the following section. In the depth images shown in Figure 14, the X-coordinate in each image corresponds to the index of the \(x\)-th laser scan. As the lasted upper is moved by a transfer platform at a known constant speed \(v\) (mm/s), and the camera is triggered at a fixed interval \(t\) (s) by the signal generation module, the actual scanning interval can be calculated as \(vt\) (mm) per trigger. Therefore, by multiplying this interval distance by the X-coordinate index \(x\), the \(X\)-axis pixel position can be converted into a physical length in millimeters, enabling the accurate spatial representation of the shoe surface. In contrast to the \(X\)-axis, the unit conversion along the \(Y\)-axis is more complex. While the \(X\)-axis directly corresponds to the scan sequence and the known movement speed of the transfer platform, the physical length represented by each pixel in the \(Y\)-axis varies with height. This variation arises from the camera's perspective geometry and optical properties, which cause nonlinear scale changes at different heights. As the laser stripe shifts vertically due to height differences, the pixel spacing in the \(Y\)-axis changes accordingly. As illustrated in Figure 15, when a gauge block with a known width of 9 mm is placed at different heights, the same physical width appears as different pixel lengths in the captured images. This observation confirms that the pixel-to-millimeter conversion factor (mm/pixel) along the \(Y\)-axis is height-dependent and must be adjusted accordingly during reconstruction. To address this issue, a variable \(Y\)-axis scaling function is established using calibration data collected from all three scanning systems. Similarly to the previous steps, images of reference objects--such as gauge blocks--at various known heights are captured, and the corresponding pixel-to-millimeter ratios are computed. Based on this dataset, three interpolation functions are derived for the left, right, and bottom views of the lasted upper, respectively, enabling the dynamic adjustment of the \(Y\)-axis scaling factor according to the local height. Once the unit conversions along both the X and Y axes are completed, the three sets of 2.5D depth data obtained from laser scanning can be transformed into 3D point cloud data. These point clouds are subsequently used to reconstruct a complete 3D model of the lasted upper. As shown in Figure 16, the point cloud model is constructed by merging three sets of point cloud data captured from the left, right, and bottom views of the lasted upper. Following model construction, the coordinate system is transformed to align with that of the robotic arm.