File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 17
17
# depend on the display driver. For example, the default ST7789 display driver
18
18
# will crop large images, and show small images in the top-left corner
19
19
cv2 .imshow (display , img )
20
- key = cv2 .waitKey (1000 )
20
+
21
+ # Prompt the user to press a key to continue
22
+ print ("Press any key to continue" )
23
+ key = cv2 .waitKey (0 )
21
24
22
25
# Let's modify the image! Here we use `cv2.Canny()` to perform edge detection
23
26
# on the image, which is a common operation in computer vision
Original file line number Diff line number Diff line change 13
13
# `boot.py` script. See the example `boot.py` script for more details
14
14
camera .open ()
15
15
16
+ # Prompt the user to press a key to continue
17
+ print ("Press any key to continue" )
18
+
16
19
# Loop to continuously read frames from the camera and display them
17
20
while True :
18
21
# Read a frame from the camera, just like any other Python environment! It
31
34
# Check for key presses
32
35
key = cv2 .waitKey (1 )
33
36
34
- # If the 'q' key is pressed, exit the loop
35
- if key == ord ( 'q' ) :
37
+ # If any key is pressed, exit the loop
38
+ if key != - 1 :
36
39
break
37
40
38
41
# Release the camera, just like in any other Python environment!
You can’t perform that action at this time.
0 commit comments