descriptions for watershed.py and video.py

This commit is contained in:
Alexander Mordvintsev
2012-07-02 04:44:31 +00:00
parent d015bf6f5e
commit 6977a89525
3 changed files with 54 additions and 15 deletions

View File

@@ -1,18 +1,31 @@
import numpy as np
import cv2
from common import Sketcher
'''
Watershed segmentation
=========
help_message = '''
USAGE: watershed.py [<image>]
This program demonstrates the watershed segmentation algorithm
in OpenCV: watershed().
Use keys 1 - 7 to switch marker color
Usage
-----
watershed.py [image filename]
Keys
----
1-7 - switch marker color
SPACE - update segmentation
r - reset
a - switch autoupdate
a - toggle autoupdate
ESC - exit
'''
import numpy as np
import cv2
from common import Sketcher
class App:
def __init__(self, fn):
self.img = cv2.imread(fn)
@@ -60,5 +73,5 @@ if __name__ == '__main__':
import sys
try: fn = sys.argv[1]
except: fn = '../cpp/fruits.jpg'
print help_message
print __doc__
App(fn).run()