## 2 Materials and Methods
### Curve Fitting  
By covering sampling design and genetic algorithm, the detection path with the optimal sampling resolution can be obtained under the energy limitation. However, this path does not meet the requirement of the continuous flight path of the UAV; that is, the second-order continuous differentiability. As a result, the UAV will decelerate, hover and turn at some discontinuous waypoints during the flight, which will increase mission execution time and waste a lot of energy. Path smoothing is an effective method used to obtain the actual flight path of UAVs, which can improve the safety and efficiency of UAVs. The B-spline method retains all the advantages of the Bezier method and overcomes the fact that the Bessel method cannot modify local curves and the complexity of curve splicing. The B-spline function has continuous first and second derivatives, and the curvature change is relatively uniform; it meets the requirements of the continuous change of the speed and acceleration rate of the UAV. When the B-spline curve is used for track smoothing, it can achieve a smooth transition of the intersecting parts of the track, and the B-spline curve can be partially adjusted according to the local adjustment of the track point. The new track obtained is in the convex hull, which ensures that the cost of the new track and the cost of the original track vary within a certain allowable range. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Algorithm** & \begin{tabular}{c} **Optimal Path** \\ **Length (m)** \\ \end{tabular} & \begin{tabular}{c} **Optimal** \\ **Angle (Rad)** \\ \end{tabular} & \begin{tabular}{c} **Average Path** \\ **Length (m)** \\ \end{tabular} & \
\begin{tabular}{c} **Average** \\ **Angle (Rad)** \\ \end{tabular} &
\begin{tabular}{c} **Average** \\ **Count of** \\ **Iterations** \\ **(Count)** \\ \end{tabular} \\ \hline GA & 472.85 & 96.34 & 476.08 & 112.76 & 343.52 \\ SF-GA & 472.85 & 87.96 & 474.75 & 98.28 & 407.27 \\ DF-GA & 472.85 & 85.87 & 474.75 & 96.13 & 393.35 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance of different Genetic Algorithms in solving paths in study area A.  
Figure 4: Path planning results. (**a**) Result of GA with the sum of angles 114.14; (**b**) result of DF-GA with the sum of angles 92.15, whose sum of turn angles is smaller than the GA result, with more straight paths. The B-spline curve is a generalized form of the Bezier curve, which is defined as the following Formula (9):  
\[\mathrm{C}(u)=\sum_{i=0}^{n}N_{i,p}(u)P_{i} \tag{9}\]  
where \(P_{i},i\in[0,n]\) is the control point of the B-spline curve. \(N_{i,p}\) is the basic function of the B-spline curve and the subscript p represents the order of the basis function. Compared with the Bezier curve, the B-spline curve introduces the node vector \(U=\{u_{0},u_{1},u_{2},\ldots,u_{m}\},u_{0}\leq u_{1}\leq u_{2}\leq\cdots\leq u _{m}\), which divides the original \(u\in[0,1]\) into multiple node segments. The point \(C(u_{i})\) corresponding to the curve on the nodal vector is called a node, so that the entire B-spline curve is divided into many curve segments by the nodes, and each curve segment is actually a P-order Bezier curve defined on the node segment. The definition of the basis function depends on the nodal vector, which can be obtained according to the recursive definition of De Boor-Cox, as shown in the following Formula (10):  
\[ \begin{split} N_{i,0}(u)&=\left\{\begin{array}{ cc}1&u_{i}\leq u<u_{i+1}\\ 0&otherwise\end{array}\right.\\ N_{i,p}(u)&=\frac{u-u_{i}}{u_{i+p}-u_{i}}N_{i,p-1}(u)+\frac{u_{i+p+1}-u}{u _{i+p+1}-u_{i+1}}N_{i+1,p-1}(u)\end{split}  \tag{10}\]  
We use a third-order B-spline curve to smooth the path and find that when the sampling point spacing is too large, the fitted curve will deviate far from the sampling point, so that the path only covers a certain edge of the sub-region of interest. Therefore, we add supplementary waypoint interpolation before using B-spline curve fitting.