fixed 2 bugs in python samples (crash in camshift and running samples from within the demo)

This commit is contained in:
Vadim Pisarevsky 2011-08-22 10:10:17 +00:00
parent fd69c8b34a
commit 8dacbeb157
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class App(object):
ret, self.frame = self.cam.read() ret, self.frame = self.cam.read()
vis = self.frame.copy() vis = self.frame.copy()
hsv = cv2.cvtColor(self.frame, cv2.COLOR_BGR2HSV) 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: if self.selection:
x0, y0, x1, y1 = self.selection x0, y0, x1, y1 = self.selection

View File

@ -141,7 +141,7 @@ class App:
def on_run(self, *args): def on_run(self, *args):
cmd = self.cmd_entry.get() cmd = self.cmd_entry.get()
print 'running:', cmd print 'running:', cmd
Popen(cmd, shell=True) Popen("python " + cmd, shell=True)
def run(self): def run(self):
tk.mainloop() tk.mainloop()