Skip to main content
. 2026 Jun 10;26(12):3696. doi: 10.3390/s26123696
Algorithm 1.  Overall Pipeline of TrackRefine
Input: Video sequence V={It}t=1T, front-end instance segmenter Φ, memory bank M, thresholds Θ
Output: Trajectory set T
1  Initialize T←∅ and M←∅
2  for t =1 to T do
3     Obtain frame-wise detections:
Dt=Φ(It)={(bit,mit,cit,sit)}i=1Nt
4     Suppress highly overlapped duplicate masks in Dt
5     Refine initial masks by local Fast GrabCut:
D^t=MaskRefine(It,Dt)
6     Extract appearance feature fiapp,t, semantic feature fisem,t, and shape feature fishp,t from D^t
7     Fuse semantic and shape cues:
fijoi,t=JointFeatureEncodefisem,tfishp,t
8     Construct multimodal feature:
Fit=fiapp,tfijoi,t
9     Construct the multimodal feature set:
Ft={Fit}i=1Nt
10     Predict existing trajectory states using Kalman filtering and camera motion compensation
11   Partition trajectories into active, recently unmatched, and lost states
12       Perform progressive three-stage association:
At,Ut=ThreeStageAssociate(T,D^t,Ft,M)
13   for each matched pair (τk,dj)∈At do
14           Update the state, box, mask, and identity of τk using dj
15           Estimate the observation quality Qjt
16             Selectively update short-term memory and long-term prototypes:
Mk←QualityAwareUpdate(Mk,dj,Fjt,Qjt)
17    end for
18    Mark unmatched trajectories as occluded or lost according to missing duration
19    Initialize new tentative trajectories for unmatched detections in Ut
20    Remove expired trajectories from T
21 end for
22  return T