mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 11:40:44 +08:00
use addWeighted for blending
This commit is contained in:
parent
85166360f1
commit
55ba0af2bc
@ -31,7 +31,8 @@ class App:
|
||||
def watershed(self):
|
||||
m = self.markers.copy()
|
||||
cv2.watershed(self.img, m)
|
||||
vis = np.uint8( (self.img + self.colors[np.maximum(m, 0)]) / 2 )
|
||||
overlay = self.colors[np.maximum(m, 0)]
|
||||
vis = cv2.addWeighted(self.img, 0.5, overlay, 0.5, 0.0, dtype=cv2.CV_8UC3)
|
||||
cv2.imshow('watershed', vis)
|
||||
|
||||
def run(self):
|
||||
|
Loading…
Reference in New Issue
Block a user