A Processing Method for Kinematics Data of Human Knee Joint Obtained by Motion-Capture Measurement

9 Background: The data obtained by motion capture method is many and complex, so it is the key to find an 10 efficient method to process the data. Therefore ， to develop a processing method for kinematics data of human knee 11 joint by programming on MATLAB software. 12 Methods: The coordinate data of markers on human lower limb measured by motion capture system were firstly 13 read and repaired through the program. Then the coordinate data of anatomical points in the movement of human 14 lower limb were obtained by program processing. The local coordinate systems of human femur and tibia were 15 established with anatomical points. After that the flexion/extension, abduction/adduction and internal/external 16 rotation of human knee tibiofemoral joint in the movement of lower limb were obtained by coordinate 17 transformation. Lastly, the motion capture and measurement of healthy volunteers were carried out and the 18 MATLAB program was used for data processing. 19 Results: Using the above methods, motion capture measurements and batch data processing were carried out on 20 squatting and ascending stairs of 29 healthy volunteers to obtain the motion characteristics of the knee joint. As 21


Background
Total Knee Arthroplasty (TKA) is a routine procedure used to treat knee-related diseases in humans [1][2][3].It replaces the diseased tissue of the knee joint with an artificial joint prosthesis to restore the normal function of the knee joint and improve the quality of life of patients.By measuring the lower limbs of healthy volunteers of a certain species, the anatomical characteristics and movement parameters of the knee were obtained, which can provide reference for the design and optimization of artificial knee prosthesis in line with the characteristics of this species.With the development of motion capture technology [4][5][6], Some scholars carry out motion capture measurement of human gait [7][8][9], Some scholars have made motion capture measurement and analysis of human knee joint squatting [10][11], and some scholars use the motion capture system to measure and analyze the motion characteristics of the lower extremity joints during the stair climbing process [12][13][14][15], most of them use the commercial motion capture systems such as Visual3D (C-Motion, USA) and Vicon (Oxford Metrics Limited, UK) to calculate and analyze the kinematic parameters of the human knee joint.This method needs to be manually processed one by one, which is time-consuming and labor-intensive [16].However, through the use of MATLAB (MathWorks, USA), according to the preparation, calibration, and measurement process and characteristics of motion capture measurement, a special program for motion capture measurement can be written, which can batch process motion capture data and customize relevant data tables [17].In this paper, the motion capture system is used to measure the squat and stair movement of healthy volunteers, and the coordinate data of the body surface markers are obtained；The MATLAB software was then used to design a method for reading and processing the knee joint motion data.The kinematics parameters of the knee femoral tibial joint during the movement of the lower limbs were obtained by data processing.

Subjects
There were 29 experimental volunteers, including 17 males and 12 females within 150-178cm height (average 165.5cm) and 47-81kg weight (average 63.9kg).The population of Shanghai urban area were selected as volunteers: 15 young volunteers aged 22-28 years old and 14 middle-aged volunteers aged 41-71 years old.

Instrumentation
The experiment of motion capture measurement was carried out in Shanghai Sixth People's hospital.The experiment used the Optotrak Certus (NDI, Canada) motion capture system with two position sensors, as shown in Fig. 1.

The experimental process
In this experiment, only the right leg movement of the volunteers was measured.Then the calibration of the motion capture was performed, which includes: initial calibration the determination of the coordinate system, the calibration of the seven bone markers and the ground reference point.The seven bone markers are respectively the femoral trochanter, the femoral condyle and the medial malleolus, the medial and lateral tibial plateau, and the medial and lateral condyles of ankle joints.In this experiment, the detailed processes, from registering volunteer information and calibration to finally saving data, were shown in Fig. 2 below.
As shown in the Fig. 3, there are 4 markes respectively that were placed respectively on the thigh and calf, which were used for motion capturing; and there are 7 anatomical feature points lower limbs and one ground reference points, which were used for calibration to determine the coordinate systems.In order to avoid the measurement error, which caused by skin movement during movements and the bony point being occluded, virtual markers were generally used for calibration measurement [18], these 7 anatomical feature points are just virtual markers for measurement.The coordinates of virtual-Markers in the experiment can be determined by the coordinates of 3 or 4 Marker points photographed on the rigid body.Therefore, the real-time coordinates of anatomical feature points of human lower limbs in the movement can be obtained by measuring the coordinates of markers pasted on volunteers' thighs and calves.
Spatial three-dimensional coordinate data of Marker points and bony points were saved by the motion capture system in a file in xls format.Volunteers of the motion capture and measurement of the knee joint squatting and the parts were shown in Fig. 4. Figure 4a shows the initial squat measurement position, when the lower limbs remain upright.Figure 4b is the position with the largest knee flexion angle in the squat.The rest Marker points shown in the figure are coincident markers for other motion measurement, which have no direct relationship with the motion capture measurement in this paper.

Data processing method
MATLAB software was used to write the program to obtain and analyze the 3D coordinate data of markers.If the collected data were missing, the original data should be first interpolated and repaired reasonably.If the data were intact, it could be read and processed directly.Secondly, the data were processed to obtain the coordinates of 7 anatomical feature points (Fig. 3) in the movement of lower limbs, and the local coordinate systems of femur and tibia were established based on these 7 markers.Finally, the kinematics parameters of the knee tibiofemoral joint during the movement of the lower limbs were obtained by using coordinate transformation.The kinematics parameters respectively were below: the flexion and extension of femur relative to tibia, adduction and abduction, and internal and external rotation.The data processing flow chart is shown in Fig. 5.

Reading and preprocessing of the original coordinate data of the marker points
The original data measured in the experiment included coordinates during calibration below: markers on the probe tool and markers pasted on the leg for motion capture, and the coordinates of human lower limb movement: the coordinates of marker points on the leg.The data read function 'xlsread' was used in the MATLAB software to directly read coordinate data.
Figure 6 shows the change of the coordinate value of the Marker points on the legs in the up and down direction.The horizontal coordinate represents the number of frames.Maker 5-8 is on the thigh, Marker9-12 is on the lower leg, and the data of markers on the lower leg has a small change because of the small amplitude of the calf in the movement.It could be seen that in the first 50 frames, the data remains unchanged.Within these 50 frames, the volunteers do not move, and then the squatting action begins.After reaching the lowest point, the knee begain extending and the data appears to be increasing firstly and then decreasing.Finally, the volunteers remained stationary and the data remained unchanged.
In the experimental process, some of the coordinate data of markers were missing due to some of them being obscured, and the missing data needs to be repaired.The patch function were programed in Matlab based on the number of missing data and the missing position.As Fig. 6 shown: within 1-50 frames in the beginning and the last 200 frames, the volunteers were stationary, so the lack of data in these two stages has no effect on the results.It takes 2.5 seconds for 50-300 frames to complete the collection from squatting to standing, in which the data-loss will be caused by marker points being obscured or falling during the movement.When one of the 4 markers points (which were on the thigh or calf, as shown in Fig. 3) missed, it can be repaired.However, it cannot be repaired and should be discarded when 2 or more markers of the 4 markers missed.
The positional correlation among markers during the movement and the overall movement trend are all references for data repair.For example, this relation can be obtained according to the real-time coordinates of the upright position and the maximum flexion position shown in Fig. 4a and Fig. 4b respectively, and the real-time coordinates of the anatomical feature points of the upright position shown in Fig. 3.When the patch program was written, cubic spline interpolation function was used for interpolation repair [19].The curve after interpolation by this method is second-order continuous and differentiable, with high precision and smooth curve transition.The detailed introduction of cubic spline interpolation function is described in literature [19], and its principle is shown in Appendix.1.
The written patch flowchart is shown in Fig. 7 below.In the experiment, as shown in Fig. 4, there are 4 Markers attached to the thighs and calves of the volunteers respectively.If there is one Marker data missing in the nth frame in the motion measurement, then according to the data of 4 markers in the previous frame or the nearest frame and the remaining three Marker data of the nth frame, the transformation matrix and a translation matrix between the two sets of coordinates were established, thereby the coordinate data of missing markers in the nth frame were solved.

Solution of Coordinate Data of Bone Markers in Lower Limb Movement
, where R is the 3 3  rotation matrix, and T is the 1 3 translation vector of the column matrix, The transformation matrix R and the translation matrix T can be solved based on the known two sets of points based on the singular value decomposition method.
Figure 8 shows the probe and probe local coordinate system, the tip of the probe was defined as the local coordinate system origin.According to the coordinate data of 4 marker points on the probe obtained by measurement and the parameters of the probe itself (coordinate data of 4 mark points in local coordinate system), then the transformation matrix and translation matrix between two sets of coordinate data were established.Finally, the coordinate data (probe-tip's coordinates) of the bony-markers (also known as anatomical feature points) was obtained.According to the coordinate data of the Marker points on the thigh and calf respectively in the calibration of bonymarkers and ground reference points, the transformation matrix and the translation matrix between the two sets of coordinate data were established, it was used to calculate the coordinate data of bony-markers points in the calibration of ground reference points.Finally, according to the coordinate data of Marker point on the leg in the calibration of ground reference point and the coordinate data during the movement of human lower limb, the transformation matrix and translation matrix between the two sets of coordinate data were established.Thereby, the coordinate data of the bony-markers in the lower limb movement of the human body was obtained.

Establishment of local coordinate system of femur and tibia
This study defines and establishes the local coordinate system of the femur and tibia according to the seven bony-markers of the lower extremities.In 1983, Grood et al. [20] first introduced the method of establishing the joint coordinate system for the three-dimensional motion of joints.
Later, other scholars redefined the method of establishing the local coordinate system of various parts of the human body [21][22][23][24][25]. Dane et al. [26] modified the coordinate system definition method proposed by Grood.Of course, some scholars have proposed the definition method of the coordinate system of human lower limbs and knee joints [2].This paper refers to the above scholars' research and establishes the human femur and tibia local coordinate system in combination with the actual situation.As shown in Fig. 9, the femur and tibia coordinate systems are established.The method is as follows: The local coordinate system of the femur: the line connecting the lateral femoral condyle and medial femoral epicondyle is the X axis, the direction is pointing to the outside, and the midpoint of the line is the origin.The X-axis multiplied by the line being connected the femur greater trochanter and the origin to obtain the Y-axis with the direction facing forward.The X-axis multiplied by the Y-axis to obtain the Z-axis with the direction facing up.The local coordinate system of the tibia: the connection between the medial and lateral tibial plateau is the X axis, the direction is pointing to the outside, the midpoint of the line is the origin, and the X-axis multiplied by the line being connected the origin and the midpoint of the inner and outer ridges to obtain the Y-axis, the direction is forward.The X-axis multiplied by the Y-axis to obtain the Z-axis with the direction facing up.

Solving knee kinematic parameters
According to the above method, the local coordinate systems of femur and tibia were established according to the bony-markers [27].The femoral coordinate system was rotated and translated to obtain the tibia coordinate system.According to the order of coordinate rotation, coordinates transform can be divided into two categories [28].One type is that the three axises were different for the three rotation transforms to rotate, the other type is that the first and third rotations axises are the same one, and these two types all have six rotation transformation orders.
In this paper, the order of X-Y-Z is used for Euler rotation, and its transformation matrix is R: The femoral coordinate system were orderly rotatedα angle around the X axis, rotatedβ angle around the Y axis, rotated γ angle around the Z axis, and coincides with the tibia coordinate system.According to the coordinate transformation principle, the rotation transformation matrix R is as follows: a a  According to the local coordinate system, the follows were respectively defined：the flexion extension angle of the femur relative to the tibia is the angle α of the femoral coordinate system rotating around the X axis, and the adduction abduction angle is the angle β of the femoral coordinate system rotating around the Y axis.The internal and external rotation angle is the angle γ of the femoral coordinate system rotating around the Z axis, as shown in Figure 10   calculating the coordinates of the bony-markers firstly.Secondly, marker data when the reference-points were calibrated is read and the coordinates of the bony-markers under the reference point posture were calculated, then the marker data in the motion is read to calculate the coordinates of bony-markers in the movement; At the meantime, the local coordinate system of the femur and tibia were established according to the bony-markers.Finally the coordinate transformation was used to solve the kinematic parameters of the knee joint.

Result
The method described in this paper was applied to capture and measure the subjects' motion and process the data, so as to obtain the flexion-extension, adduction-abduction, and internal-external rotation data of the knee joint femur relative to the tibia during the movement of the lower limbs.
As shown in Fig. 12 and Fig. 13, respectively, the x-coordinate is knee flexion Angle, and the y-coordinate is adduction-abduction and internal-external rotation.
Figure 12 shows the adduction-abduction and internal-external rotation of the human knee joint femur relative to the tibia at different flexion angles during squatting for six healthy subjects.As the knee flexion angle deepens, the femur is abducted and then adducted relative to the tibia, and the femur is always in an external rotation state relative to the tibia.It can be seen from the figure that the maximum flexion angle of the knee joint in the squat is between 79 and 98 degrees, which is smaller than the maximum knee flexion angle of the normal squat motion.The reason is that the experiment and an X-ray stereophotometry experiment (RSA, Roentgen Stereophotogrammetric Analysis) are synchronized, volunteers' movement space being limited, and the experiment requires volunteers to behave in a specified small action and within 5 seconds shooting times.
Acordingly, other knee movement parameters were also relatively small.
Figure 13 shows the adduction-abduction and internal and external rotation of the femur relative to the tibia during the ascending step of a healthy subject.Since the experiment was performed in parallel with the RSA experiment, the volunteers had limited shooting space and a short measurement time, required to be completed within 5 seconds, and the height of the stairs used for the measurement was small.Therefore, the maximum flexion angle of the knee joint was smaller during the stairs climbing.It can be seen from the figure that the maximum flexion angle of the knee joint of the subject is between 23 and 44 degrees.Due to the higher mobility of the knee joint on the anterior-posterior axis, as the knee flexion angle increases, the femur with respect to tibia has a larger difference in adduction and abduction movements; but the femur first abducts and then adducts overall.At the same time, in the process of going up the stairs, starting from the knee flexion, the femur continues to be external-rotation with respect to the tibia as a whole.However， in some subjects, the femur rotates inward at the end of knee flexion.

Discussion
In this paper, the motion capture measurement of the squat and upstairs movements of the subjects was carried out。The relative movements of the human knee joints in the lower limbs movements were analyzed.For the squatting movement, in the study of Schmitz [10], the squat of 15 healthy people was measured by the motion capture system.The experimental conditions were used to control the flexion angle of the knee joint to 60 degrees, and the data was processed by Visual 3D software.The results showed that in a squat cycle, from the beginning to the flexion angle of the knee joint reaching the maximum, the knee joint was always in external-rotation.This is consistent with the trend of movement in this squat measurement.In the study of Clement [11], 5 healthy people and 5 patients with osteoarthritis were compared and analyzed in the quasi-static and dynamic lower knee joint movement.Five flexion positions were selected in the experiment, and the maximum flexion angle was at 72 degrees, the results showed that as the knee flexed, the external-rotation and posterior-translation of the knee increased.This is also consistent with the changes of the knee joint movement in this paper.In the work of many other scholars, the maximum flexion angle of the knee joint in the squatting process exceeded 130 degrees [28][29].
The maximum flexion angle of the knee joint in this experimental was smaller, between 79 and 98 degrees.And this based on these below reason: This experiment is measured synchronously with the RSA experiment.The volunteers did the movement between the two C-arms, so the shooting space is limited, and in order to ensure that the RSA experiment can capture the human knee joint, the volunteers are required to follow the prescribed action (action range is smaller), and the each measurement time should not exceed 5 seconds.
As for the action of stairs climbing, Riener [12] measured the upstairs movements of 10 normal people on the steps with different slopes, and analyzed the joint movement of the lower limbs.The results show that the joint angle is significantly related to the step slope, and the larger the step slope is, the greater the maximum flexion angle of the knee joint during movements is.Tang Gang et al [15] used a staircase with 160 mm in height to analyze the changes of the lower limb joint angle of healthy volunteers during the ascending stairs.It was pointed out that the knee flexion angle range was 91.4 degrees, and the adduction-abduction range was 12.1 degrees, and the rotation range is 20.5 degrees.The height of the stair used in this paper is 100mm, and the greatest knee flexion angle during stairs climbing is 44 degrees.At the meantime, the maximal range of the knee joint adduction-abduction is 10.8 degrees, and the maximum range of internal-external rotation is 16.5 degrees, which is in line with the research results in literature [12], but lower than that in literature [15].It shows that adduction-abduction and internal-external rotation angle are within a reasonable range, and indicates the reliability and rationality of this experimental results.
In this experiment, the patients having been operated shortly after TKA was conducted the same measurement considering the difference in knee joint motion function of patients after surgery, the height of stair steps was required to be low.Besides, RSA (Roentgen Stereophotogrammetric Aanlysis) and high-speed photographic experimental measurements were also carried out in this experiment to facilitate data control analysis.During the experiment, due to the limited shooting space of experimental equipment and the space limitations caused by the simultaneous measurement of multiple systems, the volunteers' motion range was small and the shooting time could not exceed 5 seconds.Based on the above two main reasons, the maximum buckling Angle of knee joint in the stair climbing experiment in this paper is small.This experiment calibrate the anatomical feature points under the guidance of a professional orthopedist.Multiple calibrations are required prior to formal testing to ensure accurate position of the anatomical feature points.Volunteer require training for actions to enable them to perform as specified.In the formal experiment, each action is measured multiple times, and then the normal behavior of the most normal state is selected for analysis.However, the method described in this paper also has some limitations, for example, the motion capture measurement of human lower extremity motion and the calculation of kinematic parameters of the knee joint need to use the seven anatomical feature points to establish the coordinate system of the femur and tibia.
Therefore, the determination of the anatomical feature point position has certain influence on the experimental results.
At present, there are a variety of methods for the processing of kinematics data measured by motion capture system and special software for data processing, including the de-noise processing of data, the matching of scattered data and the repair of missing points.Wu sheng [30] proposed a data processing algorithm based on the piecewise linear model of modules, which can effectively carry out global hierarchical prediction and tracking of 3d motion data modules, carry out module-based denoising processing of noise data, and put forward piecewise Newton interpolation operation based on missing motion data to make reasonable supplement.In this paper, cubic spline interpolation function is used to repair the interpolation program.The interpolated curve of this method is second-order continuous and differentiable, and the interpolation operation method of piecewise Newton interpolation has high accuracy and smooth curve transition.AlonsoF.J. Et al. [31] proposed to use the inverse dynamics model of human skeleton for motion data processing, where the complement algorithm based on rigid body requires that there should not be too many defects in the rigid body.For example, for the four waist points, matching complement points can be obtained only when one point is missing, which is the same idea as the repair data in this paper.
When one of four marker points missed, it can be repaired; when two or more marker points missed, it cannot be repaired, so it needs to be abandoned.Liu [32] et al. used piecewise linear PCA technology to estimate the missing points and introduced statistical theory into motion data processing for statistical analysis.In terms of motion data processing software, as mentioned in literature [10], Visual3D commercial software and Vicon optical infrared motion capture system [33] were used for data processing of the experimental data of lower limb motion measurement by motion capture system.The system cost a lot.These softwares can automatically analyze and report motion capture data.When the data was of the large sample size, and there are some points being not captured or covered during the movement, it can only be supplemented manually and the data need to be processed manually one by one in these softwares.At the same time, in the initial stage of data processing, everyone needs to use BodyBuilder, a systematic biomechanical modeling software, to model the motion model, which need costing much time.In this paper, MATLAB software is used as a tool to program and process human knee motion capture data.
MATLAB program written by this paper can read kinematics data in batches and repair data.The local coordinate system of tibial femur can be established by using bone markers in the program.
At last, according to the coordinate transformation, the kinematics parameters of knee femur relative to tibia in the movement of human lower limbs are quickly calculated, and the spatial coordinate curve of knee tibial femur in the movement process also can be obtained.Therefore, human motion can be processed quickly by batch processing, and the program can be modified to meet different special requirements of motion function analysis.In the future, more accurate kinesiology data will be obtained by increasing the sample size and continuously improving the program.

Conclusions
A set of methods was designed to process human knee motion data in this paper, and programs was written in MATLAB software.The kinematics parameters of the femoral tibial joint of the knee joint during squatting and stair climbing were obtained.For the squat movement, when the knee joint reaches the maximum flexion (79-98 degrees) from the beginning of flexion to the maximum flexion angle, the knee femoral tibial joint is always in the external-rotation state during the whole process, and the maximum outward rotation is 30.5 degrees.In this paper, the maximum flexion angle of knee joint in the process of stair climbing is 44 degrees, and the knee femoral tibial joint is also in external-rotation all the time with a maximum of 16.5 degrees, and the range of adduction-abduction is 10.8 degrees.The research results of other researchers are consistent with the movement trend of knee squat and stair climbing in this paper, which also verifies the validity and rationality of the data processing method in this paper.It could be fast, convenient and accurate in processing human knee motion data by using the method in this paper; and the program can be modified according to different research purposes.It can provide data support for the design and optimization of artificial knee prosthesis, provide reference and help for the study of knee movement of patients after TKA and provide data processing for kinematics research of human body.

List of abbreviations
, then j j j j j j j j j j j j j j j j h

，(1)
The system of equations in matrix form were solved finally according to known conditions.The probe and its local coordinate system The coordinate values in Y direction of markers in thigh and shank in a squat below .The kinematic parameters of the knee joint during the lower limb movement are obtained by calculating the α, β and γ angle.

Figure 11
Figure 11 is the flow chart of the main program for obtaining relative motion parameters of

Fig. 11
Fig. 11 Main program flow chart of obtaining relative motion parameters of femoral tibial joint

Figure 14
Figure 14 Block diagram for solving cubic spline interpolation function

，
The coefficient matrix of equation (2) is a three-diagonal matrix and a diagonally dominant matrix, so there is a unique solution.The interpolation function S(x) on [a, b] is obtained by taking the solution into equation(1).

Figures
Figures

Figure 8 Patch program ow chart Figure 9
Figure 8

Figure 10 Data processing ow chart Figure 11 (
Figure 10

Figure 14 Position
Figure 14

Declarations Ethics approval and consent to participate
Informed consent was obtained from all individual participants included in the study.And we