# Dynamic Programming Ring for Point Target Detection
## 3 MFF-DPR-Based Point Target Detection
### Mff-Dpr
The coordinates corresponding to the maximum value of the merit function of the MFF-DPR at time \(t\) during the \(l\)th iteration can be expressed as: \[\mathbf{p}^{(l,st)}=\text{argmax}_{\mathbf{p}\in\mathbf{\Omega}}\Big{\{}I_{\mathbf{p}}^{(l,st )}\Big{\}}.\] (10) Step 3: Trajectory detection. ```
**Algorithm 2** Multi-Target Detection

To prevent the same trajectory is detected multiple times, in this study, target trajectories are detected one by one. Step (3) outputs one trajectory at a time, and the trajectory can be generated by correlating the coordinate set \(\left\{\mathbf{p}^{(l,st)}\middle|1\leq t\leq N\right\}\). The specific steps are as follows:

**Step 3.1:** Trajectory initialization. For the maximum value coordinate without matching the previous frame, a search window with a size of \((2v_{\text{max}}+1)\times(2v_{\text{max}}+1)\) is set by centering it on this coordinate point. If there exists a maximum value coordinate within the search window, a new trajectory is established, and the tracking counter is set to two; then, a \(3\times 3\) search window of the next frame centered on the predicted point is set, and the prediction counter is set to zero; otherwise, the maximum value coordinate of the previous frame is considered a noise coordinate and thus is deleted. **Step 3.2:** Trajectory generation. For the established trajectory, if there is a maximum value coordinate in the search window, the tracking counter is increased by one. Then, the trajectory is extended to the matching point, a \(3\times 3\) search window of the next frame centered on the predicted point is set, and the prediction counter is set to zero. If no matching point is found, the trajectory is extended to the prediction point, the search window of the next frame centered on the predicted point is set, the size of the search window is increased by 2 pixels, and the prediction counter is increased by one. If the prediction counter is greater than five, the point target corresponding to the trajectory has been lost, and the current trajectory updating process is terminated. In this process, the least squares linear prediction algorithm with five consecutive frames is used for coordinate prediction. **Step 3.3:** The highest-score trajectory selection. The trajectory coordinates are scored as follows: invalid coordinates as \"0\", initial coordinates as \"1\", prediction coordinates as \"2\", and matching coordinates as \"3\". After batch processing, as shown in Steps (3.1) and (3.2), the coordinate scores of each trajectory are added to the trajectory score. The trajectory's coordinates \(\mathbf{p}_{\text{traj}}^{(l,t)}\) and trajectory score \(S_{\text{traj}}^{(l,t)}\) corresponding to the highest-score trajectory are output. The iteration counter is increased by one, i.e., \(l=l+1\). If \(l\leq L\), the algorithm goes to Step 4; otherwise, it goes to Step 5. ```
Step 4: Updating observation data. ```
To prevent the same trajectory is detected multiple times, once the trajectory is detected, the corresponding pixels in the observation data are replaced by adjacent background pixels. ```
Define the updating area \(\boldsymbol{\Omega}_{\text{traj}}^{(l,t)}=\left\{\boldsymbol{q}\big{\|}\| \boldsymbol{q}-\boldsymbol{p}_{\text{traj}}^{(l,t)}\|_{\infty}\leq 1\right\}\), and perform \(3\times 3\) median filtering filling on it as follows:  
\[X_{\boldsymbol{p}}^{(t)}=\text{med}\big{\{}X_{\boldsymbol{q}}^{(t)}\big{|}\| \boldsymbol{p}-\boldsymbol{q}\|_{\infty}\leq 1\big{\}},\boldsymbol{p}\in \boldsymbol{\Omega}_{\text{traj}}^{(l,t)},1\leq t\leq N, \tag{11}\]  
where \(\|\ \|_{\infty}\) represents the Chebyshev norm, and \(\text{med}\{\ \}\) stands for the operation of calculating the median of the set elements; go to Step 1. Step 5: Trajectory regularization. ```
In theory, complete target trajectories can be extracted from observation data by performing Steps 1-4. However, target identification errors caused by trajectory intersection could arise, as shown in Figure 4c.