Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

waitkey in python

#Examples 1: Display image with a time limit

# importing cv2 module
import cv2
  
# read the image
img = cv2.imread("gfg_logo.png")
  
# showing the image
cv2.imshow('gfg', img)
  
# waiting using waitKey method
cv2.waitKey(5000)

Example 2: Display image until key pressed

# importing cv2 module
import cv2
  
# read the image
img = cv2.imread("gfg_logo.png")
  
# showing the image
cv2.imshow('gfg', img)
  
# waiting using waitKey method
cv2.waitKey(0)
 
PREVIOUS NEXT
Tagged: #waitkey #python
ADD COMMENT
Topic
Name
6+9 =