Skip to content

Commit

Permalink
solved "can not work by 'p' and 'esc' key bikz05#4"
Browse files Browse the repository at this point in the history
  • Loading branch information
virajmavani authored Apr 17, 2018
1 parent d9bbe2b commit 3992dda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions object-tracker-multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def run(source=0, dispLoc=False):
if not retval:
print "Cannot capture frame device"
exit()
if(cv2.waitKey(10)==ord('p')):
if(0xFF & cv2.waitKey(10))==ord('p'):
break
cv2.namedWindow("Image", cv2.WINDOW_NORMAL)
cv2.imshow("Image", img)
Expand Down Expand Up @@ -66,7 +66,7 @@ def run(source=0, dispLoc=False):
cv2.namedWindow("Image", cv2.WINDOW_NORMAL)
cv2.imshow("Image", img)
# Continue until the user presses ESC key
if cv2.waitKey(1) == 27:
if (0xFF & cv2.waitKey(1)) == 27:
break

# Relase the VideoCapture object
Expand Down

0 comments on commit 3992dda

Please sign in to comment.