## 3 Materials and Methods
### Skeleton Tracking  
Skeleton tracking (Figure 4) operates on a sequence of the 3D scans and a skeleton for the first frame. Starting from the first frame, the current frame (t) is segmented based on the skeleton pose for that frame. Then, each of the generated segments is fitted to the point cloud of the next frame (t + 1) using the Iterative Closest Point (ICP) method. On the grounds of the obtained transform change of the segment, the transform of the relevant bone is updated by applying motion constraints specific to that bone. After analyzing all the segments (bones) in this way, the pose of the next frame (t + 1) is obtained. This procedure is iteratively repeated for successive frames of the sequence. Figure 4: Bone update procedure. From left to right: input scan for frame (t) with skeleton (bottom), scan for frame (t + 1) (upper); extracted segment for bone (B) (green) in frame (t); Iterative Closest Point (ICP) step; segment for bone (B) fitted to frame (t + 1), using ICP; constraints step; obtained transformation  
Figure 3: Method overview. From left to right: sequence of 3D scans (gray) and skeleton for first frame; pose tracking step; resulting skeleton for frame (t + 1) and segmentation (multicolor) for frame (t); shape maps computation step; template mesh (blue); template mesh deformation step; and final reconstructed mesh for frame (t). change of the bone (B) in frame (t + 1); and resulting skeleton for frame (t + 1), along with scan for frame (t + 1). The purpose of segmentation (Figure 5) is to assign each point from the input scan to a skeleton bone. In the devised method, a point is assigned to the nearest bone which meets the cutoff plane, normal vector compatibility, and coplanarity conditions. Filtration with the cutoff plane consists of defining, for each bone (B\({}_{n}\)) in the skeleton, a cutoff plane (Z\({}_{n}\)) hooked at the end of a preceding bone, B\({}_{n\text{ }-\text{ }1}\), whose normal vector (N\({}_{\text{Zn}}\)) is directed according to the sum of the vectors of the given bone (B\({}_{n}\)) and the preceding bone (B\({}_{n\text{ }-\text{ }1}\)) (see Figure 6). A point (P) cannot be assigned to the bone (B) if it is behind this plane. **Segmentation algorithm**:  
**Data:** 3D scan for frame (t) and skeleton for frame (t)  
**Result:** segmentation of scan to skeleton (closest bone assignment for each vertex)  
**for** each vertex **V** in scan **do**:  
set closest_distance to 0;  
set closest_bone to None;  
**for** each bone (B) in skeleton **do**:  
**if** not cut_plane_condition(B,V) **then**:  
**continue**:  
**if** not normal_vector_condition(B,V) **then**:  
**continue**:  
**if** not coplanarity_condition(B,V) **then**:  
**continue**:  
compute distance from vertex (V) to bone (B) and set as B_distance;  
**if** B is closer then closest_distance or closest_bone is None **then**:  
set closest_distance to B_distance;  
set closest_bone to B;  
apply median filter for unassigned points;  
apply median filter for all points;  
Figure 5: The segmentation algorithm. Figure 6: Cut planes. Red arrows show bone vectors of the currently considered bone, B\({}_{n}\), the previous bone B\({}_{n\text{ }-\text{ }1}\), and next bone B\({}_{n\text{ }+\text{ }1}\). The point (P) cannot be assigned to bone B\({}_{n}\) if it lies behind the cutting plane Z\({}_{n}\). The plane Z\({}_{n}\) is defined by the normal vector N\({}_{\text{Zn}}\) and the first joint of bone B\({}_{n}\) (J\({}_{n0}\)). The normal vector parallelism condition allows us to exclude incorrect assignment of points from large segments (e.g., torso) to the bones of smaller segments (e.g., hands). According to this filtering, a point (P) may be assigned to bone (B) if the scalar product of its normal vector (N) and the radius vector (R) from the bone to the point is less than a defined threshold (Figure 7, Equation (1)):  
\[\text{R}\cdot\text{N}>\alpha \tag{1}\]  
where R is the radius vector from the bone to point (P), N is the normal vector in point (P), and \(\alpha\) is the threshold.