mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
fixed 2 bugs in python samples (crash in camshift and running samples from within the demo)
This commit is contained in:
parent
fd69c8b34a
commit
8dacbeb157
@ -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
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user