Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import cv2
- WINDOW_NAME = 'program'
- cv2.namedWindow(WINDOW_NAME, cv2.WINDOW_NORMAL)
- cv2.setWindowProperty(WINDOW_NAME, cv2.WND_PROP_FULLSCREEN,
- cv2.WINDOW_GUI_EXPANDED)
- while True:
- # Simplified image acquisition.
- frame = (np.random.rand(1080, 1920, 3)*255).astype(np.uint8)
- cv2.imshow(WINDOW_NAME, frame)
- while True:
- pressed_key_code = cv2.pollKey()
- if pressed_key_code == -1:
- print('no key')
- break
- if pressed_key_code == ord('q'):
- exit()
- elif pressed_key_code == ord('p'):
- print('moving action')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement