From 8dacbeb157fb974edf03ee6b22d5f9cd1641605f Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 22 Aug 2011 10:10:17 +0000 Subject: [PATCH] fixed 2 bugs in python samples (crash in camshift and running samples from within the demo) --- samples/python2/camshift.py | 2 +- samples/python2/demo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/python2/camshift.py b/samples/python2/camshift.py index 3a576e111c..79b4c29510 100644 --- a/samples/python2/camshift.py +++ b/samples/python2/camshift.py @@ -58,7 +58,7 @@ class App(object): ret, self.frame = self.cam.read() vis = self.frame.copy() hsv = cv2.cvtColor(self.frame, cv2.COLOR_BGR2HSV) - mask = cv2.inRange(hsv, np.array((0, 60, 32)), np.array((180, 255, 255))) + mask = cv2.inRange(hsv, np.array((0., 60., 32.)), np.array((180., 255., 255.))) if self.selection: x0, y0, x1, y1 = self.selection diff --git a/samples/python2/demo.py b/samples/python2/demo.py index 5fb801036d..c8bdcd9f30 100644 --- a/samples/python2/demo.py +++ b/samples/python2/demo.py @@ -141,7 +141,7 @@ class App: def on_run(self, *args): cmd = self.cmd_entry.get() print 'running:', cmd - Popen(cmd, shell=True) + Popen("python " + cmd, shell=True) def run(self): tk.mainloop()