The tracker of PeTrack is implemented on top of the Lucas-Kanade-Algorithm for determining optical flow.
Each person has an associated feature point in each frame it occurs in. This feature point gets tracked via Lucas-Kanade.1 Each person gets tracked with its own WindowSize (see
Petrack::winSize). There are currently two tracking methods and multiple refinements.
- When tracking adaptive, after a unsuccessful attempt the pyramid level of the Lucas-Kanade-Method is lowered. Sometimes this enables us to continue tracking. This gets repeated till the feature point gets successfully tracked or the minimal level of 0 is reached
- When tracking non-adaptive, only one attempt with one pyramid level is executed
Refinements only get executed if the error in normal tracking is too high
- Track colorpoint
- This refinement tried to track the color-point instead of the feature point. Remember that there are color points different from feature points with markers like the casern-marker or the combined multicolor-aruco-marker.
- Near dark point
- This method is only used with the Casern and Hermes Markers, which both have an black middle. The target of this method is to find this dark point in the middle of the marker and track that instead of the feature point.
- BackgroundFilter - gets executed regardless of error, but needs to be enabled by user
- Deletes trajectories which have more successive frames in the background than a user-specified maximum
Actually, which persons get tracked specifically is determined in
Tracker::calculatePrevFeaturePoints. This most importantly means filtering people out if "only visible" (may be renamed to "only selected") is used.