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 3992dda commit c3f6ba3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions object-tracker-single.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 @@ -65,7 +65,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 c3f6ba3

Please sign in to comment.