public void initialize ( T image , int x0 , int y0 , int x1 , int y1 ) { if ( imagePyramid == null || imagePyramid . getInputWidth ( ) != image . width || imagePyramid . getInputHeight ( ) != image . height ) { int minSize = ( config . trackerFeatureRadius * 2 + 1 ) * 5 ; int scales [ ] = selectPyramidScale ( image . width , image . height , minSize ) ; imagePyramid = FactoryPyramid . discreteGaussian ( scales , - 1 , 1 , true , image . getImageType ( ) ) ; } imagePyramid . process ( image ) ; reacquiring = false ; targetRegion . set ( x0 , y0 , x1 , y1 ) ; createCascadeRegion ( image . width , image . height ) ; template . reset ( ) ; fern . reset ( ) ; tracking . initialize ( imagePyramid ) ; variance . setImage ( image ) ; template . setImage ( image ) ; fern . setImage ( image ) ; adjustRegion . init ( image . width , image . height ) ; learning . initialLearning ( targetRegion , cascadeRegions ) ; strongMatch = true ; previousTrackArea = targetRegion . area ( ) ; }
Starts tracking the rectangular region .