Merged the trunk r8852:8880

This commit is contained in:
Andrey Kamaev
2012-07-02 11:04:43 +00:00
parent 304dac7f00
commit b368f99d03
60 changed files with 507 additions and 255 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()