#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)