## 3 Target Detection and Tracking Algorithm
### Feature Points Tracking-Based Algorithm for Square Checkerboard Patterns  
The square checkerboard pattern consists of regularly arranged squares, forming a highly symmetric two-dimensional pattern. The orthogonal geometric structure ensures that each corner point in the pattern has a well-defined position. A square checkerboard pattern usually contains multiple corner points, providing abundant feature points for detection and tracking. A feature points tracking-based algorithm is developed to track the corner points (feature points) and to determine the geometric center in each video frame from the pre-defined initial ROI in the reference video frame for square checkerboard patterns. Following detection of the corner points in the reference video frame, a Kanade-Lucas-Tomasi (KLT) feature tracker [32; 33] is initialized with the detected feature points to track the movements of these points. The KLT algorithm aims to minimize computational intensity by directing the search position, as guided by the initial corner points detected for a particular pattern. All patterns except Type 4 for both stationary and moving targets are square checkerboard patterns. Detection of the corner points based on the pre-defined ROI is successfully implemented based on the four steps described in Figure 4, where a Type 2 target is selected for illustration. Steps 1 to 3 aim to generate a refined ROI to filter out the background noise in the pre-defined ROI. Corner points detection is performed within this refined ROI in Step 4. The details of these analysis steps are presented as follows:  
* **Step-1**: The grayscale initial ROI image (Figure 4a) is thresholded into a binary image (Figure 4b) using the [PERSON]'s method [34]. Pixels representing white color in the pattern are defined as foreground pixels. To remove the noise in the background, connected components that have fewer than 10 pixels are removed in the binary image. * **Step-2**: Edge detection with pixel level accuracy (Figure 4c) is performed on the binary image using the Sobel operator [35]. Although the Canny edge detection method [36] or other sub-pixel edge detection methods [37] may provide better localization of the edge points, the edge detection using the Sobel operator is sufficient for the refined ROI generation in step 3 with a lower computational cost, since this step only aims to generate a refined ROI to filter out the background noise from the initial ROI. In this step, both the edge points representing the edge of the squares (black against white or red against white) and the boundary of the target (white, black, or red against background) are extracted. * **Step-3**: The boundary point set of all edge points is extracted to form the bounding box of the target, representing the exact target region with pixel level accuracy (blue solid lines in Figure 4d). The approximate center of this bounding box is calculated as the mean of the boundary point set. A scaling operation expanding the bounding box by a factor of 1.1 relative to its approximate center is applied to obtain the refined ROI (red dash lines in Figure 4d), ensuring comprehensive inclusion of all feature points within the refined ROI. * **Step-4**: The Harris-Stephens feature detection algorithm with quadratic interpolation [38; 39] is applied to detect the corner points within the refined ROI in the grayscale image (red dash lines in Figure 4e). The Harris-Stephens feature detection algorithm runs a \(3\times 3\) window over the refined ROI in the grayscale image and computes the spatial gradient matrix \(M\) at each pixel (\(x,y\)) in the refined ROI [38]: \[M(x,y)= \begin{bmatrix}\sum_{x}\sum_{y}I_{x}(x,y)I_{x}(x,y)&\sum_{x}\sum_{y}I_{x }(x,y)I_{y}(x,y)\\ \sum_{x}\sum_{y}I_{x}(x,y)I_{y}(x,y)&\sum_{x}\sum_{y}I_{y}(x,y)I_{y}(x,y)\end{bmatrix} \] (1) where \(I_{x}(x,y)\) and \(I_{y}(x,y)\) are the intensity gradients with respect to \(x\) and \(y\) (pixel coordinates) at location (\(x,y\)) of the grayscale image.