# A Study on the Application of Walking Posture for Identifying Persons with Gait Recognition
## 2 Material and Methods
Therefore, we used OpenPose to detect the skeleton in the above videos. Figure 5a shows the video of step 1 using OpenPose to capture the nodes. It can be seen that OpenPose can accurately capture the joints of the human body, which is very helpful for us in obtaining information about the human body. Figure 5b shows a keypoint type xml file for each frame. The yml file contains various information about the joints captured by OpenPose, showing the number of people on the screen and the locations of the human joints captured by OpenPose. The first number represents the x-coordinate of the numbered joints, the second number represents the y-coordinate of the numbered joints, and the third number represents the number of points. Since not all frames can catch the character, we deleted the frame if no critical points in the frame were caught. Figure 3: Experimental architecture diagram. * Frame selections  
The data needed for this experiment were 18 coordinates (x, y) output by OpenPose, and 30 frames as a group of movements. We took these actions as training data and divided the same person into two categories: walking to the left and walking to the right, and then give them labels. The 60 frames were cut into two training data sets by odd and even means. The advantage of this approach is that we can shorten the 60 fps video to 30 fps. In addition, we can use fewer data to represent the same time information. Figure 6 shows a schematic diagram of a group of data, where each color represents a frame of information, and we visualize 30 frames from 2 s with odd and even numbers. Therefore, each data group will have 30 lines of data, and each line represents a frame to capture the character's joints. As a group of feature points has 25 coordinates, each coordinate has x and y values, so that each line has 50 numbers. In the end, there will be a total of 30 \(\times\) 50 numbers in a set of data, making 1500 numbers in total. * Data normalization  
Our training data were taken with a GoPro Hero5 camera at a fixed distance. In order to reduce the error caused by different distances, we fixed the distance of people at 3.5 m (Algorithm 1). Additionally, we solved the problem of inconsistent starting positions for each group of training data. The normalization was according to Equation (1). To make the starting position of each group consistent, we first selected a reference point (the reference point selected in this study was the first frame number 1 joint). We set this point as the origin (\(x=0\), \(y=0\)) and mapped this point to a positioning point (\(c_{x}\), \(c_{y}\)). The joints of the first frame, number 1, are (\(X_{0}\), \(Y_{0}\)); \(X_{ij}\) represents the x-coordinate of the \(j\)th point of the \(i\)-frame; and  
Figure 4: (**a**,**b**) Types of left and right walking. Figure 5: (**a**) OpenPose skeleton; (**b**) the yml file obtained from OpenPose. represents the y-coordinate of the \(j\)th point of the i-frame. We let \(X_{ij}{}^{\prime}\) be the corrected value of \(X_{ij}\), and \(Y_{ij}{}^{\prime}\) be the corrected value of \(Y_{ij}\). The total data were 60 frames, each with 25 points of \(X\) and 25 points of \(Y\). For clarity, we have included the algorithm below. \[X_{ij}^{\prime}=\left(X_{ij}-X_{0}\times k+c_{x}\right) \tag{1}\] \[Y_{ij}^{\prime}=\left(Y_{ij}-Y_{0}+c_{y}\right)\]  
Figure 7 shows the key points of the character before and after normalization. Again, it can be seen that no matter where the character starts and ends, the starting position will be the same after normalization. \(\bullet\) Model training  
After obtaining the training data, we applied deep learning by taking 80% of the data and the remaining 20% as test data. Next, we used Tensorflow to implement LSTM-RNN. We used two layers of LSTM-RNN; each LSTM had a hidden layer; the model architecture was shown in Figure 8.  
\(\bullet\) Identity recognition  
Last, the test data were put into the training model for the final judgment.