camshift.py description
This commit is contained in:
@@ -1,16 +1,29 @@
|
||||
'''
|
||||
Camshift tracker
|
||||
================
|
||||
|
||||
This is a demo that shows mean-shift based tracking
|
||||
You select a color objects such as your face and it tracks it.
|
||||
This reads from video camera (0 by default, or the camera number the user enters)
|
||||
|
||||
http://www.robinhewitt.com/research/track/camshift.html
|
||||
|
||||
Usage:
|
||||
------
|
||||
camshift.py [<video source>]
|
||||
|
||||
To initialize tracking, select the object with mouse
|
||||
|
||||
Keys:
|
||||
-----
|
||||
ESC - exit
|
||||
b - toggle back-projected probability visualization
|
||||
'''
|
||||
|
||||
import numpy as np
|
||||
import cv2
|
||||
import video
|
||||
|
||||
help_message = '''USAGE: camshift.py [<video source>]
|
||||
|
||||
Select a bright colored object to track.
|
||||
|
||||
Keys:
|
||||
ESC - exit
|
||||
b - toggle back-projected probability visualization
|
||||
'''
|
||||
|
||||
|
||||
class App(object):
|
||||
def __init__(self, video_src):
|
||||
@@ -99,6 +112,6 @@ if __name__ == '__main__':
|
||||
import sys
|
||||
try: video_src = sys.argv[1]
|
||||
except: video_src = 0
|
||||
print help_message
|
||||
print __doc__
|
||||
App(video_src).run()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user