summaryrefslogtreecommitdiff
path: root/megapixels/app/utils/display_utils.py
blob: e72cc0f0411424b742e1b3f379862197404d9c4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import sys

import cv2 as cv

from app.utils.logger_utils import Logger


log = Logger.getLogger()

def handle_keyboard(delay_amt=1):
  '''Used with cv.imshow('title', image) to wait for keyboard press
  '''
  while True:
    k = cv.waitKey(delay_amt) & 0xFF
    if k == 27 or k == ord('q'):  # ESC
      cv.destroyAllWindows()
      sys.exit()
    #else:
      #log.info('Press Q, q, or ESC to exit')