From: Alexander Mordvintsev Date: Mon, 4 Jul 2011 14:13:57 +0000 (+0000) Subject: use addWeighted for blending X-Git-Tag: accepted/2.0/20130307.220821~2544 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55ba0af2bcb33bcc26194997894b57b6da9bca83;p=profile%2Fivi%2Fopencv.git use addWeighted for blending --- diff --git a/samples/python2/watershed.py b/samples/python2/watershed.py index f35248a..5d45417 100644 --- a/samples/python2/watershed.py +++ b/samples/python2/watershed.py @@ -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):