Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion get_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def callback(event, x, y, flags, param):
# Display the cropped images
cv2.namedWindow(window_name_2, cv2.WINDOW_NORMAL)
cv2.imshow(window_name_2, im_disp)
key = cv2.waitKey(30)
key = (0xFF & cv2.waitKey(30))
if key == ord('p'):
# Press key `s` to return the selected points
cv2.destroyAllWindows()
Expand Down
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
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