<s> '''<STR_LIT>''' <EOL> print __doc__ <EOL> import time <EOL> from SimpleCV import Color , Image , np , Camera <EOL> from SimpleCV . Display import Display <EOL> cam = Camera ( ) <EOL> display = Display ( ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> quality = <NUM_LIT> <EOL> minDist = <NUM_LIT> <EOL> minMatch = <NUM_LIT> <EOL> template_img = None <EOL> mode = "<STR_LIT>" <EOL> startX = None <EOL> startY = None <EOL> endY = None <EOL> endX = None <EOL> while ( display . isNotDone ( ) ) : <EOL> img = cam . getImage ( ) . resize ( <NUM_LIT> , <NUM_LIT> ) <EOL> if mode == "<STR_LIT>" : <EOL> if startX == None or startY == None : <EOL> img . dl ( ) . text ( "<STR_LIT>" , ( <NUM_LIT:10> , <NUM_LIT:10> ) ) <EOL> if display . mouseLeft : <EOL> startX = display . mouseRawX <EOL> startY = display . mouseRawY <EOL> time . sleep ( <NUM_LIT> ) <EOL> elif endX == None or endY == None : <EOL> img . dl ( ) . text ( "<STR_LIT>" , ( <NUM_LIT:10> , <NUM_LIT:10> ) ) <EOL> if display . mouseLeft : <EOL> endX = display . mouseX <EOL> endY = display . mouseY <EOL> template_img = img . crop ( startX , startY , endX - startX , endY - startY ) <EOL> mode = "<STR_LIT>" <EOL> time . sleep ( <NUM_LIT> ) <EOL> else : <EOL> pass <EOL> if mode == "<STR_LIT>" : <EOL> keypoints = img . findKeypointMatch ( template_img , quality , minDist , minMatch ) <EOL> if keypoints : <EOL> img = img . applyLayers ( ) <EOL> img = img . drawKeypointMatches ( template_img ) <EOL> if display . mouseRight : <EOL> template_img = None <EOL> mode = "<STR_LIT>" <EOL> startX = None <EOL> startY = None <EOL> endY = None <EOL> endX = None <EOL> img = img . applyLayers ( ) <EOL> img = img . resize ( <NUM_LIT> , <NUM_LIT> ) <EOL> img . save ( display ) <EOL> time . sleep ( <NUM_LIT> ) </s>
