# Multi-Task Agent Hybrid Control in Sparse Maps and Complex Environmental Conditions
## 3 Dynamic Environment Target Identification and Localization (DETIL)
### Identification and Localization of Interest Targets
#### 3.2.2 Spatiotemporal Dimension Clustering Based on DBSCAN  
Having obtained the world coordinates of potential interest targets from two-dimensional images, the coordinates derived from a single image may have unacceptable errors. Without altering the target detection algorithm itself, increasing the sample size of the same target can effectively reduce the variance of experimental errors. The movement behavior of the intelligent agent in actual tasks allows for the acquisition of the same target information from multiple angles. The DETIL algorithm stores these pieces of information in chronological order as the agent moves. After completing phase-specific tasks, it retrieves them for localization, ultimately yielding highly credible world coordinates for the interest targets, Figure 5 shows the framework for the algorithm's interest target identification and localization section. Such an approach enables the intelligent agent to only perform target detection and coordinate transformation computations during movement tasks, with the actual localization calculations deferred until computational resources are more available, significantly enhancing the agent's operational efficiency. At the same time, we have de signed a spatiotemporal dimension clustering scheme based on DBSCAN, which clusters different spatiotemporal units obtained by segmenting the agent's progress, to maximally discard the cumulative error in the agent's localization. The overall structure of the DETIL algorithm's interest target identification and localization component is shown in Figure 6, with the detailed steps outlined in Algorithm 2.  
1. Agent action starts
2. **For** each image for object detection
3. Obtain pixel coordinates of the target of interest
4. Transform coordinates to get the world coordinates of the target of interest
5. Add to the list in chronological order
6. **End For**
7. Agent action ends
8. Divide the current action into \(n\) spatiotemporal units
9. **For** each spatiotemporal unit
10. Perform DBSCAN clustering
11. Select the top \(m\) clusters with the most samples for analysis
12. **End For**
13. Sort the \(m\times n\) clusters based on the number of samples to obtain list \(L\)
14. Select the top \(o\) clusters with the most samples from list \(L\)
15. **While** there exist pairs of clusters among the \(o\) clusters with inter-cluster distance less than the threshold
16. **For** each pair of clusters with inter-cluster distance less than the threshold
17. Remove the cluster with fewer samples
18. Update list \(L\) to include the remaining clusters
19. Reselect the top \(o\) clusters with the most samples
20. **End For**
21. **End While**
22. For the final \(o\) clusters, compute their centers to determine the coordinates of the targets of interest  
Figure 5: Framework diagram of the DETIL algorithm for interest target identification and localization.  
Application of Multi-Task Mixed Control Scheme Under Sparse Map and Complex Environmental Conditions