# Comparative Analysis of Discrete Subtraction and Cross-Correlation for Subpixel Object Tracking
## 3 Results and Discussion
These errors may be compensated for, as seen in the case of the Gaussian or square targets, or they may not be compensated for in the case of the mole figure. Coming back to Figure 8, the observed deviation is probably due to the small holes in the target that modify the linear counting of luminance differences and are responsible for the increasing interframe error trend observed in Figure 4. We have tested this hypothesis by implementing the tracking only with the head of the rider, which has a simpler profile than the whole picture, resulting in a correction of the trajectory, as can be seen in Figure 10. There we include the minimum square fitting results for the central part, between the two plateaus. As can be seen, the results have greatly improved. Observed differences may be due to calculation inaccuracies or noise distortion in any of the two methods, but overall, the small difference observed is not large enough to state that one method is better than the other. Figure 9: Detail of Figure 5, showing the correction in the trajectory for the correlation method. To complete our analysis, the accuracy of DSM and correlation methods has been evaluated by calculating the position errors of the four targets with respect to the theoretical position. We have ignored the starting and ending parts of the graph where the targets are static, so the calculations refer again to the central 2000 frames in the middle of the trajectory. To avoid differences in the initial positions, we have considered relative displacement instead of exact location. Thus, we have compared the theoretical shift between frames (1.3 \(\upmu\)m) with the displacement calculated through both methods. In Figure 11, we plot the displacement error for each target, while in Table 2, we give the maximum and mean error with the standard deviation obtained for each case. Figure 4:0 Displacement errors calculated for 2000 frames in the middle of the trajectory. Figure 4:1 Calculated position of the rider’s head using DSM and correlation methods. The graph includes the results of fitting the sloped part to a straight line as a measure of the accuracy of each method. Errors depicted in Figure 11 show that both methods, DSM and correlation deviation, provide accurate results with small deviations through all the trajectories. We would like to notice that both correlation and DSM are not calculated incrementally but by comparing each frame with the first one in the sequence. This means that deviations observed are not the result of cumulative errors, but that the error at each frame is independent of the previous one. One possible source of inaccuracies may come from the motorized stage since the displacements registered are at the limit of the device's resolution. Although this effect cannot be fully discarded, we would like to point out that the error graphs are different for all the targets, so this component of the error is of a random nature. Another source of error may be the image degradation of the targets as they move, and information in one pixel may be distributed to different sensors. Also, small asymmetries in the printed figure or in the illumination system may contribute to the total error. In any case, all these inaccuracies affect both methods and do not add information about which of the methods has better performance in tracking subpixel displacement. From Figures 4 and 11, we can confirm that both tracking methods work better with compact and symmetric objects like the circle. In the case of the squared target when using the correlation tracking method, clear sudden jumps corresponding to the peak-locking oscillations can be appreciated, but even with these, the tracking errors are relatively low. Notice also that, although the DSM results do not suffer from sudden corrections with the square, a wavy behavior can be appreciated in the graph for the square, making the errors of similar magnitude as those of the correlation method (see Table 1).