public void setTrackLocation ( int x0 , int y0 , int regionWidth , int regionHeight ) { if ( imageWidth < regionWidth || imageHeight < regionHeight ) throw new IllegalArgumentException ( "Track region is larger than input image: " + regionWidth + " " + regionHeight ) ; regionOut . width = regionWidth ; regionOut . height = regionHeight ; // adjust for padding int w = ( int ) ( regionWidth * ( 1 + padding ) ) ; int h = ( int ) ( regionHeight * ( 1 + padding ) ) ; int cx = x0 + regionWidth / 2 ; int cy = y0 + regionHeight / 2 ; // save the track location this . regionTrack . width = w ; this . regionTrack . height = h ; this . regionTrack . x0 = cx - w / 2 ; this . regionTrack . y0 = cy - h / 2 ; stepX = ( w - 1 ) / ( float ) ( workRegionSize - 1 ) ; stepY = ( h - 1 ) / ( float ) ( workRegionSize - 1 ) ; updateRegionOut ( ) ; }
Used to change the track s location . If this method is used it is assumed that tracking is active and that the appearance of the target has not changed