# Research on an Optimal Path Planning Method Based on A* Algorithm for Multi-View Recognition
## 3 Optimal Path Planning for Multi-View Recognition Based on the A\({}^{*}\) Algorithm
### Optimal Path Planning Based on \(A^{*}\) Algorithm for Multi-View Recognition
\begin{array}{cccccccc}D_{11}&D_{12}&D_{13}&\cdots&D_{1(M_{u}-2 )}&D_{1(M_{u}-1)}&D_{1M_{u}}\\ D_{21}&D_{22}&D_{23}&\cdots&D_{2M_{u}-2}&D_{2(M_{u}-1)}&D_{2M_{u}}\\ D_{31}&D_{32}&D_{33}&\cdots&D_{3(M_{u}-2)}&D_{3(M_{u}-1)}&D_{3M_{u}}\\ \vdots&\vdots&\vdots&\ddots&\vdots&\vdots&\vdots\\ D_{(M_{u}-2)1}&D_{(M_{u}-2)2}&D_{(M_{u}-2)3}&\cdots&D_{(M_{u}-2)(M_{u}-2)}&D_{ (M_{u}-2)(M_{u}-1)}&D_{(M_{u}-2)M_{u}}\\ D_{(M_{u}-1)1}&D_{(M_{u}-1)2}&D_{(M_{u}-1)3}&\cdots&D_{(M_{u}-2)(M_{u}-2)}&D_{(M _{u}-1)(M_{u}-1)}&D_{(M_{u}-1)M_{u}}\\ D_{M_{u}1}&D_{M_{u}2}&D_{M_{u}3}&\cdots&D_{M_{u}(M_{u}-2)}&D_{M_{u}(M_{u}-1)}&D _{M_{u}M_{u}}\\ \end{array} \right] \tag{25}\]  
where \(\mathbf{D}_{R}\in\mathbb{R}^{M_{u}M_{u}M_{u}M_{u}}\mathbf{D}_{ij}\in\mathbb{R}^{M_{u} \times M_{u}}\), \(i=1,2,\,\ldots,\,M_{iu},j=1,2,\,\ldots,\,M_{lu}\). When \(i=j\), the specific elements of \(D_{ij}=D_{ii}\) are shown in Equation (26). \(\dot{d}=1,\,2,\,\ldots\,\), \(\mathrm{C}_{l}\), \(0<r^{1}<r^{2}<...<r^{\dot{d}}\leq 1\) are the normalized weight set proportional to the distance between viewpoints. \[\mathbf{D}_{ii}=\left[ \begin{array}{cccccccc}0&r^{1}&r^{2}&\cdots&r^{\dot{d}}&0 &\cdots&0\\ 0&0&r^{1}&r^{2}&\cdots&\dot{r^{\dot{d}}}&0&\cdots\\ 0&0&0&r^{1}&r^{2}&\cdots&0&\cdots\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ 0&0&0&0&r^{1}&\cdots&r^{(\dot{d}-1)}&\dot{r^{\dot{d}}}\\ 0&0&0&0&0&r^{1}&\cdots&r^{(\dot{d}-1)}\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ 0&0&0&0&0&0&0&r^{1}\\ 0&0&0&0&0&0&0\end{array} \right] \tag{26}\]  
When \(j=i+\dot{d}\leq\mathrm{M}_{lu}\), matrix \(\mathbf{D}_{ij}=\mathbf{D}_{i(i+\dot{d})}\), specific elements are listed in Equation (27). When \(i\geq\mathrm{M}_{lu}-\dot{d}+1\) and \(j=i+\dot{d}-\mathrm{M}_{lu}\), specific elements of matrix \(\mathbf{D}_{i(i+\dot{d}-M_{lu})}\) are listed in Equation (27). The difference of two non-0 elements in each row is \(\dot{d}\) columns. \(\mathbf{D}_{ij}\) of the other cases are \(\mathrm{M}_{i0}\times\mathrm{M}_{l0}\)\(\mathbf{0}\) matrix. \[\mathbf{D}_{i(i+\dot{d})}=\mathbf{D}_{i(i+\dot{d}-M_{lu})}=\left[ \begin{array}{cccccccc} \dot{r^{\dot{d}}}&0&\cdots&0&\dot{r^{\dot{d}}}&0&0&\cdots&0\\ 0&\dot{r^{\dot{d}}}&0&\cdots&0&\dot{r^{\dot{d}}}&0&\cdots&0\\ 0&0&\dot{r^{\dot{d}}}&0&\cdots&0&\dot{r^{\dot{d}}}&0&\cdots\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ 0&0&0&0&\dot{r^{\dot{d}}}&0&\cdots&0&\dot{r^{\dot{d}}}\\ 0&0&0&0&0&\dot{r^{\dot{d}}}&0&\cdots&0\\ 0&0&0&0&0&0&\dot{r^{\dot{d}}}&\cdots&0\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ 0&0&0&0&0&0&0&\dot{r^{\dot{d}}}\\ \end{array} \right] \tag{27}\]  
Considering the two optimization problems of optimal recognition performance and shortest planning path, based on the same directed graph model, the weight \(\omega\) is introduced to adjust the recognition performance and planning path distance to further transform the problem into a single optimization problem, which is the shortest path search on the directed graph. The directed graph is defined as \(\mathbf{G}=(\mathbf{\Phi}_{\ddot{p}}\mathbf{A})\), then the fused adjacency matrix can be expressed as:  
\[\mathbf{A}=\omega\cdot\mathbf{R}_{e}+(1-\omega)\mathbf{D}_{R} \tag{28}\]  
As a typical heuristic search algorithm in artificial intelligence, the A* algorithm has been widely used in path solving. The algorithm introduces the path evaluation formula when selecting nodes:  
\[f(n)=g(n)+h(n) \tag{29}\]where \(g(n)\) is actual cost from initial state to state \(n\), \(h(n)\) is the estimation cost of the optimal path from the state n to the target state. In this section, the A* algorithm is used to solve the single-source shortest path problem of the fused directed graph, and the sum of the edge weights of the fused directed graph is defined as the cost function to complete the viewpoint optimization path planning in a barrier-free environment.