public void spawnTracksFromDetected ( ) { // mark detected features with no matches as available FastQueue < AssociatedIndex > matches = associate . getMatches ( ) ; int N = detector . getNumberOfFeatures ( ) ; for ( int i = 0 ; i < N ; i ++ ) associated [ i ] = false ; for ( AssociatedIndex i : matches . toList ( ) ) { associated [ i . dst ] = true ; } // spawn new tracks for unassociated detected features for ( int i = 0 ; i < N ; i ++ ) { if ( associated [ i ] ) continue ; Point2D_F64 p = detector . getLocation ( i ) ; TD d = detectedDesc . get ( i ) ; CombinedTrack < TD > track ; if ( tracksUnused . size ( ) > 0 ) { track = tracksUnused . pop ( ) ; } else { track = new CombinedTrack <> ( ) ; track . desc = detector . createDescription ( ) ; track . track = trackerKlt . createNewTrack ( ) ; } // create the descriptor for tracking trackerKlt . setDescription ( ( float ) p . x , ( float ) p . y , track . track ) ; // set track ID and location track . featureId = totalTracks ++ ; track . desc . setTo ( d ) ; track . set ( p ) ; // update list of active tracks tracksPureKlt . add ( track ) ; tracksSpawned . add ( track ) ; } }
From the found interest points create new tracks . Tracks are only created at points where there are no existing tracks .