# An Inertial Sensing-Based Approach to Swimming Pose Recognition and Data Analysis

Authors: Shaofeng Xu; Somi Lee
Journal: Journal of Sensors
 (2022)

---

## Abstract

In this paper, inertial sensing is used to identify a swimming stance and analyze its swimming stance data. A wireless monitoring device based on a nine-axis microinertial sensor is designed for the characteristics of swimming motion, and measurement experiments are conducted for different intensities and stances of swimming motion. By comparing and analyzing the motion characteristics of various swimming stances, the basis for performing stroke identification is proposed, and the monitoring data characteristics of the experimental results match with it. The stance reconstruction technology is studied, PC-based OpenGL multithreaded data synchronization and stance following reconstruction are designed to reconstruct the joint association data of multiple nodes in a constrained set, and the reconstruction results are displayed through graphic image rendering. For the whole system, each key technology is organically integrated to design a wearable wireless sensing network-based pose resolution analysis and reconstruction recognition system. Inertial sensors inevitably suffer from drift after a long period of position trajectory tracking. The proposed fusion algorithm corrects the drift of position estimation using the measurement of the visual sensor, and the measurement of the inertial sensor complements the missing measurement of the visual sensor for the case of occlusion of the visual sensor and fast movement of the upper limb. An experimental platform for upper-limb position estimation based on the fusion of inertial and visual sensors is built to verify the effectiveness of the proposed method. Finally, the full paper is summarized, and an outlook for further research is provided.


---

## Body

## 1. Introduction

Human motion capture technology uses sensor devices to track, measure, and record the motion information of key limbs of the human body in 3D space and then uses this information to reconstruct, edit, and analyze the human motion process. Human motion capture technology has a broad market space and application prospects and has been widely used in film and television animation production, human-computer interaction, virtual reality, sports training, medical rehabilitation, and other cross-disciplinary fields. As an emerging multimedia data, the technical research of editing, analysis, and recognition of human motion data has attracted extensive attention from many scholars and researchers [1]. Nowadays, the main methods of movement analysis are visual movement observation and video movement observation, both of which require managers to subjectively observe, analyze, and evaluate the operator’s operation process and then develop improvement plans. Human posture recognition has a wide range of applications, including human-computer interaction, film and television production, motion analysis, games, and entertainment. The visual action observation method is a direct analysis method in which the observed operation is recorded directly on a special form for analysis, provided that the operator’s original operating condition is not affected. This method is intuitive but has the disadvantage of being difficult to measure subtle movements and requires more energy. The video motion observation method is recorded and retained, which is susceptible to a variety of factors when recording human motion images due to the fixed location of the video equipment, and it is difficult to directly measure some motion parameters, such as acceleration and angular velocity [2]. Compared with the above methods, the human motion monitoring recognition method based on an inertial sensor module can monitor human motion at any time and place, the motion recognition results are highly accurate, the motion parameters can be directly calculated by the collected inertial data and physiological data, and it has the advantages of simple operation and portable wearing. Motion analysis is another element of the method study, which focuses on analyzing the body movements of people while performing various operations in order to eliminate redundant movements, reduce labor intensity, make operations easier and more effective, and thus develop the best action procedures.The study of an LPMS-B2-based swimming data acquisition and monitoring system is very significant for detailed recording and analysis of swimming movements [3]. The swimming monitoring studied in this paper specifically refers to the recognition of swimming strokes, arm strokes, and turns and generates detailed swimming data. In competitive sports, detailed data analysis can help athletes to track and analyze their movements. For the average person, recording their daily swimming log and monitoring their swimming data in detail can help them to plan their workouts and improve their swimming performance [4]. As the third most popular sport in the world, swimming also needs a mature product that can help users to complete their daily monitoring work. Water therapy has become a recognized form of physical therapy because of the buoyancy of water movement to offset some of the effects of gravity, the human joints, the spine, and other very good protection. Swimming is an important exercise in rehabilitation because it can reflect sports injuries and many spinal disorders through the coordination and symmetry of movements [5]. However, it has been difficult to effectively extract information on physical conditions from human swimming data. Initially, the assessment of swimming movements relied mainly on the visual observation and experience of professional instructors in the field, which was inefficient. Subsequently, a class of video image-based swimming movement recording systems has emerged, where the professional instructor no longer needs to be physically present but still needs to make judgments based on the video, and the cost of this method is generally very high. The image action observation method is a method of recording the execution of the operation through video and photography, using film and audio tapes, and then observing and analyzing the operation action through the method of video and image playback.Swimming is a sport that involves many parts, and early studies would obtain complete motion information by fixing multiple sensors to multiple parts of the body and obtaining the acceleration rate of each part. This method has improved the recognition rate, but too many devices are very uncomfortable for the wearer and can interfere with the movement, and the experimental cost is high, so this paper acquires acceleration data through a single sensor [6]. The purpose of this paper is to use a single inertial measurement unit to comprehensively monitor swimming movements and to explore a method to assess the physical condition of swimmers, which can provide some reference basis for the application of physical rehabilitation therapy in water, training injury assessment, etc. A single inertial sensor-based wireless swimming motion monitoring experimental device was built and worn on the lower back of swimmers in the form of a belt. Human motion detection is to input video images and then detect the location, scale size, and pose of the moving human body. A series of processing methods such as low-pass filter denoising, background differencing, morphological image processing, and regional connectivity analysis can be used to extract the moving object from the video image, and then, the features of human body height and width and its ratio are used for human body recognition. The motion characteristics of various swimming stances are analyzed, and the basis for stroke recognition is proposed and verified by comparing them with the experimental monitoring data. The link between the monitoring data and the information of human body condition (fatigue and injury level) was established for the strong movement symmetry characteristic of the freestyle and backstroke sports.


## 2. Related Works

Inertial sensors inevitably encounter certain difficulties because of their sensor characteristics. For example, gyroscope integration introduces attitude drift, accelerometers are susceptible to external linear acceleration, and magnetometers are susceptible to external magnetic field interference. The Kalman filter-based multisensor fusion algorithm enables the fusion of multisensor information with complementary information to improve the estimation accuracy [7]. The decomposition of acceleration measurements and magnetometer measurements reduces the effect of magnetic field interference on the gravitational direction attitude angle. The threshold-based approach uses the gyroscope measurements as the process equation and the quaternions obtained from attitude decomposition as the observation equation to achieve the fusion of information. The inverse operation imposes a large computational burden on the system [8]. It is more difficult for embedded devices to perform such operations while ensuring real-time performance. This algorithm replaces the inverse operation with an operation of one complexity [9]. In attitude estimation applications, due to the nature of magnetic-inertial sensors, the measurement noise covariance matrix is often assumed to be a diagonal array, and the terms on the diagonal are large to ensure convergence. This results in the new interest covariance matrix being naturally a diagonally dominant matrix, thus ensuring convergence of the Taylor series expansion [10]. Even without the interference of linear acceleration, the accelerometer can only measure two rotational degrees of freedom and cannot be used for measurements of the multirotational degree of freedom joints.There are several universities dedicated to the establishment of an inertial motion capture laboratory, to a certain extent, to promote the development of domestic inertial motion capture technology. Due to the late start of domestic research in this field, in both the system architecture and core algorithms and similar foreign products, there is a significant gap; there are obvious distortions and jams in motion capture [11]. At present, most of the inertial motion capture systems appearing on the market are still at the stage of experimental prototypes, with low capture accuracy, poor reliability, immature supporting software, and other problems, and there is still a long way to go from marketization [12]. Not only the continuous development of the human posture recognition algorithm but also human posture recognition technology is applied in various fields. Inertial motion capture is a new type of human motion capture technology, in which human posture recognition is the core of motion capture technology, divided into three parts: data acquisition equipment, data transmission equipment, and data processing unit [13]. The data acquisition equipment is to collect the pose information of the body parts using inertial sensors such as accelerometer, gyroscope, and magnetometer, the data transmission equipment is to transmit the data collected by the inertial sensors to the data processing end, and the data processing unit is to process the collected data and recover the human motion model using the human kinematics principle to present in the computer software [14].Firstly, the basics of inertial sensors are described, and the current data fusion algorithms are briefly introduced. Then, according to the nine-axis sensor chip used in this paper and the usage scenario, the extended Kalman filtering algorithm is selected to correct the angle with the data collected from the gyroscope as the main data and the measured data from the accelerometer and magnetometer as the supplement to reduce the error of the attitude module. Swimming exercise promotes physical health, healthy mental development, and social adaptability in adolescents in a way that other sports cannot replace the benefits. Long-term swimming can lead to healthy chest development and improved lung capacity, and swimming can also shape a healthy form and improve physical fitness. Swimming can provide a physical foundation for adolescent health and promote good psychological development. For swimming drives, rotation means applying asymmetric driving forces to both sides of the drive. The traditional method is to focus the beam on a noncenter part of the actuator, generating an unbalanced driving force to achieve rotation. However, for microscale actuators, it is difficult to maintain a specific point on which the light is also focused during the motion. The collected attitude data are processed and analyzed, and the features of each attitude data are extracted by the commonly used time-domain analysis method and frequency domain analysis method, and then, the measured attitude data are classified and recognized, which proves that the attitude recognition device designed in this paper can meet the basic requirements of recognition. The algorithmic problem of using inertial sensors for attitude resolution and reconstruction under high dynamic motion conditions with low cost and limited sensor accuracy is mainly studied, and experiments are designed to verify the correctness of the relevant algorithms. The theory related to this system is introduced as the basis for the subsequent chapters; secondly, the algorithmic part of this paper is investigated, mainly including the study of the calibration algorithm of the nine-axis sensor, the gradient descent-based attitude solving algorithm, and the attitude angle-based attitude recognition algorithm.


## 3. Analysis of Swimming Attitude Data Recognition with Inertial Sensing

### 3.1. Swimming Inertial Sensor System Design

The accelerometer and gyroscope in the ICM-20948 chip can be activated by triggering the self-test register, and the chip will automatically simulate the external force applied to the accelerometer and gyroscope. After the self-test, the output value will be changed compared to the value without the self-test [15]. When the self-test function is activated, the sensor generates an output signal to observe the self-test condition. The self-test response value is equal to the difference between the sensor output value with the self-test and the output value without the self-test. When the self-test reply value is within a reasonable range, the self-test passes; when the self-test reply value is outside the specified range, it indicates a self-test failure. The action of a particular job is a succession of changes in several job postures over a continuous period. This series of successive changes is produced by instructions from the brain acting on the muscles of the body. For a specific operational posture, it is important to maintain its momentary stability. If this stability is disrupted during the action, the correct posture will be lost and this will lead to an operational accident. The continuous collection of such stability in the operating posture is the stability of the operating action, and the stability of the action can be well enhanced by repetitive training.Motion analysis, also known as motion study, is the process of studying and analyzing each action to ensure the effectiveness and reasonableness of the operator’s actions during the work process and to achieve the highest return on the work at the lowest cost. An action analysis is generally based on the actions performed by the operator, recording the contents of each limb action cantered on the operator’s hands and eyes according to specific marks, charting the actual action, and using this as a basis for analysis and improvement [16]. Because the motion sensor is very sensitive to movements, even for the same swimming stroke, each person’s subtle hand movements are very different, resulting in a limited coverage of the population and a very complex algorithm model. On the other hand, because the motion sensor can only sense the movement, it is difficult to distinguish accurately between the stroke movement in swimming and similar movement in a nonswimming state, and the data is easily disturbed to reduce the accuracy rate. At present, most accidents in production operations are caused by improper movements of the operator. Therefore, the analysis and improvement of movements, the orderly combination of operational movements, the improvement of inadequate movements, and the elimination of dangerous movements are powerful means of preventing accidents.Based on the above requirements, this experimental device adopts a system structure consisting of a measurement device, wireless network, and data processing software, as shown in Figure1. The measurement device includes a three-axis acceleration sensor, a three-axis gyroscope sensor, and an embedded WIFI module, which is mainly responsible for real-time acquisition of human swimming motion data and real-time uploading of measurement data using the embedded WIFI module. The wireless network can be used to cover the wireless network, which is responsible for forwarding the data uploaded by the embedded WIFI module to the terminal data processing software. Due to the manufacturing process, data measured by inertial sensors are usually subject to some errors. Offset error is also known as gyroscope and accelerometer will have nonzero data output even when they are not rotating or accelerating. To get the displacement data, we need to integrate the output of the accelerometer twice. After two integrations, even small offset errors will be amplified, and as time progresses, displacement errors will accumulate, eventually causing us to no longer be able to track the position of the object. In statistics and probability theory, each element of the covariance matrix is the covariance between the individual vector elements, a natural generalization from scalar random variables to higher dimensional random vectors. The terminal data processing software includes three modules: network communication, data monitoring, data processing, and display, as shown in Figure 1, which is mainly responsible for establishing data communication and data monitoring with the measurement device, as well as simple processing and display of the measurement data.Figure 1
Structure of the IoT-based swimming attitude measurement system.Complementary filters are analyzed in the frequency domain to fuse the signal to obtain a better estimate of a particular quantity. Assuming that the signal is driven by noise at two different frequencies, two filters with appropriate bandwidths can be constructed to cover the useful frequencies with these two filters. For this system, the complementary filters perform high-pass filtering on the direction estimated by the gyroscope data affected by low-frequency noise and low-pass filtering on the accelerometer data and magnetometer data affected by high-frequency noise. The fusion between the two filter estimates will ideally result in an all-pass and noise-free pose estimate.(1)Rs=GLSR0s−GHSR0s,Cs=kp−kis2,whereRs determines the cut-off frequency of the complementary filter and GL determines the time taken to suppress the static error; in general, kp is 10-100 times larger than ki. The complementary filter performs high-pass filtering on the direction line estimated from gyroscope data affected by low-frequency noise and low-pass filtering on accelerometer data and magnetometer data affected by high-frequency noise. Fusion between the two filtered estimates will ideally result in an all-pass and noise-free pose estimate. Consider the unconstrained optimization problem min fx, where fx is a continuously differentiable function. If one can construct a sequence x1,x2,x3,⋯,xt satisfying
(2)fxt+1≥fxt,t=0,1,⋯,t,thus, to satisfyfx−Δx≥fx, one may choose
(3)Δx=γ∇fx,where the step sizeγ is a constant. However, if γ is obtained too small, the convergence process of gradient descent will take a long time and will show poor following results in this system, while if γ is obtained too large, the gradient descent will overshoot and may sometimes converge quickly, but most cases will have repeated oscillations. In a gradient descent algorithm, a loss function is generally given first and a starting point is chosen; next, the gradient of the loss curve at the starting point is calculated, a step is taken in the direction of the negative gradient, a fraction of the gradient size is added to the starting point, and the process is iterated over and over, gradually approaching the lowest point of the loss curve.The problem of calibration of inertial and vision sensors without connection is studied [17]. The calibration method introduces the ground coordinate system and the calibration plate coordinate system to establish the relationship between the ground coordinate system and the vision sensor coordinate system. The rotation relationship between the ground coordinate system and the visual sensor is solved by the camera calibration method and the pose estimation method. Finally, a set of wrist part motion tracking experiments are designed to verify the effectiveness of the proposed method.For the inevitable cumulative error and position drift problems of the inertial sensor-based positional estimation system, a multisensor information fusion method based on an event-triggered mechanism is designed to use the position information obtained from vision sensors to constrain the cumulative error of inertial sensors and use the high-frequency measurement information of inertial sensors to supplement the visual data in the interval between two frames of vision sensors and in the case of occlusion loss, as shown in Figure2. The cost of the entire set of optical motion capture equipment is extremely expensive, cumbersome to set up, and vulnerable to blocking or light interference, bringing a lot of trouble to the postprocessing work. For some serious obstruction of the action, optical motion capture cannot accurately restore the action of, for example, squatting, hugging, and twisting in real time. The emergence of motion capture technology based on an inertial sensor system has greatly improved the status quo.Figure 2
Ellipse around the axis of rotation and data.These three methods of pose solving have their characteristics and can be chosen according to different situations and can be converted to each other. The Eulerian angle is easy to understand and convenient to represent, but the phenomenon of gimbal deadlock will occur, and it cannot display the pose information of the object in all directions; quaternion can avoid gimbal deadlock compared with the Eulerian angle, but it has one more dimension, which is relatively difficult to understand and cannot be displayed intuitively; the rotation matrix can be easily represented by arbitrary vectors, but the operation is relatively large and consumes time and memory. Computer vision-based recognition mainly uses various feature information to recognize human posture movements, such as video image sequences, human contours, and multiple viewpoints. Computer vision-based recognition can easily obtain the trajectory and contour information of human motion, but there is no specific way to express the details of human motion, and it is easy to have problems such as recognition errors due to occlusion.Since the size of the filter window used by the conventional median filter is fixed, causing the above contradiction cannot be solved. This problem can be solved by using the filtering method of an adaptive median filter. First, a threshold is set in advance for the adaptive median filter, and when the data point in the center of the window is judged to be noisy, the current median window value is replaced by the output of the filter; otherwise, its value is up to retention. The adaptive median filter can produce a good suppression of the impulse noise that often occurs in acceleration data, and the details are well preserved.(4)Zmed=ak2,n∈1,3,5,⋯2n+1,ak2−ak+122,n∈2,4,⋯2n,wheren is the size of the sliding window, ak2 denotes the number in the middle of the current sliding window after arranging the data in numerical order one by one, and ak2 is the input window acceleration data. Define Zmax as the minimum value of the acceleration data ak2, Zmin as the maximum value of the acceleration data ak+12, Zmed as the median signal, and Zmax as the maximum window size allowed. In this way, the adaptive median filter has two processes that can be summarized: determining whether the median obtained within the current window is noise and determining whether the acceleration ak2 is noise. If the relation Zmin<Zmed<Zmax is satisfied, the median Zmed is not determined to be noise and the acceleration data at the center of the current window is continued to be checked. Compensation for hard and soft iron distortion depends on the materials in the sensor and its surroundings. While we can compensate for the presence of materials around the sensor that may distort the magnetic field relative to the sensor at rest or moving with the sensor, this compensation becomes much more difficult when the distorted materials in the external environment are changing, especially when the object is in motion and compensation for this external environment is almost impossible.


### 3.2. Design of Swimming Stance Data Identification and Analysis

The LPMS-B2 nine-axis sensor chosen for this paper is powerful, with a three-axis accelerometer, three-axis gyroscope, three-axis magnetometer, and barometric and humidity sensors, small enough to be easily worn by the user, and easy to connect using an app via Bluetooth communication [18]. Swimming is a sport that involves many parts, and early studies would obtain complete motion information by attaching multiple sensors to multiple parts of the body and obtaining the acceleration velocity of each part. This method does improve the recognition rate, but too many devices are very uncomfortable for the wearer and can interfere with the movement, and the cost of the experiment is also high.The different parts of the individual sensors can also have a great influence on the results. For swimming, the motion characteristics of the hands and feet are more obvious for different strokes, and from the perspective of daily use, wearing the sensor on the hand is more in line with people’s habits, so in this paper, the sensor is worn on the wrist to acquire data. For the most popular backstroke and freestyle in rehabilitation, the body rotates around the longitudinal axis of the body with the left and right arm strokes and has strong left and right symmetry, so the body rotation angle during swimming can be used to represent the left and right arm movements.y-axis gyroscope data represents the angular velocity of the left and right body rotation during swimming, which is a simple periodic signal with strong regularity, and can be calculated by using equation (5). Its integration to calculate the body rotation angle during swimming is also a simple periodic signal.
(5)φY=∫wY2dt,whereφY is the body rotation angle in the left and right directions and wY2 is the angular velocity in the left and right directions. By analyzing the basic characteristics of the rotation angle signal in swimming, the amplitude and time to complete the corresponding swimming stroke can be determined, in which the maximum and minimum values of the human body rotation angle can reflect the amplitude of the left and right arm strokes, respectively; the stroke period of the left and right arm strokes can be extracted according to the time when the rotation angle crosses the zero point. During the swimming exercise, the maximum rotation angle and the stroke period of the left and right arms of the swimmer will remain relatively stable. If the swimmer has some spinal disease, injury, or limb injury, it will produce some asymmetry in the left and right arm movements, and the higher the degree of injury, the greater the corresponding asymmetry, so we can calculate the difference between the maximum left and right rotation angles and the difference between the left and right movement cycles during the whole swimming process to comprehensively evaluate the degree of human injury, as shown in
(6)η=∑φY−maxi+φY−mini∑φY−maxi−φY−mini/2,whereη denotes the combined asymmetry of the left and right swimming movements, i.e., the degree of human injury; D denotes the combined variance of the left and right swimming movements, i.e., the degree of human fatigue. φY−maxi, φY−min, TLi, and TRi denote the maximum and minimum values of the rotation angle and the left-handed and right-handed action cycles in the i-th action cycle, respectively; n denotes the number of action cycles in a certain time.This compensation for magnetic field distortions ensures that magnetic field disturbances are limited to affect only the direction to be estimated. This approach eliminates the need to predetermine the reference direction of the Earth’s magnetic field, overcoming the potential drawbacks of other direction estimation algorithms, as shown in Figure3.Figure 3
Overall structure of the recognition algorithm.Attitude estimation requires fusing information from the gyroscope, accelerometer, and magnetometer inside the magnetic-inertial sensor to determine the attitude of the target under test [19]. The second part is the estimation of the motion position of the upper limb joints. The results of the pose estimation in the first part can be obtained by transferring the accelerometry measurement to the ground coordinate system and excluding the gravitational acceleration to obtain the motion acceleration of the object under test. Once a uniformly accelerated motion model is established, the motion acceleration can be fused with the position information provided by the vision sensor, and a more robust and more accurate wrist motion trajectory can be obtained. Diagnostic research focuses on the study of the action itself. It may be a pilot study that explores how an action is applied and may be received in practice, or it may describe the action process itself. Diagnostic research is primarily for the benefit of the leaders of the organization being diagnosed, and the research report is for their reference only. Therefore, it is mostly conducted before or after the action has been implemented.The accuracy of posture estimation is very dependent on the accuracy of sensor measurements; however, sensor measurements are subject to linear acceleration and external magnetic field interference. For example, when the human arm is moving rapidly, the acceleration measurements will contain large linear acceleration disturbances and the measurements cannot be trusted. And in the case of rapidly changing magnetic fields, the assumption of a uniform magnetic field does not hold, and then, the attitude angle calculated from the magnetometry measurement will be inaccurate. Also, numerical integration of the angular velocity measured by the gyroscope can give attitude information, but this method is only valid for short periods and gradually deviates as the integration time becomes longer and longer or even becomes an incorrect attitude estimate.Based on the above characteristics of inertial sensors, threshold-based methods are a mainstream approach to reduce the effects of external disturbances. The core idea of this type of approach is that during a measurement, for accelerometers, if there is a measurement that deviates significantly from the acceleration of gravity, which indicates that the sensor’s measurement cannot be trusted, it is rejected, and the gyroscope measurement is then used to predict the direction of gravity at that moment. Similarly, in magnetometer measurements, if the measurement deviates too much from the geomagnetic intensity or if the measured measurement deviates significantly from the declination of gravity and the initial moment, it is rejected and replaced with the predicted value of the previous moment’s measurement again.From the division of the gait cycle in the Figure3, the user takes two steps in a gait cycle and the situation where the difference between the posture angles at the two thighs is the largest once in each step, so the situation where the absolute value of the difference between the posture angles is the largest can be used as the discrimination criterion for each step, thus achieving the recognition of the number of steps in the walking posture. This approach overcomes the drawbacks of a single sensor and takes full advantage of the multisensor network of this system. The raw data and difference curves of the collected left and right leg posture angles in the actual measurement experiment are shown in Figure 4.Figure 4
Raw data and difference curves of left and right leg posture angles.In the attitude reconstruction thread, the source IP is first obtained; then, the quaternions used for attitude transformation are initialized and blocked to determine if data is received from the inertial acquisition node, and if so, the node number, raw nine-axis data, Euler angles, and other information in the resulting data frame are parsed. The next step after getting the data is to start the work of attitude reconstruction [20]. First, determine if the pose has been initialized; if it has been initialized, then find the pose transformation matrix of the node before and after two times relative to the reference point of the node, find the pose transformation matrix, and then send a drawing message to the view to drive the corresponding node motion and update the pose data to the aggregated pose structure for the next call. Median filtering is a nonlinear digital filtering technique often used to remove noise from images or other signals. The design idea is to examine a sample in the input signal and determine if it represents the signal, using a viewing window consisting of an odd number of samples to achieve this function. The values in the viewport are sorted, and the median value in the middle of the viewport is used as the output. Then, the earliest value is discarded, a new sample is obtained, and the above calculation process is repeated.


## 3.1. Swimming Inertial Sensor System Design

The accelerometer and gyroscope in the ICM-20948 chip can be activated by triggering the self-test register, and the chip will automatically simulate the external force applied to the accelerometer and gyroscope. After the self-test, the output value will be changed compared to the value without the self-test [15]. When the self-test function is activated, the sensor generates an output signal to observe the self-test condition. The self-test response value is equal to the difference between the sensor output value with the self-test and the output value without the self-test. When the self-test reply value is within a reasonable range, the self-test passes; when the self-test reply value is outside the specified range, it indicates a self-test failure. The action of a particular job is a succession of changes in several job postures over a continuous period. This series of successive changes is produced by instructions from the brain acting on the muscles of the body. For a specific operational posture, it is important to maintain its momentary stability. If this stability is disrupted during the action, the correct posture will be lost and this will lead to an operational accident. The continuous collection of such stability in the operating posture is the stability of the operating action, and the stability of the action can be well enhanced by repetitive training.Motion analysis, also known as motion study, is the process of studying and analyzing each action to ensure the effectiveness and reasonableness of the operator’s actions during the work process and to achieve the highest return on the work at the lowest cost. An action analysis is generally based on the actions performed by the operator, recording the contents of each limb action cantered on the operator’s hands and eyes according to specific marks, charting the actual action, and using this as a basis for analysis and improvement [16]. Because the motion sensor is very sensitive to movements, even for the same swimming stroke, each person’s subtle hand movements are very different, resulting in a limited coverage of the population and a very complex algorithm model. On the other hand, because the motion sensor can only sense the movement, it is difficult to distinguish accurately between the stroke movement in swimming and similar movement in a nonswimming state, and the data is easily disturbed to reduce the accuracy rate. At present, most accidents in production operations are caused by improper movements of the operator. Therefore, the analysis and improvement of movements, the orderly combination of operational movements, the improvement of inadequate movements, and the elimination of dangerous movements are powerful means of preventing accidents.Based on the above requirements, this experimental device adopts a system structure consisting of a measurement device, wireless network, and data processing software, as shown in Figure1. The measurement device includes a three-axis acceleration sensor, a three-axis gyroscope sensor, and an embedded WIFI module, which is mainly responsible for real-time acquisition of human swimming motion data and real-time uploading of measurement data using the embedded WIFI module. The wireless network can be used to cover the wireless network, which is responsible for forwarding the data uploaded by the embedded WIFI module to the terminal data processing software. Due to the manufacturing process, data measured by inertial sensors are usually subject to some errors. Offset error is also known as gyroscope and accelerometer will have nonzero data output even when they are not rotating or accelerating. To get the displacement data, we need to integrate the output of the accelerometer twice. After two integrations, even small offset errors will be amplified, and as time progresses, displacement errors will accumulate, eventually causing us to no longer be able to track the position of the object. In statistics and probability theory, each element of the covariance matrix is the covariance between the individual vector elements, a natural generalization from scalar random variables to higher dimensional random vectors. The terminal data processing software includes three modules: network communication, data monitoring, data processing, and display, as shown in Figure 1, which is mainly responsible for establishing data communication and data monitoring with the measurement device, as well as simple processing and display of the measurement data.Figure 1
Structure of the IoT-based swimming attitude measurement system.Complementary filters are analyzed in the frequency domain to fuse the signal to obtain a better estimate of a particular quantity. Assuming that the signal is driven by noise at two different frequencies, two filters with appropriate bandwidths can be constructed to cover the useful frequencies with these two filters. For this system, the complementary filters perform high-pass filtering on the direction estimated by the gyroscope data affected by low-frequency noise and low-pass filtering on the accelerometer data and magnetometer data affected by high-frequency noise. The fusion between the two filter estimates will ideally result in an all-pass and noise-free pose estimate.(1)Rs=GLSR0s−GHSR0s,Cs=kp−kis2,whereRs determines the cut-off frequency of the complementary filter and GL determines the time taken to suppress the static error; in general, kp is 10-100 times larger than ki. The complementary filter performs high-pass filtering on the direction line estimated from gyroscope data affected by low-frequency noise and low-pass filtering on accelerometer data and magnetometer data affected by high-frequency noise. Fusion between the two filtered estimates will ideally result in an all-pass and noise-free pose estimate. Consider the unconstrained optimization problem min fx, where fx is a continuously differentiable function. If one can construct a sequence x1,x2,x3,⋯,xt satisfying
(2)fxt+1≥fxt,t=0,1,⋯,t,thus, to satisfyfx−Δx≥fx, one may choose
(3)Δx=γ∇fx,where the step sizeγ is a constant. However, if γ is obtained too small, the convergence process of gradient descent will take a long time and will show poor following results in this system, while if γ is obtained too large, the gradient descent will overshoot and may sometimes converge quickly, but most cases will have repeated oscillations. In a gradient descent algorithm, a loss function is generally given first and a starting point is chosen; next, the gradient of the loss curve at the starting point is calculated, a step is taken in the direction of the negative gradient, a fraction of the gradient size is added to the starting point, and the process is iterated over and over, gradually approaching the lowest point of the loss curve.The problem of calibration of inertial and vision sensors without connection is studied [17]. The calibration method introduces the ground coordinate system and the calibration plate coordinate system to establish the relationship between the ground coordinate system and the vision sensor coordinate system. The rotation relationship between the ground coordinate system and the visual sensor is solved by the camera calibration method and the pose estimation method. Finally, a set of wrist part motion tracking experiments are designed to verify the effectiveness of the proposed method.For the inevitable cumulative error and position drift problems of the inertial sensor-based positional estimation system, a multisensor information fusion method based on an event-triggered mechanism is designed to use the position information obtained from vision sensors to constrain the cumulative error of inertial sensors and use the high-frequency measurement information of inertial sensors to supplement the visual data in the interval between two frames of vision sensors and in the case of occlusion loss, as shown in Figure2. The cost of the entire set of optical motion capture equipment is extremely expensive, cumbersome to set up, and vulnerable to blocking or light interference, bringing a lot of trouble to the postprocessing work. For some serious obstruction of the action, optical motion capture cannot accurately restore the action of, for example, squatting, hugging, and twisting in real time. The emergence of motion capture technology based on an inertial sensor system has greatly improved the status quo.Figure 2
Ellipse around the axis of rotation and data.These three methods of pose solving have their characteristics and can be chosen according to different situations and can be converted to each other. The Eulerian angle is easy to understand and convenient to represent, but the phenomenon of gimbal deadlock will occur, and it cannot display the pose information of the object in all directions; quaternion can avoid gimbal deadlock compared with the Eulerian angle, but it has one more dimension, which is relatively difficult to understand and cannot be displayed intuitively; the rotation matrix can be easily represented by arbitrary vectors, but the operation is relatively large and consumes time and memory. Computer vision-based recognition mainly uses various feature information to recognize human posture movements, such as video image sequences, human contours, and multiple viewpoints. Computer vision-based recognition can easily obtain the trajectory and contour information of human motion, but there is no specific way to express the details of human motion, and it is easy to have problems such as recognition errors due to occlusion.Since the size of the filter window used by the conventional median filter is fixed, causing the above contradiction cannot be solved. This problem can be solved by using the filtering method of an adaptive median filter. First, a threshold is set in advance for the adaptive median filter, and when the data point in the center of the window is judged to be noisy, the current median window value is replaced by the output of the filter; otherwise, its value is up to retention. The adaptive median filter can produce a good suppression of the impulse noise that often occurs in acceleration data, and the details are well preserved.(4)Zmed=ak2,n∈1,3,5,⋯2n+1,ak2−ak+122,n∈2,4,⋯2n,wheren is the size of the sliding window, ak2 denotes the number in the middle of the current sliding window after arranging the data in numerical order one by one, and ak2 is the input window acceleration data. Define Zmax as the minimum value of the acceleration data ak2, Zmin as the maximum value of the acceleration data ak+12, Zmed as the median signal, and Zmax as the maximum window size allowed. In this way, the adaptive median filter has two processes that can be summarized: determining whether the median obtained within the current window is noise and determining whether the acceleration ak2 is noise. If the relation Zmin<Zmed<Zmax is satisfied, the median Zmed is not determined to be noise and the acceleration data at the center of the current window is continued to be checked. Compensation for hard and soft iron distortion depends on the materials in the sensor and its surroundings. While we can compensate for the presence of materials around the sensor that may distort the magnetic field relative to the sensor at rest or moving with the sensor, this compensation becomes much more difficult when the distorted materials in the external environment are changing, especially when the object is in motion and compensation for this external environment is almost impossible.


## 3.2. Design of Swimming Stance Data Identification and Analysis

The LPMS-B2 nine-axis sensor chosen for this paper is powerful, with a three-axis accelerometer, three-axis gyroscope, three-axis magnetometer, and barometric and humidity sensors, small enough to be easily worn by the user, and easy to connect using an app via Bluetooth communication [18]. Swimming is a sport that involves many parts, and early studies would obtain complete motion information by attaching multiple sensors to multiple parts of the body and obtaining the acceleration velocity of each part. This method does improve the recognition rate, but too many devices are very uncomfortable for the wearer and can interfere with the movement, and the cost of the experiment is also high.The different parts of the individual sensors can also have a great influence on the results. For swimming, the motion characteristics of the hands and feet are more obvious for different strokes, and from the perspective of daily use, wearing the sensor on the hand is more in line with people’s habits, so in this paper, the sensor is worn on the wrist to acquire data. For the most popular backstroke and freestyle in rehabilitation, the body rotates around the longitudinal axis of the body with the left and right arm strokes and has strong left and right symmetry, so the body rotation angle during swimming can be used to represent the left and right arm movements.y-axis gyroscope data represents the angular velocity of the left and right body rotation during swimming, which is a simple periodic signal with strong regularity, and can be calculated by using equation (5). Its integration to calculate the body rotation angle during swimming is also a simple periodic signal.
(5)φY=∫wY2dt,whereφY is the body rotation angle in the left and right directions and wY2 is the angular velocity in the left and right directions. By analyzing the basic characteristics of the rotation angle signal in swimming, the amplitude and time to complete the corresponding swimming stroke can be determined, in which the maximum and minimum values of the human body rotation angle can reflect the amplitude of the left and right arm strokes, respectively; the stroke period of the left and right arm strokes can be extracted according to the time when the rotation angle crosses the zero point. During the swimming exercise, the maximum rotation angle and the stroke period of the left and right arms of the swimmer will remain relatively stable. If the swimmer has some spinal disease, injury, or limb injury, it will produce some asymmetry in the left and right arm movements, and the higher the degree of injury, the greater the corresponding asymmetry, so we can calculate the difference between the maximum left and right rotation angles and the difference between the left and right movement cycles during the whole swimming process to comprehensively evaluate the degree of human injury, as shown in
(6)η=∑φY−maxi+φY−mini∑φY−maxi−φY−mini/2,whereη denotes the combined asymmetry of the left and right swimming movements, i.e., the degree of human injury; D denotes the combined variance of the left and right swimming movements, i.e., the degree of human fatigue. φY−maxi, φY−min, TLi, and TRi denote the maximum and minimum values of the rotation angle and the left-handed and right-handed action cycles in the i-th action cycle, respectively; n denotes the number of action cycles in a certain time.This compensation for magnetic field distortions ensures that magnetic field disturbances are limited to affect only the direction to be estimated. This approach eliminates the need to predetermine the reference direction of the Earth’s magnetic field, overcoming the potential drawbacks of other direction estimation algorithms, as shown in Figure3.Figure 3
Overall structure of the recognition algorithm.Attitude estimation requires fusing information from the gyroscope, accelerometer, and magnetometer inside the magnetic-inertial sensor to determine the attitude of the target under test [19]. The second part is the estimation of the motion position of the upper limb joints. The results of the pose estimation in the first part can be obtained by transferring the accelerometry measurement to the ground coordinate system and excluding the gravitational acceleration to obtain the motion acceleration of the object under test. Once a uniformly accelerated motion model is established, the motion acceleration can be fused with the position information provided by the vision sensor, and a more robust and more accurate wrist motion trajectory can be obtained. Diagnostic research focuses on the study of the action itself. It may be a pilot study that explores how an action is applied and may be received in practice, or it may describe the action process itself. Diagnostic research is primarily for the benefit of the leaders of the organization being diagnosed, and the research report is for their reference only. Therefore, it is mostly conducted before or after the action has been implemented.The accuracy of posture estimation is very dependent on the accuracy of sensor measurements; however, sensor measurements are subject to linear acceleration and external magnetic field interference. For example, when the human arm is moving rapidly, the acceleration measurements will contain large linear acceleration disturbances and the measurements cannot be trusted. And in the case of rapidly changing magnetic fields, the assumption of a uniform magnetic field does not hold, and then, the attitude angle calculated from the magnetometry measurement will be inaccurate. Also, numerical integration of the angular velocity measured by the gyroscope can give attitude information, but this method is only valid for short periods and gradually deviates as the integration time becomes longer and longer or even becomes an incorrect attitude estimate.Based on the above characteristics of inertial sensors, threshold-based methods are a mainstream approach to reduce the effects of external disturbances. The core idea of this type of approach is that during a measurement, for accelerometers, if there is a measurement that deviates significantly from the acceleration of gravity, which indicates that the sensor’s measurement cannot be trusted, it is rejected, and the gyroscope measurement is then used to predict the direction of gravity at that moment. Similarly, in magnetometer measurements, if the measurement deviates too much from the geomagnetic intensity or if the measured measurement deviates significantly from the declination of gravity and the initial moment, it is rejected and replaced with the predicted value of the previous moment’s measurement again.From the division of the gait cycle in the Figure3, the user takes two steps in a gait cycle and the situation where the difference between the posture angles at the two thighs is the largest once in each step, so the situation where the absolute value of the difference between the posture angles is the largest can be used as the discrimination criterion for each step, thus achieving the recognition of the number of steps in the walking posture. This approach overcomes the drawbacks of a single sensor and takes full advantage of the multisensor network of this system. The raw data and difference curves of the collected left and right leg posture angles in the actual measurement experiment are shown in Figure 4.Figure 4
Raw data and difference curves of left and right leg posture angles.In the attitude reconstruction thread, the source IP is first obtained; then, the quaternions used for attitude transformation are initialized and blocked to determine if data is received from the inertial acquisition node, and if so, the node number, raw nine-axis data, Euler angles, and other information in the resulting data frame are parsed. The next step after getting the data is to start the work of attitude reconstruction [20]. First, determine if the pose has been initialized; if it has been initialized, then find the pose transformation matrix of the node before and after two times relative to the reference point of the node, find the pose transformation matrix, and then send a drawing message to the view to drive the corresponding node motion and update the pose data to the aggregated pose structure for the next call. Median filtering is a nonlinear digital filtering technique often used to remove noise from images or other signals. The design idea is to examine a sample in the input signal and determine if it represents the signal, using a viewing window consisting of an odd number of samples to achieve this function. The values in the viewport are sorted, and the median value in the middle of the viewport is used as the output. Then, the earliest value is discarded, a new sample is obtained, and the above calculation process is repeated.


## 4. Results and Analysis

### 4.1. Test Results of the Swimming Inertial Sensor System

The experimental design of stillness and motion recognition in posture recognition is as follows: the user will wear the hardware used in this system and power it up and the user performs the following operations, respectively: stand still for 5 seconds, do casual motion for 10 seconds, sit still for 5 seconds, do casual motion for 10 seconds, lie still for 5 seconds, do casual motion for 10 seconds, lie down for 5 seconds, do casual motion for 5 seconds, lie down for 5 seconds, do casual motion for 10 seconds, and so on for 5 times; that is, the number of times of stillness and motion is 10 times, respectively, and each posture at rest occurs 5 times, and the statistical recognition results are shown in Figure5.Figure 5
Experimental statistics of stationary and motion pose recognition.From the above experimental results, only one “sitting at rest” action was not recognized, but the recognition rate of rest and motion reached 100%, which is because the trend of the change of the posture angle in the process of rest and motion in this experiment based on the posture angle recognition method is very different. The reason the sitting posture is not recognized in the experiment is that the user does not reach the set threshold value during the experiment after inspection and analysis. In this paper, a multisensor information fusion method based on an event-triggered mechanism is used. The measurement of inertial and visual sensors is used as a trigger condition to perform sensor information fusion, specifically expressed as: once the position filter receives the data from inertial and visual sensors, it is fused with the predicted values of the past moments to estimate the position information at this moment.Once the sensor measurements reach the position filter, then the position filter performs information fusion to estimate the 3D spatial position of the wrist part at that moment. This allows all data to be used efficiently, improving the dynamic performance of the wrist position estimation system and enhancing the stability of the system in the absence of Kinect data. The inertial sensor can maintain good estimation accuracy even at high motion speeds. However, after 5 seconds, the velocity deviates to some extent and cannot be compensated. As time increases, the deviation gets larger showing the disadvantages of using the inertial sensor alone for position tracking. After the inertial sensor does two integrations, the accumulated error gets larger and larger and soon deviates from the true value. Inertial sensors can only provide acceleration information and cannot compensate for the drift on their own. Therefore, it is necessary to fuse inertial sensors and vision sensors for human position estimation (Figure6).Figure 6
System location estimation.And after position filtering, the interrupted position data can be effectively compensated by the data from inertial sensors, avoiding rapid and drastic changes in the tracking trajectory. This algorithm enhances the robust performance of the tracking system, which helps to ensure safety performance in human-machine collaboration or teleoperation scenarios. However, the single use of inertial sensors does not guarantee that the tracking effect is effective for a long time. This is because inertial sensors can only rely on double integration to obtain position information in space, a process that inevitably introduces the problem of drift, causing the position to eventually deviate from the true value. In general, do not use the inertial sensor integration alone for some time greater than 1 second. At the same time, a wrist joint position filter can achieve good results in other periods and can effectively improve the estimation accuracy of the wrist joint position.After differencing, the Kinect sensor obtains a large noise in the velocity valuation, while the position filtering is almost unaffected by it and can track the upper motion velocity better, avoiding the impact of the visual sensor measurements on the system. Under the control application of teleoperation, the velocity affects the torque of the robot, and once the velocity changes drastically, it may affect the estimation accuracy of teleoperation and damage the robot’s motor to some extent. Therefore, the velocity estimation experiments demonstrate that the present algorithm has better dynamic performance than the single vision sensor human pose estimation algorithm.


### 4.2. Results of Identification and Analysis of Swimming Stance Data

Vision sensors have a low sampling frequency and are somewhat lacking in detail for motion. The high sampling frequency of the inertial sensor can complement the sampling interval of the visual sensor well. This experiment is aimed at verifying the position tracking of the performance of the proposed fusion algorithm in the case of fast motion. The experiment requires the test subject to slide his arm in front of his body as fast as possible to provide a fast-motion experimental scenario.Figure7 shows the 2D wrist position estimation for the front of the tester, which is the view of the human arm motion from the camera perspective. The blue dots are the sampled wrist joint points obtained by the Kinect vision sensor, the red plus signs are the wrist joint motion trajectory points obtained by the position filter, and the green line is the wrist joint motion position obtained by the OptiTrack system. All the above estimates are transformed in some way and are in the Kinect sensor coordinate system. The inertial and visual sensor fusion algorithm provides more motion trajectory points, i.e., richer human motion data. In addition, the fusion results are closer to the true values of wrist motion provided by the OptiTrack system than the position estimates from the vision sensor only. Therefore, the experimental results show that the upper limb position estimation algorithm based on the fusion of inertial and visual sensors can obtain better tracking results in the case of fast movements.Figure 7
Wrist motion position tracking.Figure8 shows the average deviation distance and average time distortion for the DBA and ADBA algorithms, respectively, when different initial averaging sequences are chosen. The ADBA algorithm always obtains a smaller average deviation distance and average time distortion than the DBA algorithm when the same initial averaging sequence is chosen. Regardless of how the initial averaging sequence is chosen, the average deviation distance and average time distortion obtained by the ADBA algorithm are very stable and fluctuate very little, while the average deviation distance and average time distortion obtained by the DBA algorithm vary more significantly and fluctuate more.Figure 8
Comparison of mean deviation distances for ten experiments.To further evaluate the impact of the initial averaging sequences on the ADBA and DBA algorithms, 30 different sequences are selected as the initial averaging sequences, respectively. Due to the large amount of computation required for this experiment, only eight of these sequence sets are selected for testing in this paper. The mean and variance of the mean deviation distance and meantime distortion of the ADBA algorithm and DBA algorithm are shown for 30 different initial conditions, respectively. The mean and variance of the mean deviation distance and meantime distortion can be used to measure the sensitivity of both algorithms to the initial mean sequence selection. For all sets of test sequences, the ADBA algorithm always results in smaller mean deviation distances and meantime distortions relative to the DBA algorithm, regardless of the choice of initial averaging sequence. Even the computational results of the DBA algorithm at the best time are not as good as those of the ADBA algorithm at the worst time. The above experimental results show that the ADBA algorithm is more robust than the DBA algorithm under different initialization conditions.The human rotation angle is obtained by integrating they-axis angular velocity data for the medium-intensity backstroke and freestyle of Figure 8 using equation (6), which reveals the period and rhythm characteristics of the swimming action. The maximum and minimum curves can be obtained by the envelope extraction of the rotation angle signal, which corresponds to the left and right action rotation angles in swimming, respectively. Then, according to the zero-point detection method in signal processing, the time corresponding to when the rotation angle signal passes the zero point is determined, which in turn leads to the period of the left and right-hand movements, i.e., the duration of the left- and right-hand movements. Using the same processing method, the motion data of backstroke and freestyle of three intensities were processed in turn to obtain the rotation angle signals corresponding to them, and the maximum and minimum rotation angles and action periods were extracted.


## 4.1. Test Results of the Swimming Inertial Sensor System

The experimental design of stillness and motion recognition in posture recognition is as follows: the user will wear the hardware used in this system and power it up and the user performs the following operations, respectively: stand still for 5 seconds, do casual motion for 10 seconds, sit still for 5 seconds, do casual motion for 10 seconds, lie still for 5 seconds, do casual motion for 10 seconds, lie down for 5 seconds, do casual motion for 5 seconds, lie down for 5 seconds, do casual motion for 10 seconds, and so on for 5 times; that is, the number of times of stillness and motion is 10 times, respectively, and each posture at rest occurs 5 times, and the statistical recognition results are shown in Figure5.Figure 5
Experimental statistics of stationary and motion pose recognition.From the above experimental results, only one “sitting at rest” action was not recognized, but the recognition rate of rest and motion reached 100%, which is because the trend of the change of the posture angle in the process of rest and motion in this experiment based on the posture angle recognition method is very different. The reason the sitting posture is not recognized in the experiment is that the user does not reach the set threshold value during the experiment after inspection and analysis. In this paper, a multisensor information fusion method based on an event-triggered mechanism is used. The measurement of inertial and visual sensors is used as a trigger condition to perform sensor information fusion, specifically expressed as: once the position filter receives the data from inertial and visual sensors, it is fused with the predicted values of the past moments to estimate the position information at this moment.Once the sensor measurements reach the position filter, then the position filter performs information fusion to estimate the 3D spatial position of the wrist part at that moment. This allows all data to be used efficiently, improving the dynamic performance of the wrist position estimation system and enhancing the stability of the system in the absence of Kinect data. The inertial sensor can maintain good estimation accuracy even at high motion speeds. However, after 5 seconds, the velocity deviates to some extent and cannot be compensated. As time increases, the deviation gets larger showing the disadvantages of using the inertial sensor alone for position tracking. After the inertial sensor does two integrations, the accumulated error gets larger and larger and soon deviates from the true value. Inertial sensors can only provide acceleration information and cannot compensate for the drift on their own. Therefore, it is necessary to fuse inertial sensors and vision sensors for human position estimation (Figure6).Figure 6
System location estimation.And after position filtering, the interrupted position data can be effectively compensated by the data from inertial sensors, avoiding rapid and drastic changes in the tracking trajectory. This algorithm enhances the robust performance of the tracking system, which helps to ensure safety performance in human-machine collaboration or teleoperation scenarios. However, the single use of inertial sensors does not guarantee that the tracking effect is effective for a long time. This is because inertial sensors can only rely on double integration to obtain position information in space, a process that inevitably introduces the problem of drift, causing the position to eventually deviate from the true value. In general, do not use the inertial sensor integration alone for some time greater than 1 second. At the same time, a wrist joint position filter can achieve good results in other periods and can effectively improve the estimation accuracy of the wrist joint position.After differencing, the Kinect sensor obtains a large noise in the velocity valuation, while the position filtering is almost unaffected by it and can track the upper motion velocity better, avoiding the impact of the visual sensor measurements on the system. Under the control application of teleoperation, the velocity affects the torque of the robot, and once the velocity changes drastically, it may affect the estimation accuracy of teleoperation and damage the robot’s motor to some extent. Therefore, the velocity estimation experiments demonstrate that the present algorithm has better dynamic performance than the single vision sensor human pose estimation algorithm.


## 4.2. Results of Identification and Analysis of Swimming Stance Data

Vision sensors have a low sampling frequency and are somewhat lacking in detail for motion. The high sampling frequency of the inertial sensor can complement the sampling interval of the visual sensor well. This experiment is aimed at verifying the position tracking of the performance of the proposed fusion algorithm in the case of fast motion. The experiment requires the test subject to slide his arm in front of his body as fast as possible to provide a fast-motion experimental scenario.Figure7 shows the 2D wrist position estimation for the front of the tester, which is the view of the human arm motion from the camera perspective. The blue dots are the sampled wrist joint points obtained by the Kinect vision sensor, the red plus signs are the wrist joint motion trajectory points obtained by the position filter, and the green line is the wrist joint motion position obtained by the OptiTrack system. All the above estimates are transformed in some way and are in the Kinect sensor coordinate system. The inertial and visual sensor fusion algorithm provides more motion trajectory points, i.e., richer human motion data. In addition, the fusion results are closer to the true values of wrist motion provided by the OptiTrack system than the position estimates from the vision sensor only. Therefore, the experimental results show that the upper limb position estimation algorithm based on the fusion of inertial and visual sensors can obtain better tracking results in the case of fast movements.Figure 7
Wrist motion position tracking.Figure8 shows the average deviation distance and average time distortion for the DBA and ADBA algorithms, respectively, when different initial averaging sequences are chosen. The ADBA algorithm always obtains a smaller average deviation distance and average time distortion than the DBA algorithm when the same initial averaging sequence is chosen. Regardless of how the initial averaging sequence is chosen, the average deviation distance and average time distortion obtained by the ADBA algorithm are very stable and fluctuate very little, while the average deviation distance and average time distortion obtained by the DBA algorithm vary more significantly and fluctuate more.Figure 8
Comparison of mean deviation distances for ten experiments.To further evaluate the impact of the initial averaging sequences on the ADBA and DBA algorithms, 30 different sequences are selected as the initial averaging sequences, respectively. Due to the large amount of computation required for this experiment, only eight of these sequence sets are selected for testing in this paper. The mean and variance of the mean deviation distance and meantime distortion of the ADBA algorithm and DBA algorithm are shown for 30 different initial conditions, respectively. The mean and variance of the mean deviation distance and meantime distortion can be used to measure the sensitivity of both algorithms to the initial mean sequence selection. For all sets of test sequences, the ADBA algorithm always results in smaller mean deviation distances and meantime distortions relative to the DBA algorithm, regardless of the choice of initial averaging sequence. Even the computational results of the DBA algorithm at the best time are not as good as those of the ADBA algorithm at the worst time. The above experimental results show that the ADBA algorithm is more robust than the DBA algorithm under different initialization conditions.The human rotation angle is obtained by integrating they-axis angular velocity data for the medium-intensity backstroke and freestyle of Figure 8 using equation (6), which reveals the period and rhythm characteristics of the swimming action. The maximum and minimum curves can be obtained by the envelope extraction of the rotation angle signal, which corresponds to the left and right action rotation angles in swimming, respectively. Then, according to the zero-point detection method in signal processing, the time corresponding to when the rotation angle signal passes the zero point is determined, which in turn leads to the period of the left and right-hand movements, i.e., the duration of the left- and right-hand movements. Using the same processing method, the motion data of backstroke and freestyle of three intensities were processed in turn to obtain the rotation angle signals corresponding to them, and the maximum and minimum rotation angles and action periods were extracted.


## 5. Conclusion

In this paper, a wireless swimming posture measurement experimental device is implemented, which can upload the measurement data in real time with low cost and without affecting the exercise process. The characteristics of swimming motion data are also analyzed, the identification method of swimming posture and intensity is proposed, and the period and amplitude of swimming motion are used as the basis for extracting human body condition. TheXYZ acceleration data corresponding to different strokes of equal intensity are significantly different, which can be used as the basis for the identification of human swimming posture. For freestyle and backstroke, the left and right rotation angles of the human body are a simple periodic signal from which the period and amplitude of the human body movements on both sides can be extracted, and the difference and variance between the left and right sides can be used to evaluate the degree of impairment and fatigue of the human body, respectively. In this paper, we designed a swimming data recording and analysis system based on a single LPMS-B2 nine-axis sensor. The user wears the LPMS-B2 sensor on his wrist, collects data such as acceleration during swimming, uploads it to a mobile app and then uploads it to a server to calculate data such as stroke, stroke arm, time, and distance, and displays it on the mobile. The final experimental results prove that the recognition accuracy of the system can meet the actual demand, and the system has a lower development cycle and development cost, which has some application value.



---

*Source: 5151105-2022-01-27.xml*