## 4 Autonomous Landing Method
### Power Line Detection and Location Estimation
#### 4.1.2 Location Estimation  
To control the landing of the FPLIR on the power line, its relative position to the target must be calculated. The camera is installed on the walking mechanism of the FPLIR using a rigid connection, and the lens's direction is the same as the orientation of the FPLIR. Taking the right-handed frame as the reference, the relative position of the frame between the FPLIR and the target is depicted in Figure 5. There are five frames on different levels: A, pixel frame \(O_{A}(u,v)\); I, image frame \(O_{I}(x,y)\); C, camera frame \(O_{c}(X_{c},Y_{c},Z_{c})\); W, world frame \(O_{W}(X_{W},Y_{w},Z_{w})\); and B, FPLIR body frame \(O_{B}(X_{B},Y_{B},Z_{B})\).  
The image frame is the frame of the photosensitive element of the camera. Assuming that the size of each pixel is \(d_{x}\) and \(d_{y}\), and the coordinate of the image frame origin \(O_{I}\) in the pixel frame is \((u_{o},v_{o})\), the conversion relationship between the two frames is expressed by:  
\[\left\{\begin{aligned} u&=\frac{x}{d_{x}}+u_{o}\\ v&=\frac{y}{d_{y}}+v_{o}\end{aligned}\right. \tag{1}\]  
Based on the pinhole imaging principle, the camera focal length is set as \(f\), while the distance from the optical center to the object is defined as \(D\), and the relationship between them is presented as follows:  
\[\frac{X}{D}=\frac{x}{f} \tag{2}\]  
The relationship between the image coordinates \(p(x,y)\) and the camera coordinates \(P(X_{c},Y_{c},Z_{c})\) is defined as follows:  
\[\left\{\begin{aligned} \frac{x}{f}&=\frac{X_{c}}{Z_{c}}\\ \frac{y}{f}&=\frac{Y_{c}}{Z_{c}}\end{aligned}\right. \tag{3}\]  
The relationship between the pixel and the camera frame can be obtained by substituting Equation (1) into Equation (3):  
Figure 4: Illustration of the training and detection phases of the power line segmentation algorithm.  
Figure 5: Coordinate system for relative position estimation.  
\[\left\{\begin{aligned} u&=\frac{X_{c}}{Z_{c}}f_{u}+u_{o}\\ v&=\frac{Y_{c}}{Z_{c}}f_{v}+v_{o}\end{aligned}\right. \tag{4}\]  
where \(f_{u}\) is \(\frac{f}{d_{x}}\) and \(f_{v}\) is \(\frac{f}{d_{y}}\). Since the binocular camera can obtain the depth value \(Z_{c}\) for each pixel in the object area, the position of the object in the camera frame is obtained by the transformation of homogeneous coordinates to project the 2D point into 3D space:  
\[Z_{c}\begin{bmatrix}u\\ v\\ 1\end{bmatrix}=\begin{bmatrix}f_{u}&0&u_{o}\\ 0&f_{v}&v_{o}\\ 0&0&1\end{bmatrix}\begin{bmatrix}X_{c}\\ Y_{c}\\ Z_{c}\end{bmatrix}=\mathbf{K}\mathbf{P} \tag{5}\]  
where \(\mathbf{K}\) is the intrinsic camera matrix. The point \(\mathbf{P}\) is transformed into the world frame by applying Equation (6):  
\[\begin{bmatrix}X_{w}\\ Y_{w}\\ Z_{w}\\ 1\end{bmatrix}=\begin{bmatrix}\mathbf{R}_{B}^{W}&\mathbf{t}_{B}^{W}\\ 0&1\end{bmatrix}\begin{bmatrix}\mathbf{R}_{C}^{B}&\mathbf{t}_{C}^{B}\\ 0&1\end{bmatrix}\begin{bmatrix}\mathbf{X}_{c}\\ Y_{c}\\ Z_{c}\\ 1\end{bmatrix}=\mathbf{T}_{B}^{W}\mathbf{T}_{C}^{B}\begin{bmatrix}X_{c}\\ Y_{c}\\ Z_{c}\\ 1\end{bmatrix} \tag{6}\]  
\[\mathbf{T}_{B}^{W},\mathbf{T}_{C}^{B}\in SE(3)\]  
where \(\mathbf{T}_{B}^{W}\) is a transformation from the body frame to the world frame, and \(\mathbf{T}_{C}^{B}\) is the transformation from the camera frame to the body frame. In this study, the calculated coordinates of the target area are used to create a point cloud containing the points that are candidates for belonging to the power line. However, the point cloud also contains noisy points associated with the binocular camera. The RANSAC [46] algorithm is used to detect the power line to eliminate the noisy points.