def autoTrack(clip, pattern, tt=None, fps=None, radius=20, xy0=None):
 if (not autotracking_possible):
  raise IOError('Sorry, autotrack requires OpenCV for the moment. Install OpenCV (aka cv2) to use it.')
 if (not xy0):
  xy0 = findAround(clip.get_frame(tt[0]), pattern)
 if (tt is None):
  tt = np.arange(0, clip.duration, (1.0 / fps))
 xys = [xy0]
 for t in tt[1:]:
  xys.append(findAround(clip.get_frame(t), pattern, xy=xys[(-1)], r=radius))
 (xx, yy) = zip(*xys)
 return Trajectory(tt, xx, yy)

def autoTrack ( clip , pattern , tt = None , fps = None , radius = 20 , xy0 = None ) : if ( not autotracking_possible ) : raise IOError ( 'Sorry, autotrack requires OpenCV for the moment. Install OpenCV (aka cv2) to use it.' ) if ( not xy0 ) : xy0 = findAround ( clip . get_frame ( tt [ 0 ] ) , pattern ) if ( tt is None ) : tt = np . arange ( 0 , clip . duration , ( 1.0 / fps ) ) xys = [ xy0 ] for t in tt [ 1 : ] : xys . append ( findAround ( clip . get_frame ( t ) , pattern , xy = xys [ ( - 1 ) ] , r = radius ) ) ( xx , yy ) = zip ( * xys ) return Trajectory ( tt , xx , yy )
tracks a given pattern in a video clip .