<s> """<STR_LIT>""" <EOL> from SimpleCV import * <EOL> def lktest ( ) : <EOL> cam = Camera ( ) <EOL> img = cam . getImage ( ) <EOL> d = Display ( img . size ( ) ) <EOL> img , bb1 = getBBFromUser ( cam , d ) <EOL> fs1 = [ ] <EOL> while True : <EOL> try : <EOL> img1 = cam . getImage ( ) <EOL> fs1 = img1 . track ( "<STR_LIT>" , fs1 , img , bb1 , maxCorners = <NUM_LIT> , qualityLevel = <NUM_LIT> , winSize = ( <NUM_LIT:15> , <NUM_LIT:15> ) ) <EOL> fs1 . drawBB ( color = Color . RED ) <EOL> print fs1 [ - <NUM_LIT:1> ] . getBB ( ) <EOL> img1 . show ( ) <EOL> except KeyboardInterrupt : <EOL> break <EOL> def getBBFromUser ( cam , d ) : <EOL> p1 = None <EOL> p2 = None <EOL> img = cam . getImage ( ) <EOL> while d . isNotDone ( ) : <EOL> try : <EOL> img = cam . getImage ( ) <EOL> img . save ( d ) <EOL> dwn = d . leftButtonDownPosition ( ) <EOL> up = d . leftButtonUpPosition ( ) <EOL> if dwn : <EOL> p1 = dwn <EOL> if up : <EOL> p2 = up <EOL> break <EOL> time . sleep ( <NUM_LIT> ) <EOL> except KeyboardInterrupt : <EOL> break <EOL> if not p1 or not p2 : <EOL> return None <EOL> xmax = np . max ( ( p1 [ <NUM_LIT:0> ] , p2 [ <NUM_LIT:0> ] ) ) <EOL> xmin = np . min ( ( p1 [ <NUM_LIT:0> ] , p2 [ <NUM_LIT:0> ] ) ) <EOL> ymax = np . max ( ( p1 [ <NUM_LIT:1> ] , p2 [ <NUM_LIT:1> ] ) ) <EOL> ymin = np . min ( ( p1 [ <NUM_LIT:1> ] , p2 [ <NUM_LIT:1> ] ) ) <EOL> return ( img , ( xmin , ymin , xmax - xmin , ymax - ymin ) ) <EOL> lktest ( ) </s>
