## 3 Long-Term Feature Points Localization
### Adaptive Contact Points Tracking  
As the corner of the pantograph and contact line in the image coordinate system, the contact point is defined as the projection of the pantograph catenary contact position in space, which is the contact position at which the pantograph and catenary maintain sliding contact under train operation. As a result, it will move rapidly with the train running in the image sequence, because the contact wire will move quickly on the pantograph slide between one side and another. At the same time, the complex structure of the catenary produces a number of similar interference targets in the image. Additionally, the line-changing stage requires the tracking target to switch automatically, which produces a serious image occlusion when two contact wires in images. The appearance of the supporting structure of the catenary on both sides and above the rail means that the image not only needs to deal with illumination changes caused by outdoor operation, but also has to overcome the challenge of the complex image itself. To solve these problems, we propose an parameter adaption tracking method, which not only ensures high real-time precision measurements, but transforms the contact point positioning problem into an area tracking problem. In view of whether there is an initial position or not, we have chosen two baseline methods to develop: CF tracker combined with histogram of gradient (HoG) features, and pseudo-two-dimensional template matching by combined one-dimensional templates. Baseline: Given the image \(I\), as well as the one-dimensional template list \(\{t_{1},t_{2}\}\) for template matching, the left and right edge point sets of contact wire \(\{p_{l},p_{r}\}\) are obtained by taking an example using \(t_{1}\) to do template matching. The formula is  
\[p_{l},p_{r}=\{\varphi_{TM}(I_{i},t_{1}),i\in[1,N]\}, \tag{1}\]  
Figure 2 shows the \(i\)-th one-dimensional vector slices with N equal spacing selected in the horizontal direction of the image \(I_{i}\). \(\varphi_{TM}\) is the function to optimal left and right edge positions obtained after template matching. We can also obtain the point set distributed on the upper surface of the pantograph slide through the template \(t_{2}\). Furthermore, the accuracy of positioning determines the accuracy of the subsequent stereo reconstruction and the effectiveness of condition analysis. However, positioning through the intersectionof the fitted lines can only determine a rough localization area. This paper uses the prior knowledge that the contact point is the corner to carry out sub-pixel positioning to ensure the effectiveness of the positioning results. Therefore, we determine the point set through the line interleaving and further using sub-pixel corner refinement \(\phi_{\text{refine}}\) for sub-pixel approximation, which is the true location of the contact points in the frame. The equation is  
\[p_{l}^{i},p_{r}^{i} =\phi_{Cross}(\{p_{l}\},\{p_{r}\},\{p_{c}\}), \tag{2}\] \[p_{l_{r}}^{i},p_{r_{r}}^{i} =\phi_{\text{refine}}\left(p_{l}^{i},p_{r}^{i}\right). \tag{3}\]  
For the straight-line fitting process, we used the RANSAC method to filter possible outliers and ensure the stability of initialization. We obtained the initial region of tracking through the detected contact points and performed KCF tracking to obtain the target area of the subsequent frames. The formula is shown below,  
\[\text{ROI}^{i}=\phi_{RP}\left(I^{i},p_{l}^{i},p_{r}^{i}\right), \tag{4}\] \[\text{ROI}^{i+1}=track(I^{i+1},I^{i},\text{ROI}^{i}), \tag{5}\]  
where \(\text{ROI}^{i}\) is the tracking area obtained in the \(i\)-th frame according to the contact points \(p_{l}^{i}\), \(p_{r}^{i}\); \(I^{i+1}\), \(I^{i}\) are the adjacent image frames; and \(\phi_{RP}\) is the region proposal (RP) process, which is used to generate the target patches. These methods facilitate stable tracking and positioning of the contact points when the image is simple and there are no obvious illumination changes.