## 3 Materials and Methods
### Multi-Scale Positioning for Waypoint Navigation
```
1:\(F\) (image of robot receptive field), \(c\) (movement cost), \(\sum_{j=0}^{n}G_{j}\) (\(G\) for gait sequence, \(j\) for gait sequence subscript, \(n\) for overall number of action groups), \(s\) (start point), \(g_{s}\) (the planning result for start point) \(g_{i}\) (the planning result for \(i\)th iteration), \(Max\_I\) (maximum iteration, which is 3000 in this paper), \(X_{i}\) (Robot gait planning result after \(i\)th iteration), \(Net1\), \(Net2\) (the modular combination network including instance segmentation and position, and the network for patch-based selection and refining mentioned in Section 3.3), \(\epsilon\) (the lower limit of the difference between the target prediction results) Output: Robot gait planning result \(X\) after optimization /* INITIALIZATION */
1: Initialize \(X_{0}\Leftarrow g_{s}\), \(j\Leftarrow random\)\(num\), \(X\Leftarrow\varnothing\), \(G\Leftarrow\varnothing\), Parent \((g_{s})\Leftarrow\varnothing\), \(i\Leftarrow 0\) /* MULTSCALE FEATURE EXTRATION */
2:while\(g_{i}\in\sum_{j=0}^{n}G_{j}\) and \(i\in[1,I]\)do:
3:\(F^{\prime}\Leftarrow\) Get and fill the \(F\)
4:\(F_{1},F_{2},F_{3},F_{4},F_{5}\Leftarrow\) two stream feature extraction pyramid \(F^{\prime}\cap\)\((X_{i}\Leftarrow(X_{i-1}\cup g_{i})\)
5:\(X_{i}\Leftarrow Net\)\((F_{1},F_{2},F_{3},F_{4},F_{5})\)
6:while\(X_{i}\ -\ X_{i-1}\ <\ \epsilon\)do:
7:\(X_{i}\Leftarrow Net\)\((F_{1},F_{2},F_{3},F_{4},F_{5})\)
8:endwhile /* OPTIMIIZATION */
9: Optimize \(g_{i}\in\)\(\sum_{j=0}^{n}G_{j}\) based on Equation (8)-(10)
10: Update and Extract \(g_{i}\) */
11:\(\text{{\lstinline{\lstinline{\lstinline{\lst@@@set@language{ \lst@@@set@language{\lst@@@set@language{\lst@@@set@language{\lst@@@set@language{ \lst@@@set@language{\lst@@@set@language{\lst@@@set@language{\lst@@@@set@language {\lst@@@@set@language{\lst@@@@set@language{\lst


```
1:Input:\(P\) (perturbation), \(NP\) (the number of patches), \(Max\_P\) (the max number of patches), \(Min\_P\) (the min number of patches), \(A_{k}\) (the frequency of adding perturbation), \(D_{k}\) (the threshold of decreasing perturbation), \(I\) (maximum iteration), \(SA\)(the flag for increased classification area), \(SD\) (the flag for decreased classification area), \(x\) (input image), \(Optimize\) (optimize method which returns new waypoints and the number of bounding boxes)
2:Output: Classification result \(X\) after optimization
3:\(SA\Leftarrow false\), \(SD\Leftarrow false\), \(a_{k}\Leftarrow 0\), \(d_{k}\Leftarrow 0\)
4:\(min\_bb\_num\Leftarrow INF\)
5:for each \(i\in[1,\;1]\)do
6:\(P,N\Leftarrow Optimize(x)\)
7:if\(N>0\)then
8:\(a_{k}\Leftarrow a_{k+1}\)
9:if\(a_{k}\%A_{k}=0\) and \(NP<Max\_P\)then
10:\(NP\Leftarrow NP+1\)
11:endif
12:if\(PN<Min\_P\)then
13:\(Min\_P\Leftarrow PN\)
14:endif
15:if\(PN=Min\_P\)then
16:\(d_{k}\Leftarrow d_{k+1}\)
17:if\(d_{k}\%D_{k}=0\)then
18:\(SD\Leftarrow true\)
19:endif
20:if\(SD=true\)then
21:\(X\Leftarrow decrease\ classification\ area(x)\)
22:endif
23:endif
24:endif
25:endfor
26:end
```

**Algorithm 2** Patch-based Selection and Refining

Figure 3: Illustration of the process to eliminate redundant points and obtain key waypoints. ### Position Correction and Eliminate Camera Distortion

In high-dimensional space planning, there is a deviation between the robot camera coordinate system and the actual coordinate system, as well as the influence of tangential distortion, which leads to planning errors. In order to adjust the gait more accurately, our HDPP performs coordinate system mapping to achieve the purpose of correction.