# Multi platform Computer Vision System to Support Physical Fitness Assessments in Schoolchildren
## 2 Materials and Methods
### Multiplatform Implementation
#### 2.3.4 Modeling  
The high-level description of the solution described in each software module is a scene in the Unity tool, where each scene consists of the code necessary to evaluate an individual test. There are four scenes: the first is called \"HorizontalJump,\" which is used to measure horizontal jump; the second is called \"FlexibilityTest,\" which measures the sitting flexibility test; the third is called \"SitUpCounter\" and counts the number of abdominals performed in a period; and the last one is called \"BicepCurlCounter\" and counts the number of biceps curls with a dumbbell, which is performed in a certain period. The academic license for LightBuzz SDK version 5.5.0 was used [19]. This software starts with the functions of the Azure Kinect SDK and allows these functions to be executed with any camera and easily imported into a mobile environment. The Unity editor version used was \"2022.3.0f1 LTS\" due to recommendations provided by LightBuzz. All coding was performed in the C# language, native to Unity, using Visual Studio 2022, running on the Windows 11 operating system. The libraries and architecture provided by Unity and those of the LightBuzz SDK were used. These libraries are used with the \"LightBuzz.BodyTracking\" workspace. Additionally, once the tests were implemented in this software, an accuracy percentage of 95% was obtained in the initial laboratory tests. The code architecture is the same for all scenes and consists of a class and three primary functions, \"Start(),\" which initializes parameters of the sensor and is executed when the scene starts; \"Update(),\" which carries out the logic of the test and is constantly performed until the analysis of the video of an exercise is completed, the \"Angle()\" function, which allows measuring the angle between three joints and finally \"onDestroy(),\" which destroys the class object and displays the data obtained about the exercise performed and frees the used memory space. The first scene, \"HorizontalJump,\" measures the maximum horizontal distance of a student's jump and the change in angularation of the ankle, knee, and hip joints when performing the jump. To carry this out, measuring the initial position of the student's feet is necessary. The jump is evaluated by measuring the distance traveled by the student's toe; therefore, the \"Right Foot\" or \"Left Foot\" joint from the map of joints as measured by LightBuzz [20] was used. The joint map is shown in Figure 3.  
Figure 3: Joint map provided by LightBuzz. The foot's initial and final position data are stored to measure the distance. However, because 2D positions are used, which the SDK measures in pixels, it was necessary to apply an appropriate conversion from pixels to centimeters. Searching similar research, we found no single theoretical conversion for converting pixels to centimeters. However, it was found that a \"1280 \(\times\) 720p\" video can be converted from pixels to centimeters using a conversion factor, which was empirically determined as \"0.26548\". With this conversion factor, a percentage of precision is obtained after comparing the measurements taken traditionally by a human evaluator and the distance estimated by the software. Generally, a 93% coincidence was obtained between the traditional measurements and the software's. It is concluded that the conversion factor was appropriate for the type of video and exercise evaluated. The flexibility test uses logic like the previously explained horizontal jump exercise. The main difference is the joints considered to calculate the distance traveled, which, in this case, measures the distance traveled by the wrists. For this test, it was also necessary to use the conversion factor, \"0.26548\", seen in the previous section. Finally, the angle of the chest, hip, and knee at which the student reaches the moment of maximum flexion is measured. The last two sit-up and bicep curl tests use similar logic. In both tests, we seek to measure a change in the angle between two vectors.