public void updateLearning ( Rectangle2D_F64 targetRegion ) { storageMetric . reset ( ) ; // learn the initial descriptor TldHelperFunctions . convertRegion ( targetRegion , targetRegion_I32 ) ; template . addDescriptor ( true , targetRegion_I32 ) ; fern . learnFernNoise ( true , targetRegion_I32 ) ; // mark only a few of the far away regions as negative. Marking all of them as negative is // computationally expensive FastQueue < TldRegionFernInfo > ferns = detection . getFernInfo ( ) ; int N = Math . min ( config . numNegativeFerns , ferns . size ) ; for ( int i = 0 ; i < N ; i ++ ) { int index = rand . nextInt ( ferns . size ) ; TldRegionFernInfo f = ferns . get ( index ) ; // no need to check variance here since the detector already did it // learn features far away from the target region double overlap = helper . computeOverlap ( targetRegion_I32 , f . r ) ; if ( overlap > config . overlapLower ) continue ; fern . learnFern ( false , f . r ) ; } learnAmbiguousNegative ( targetRegion ) ; }
Updates learning using the latest tracking results .