Obstacle Avoidance and Environmental Adaptability Analysis of Snake-like Robot Based on Deep Learning

Aiming at the problems of high complexity and low accuracy of visual depth map feature recognition, a graph recognition algorithm based on principal component direction depth gradient histogram (pca-hodg) is designed in this study. In order to obtain high-quality depth map, it is necessary to calculate the parallax of the visual image. At the same time, in order to obtain the quantized regional shape histogram, it is necessary to carry out edge detection and gradient calculation on the depth map, then reduce the dimension of the depth map combined with the principal component, and use the sliding window detection method to reduce the dimension again to realize the feature extraction of the depth map. The results show that compared with other algorithms, the pca-hodg algorithm designed in this study improves the average classification accuracy and significantly reduces the average running time. This shows that the algorithm can reduce the running time by reducing the dimension, extract the depth map features more accurately, and has good robustness.


Introduction
Based on the development of stereo vision technology, depth map feature extraction has gradually become a research hotspot [1]. However, related research only carries out feature extraction, but can not deal with the weak texture features and noise sensitivity of image extraction, and there are still a series of problems such as lack of real-time, high dimension and inaccurate shape extraction [2][3][4][5]. Therefore, based on the directional gradient histogram algorithm (HOG), a directional depth gradient histogram algorithm based on principal component analysis (pca-hodg) is designed to extract the features of depth map accurately and efficiently. The innovation of this research is not only to reduce the category complexity of feature extraction, but also to ensure the real-time and accuracy of feature extraction through twice dimensionality reduction.

Parallax calculation and depth map extraction
In order to solve the problems of category complexity and extraction accuracy in visual depth map feature recognition, a graphic recognition algorithm based on directional depth gradient histogram (pca-hodg) based on principal component analysis is designed in this study [6]. The flow chart of pca-hodg algorithm is shown in Figure 1.   Figure 1, in order to obtain a high-quality depth map, it is necessary to calculate the parallax of the visual image. At the same time, in order to obtain a quantized regional shape histogram, it is necessary to carry out edge detection and gradient calculation on the depth map, then reduce the dimension of the depth map in combination with the principal component, and use the sliding window detection method to reduce the dimension again to realize the feature extraction of the depth map [7][8].
At the level of parallax calculation and depth map feature extraction, this study adopts the graph cut algorithm with external limit constraints to carry out parallax calculation. The core idea of the algorithm is to construct the global energy function by using the minimum cut and maximum flow methods, so as to optimize the parallax solution [9]. At the same time, in order to eliminate flicker effect and noise, spatio-temporal consistency processing is also required to realize spatial smoothing [10]. See formula (1) for the energy function of parallax calculation.
In formula (2), depth is expressed in Z and parallax is expressed in d . The camera baseline distance is expressed in B and the focal length is expressed in F . The distance between the left and right matching points and the optical axis of the camera lens is expressed by l x and r x respectively.
Since the depth map can be represented by gray image to complete the auxiliary rendering of the new view, the formula for depth calculation can be obtained ( In formula (3) 3 feature extraction based on window is also needed. In order to reduce the influence of illumination and shadow on the feature extraction of depth map and enhance the contrast of image, Canny operator edge detection and gradient calculation method are selected to complete the standardized processing of depth map [11]. That is, the window size is preset according to the distribution of feature points and domain pixels of the depth map, so as to obtain the gradient information of the depth map. See formula (4) and formula (5) for the definition function of gradient modulus size and direction.
In formulas (4) and (5), the size of horizontal modulus is expressed in ( , ) h G x y and the size of pure prime modulus is expressed in ( , ) v G x y . The convolution operation mode [-1,0,1] of non smooth gradient operator is used to process the depth map. At the feature vector level of the directional gradient histogram, the gradient information statistics are expanded in combination with the direction and size of the gradient modulus, in which the gradient includes positive and negative directions [12].
Combined with the principle of directional gradient histogram algorithm, the selected window needs to be divided into several blocks, and each block group is composed of several cells, and then the block to block overlap method is used to deal with the aliasing effect of gradient information [13]. The eigenvector of the kth cell based on the gradient histogram is shown in formula (6).
In formula (6), the number of histograms (bin) is expressed in β . The algorithm generates a 9-dimensional histogram (bin) with 8 pixels in the [0, π] interval × 8 cell sizes, 2 cells per block × 2cell, then at 64 × In the 128 pixel window, the feature vector is 3780 dimensions.

Feature vector optimization based on principal component analysis
After calculating the features of directional gradient histogram, the regional administrative features of the image are obtained. Then, due to the large feature dimension, the accuracy and efficiency of feature matching are reduced [13]. Therefore, this study combines the principal component analysis method to reduce the dimension of the regional shape, That is, the shape eigenvector of n-dimensional region is represented by η φ × matrix, so as to complete the construction of the covariance matrix. For the definition function of covariance and characteristic mean, see formulas (7) and (8). In formulas (7) and (8), the eigenvector matrix is represented by A and H, and A is equivalent to H, the orthogonal transformation matrix is represented by AT, so as to complete the construction of a new eigenvector space, and the diagonal matrix is represented by ST. Therefore, the eigenvector definition function of the covariance matrix and the dimension reduction transformation expression of the eigenspace can be obtained. See formula (9) for details. In formula (9), the eigenvalue is recorded as ( ) i λ , expressed by ( ) i δ the variance of the variable value in the eigenvector space, and the corresponding eigenvector is. Combined with the core analysis idea of principal component, the principal component selects the first p feature vectors to complete the descending arrangement of features. After feature vector optimization based on principal component analysis, it is also necessary to use sliding window detection method for depth map feature extraction, so as to ensure the accuracy and integrity of feature extraction [14]. The resolution is m by sliding window overlap M×N depth map expansion detection, and the image needs to be divided into w windows. See formula (10) for the calculation function.
W ψ ϕ = × (10) In formula (10), the number of image horizontal windows is expressed in ψ and the number of image vertical windows is expressed in ϕ . According to the w feature windows formed by sliding detection, w feature sequences can be obtained, and each feature sequence is composed of p-dimensional feature vector, and then w can be obtained W×p, and then PCA is selected to reduce the dimension. The schematic diagram of sliding window feature detection is shown in Figure 2 As shown in Figure 2, the depth map obtained from each sequence has strong similarity in regional shape and characteristics. Therefore, according to the similarity calculation, the images belonging to the same sequence in the depth map library can be classified into the same category, that is, each depth map of each test sequence can be matched with the test sequence library image to verify the accuracy of feature extraction with the average classification accuracy [15].

Analysis of direction depth gradient histogram based on principal component analysis
The depth map is simulated by similarity classification. Calculate the similarity of the features extracted from the depth map, and then divide the depth map into the classes with the greatest similarity according to the calculated similarity; At the same time, the robustness of depth map feature extraction and matching is verified. At the experimental data level, the sequence length is 100 frames and the pixel is 400 × 300, and the parallax range of 64 pixels is guaranteed. The test sequence uses street, tanks, tunnel and temple as analog inputs. Among them, the average classification accuracy of feature matching of different algorithms is shown in Table 1. respectively. This shows that pca-hodg algorithm has good feature extraction and matching accuracy. The average running time of feature extraction and classification of different algorithms is shown in Figure 3.  As can be seen from Figure 3, in terms of the average running time of feature extraction and classification, the average running time of GIF algorithm, HOD algorithm and rsdf algorithm are 3.61s, 2.54s and 3.28s respectively, while the running time of pca-hodg algorithm designed in this study is only 0.72s, which shows that the algorithm can effectively reduce the complexity of feature extraction and classification and significantly improve the running efficiency. In addition, this study also compares the classification accuracy of different algorithms for similar noise, as shown in Figure 4.  It can be seen from Figure 4 that in comparing the accuracy of different kinds of algorithms for noise similarity classification in street sequence, compared with GIF algorithm, HOD algorithm and rsdf algorithm, the pca-hodg algorithm designed in this study has the highest accuracy, and the change curve of pca-hodg algorithm is relatively stable, which shows that the algorithm has both high accuracy and good robustness to noise.

Conclusion
Based on the directional gradient histogram algorithm (HOG), a directional depth gradient histogram algorithm based on principal component analysis (pca-hodg) is designed to extract the features of depth map accurately and efficiently. The results show that pca-hodg algorithm has better feature