5.2 Integration of soware processor
5.4.9 Tracking
e tracker algorithm is implemented using C structs and linked lists in order to store and organise detections and their associated tracks. ese structures are defined as follows:
t y p e d e f s t r u c t r a d a r _ d e t e c t i o n r a d a r _ d e t e c t i o n ; s t r u c t r a d a r _ d e t e c t i o n {
i n t t i m e ; double p o s i t i o n ; double p o s i t i o n _ e s t ; double v e l o c i t y ; double i n t e n s i t y ; i n t b e a m _ s t a r t ; i n t beam_count ; r a d a r _ d e t e c t i o n * prev ; r a d a r _ d e t e c t i o n * n e x t ; } ; t y p e d e f s t r u c t t r a c k e d _ o b j e c t t r a c k e d _ o b j e c t ; s t r u c t t r a c k e d _ o b j e c t { i n t i d ; i n t s i z e ; i n t l a s t _ u p d a t e d ; double l a s t _ p o s i t i o n ; double l a s t _ v e l o c i t y ; r a d a r _ d e t e c t i o n * f i r s t ; r a d a r _ d e t e c t i o n * l a s t ; t r a c k e d _ o b j e c t * prev ; t r a c k e d _ o b j e c t * n e x t ; } ;
Each individual detection has a radar_detection structure associated with it and every tracked wave has a tracked_object structure associated with it. Both structures contain pointers to the previous and next element of the linked list to which they belong. Each radar_detection itself belongs to one of the following lists:
• List of new detections
• List of orphaned detections, which were detected in previous frames but have not yet been associated with a track
• List of detections associated to a given tracked wave
Aer each frame is acquired, a new tracked_object struct is populated and added to the set of new detections. An aempt is made to associate each new
detection with an established track. Each track has an associated position and velocity at the time it was last observed. A current position estimate is obtained for each track based on the last known position estimate, time of last observation and the last known velocity element. For each existing track, an aempt is first made to associate it with a new detection. e detection with the smallest dis- crepancy between observed position of the detection and the track’s estimated current position, is chosen as long as it is below the maximum error limit. e detection is removed from the list of new detections and appended to the list of points within its new track.
e track position and velocity estimates are updated based on the new de- tection. e position and velocity estimates are also duplicated within the radar detection struct corresponding to the new detection. is allows the change in position and velocity to be monitored as the track grows. is additional infor- mation is very useful in understanding the effect of the tracker parameters, per- miing them to be fine-tuned for this application. e track is removed from the list of tracks and reinserted at the front. is results in priority being given to the tracks which have been observed most recently.
Aer this process is complete, the new detections which have not yet been associated with tracks are then compared with the list of orphaned detections, in order to create new tracks. If an orphaned point can be associated a new de- tection, then both points are removed from their respective lists and added to a new track object. e track position is set to the last detected position and the velocity estimate is calculated from the difference in observation times and ob- served positions. New detections which have failed to associate with a track are removed from the list of new detections and placed in the list of orphaned detec- tions. Orphaned detections which have failed to be associated with a track aer three frames, are discarded.
Track data structures, and the detection structures stored within them, are recycled under the following two conditions:
• When the position and velocity estimates indicate that it must have arrived at the boat
• When the tracked wave is moving away from the boat and its distance exceeds the maximum range of the radar