# Comparative Analysis of Discrete Subtraction and Cross-Correlation for Subpixel Object Tracking
## 3 Results and Discussion  
Calculations were performed with our own software, which can be freely downloaded from [20]. We would like to remark that, in general, with our own software, the calculation time for the DSM method was one order of magnitude lower than the time consumed by the correlation method. In the first place, the real accuracy of the method was checked. To this end, 2000 frames taken in the middle of the trajectory were selected, and the interframe displacement was calculated. Notice that, according to [18], the maximum achievable subpixel accuracy of a tracking method relates to the dynamic range of the image, which in this case is 8-bits or, equivalently, 256 gray levels. This results in a maximum theoretical resolution of \(1/256\approx 0.004\) px, or, according to our pixel-to-mm ratio, this is equivalent to 3 \(\upmu\)m. Since our experiment is below this limit, it is worth exploring if the method is able to follow the displacement or if there is a succession of underestimations and overcorrections of the target position. Furthermore, we can even wonder if the method is really detecting frame-by-frame changes or if the subpixel effect is just the result of statistics. In Figure 4, we present the results for the four targets here used. The statistics for these results are summarized in Table 1.  
Figure 3: Flowchart summarizing the procedure for the analysis of the correlation and DSM tracking methods. From the results obtained, we can see that both methods show, on average, the same accuracy since both can correctly reproduce the frame-to-frame displacement. It should be noted that while the mean value remains consistent across all cases, the standard deviation (STD), which accounts for noise and calculation inaccuracies, varies significantly. Dispersion serves as the true measure of accuracy, as values within the range defined by the mean and \(\pm\)STD should be considered indistinguishable. Consequently, a high STD value indicates that the measurement of interframe displacement lacks precision, potentially leading to small drifts when the total movement is accumulated [21]. According to the STD parameter, the cross-correlation method seems to introduce less dispersion than the DSM method. This may not be surprising, since correlation is known for minimizing the Mean Square Error [3], making it less sensitive to noise in the image. In general, and according to the results in Table 1, among the four targets proposed, the circular object presents the best results, followed by the rule and the square. These results are in accordance with the conclusions presented in [14,22], where it is stated that objects with complex profiles are more suitable for registering subject displacements. In the opposite case, the Gaussian target presents the worst performance. Our hypothesis is that the intensity gradient is degraded as the target moves, thus introducing additional noise to the calculation. In any case, both methods can track an object with a resolution at least higher than 20 \(\mu\)m, or equivalently 0.027 px, which is enough for most cases. If we focus on specific details of Figure 4, we can see that tracking of the squared target presents a sudden correction every 540 px approximately, which corresponds to a full pixel displacement. Additionally, dispersion in the rule target seems to be higher as the object displaces, meaning that non-compensated displacement errors appear. In Figures 5-8, we represent the target position obtained for each frame. One can observe in all figures the presence of a plateau at the beginning and end of the graph. This