projects
/
profile
/
ivi
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8516636
)
use addWeighted for blending
author
Alexander Mordvintsev
<no@email>
Mon, 4 Jul 2011 14:13:57 +0000
(14:13 +0000)
committer
Alexander Mordvintsev
<no@email>
Mon, 4 Jul 2011 14:13:57 +0000
(14:13 +0000)
samples/python2/watershed.py
patch
|
blob
|
history
diff --git
a/samples/python2/watershed.py
b/samples/python2/watershed.py
index
f35248a
..
5d45417
100644
(file)
--- a/
samples/python2/watershed.py
+++ b/
samples/python2/watershed.py
@@
-31,7
+31,8
@@
class App:
def watershed(self):
\r
m = self.markers.copy()
\r
cv2.watershed(self.img, m)
\r
- vis = np.uint8( (self.img + self.colors[np.maximum(m, 0)]) / 2 )
\r
+ overlay = self.colors[np.maximum(m, 0)]
\r
+ vis = cv2.addWeighted(self.img, 0.5, overlay, 0.5, 0.0, dtype=cv2.CV_8UC3)
\r
cv2.imshow('watershed', vis)
\r
\r
def run(self):
\r